X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FForm%2FContributionPage%2FWidget.php;h=1b84182c64508c5c57f77c4b085eb0cab755e9c4;hb=ac38dc5d3477334a941f3881ac5e785b6bd25ac2;hp=0080b68ccc111b2cba841a7943c420647011ab51;hpb=af321125666c7444accea956adaad22395fcd4c9;p=civicrm-core.git diff --git a/CRM/Contribute/Form/ContributionPage/Widget.php b/CRM/Contribute/Form/ContributionPage/Widget.php index 0080b68ccc..1b84182c64 100644 --- a/CRM/Contribute/Form/ContributionPage/Widget.php +++ b/CRM/Contribute/Form/ContributionPage/Widget.php @@ -1,9 +1,9 @@ _fields = array( - 'title' => array(ts('Title'), + 'title' => array( + ts('Title'), 'text', FALSE, $title, ), - 'url_logo' => array(ts('URL to Logo Image'), + 'url_logo' => array( + ts('URL to Logo Image'), 'text', FALSE, NULL, ), - 'button_title' => array(ts('Button Title'), + 'button_title' => array( + ts('Button Title'), 'text', FALSE, ts('Contribute!'), @@ -82,47 +83,56 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co ); $this->_colorFields = array( - 'color_title' => array(ts('Title Text Color'), + 'color_title' => array( + ts('Title Text Color'), 'text', FALSE, '#2786C2', ), - 'color_bar' => array(ts('Progress Bar Color'), + 'color_bar' => array( + ts('Progress Bar Color'), 'text', FALSE, - '#FFFFFF', + '#2786C2', ), - 'color_main_text' => array(ts('Additional Text Color'), + 'color_main_text' => array( + ts('Additional Text Color'), 'text', FALSE, '#FFFFFF', ), - 'color_main' => array(ts('Background Color'), + 'color_main' => array( + ts('Background Color'), 'text', FALSE, '#96C0E7', ), - 'color_main_bg' => array(ts('Background Color Top Area'), + 'color_main_bg' => array( + ts('Background Color Top Area'), 'text', FALSE, '#B7E2FF', ), - 'color_bg' => array(ts('Border Color'), + 'color_bg' => array( + ts('Border Color'), 'text', FALSE, '#96C0E7', ), - 'color_about_link' => array(ts('Button Link Color'), + 'color_about_link' => array( + ts('Button Text Color'), 'text', FALSE, '#556C82', ), - 'color_button' => array(ts('Button Background Color'), + 'color_button' => array( + ts('Button Background Color'), 'text', FALSE, '#FFFFFF', ), - 'color_homepage_link' => array(ts('Homepage Link Color'), + 'color_homepage_link' => array( + ts('Homepage Link Color'), 'text', FALSE, '#FFFFFF', @@ -131,14 +141,7 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co } /** - * Set default values for the form. Note that in edit/view mode - * the default values are retrieved from the database - * - * - * @return void - */ - /** - * + * Set default values for the form. */ public function setDefaultValues() { $defaults = array(); @@ -175,7 +178,7 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co array('onclick' => "widgetBlock(this)") ); - $this->addWysiwyg('about', ts('About'), $attributes['about']); + $this->add('wysiwyg', 'about', ts('About'), $attributes['about']); foreach ($this->_fields as $name => $val) { $this->add($val[1], @@ -207,7 +210,7 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co } /** - * Validation + * Validation. * * @param array $params * (ref.) an assoc array of name/value pairs. @@ -215,8 +218,8 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co * @param $files * @param $self * - * @return mixed true or array of errors - * @static + * @return bool|array + * mixed true or array of errors */ public static function formRule($params, $files, $self) { $errors = array(); @@ -272,4 +275,5 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co public function getTitle() { return ts('Widget Settings'); } + }