public function index() { $language = OW::getLanguage(); OW::getDocument()->setHeading($language->text('mcompose', 'heading_configuration')); OW::getDocument()->setHeadingIconClass('ow_ic_gear_wheel'); $this->assign('pluginUrl', 'http://www.oxwall.org/store/item/10'); if (!$this->plugin->isAvaliable()) { $this->assign('avaliable', false); return; } $this->assign('avaliable', true); $settingUrl = OW::getRouter()->urlForRoute('mailbox_admin_config'); $this->assign('settingsUrl', $settingUrl); $configs = OW::getConfig()->getValues('mcompose'); $features = array(); $features["friends"] = MCOMPOSE_CLASS_FriendsBridge::getInstance()->isActive(); $features["groups"] = MCOMPOSE_CLASS_GroupsBridge::getInstance()->isActive(); $features["events"] = MCOMPOSE_CLASS_EventsBridge::getInstance()->isActive(); $form = new MCOMPOSE_ConfigForm($configs, $features); $this->addForm($form); $this->assign("configs", $configs); $this->assign("features", $features); $this->assign("activeFeatures", array_filter($features)); if (OW::getRequest()->isPost() && $form->isValid($_POST)) { if ($form->process($_POST)) { OW::getFeedback()->info($language->text('mcompose', 'admin_settings_updated')); $this->redirect(OW::getRouter()->urlForRoute('mcompose-admin')); } } }
/** * Returns class instance * * @return MCOMPOSE_CLASS_FriendsBridge */ public static function getInstance() { if (!isset(self::$classInstance)) { self::$classInstance = new self(); } return self::$classInstance; }
<?php /** * Copyright (c) 2012, Sergey Kambalin * All rights reserved. * ATTENTION: This commercial software is intended for use with Oxwall Free Community Software http://www.oxwall.org/ * and is licensed under Oxwall Store Commercial License. * Full text of this license can be found at http://www.oxwall.org/store/oscl */ require 'plugin.php'; MCOMPOSE_Plugin::getInstance()->init(); MCOMPOSE_CLASS_BaseBridge::getInstance()->init(); MCOMPOSE_CLASS_FriendsBridge::getInstance()->init(); MCOMPOSE_CLASS_GroupsBridge::getInstance()->init(); MCOMPOSE_CLASS_EventsBridge::getInstance()->init();