function onSetupForms(Am_Event_SetupForms $forms) { $form = new Am_Form_Setup('getclicky'); $form->setTitle("GetClicky"); $forms->addForm($form); $form->addInteger('getclicky_id')->setLabel(array("GetClicky Account Id")); }
function onSetupForms(Am_Event_SetupForms $event) { $form = new Am_Form_Setup($this->getId()); $form->setTitle('REST API'); $event->addForm($form); $form->addAdvCheckbox('api_debug_mode')->setLabel(___('Enable Debug Mode') . "\n" . ___('all requests will be added to %sLogs%s, useful if something is going wrong', '<a href="' . ROOT_URL . '/admin-logs">', '</a>')); }
function onSetupForms(Am_Event_SetupForms $event) { $f = new Am_Form_Setup_ProtectDatabased($this); 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); $f->addEpilog('<div class="info"><pre>' . $plugin_readme . '</pre></div>'); } $event->addForm($f); // addConfigItems will be called when necessary }
function onSetupForms(Am_Event_SetupForms $forms) { $form = new Am_Form_Setup('google_analytics'); $form->setTitle("Google Analytics"); $forms->addForm($form); $form->addElement('text', 'google_analytics')->setLabel(array('Google Analytics Account ID', 'To enable automatic sales and hits tracking with GA, enter Google Analytics cAccount ID into this field. <a href=\'http://www.google.com/support/googleanalytics/bin/answer.py?answer=55603\' target=_blank>Where can I find my tracking ID?</a> The tracking ID will look like <i>UA-1231231-1</i>. Please note - this tracking is only for pages displayed by aMember, pages that are just protected by aMember, cannot be tracked. Use ' . '<a href="http://www.google.com/support/googleanalytics/bin/search.py?query=how+to+add+tracking&ctx=en%3Asearchbox" target=_blank>GA instructions</a> how to add tracking code to your own pages. ')); $form->addAdvCheckbox("google_analytics_only_sales_code")->setLabel(array("Include only sales code", "Enable this if you already have tracking code in template")); }
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); }
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); }
function eventSetupForm(Am_Event_SetupForms $event) { $form = new Am_Form_Setup_Theme($this->getId()); $form->setTitle(ucfirst($this->getId()) . ' Theme'); $this->initSetupForm($form); $event->addForm($form); }
function initSetupForms() { require_once 'Am/Form/Setup/Standard.php'; foreach ($this->getDi()->modules->getEnabled() as $module) { $fn = APPLICATION_PATH . '/' . $module . '/library/SetupForms.php'; if (!file_exists($fn)) { continue; } include_once $fn; } foreach (get_declared_classes() as $class) { if (is_subclass_of($class, 'Am_Form_Setup')) { $rc = new ReflectionClass($class); if ($rc->isAbstract()) { continue; } if ($class == 'Am_Form_Setup_Theme') { continue; } $this->addForm(new $class()); } } $this->getDi()->plugins_payment->loadEnabled()->getAllEnabled(); $this->getDi()->plugins_protect->loadEnabled()->getAllEnabled(); $event = new Am_Event_SetupForms($this); $event->run(); }
function onSetupForms(Am_Event_SetupForms $event) { $form = new Am_Form_Setup($this->getId()); $form->setTitle('SubUsers'); $event->addForm($form); $form->addAdvCheckbox('subusers_cannot_pay')->setLabel(___('Hide Payment Forms and History from SubUsers')); $form->addAdvRadio('subusers_cannot_delete')->setLabel(___('Reseller cannot delete subuser accounts'))->loadOptions(array('0' => ___('Resellers can delete subusers'), '1' => ___('Resellers cannot delete subusers'), '2' => ___('Resellers can delete subusers only when limit is over'))); $form->addAdvCheckbox('subusers_cannot_edit')->setLabel(___('Reseller cannot edit subusers accounts after insertion')); $form->addAdvCheckbox('subusers_cannot_change_email')->setLabel(___('Subuser e-mail address can be changed by site admin only')); $gr = $form->addGroup('subusers_fields')->setLabel(___('Reseller can manage the following subuser fields')); $gr->setSeparator(' '); $gr->addCheckbox('', array('value' => 'login'))->setContent(___('Username')); $gr->addCheckbox('', array('value' => 'pass'))->setContent(___('Password')); foreach ($this->getDi()->userTable->customFields()->getAll() as $field) { if (strpos($field->name, '_') === 0 || !isset($field->sql) || !$field->sql) { continue; } $gr->addCheckbox('', array('value' => $field->name))->setContent($field->title); } $gr->addHidden('', array('value' => '_')); $gr->addFilter(array($this, '_filterHidden')); $form->addAdvCheckbox('subusers_can_login')->setLabel(___('Reseller can log-in as subuser')); $form->addAdvCheckbox('subusers_different_profile_form')->setLabel(___("Use different profile form for subusers\n" . 'you can configure subusers profile form %shere%s', '<a class="link" href="' . REL_ROOT_URL . '/admin-saved-form">', '</a>')); $form->addElement('email_link', 'subusers.registration_mail')->setLabel(___('Registration E-Mail to Subusers')); $form->addEpilog('<div class="info"><pre>' . $this->getReadme() . '</pre></div>'); }
/** * Initialize setup form * You have to override this function and add elements * to returned (from parent::initSetupForm) form. * @return Am_Form_Setup */ function onSetupForms(Am_Event_SetupForms $event) { $form = new Am_Form_Setup($this->getId()); $form->setTitle($this->getConfigPageId()); $plugin = $this->getId(); $form->addText("title", array('size' => 40))->setLabel(___("Payment System Title")); $form->setDefault("payment.{$plugin}.title", @$this->defaultTitle); $form->addText("description", array('size' => 40))->setLabel(___("Payment System Description")); $form->setDefault("payment.{$plugin}.description", @$this->defaultDescription); /* $form->addAdvCheckbox("disable_postback_log") ->setLabel(___("Disable PostBack messages Logging (not recommended)\n". "By default aMember logs all payment system postback messages\n". "you can disable it by changing this configuration value" )); */ if ($this->canResendPostback()) { $gr = $form->addElement(new Am_Form_Element_CheckboxedGroup('resend_postback')); $gr->setLabel(___("Resend Postback\nenter list of URLs to resend incoming postback\none URL per line")); $gr->addTextarea('resend_postback_urls', array('rows' => 3, 'cols' => 70)); } $event->addForm($form); $this->_initSetupForm($form); if ($this->canAutoCreate()) { $form->addAdvCheckbox('auto_create')->setLabel(___("Accept Direct Payments\n" . "handle payments made on payment system side\n" . "(without signup to aMember first)")); } $form->addFieldsPrefix("payment.{$plugin}."); 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 functions may work unstable." . "Please test it carefully before use.</div>"); } return $form; }