Esempio n. 1
0
 function onSetupForms(Am_Event_SetupForms $event)
 {
     $form = new Am_Form_Setup('facebook');
     $form->setTitle('Facebook');
     $fs = $form->addFieldset()->setLabel(___('FaceBook Application'));
     $fs->addText('app_id')->setLabel(___('FaceBook App ID'));
     $fs->addText('app_secret', array('size' => 40))->setLabel(___('Facebook App Secret'));
     $fs = $form->addFieldset()->setLabel(___('Features'));
     $gr = $fs->addCheckboxedGroup('like')->setLabel(___('Add "Like" button'));
     $gr->addStatic()->setContent(___('Like Url'));
     $gr->addText('likeurl', array('size' => 40));
     $form->setDefault('likeurl', ROOT_URL);
     $fs->addAdvCheckbox('no_signup')->setLabel(___('Do not add to Signup Form'));
     $fs->addAdvCheckbox('no_login')->setLabel(___('Do not add to Login Form'));
     $form->addFieldsPrefix('misc.facebook.');
     $event->addForm($form);
 }
Esempio n. 2
0
 function onSetupForms(Am_Event_SetupForms $event)
 {
     $form = new Am_Form_Setup('facebook');
     $form->setTitle('Facebook');
     $fs = $form->addFieldset()->setLabel(___('FaceBook Application'));
     $fs->addText(self::FB_APP_ID)->setLabel(___('FaceBook App ID'));
     $fs->addText(self::FB_APP_SECRET, array('size' => 40))->setLabel(___('Facebook App Secret'));
     $fs = $form->addFieldset()->setLabel(___('Features'));
     $gr = $fs->addCheckboxedGroup('like')->setLabel(___('Add "Like" button'));
     $gr->addStatic()->setContent(___('Like Url'));
     $gr->addText('likeurl', array('size' => 40));
     $form->setDefault('likeurl', ROOT_URL);
     $fs->addAdvCheckbox('no_signup')->setLabel(___('Do not add to Signup Form'));
     $fs->addAdvCheckbox('no_login')->setLabel(___('Do not add to Login Form'));
     $fs->addSelect('add_access', null, array('options' => array('' => '-- Do not add access --') + Am_Di::getInstance()->productTable->getOptions()))->setLabel(___('Add free access to a product if user signup from Facebook'));
     $form->addFieldsPrefix('misc.facebook.');
     $this->_afterInitSetupForm($form);
     $event->addForm($form);
 }
Esempio n. 3
0
 protected function _afterInitSetupForm(Am_Form_Setup $form)
 {
     if ($this->_configPrefix) {
         $form->addFieldsPrefix($this->_configPrefix . $this->getId() . '.');
     }
     if ($plugin_readme = $this->getReadme()) {
         $plugin_readme = str_replace(array('%root_url%', '%root_surl%', '%root_dir%'), array(ROOT_URL, ROOT_SURL, ROOT_DIR), $plugin_readme);
         $form->addEpilog('<div class="info"><pre>' . $plugin_readme . '</pre></div>');
     }
     if (defined($const = get_class($this) . "::PLUGIN_STATUS") && (constant($const) == self::STATUS_BETA || constant($const) == self::STATUS_DEV)) {
         $beta = constant($const) == self::STATUS_DEV ? 'ALPHA' : 'BETA';
         $form->addProlog("<div class='warning_box'>This plugin is currently in {$beta} testing stage, some features may be unstable. " . "Please test it carefully before use.</div>");
     }
 }