<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
* @access public
*/
public function buildQuickForm() {
- //parent::buildQuickForm( );
+ parent::buildQuickForm( );
+ $this->setPageTitle(ts('Premium Product'));
if ($this->_action & CRM_Core_Action::PREVIEW) {
CRM_Contribute_BAO_Premium::buildPremiumPreviewBlock($this, $this->_id);
-
- $this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Done with Preview'),
- 'isDefault' => TRUE,
- ),
- )
- );
-
return;
}
if ($this->_action & CRM_Core_Action::DELETE) {
- $this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Delete'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
return;
}
$this->addRule('imageOption', ts('Please select an option for the premium image.'), 'required');
$this->addElement('text', 'imageUrl', ts('Image URL'));
- $this->addRule('imageUrl', 'Please enter the valid URL to display this image.', 'url');
$this->addElement('text', 'thumbnailUrl', ts('Thumbnail URL'));
- $this->addRule('thumbnailUrl', 'Please enter the valid URL to display a thumbnail of this image.', 'url');
$this->add('file', 'uploadFile', ts('Image File Name'), 'onChange="select_option();"');
$this->addFormRule(array('CRM_Contribute_Form_ManagePremiums', 'formRule'));
- $this->addButtons(array(
- array(
- 'type' => 'upload',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
-
$this->assign('productId', $this->_id);
}
*
* @param array $params (ref.) an assoc array of name/value pairs
*
+ * @param $files
+ *
* @return mixed true or array of errors
* @access public
* @static
*
* @access private
*
+ * @param $filename
+ * @param $resizedName
+ * @param $width
+ * @param $height
+ *
* @return Path to image
*/
private function _resizeImage($filename, $resizedName, $width, $height) {
$config = CRM_Core_Config::singleton();
return $config->imageUploadURL.basename($newFilename);
}
+
}