function _afterInitSetupForm(Am_Form_Setup $form) { $url = Am_Controller::escape(REL_ROOT_URL) . '/default/admin-content/p/newsletter/index'; $text = ___("Once the plugin configuration is finished on this page, do not forget to add\n" . "a record on %saMember CP -> Protect Content -> Newsletters%s page", '<a href="' . $url . '" target="_blank" class="link">', '</a>'); $form->addProlog(<<<CUT <div class="warning_box"> {$text} </div> CUT ); if ($this->canGetLists()) { $lists = array(); try { foreach ($this->getLists() as $k => $v) { $lists[$k] = $v['title']; } } catch (Exception $e) { //just log $this->getDi()->errorLogTable->logException($e); } $gr = $form->addGroup()->setLabel(___('Unsubscribe customer from selected newsletter threads')); $gr->addSelect('unsubscribe_after_signup')->loadOptions(array('' => ___('Please Select'), self::UNSUBSCRIBE_AFTER_ADDED => ___('After the user has been added'), self::UNSUBSCRIBE_AFTER_PAID => ___('After first payment has been completed'))); $gr->addStatic()->setContent('<br><br>'); $gr->addMagicSelect('unsubscribe_after_signup_lists')->loadOptions($lists); } parent::_afterInitSetupForm($form); }
public static function activate($id, $pluginType) { try { Am_Di::getInstance()->db->query("CREATE TABLE ?_notification (\n notification_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n content varchar(255),\n url varchar(255),\n is_blank TINYINT NOT NULL,\n begin date NULL,\n expire date NULL,\n is_disabled TINYINT NOT NULL\n ) CHARACTER SET utf8 COLLATE utf8_general_ci"); } catch (Am_Exception_Db $e) { } try { Am_Di::getInstance()->db->query("CREATE TABLE ?_notification_access (\n notification_access_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n notification_id INT NOT NULL,\n fn enum('product_id','product_category_id','free','user_id'),\n id INT NULL\n ) CHARACTER SET utf8 COLLATE utf8_general_ci"); } catch (Am_Exception_Db $e) { } try { Am_Di::getInstance()->db->query("ALTER TABLE ?_notification\n ADD `limit` TINYINT,\n ADD is_custom TINYINT NOT NULL"); } catch (Am_Exception_Db $e) { } try { Am_Di::getInstance()->db->query("ALTER TABLE ?_notification_access\n MODIFY fn enum('product_id','product_category_id','free','user_id', 'user_group_id')"); } catch (Am_Exception_Db $e) { } try { Am_Di::getInstance()->db->query("ALTER TABLE ?_notification\n MODIFY content TEXT"); } catch (Am_Exception_Db $e) { } try { Am_Di::getInstance()->db->query("ALTER TABLE ?_notification\n ADD sort_order INT NOT NULL"); Am_Di::getInstance()->db->query("SET @i = 0"); Am_Di::getInstance()->db->query("UPDATE ?_notification SET sort_order=(@i:=@i+1) ORDER BY notification_id DESC"); } catch (Am_Exception_Db $e) { } try { Am_Di::getInstance()->db->query("CREATE TABLE IF NOT EXISTS ?_notification_click (\n notification_click_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,\n notification_id INT NOT NULL,\n user_id INT UNSIGNED NOT NULL,\n dattm date NOT NULL,\n INDEX notification_id (notification_id)\n ) CHARACTER SET utf8 COLLATE utf8_general_ci"); } catch (Am_Exception_Db $e) { //nop } return parent::activate($id, $pluginType); }
public static function activate($id, $pluginType) { try { Am_Di::getInstance()->db->query("CREATE TABLE ?_oto (\n oto_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n comment varchar(255),\n conditions text,\n view mediumtext,\n product_id INT NOT NULL,\n coupon_id INT NULL,\n is_disabled TINYINT NOT NULL,\n bp_id INT\n ) CHARACTER SET utf8 COLLATE utf8_general_ci"); } catch (Am_Exception_Db $e) { } return parent::activate($id, $pluginType); }
public function onAdminWarnings(\Am_Event $event) { if (!$this->_api_loaded) { $event->setReturn(array(___('Facebook SDK was not loaded. Got an error: %s', $this->_api_error))); } else { parent::onAdminWarnings($event); } }
protected function _beforeInitSetupForm() { $form = parent::_beforeInitSetupForm(); $form->setTitle($this->getConfigPageId()); $plugin = $this->getId(); $form->addText('title', array('class' => 'el-wide'))->setLabel(___('Payment System Title')); $form->setDefault("payment.{$plugin}.title", @$this->defaultTitle); $form->addText('description', array('class' => 'el-wide'))->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)); } return $form; }
function init() { parent::init(); $front = Zend_Controller_Front::getInstance(); $front->getRouter()->addRoute('notification', new Zend_Controller_Router_Route('misc/notification/:action/:id', array('module' => 'default', 'controller' => 'direct', 'action' => 'index', 'type' => 'misc', 'plugin_id' => 'notification'))); }
function render(Am_View $view) { if ($this->path) { $view->block = $this; // add plugin folder to search path for blocks $paths = $view->getScriptPaths(); $newPaths = null; if ($this->plugin && !$this->plugin instanceof Am_Module && ($dir = $this->plugin->getDir())) { $newPaths = $paths; // we insert it to second postion, as first will be theme // lets keep there some place for redefenition array_splice($newPaths, 1, 0, array($dir)); $view->setScriptPath(array_reverse($newPaths)); } $pluginSaved = !empty($view->plugin) ? $view->plugin : null; if ($this->plugin) { $view->plugin = $this->plugin; } $out = $view->render("blocks/" . $this->path); $view->plugin = $pluginSaved; // remove plugin folder from view search path if (!empty($newPaths)) { $view->setScriptPath(array_reverse($paths)); } return $out; } elseif ($this->callback) { return call_user_func($this->callback, $view, $this); } else { throw new Am_Exception_InternalError("Unknown block path format"); } }
public function __construct(Am_Di $di, array $config) { $this->id = $di->config->get('getclicky_id'); // print_rre($this->id); parent::__construct($di, $config); }
public function __construct(Am_Di $di, array $config) { $this->id = $di->config->get('google_analytics'); parent::__construct($di, $config); }
/** * Constructor * @param array $config */ function __construct(Am_Di $di, array $config) { parent::__construct($di, $config); /** @todo remove this crap */ $ps = new Am_Paysystem_Description($this->getId(), $this->getTitle(), $this->getDescription(), $this->isRecurring()); $ps->setPublic(true); $di->paysystemList->add($ps); ///////////////////////////// }