Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/application/admin/config/controllers/SocialmediaController.php b/application/admin/config/controllers/SocialmediaController.php
- index 5a10e36..7757e60 100644
- --- a/application/admin/config/controllers/SocialmediaController.php
- +++ b/application/admin/config/controllers/SocialmediaController.php
- @@ -12,6 +12,7 @@ class Config_SocialmediaController extends IP_Controller_EventAction {
- $this->view->title = 'Add '.constant("SocialButtons::BUTTON_TYPE_".$buttonType).' Button';
- $this->view->form = $form;
- + $this->view->buttonType = constant("SocialButtons::BUTTON_TYPE_".$buttonType);
- if($this->getRequest()->isPost()) {
- if($form->isValid($this->getRequest()->getPost())) {
- @@ -55,9 +56,10 @@ class Config_SocialmediaController extends IP_Controller_EventAction {
- }
- $form = Form_SocialButtons::factory($buttonObj);
- - $this->view->title = 'Edit Social Button';
- + $this->view->title = 'Edit ' . $buttonObj->getObjectType() . ' Button';
- $this->view->form = $form;
- -
- + $this->view->buttonType = $buttonObj->getObjectType();
- +
- if($this->getRequest()->isPost()) {
- if($form->isValid($this->getRequest()->getPost())) {
- try {
- diff --git a/application/admin/config/scripts/socialmedia/form.phtml b/application/admin/config/scripts/socialmedia/form.phtml
- index 6de7e42..2d98d8a 100644
- --- a/application/admin/config/scripts/socialmedia/form.phtml
- +++ b/application/admin/config/scripts/socialmedia/form.phtml
- @@ -1,5 +1,37 @@
- +<form method="POST" action="" >
- <?php
- $this->adminTitle($this->title);
- $this->adminBreadCrumb('Setup', 'index/index/setup');
- $this->adminBreadCrumb('Social Media Buttons', 'config/socialmedia/');
- -echo $this->form;
- \ No newline at end of file
- +
- +$this->ip()->startContainer();
- +
- +$this->ip()->sectionTitle('General');
- +$this->ip()->startGroup();
- +echo $this->form->getElement('token');
- +echo $this->form->getElement('label');
- +$this->ip()->endGroup();
- +$this->ip()->endContainer();
- +$this->ip()->startContainer();
- +
- +$this->ip()->sectionTitle($this->buttonType . ' Button Options');
- +$this->ip()->startGroup();
- +echo $this->form->getDisplayGroup('buttonOptions');
- +$this->ip()->endGroup();
- +
- +$this->ip()->endContainer();
- +echo $this->form->getElement('save');
- +?>
- +</form>
- +<script>
- +function checkWidth() {
- + if(jQuery('#displayType').val() == "1" || jQuery('#displayType').val() == "0") {
- + jQuery('#width').attr('disabled', '');
- + } else {
- + jQuery('#width').attr('disabled', 'disabled');
- + }
- +}
- +
- +jQuery(document).ready(checkWidth);
- +jQuery("#displayType").change(checkWidth);
- +</script>
- \ No newline at end of file
- diff --git a/classes/IP/Validate/Uri.php b/classes/IP/Validate/Uri.php
- index 799a76a..6ddf1ee 100644
- --- a/classes/IP/Validate/Uri.php
- +++ b/classes/IP/Validate/Uri.php
- @@ -7,12 +7,12 @@
- * To change this template use File | Settings | File Templates.
- */
- class IP_Validate_Uri extends Zend_Validate_Abstract {
- - const INVALID_URI = 'invalidUri';
- + const INVALID_URI = 'invalidUrl';
- - protected $_fieldLabel = "Uri";
- + protected $_fieldLabel = "URL";
- public $_messageTemplates = array(
- - self::INVALID_URI => 'Uri is invalid.'
- + self::INVALID_URI => 'URL is invalid.'
- );
- /**
- @@ -43,7 +43,9 @@ class IP_Validate_Uri extends Zend_Validate_Abstract {
- if (!empty($value)) {
- $validator = new Zend_Validate_Hostname();
- if($validator->isValid($value) !== true) {
- - $this->_error(self::INVALID_URI);
- + if (!Zend_Uri::check($value)) {
- + $this->_error(self::INVALID_URI);
- + }
- }
- }
- diff --git a/model/Form/SocialMediaButton/Abstract.php b/model/Form/SocialMediaButton/Abstract.php
- index 4621610..b070a51 100644
- --- a/model/Form/SocialMediaButton/Abstract.php
- +++ b/model/Form/SocialMediaButton/Abstract.php
- @@ -12,7 +12,7 @@ abstract class Form_SocialMediaButton_Abstract extends IP_Form
- {
- parent::__construct();
- $e = $this->createElement('text', 'label');
- - $e->setLabel('Admin Label');
- + $e->setLabel('Admin Label')->setRequired();
- $this->addElement($e);
- }
- }
- diff --git a/model/Form/SocialMediaButton/Facebook.php b/model/Form/SocialMediaButton/Facebook.php
- index 05c60cc..e9c06ea 100644
- --- a/model/Form/SocialMediaButton/Facebook.php
- +++ b/model/Form/SocialMediaButton/Facebook.php
- @@ -31,37 +31,94 @@ class Form_SocialMediaButton_Facebook extends Form_SocialMediaButton_Abstract
- $this->addElement('hash', 'token');
- $e = $this->createElement('text', 'url');
- - $e->setLabel('URL')->addValidator(new IP_Validate_Uri());
- + $e->setLabel('URL')->addValidator(new IP_Validate_Uri())->setRequired();
- + $e->setDescription("The URL of the page to Like.");
- + $e->addDecorators(array(
- + array('Description', array(
- + 'tag' => 'div',
- + 'escape' => true,
- + 'class' => 'rightSideDescription',
- + 'placement' => Zend_Form_Decorator_Abstract::APPEND)),
- + array('HtmlTag', array('tag' => 'div', 'class' => 'sbElement clearfix'))));
- $this->addElement($e);
- $e = $this->createElement('select', 'includeSend',array(
- 'multiOptions' => array("0" => "No", "1" => "Yes")));
- $e->setLabel('Include Send Button');
- + $e->setDescription("This button will also include an option to share the link via a Facebook message.");
- + $e->addDecorators(array(
- + array('Description', array(
- + 'tag' => 'div',
- + 'escape' => true,
- + 'class' => 'rightSideDescription',
- + 'placement' => Zend_Form_Decorator_Abstract::APPEND)),
- + array('HtmlTag', array('tag' => 'div', 'class' => 'sbElement clearfix'))));
- $this->addElement($e);
- $e = $this->createElement('select', 'displayType',array(
- 'multiOptions' => array("0" => self::DISPLAY_TYPE_STANDARD, "1" => self::DISPLAY_TYPE_FACES, "2" => self::DISPLAY_TYPE_HORIZONTAL, "3" => self::DISPLAY_TYPE_VERTICAL)));
- - $e->setLabel('Display Type');
- + $e->setLabel('Display Type')->setRequired();
- + $e->setDescription("The display determines how the link appears. The options are \"Standard\", \"Standard with Faces\", \"Horizontal\", and \"Vertical\".");
- + $e->addDecorators(array(
- + array('Description', array(
- + 'tag' => 'div',
- + 'escape' => true,
- + 'class' => 'rightSideDescription',
- + 'placement' => Zend_Form_Decorator_Abstract::APPEND)),
- + array('HtmlTag', array('tag' => 'div', 'class' => 'sbElement clearfix', 'escape' => true))));
- $this->addElement($e);
- $e = $this->createElement('text','width');
- $e->setLabel('Enter Width (in pixels)')->addValidator(new Zend_Validate_GreaterThan(224))->addFilter(new Zend_Filter_Digits());//TODO: make this based on displayType
- + $e->setDescription("If \"Standard\" or \"Standard with Faces\" is chosen a width can be entered. The width must be at least 225 pixels without the send button and 285 pixels with it.");
- + $e->addDecorators(array(
- + array('Description', array(
- + 'tag' => 'div',
- + 'escape' => true,
- + 'class' => 'rightSideDescription',
- + 'placement' => Zend_Form_Decorator_Abstract::APPEND)),
- + array('HtmlTag', array('tag' => 'div', 'class' => 'sbElement clearfix'))));
- $this->addElement($e);
- $e = $this->createElement('select', 'verb', array(
- 'multiOptions' => array("0" => self::VERB_LIKE, "1" => self::VERB_RECOMMEND)));
- - $e->setLabel('Verb');
- + $e->setLabel('Verb')->setRequired();
- + $e->setDescription("\"Like\" or \"Recommend\" may be used.");
- + $e->addDecorators(array(
- + array('Description', array(
- + 'tag' => 'div',
- + 'escape' => true,
- + 'class' => 'rightSideDescription',
- + 'placement' => Zend_Form_Decorator_Abstract::APPEND)),
- + array('HtmlTag', array('tag' => 'div', 'class' => 'sbElement clearfix'))));
- $this->addElement($e);
- $e = $this->createElement('select', 'colorScheme', array(
- 'multiOptions' => array("0" => self::COLOR_SCHEME_LIGHT, "1" => self::COLOR_SCHEME_DARK)));
- - $e->setLabel('Color Scheme');
- + $e->setLabel('Color Scheme')->setRequired();
- + $e->setDescription("A light or dark color scheme may be selected.");
- + $e->addDecorators(array(
- + array('Description', array(
- + 'tag' => 'div',
- + 'escape' => true,
- + 'class' => 'rightSideDescription',
- + 'placement' => Zend_Form_Decorator_Abstract::APPEND)),
- + array('HtmlTag', array('tag' => 'div', 'class' => 'sbElement clearfix'))));
- $this->addElement($e);
- $e = $this->createElement('select', 'font', array(
- 'multiOptions' => array("0" => self::FONT_ARIAL, "1" => self::FONT_GRANDE, "2" => self::FONT_LUCIA, "3" => self::FONT_SEGOE, "4" => self::FONT_TAHOMA, "5" => self::FONT_TREBUCHET, "6" => self::FONT_VERANDA)));
- - $e->setLabel('Font');
- + $e->setLabel('Font')->setRequired();
- + $e->setDescription("The current options for font are Arial, Lucia Grande, Segoe Ui, Tahoma, Trebushet MS, or Verdana.");
- + $e->addDecorators(array(
- + array('Description', array(
- + 'tag' => 'div',
- + 'escape' => true,
- + 'class' => 'rightSideDescription',
- + 'placement' => Zend_Form_Decorator_Abstract::APPEND)),
- + array('HtmlTag', array('tag' => 'div', 'class' => 'sbElement clearfix'))));
- $this->addElement($e);
- + $this->addDisplayGroup(array('url', 'includeSend', 'displayType', 'width', 'verb', 'colorScheme', 'font'), 'buttonOptions');
- $this->addElement('submit', 'save', array('label' => 'Save'));
- return $this;
- }
- diff --git a/www/scripts/IP.css b/www/scripts/IP.css
- index a41d45b..616d081 100644
- --- a/www/scripts/IP.css
- +++ b/www/scripts/IP.css
- @@ -515,7 +515,25 @@ table.financialSummary td.paymentDescription {
- margin: 10px 0px 0px 10px;
- width: 200px;
- }
- -
- +.rightSideDescription {
- + font-size: 0.9em;
- + margin: 0px 0px 20px 30px;
- + width: 300px;
- +}
- +.sbElement {
- + border-bottom: 1px solid #CCCCCC;
- + display: block;
- + margin: 20px 10px;
- +}
- +.sbElement div {
- + float:left;
- +}
- +.sbElement select{
- + width:185px;
- +}
- +.sbElement input{
- + width:180px;
- +}
- .advancedReportDescription {
- margin: 0px 10px 4px;
- width: 350px;
Add Comment
Please, Sign In to add comment