当前位置: 首页>>代码示例>>PHP>>正文


PHP SettingsForm::display方法代码示例

本文整理汇总了PHP中SettingsForm::display方法的典型用法代码示例。如果您正苦于以下问题:PHP SettingsForm::display方法的具体用法?PHP SettingsForm::display怎么用?PHP SettingsForm::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SettingsForm的用法示例。


在下文中一共展示了SettingsForm::display方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: manage

 function manage($verb, $args)
 {
     if (parent::manage($verb, $args)) {
         return true;
     }
     if (!$this->getEnabled()) {
         return false;
     }
     switch ($verb) {
         case 'settings':
             $journal =& Request::getJournal();
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, null, 'plugins');
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         default:
             return false;
     }
     return true;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:31,代码来源:MetsGatewayPlugin.inc.php

示例2: display

    public function display()
    {
        $settings = new SettingsForm();
        $settings->role = 3;
        $settings->url = UrlRewriting::GetUrlByAlias($_GET['include']);
        if (isset($_GET['areatype'])) {
            $settings->areaType = $_GET['areatype'];
        }
        if (isset($_GET['area'])) {
            $settings->area = $_GET['area'];
        }
        if (isset($_GET['role'])) {
            $settings->role = $_GET['role'];
        }
        $settings->display();
        ?>
        <div style="margin-left:500px;">
        <h2>Skins</h2>
      <?php 
        $skins = DataBase::Current()->ReadRows("SELECT * FROM {'dbprefix'}skins WHERE LOWER(name) IN (SELECT DISTINCT name FROM {'dbprefix'}settings WHERE areaType = 'skins' AND area = {'dbprefix'}skins.name)");
        if ($skins) {
            foreach ($skins as $skin) {
                $url = UrlRewriting::GetUrlByAlias("admin/settings", "areatype=skins&area=" . urlencode($skin->name));
                echo "<a href=\"" . $url . "\">" . $skin->name . "</a><br />";
            }
        }
        ?>
        <h2>Plugins</h2>
      <?php 
        $plugins = new PluginList();
        $plugins->loadAll();
        foreach ($plugins->plugins as $plugin) {
            if ($plugin->configurationFile != '') {
                $url = UrlRewriting::GetUrlByAlias("admin/pluginsettings", "plugin=" . $plugin->path);
                ?>
              <a href="<?php 
                echo $url;
                ?>
"><?php 
                echo $plugin->name;
                ?>
</a><br />
            <?php 
            }
        }
        ?>
        </div>
      <?php 
    }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:49,代码来源:settingspage.php

示例3: manage

 /**
  * @see PKPPlugin::manage()
  */
 function manage($verb, $args, &$message, &$messageParams, &$pluginModalContent = null)
 {
     $returner = true;
     $request = $this->getRequest();
     $journal = $request->getJournal();
     $this->addLocaleData();
     switch ($verb) {
         case 'settings':
             AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_PKP_MANAGER);
             $templateMgr = TemplateManager::getManager($request);
             $templateMgr->register_function('plugin_url', array($this, 'smartyPluginUrl'));
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if ($request->getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     $request->redirect(null, null, 'plugins');
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         case 'enable':
             $this->updateSetting($journal->getId(), 'enabled', true);
             $message = NOTIFICATION_TYPE_SWORD_ENABLED;
             $returner = false;
             break;
         case 'disable':
             $this->updateSetting($journal->getId(), 'enabled', false);
             $message = NOTIFICATION_TYPE_PLUGIN_DISABLED;
             $messageParams = array('pluginName' => $this->getDisplayName());
             $returner = false;
             break;
         case 'createDepositPoint':
         case 'editDepositPoint':
             $templateMgr = TemplateManager::getManager($request);
             $templateMgr->register_function('plugin_url', array($this, 'smartyPluginUrl'));
             $depositPointId = array_shift($args);
             if ($depositPointId == '') {
                 $depositPointId = null;
             } else {
                 $depositPointId = (int) $depositPointId;
             }
             $this->import('DepositPointForm');
             $form = new DepositPointForm($this, $journal->getId(), $depositPointId);
             if ($request->getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     $request->redirect(null, null, null, array('generic', $this->getName(), 'settings'));
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         case 'deleteDepositPoint':
             $journalId = $journal->getId();
             $depositPointId = (int) array_shift($args);
             $depositPoints = $this->getSetting($journalId, 'depositPoints');
             unset($depositPoints[$depositPointId]);
             $this->updateSetting($journalId, 'depositPoints', $depositPoints);
             $request->redirect(null, null, null, array('generic', 'SwordPlugin', 'settings'));
             break;
     }
     return $returner;
 }
开发者ID:jalperin,项目名称:ojs,代码行数:76,代码来源:SwordPlugin.inc.php

示例4: manage

 function manage($verb, $args, &$message)
 {
     if (!parent::manage($verb, $args, $message)) {
         return false;
     }
     switch ($verb) {
         case 'settings':
             $journal =& Request::getJournal();
             Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_MANAGER));
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, null, 'plugins');
                     return false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             return true;
         default:
             // Unknown management verb
             assert(false);
             return false;
     }
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:33,代码来源:ThesisFeedPlugin.inc.php

示例5: manage

 function manage($verb, $args, &$message)
 {
     $returner = true;
     $journal =& Request::getJournal();
     $this->addLocaleData();
     switch ($verb) {
         case 'settings':
             Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_MANAGER));
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, null, 'plugins');
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         case 'enable':
             $this->updateSetting($journal->getId(), 'enabled', true);
             $message = Locale::translate('plugins.generic.sword.enabled');
             $returner = false;
             break;
         case 'disable':
             $this->updateSetting($journal->getId(), 'enabled', false);
             $message = Locale::translate('plugins.generic.sword.disabled');
             $returner = false;
             break;
         case 'createDepositPoint':
         case 'editDepositPoint':
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $depositPointId = array_shift($args);
             if ($depositPointId == '') {
                 $depositPointId = null;
             } else {
                 $depositPointId = (int) $depositPointId;
             }
             $this->import('DepositPointForm');
             $form = new DepositPointForm($this, $journal->getId(), $depositPointId);
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, null, null, array('generic', $this->getName(), 'settings'));
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         case 'deleteDepositPoint':
             $journalId = $journal->getId();
             $depositPointId = (int) array_shift($args);
             $depositPoints = $this->getSetting($journalId, 'depositPoints');
             unset($depositPoints[$depositPointId]);
             $this->updateSetting($journalId, 'depositPoints', $depositPoints);
             Request::redirect(null, null, null, array('generic', 'SwordPlugin', 'settings'));
             break;
     }
     return $returner;
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:71,代码来源:SwordPlugin.inc.php

示例6: manage

 /**
  * Execute a management verb on this plugin
  * @param $verb string
  * @param $args array
  * @param $message string Result status message
  * @param $messageParams array Parameters for the message key
  * @return boolean
  */
 function manage($verb, $args, &$message, &$messageParams)
 {
     if (!parent::manage($verb, $args, $message, $messageParams)) {
         return false;
     }
     switch ($verb) {
         case 'settings':
             $journal =& Request::getJournal();
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     return false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             return true;
         default:
             // Unknown management verb
             assert(false);
             return false;
     }
 }
开发者ID:jasonzou,项目名称:OJS-2.4.6,代码行数:39,代码来源:AnnouncementFeedPlugin.inc.php

示例7: manage

 /**
  * Perform management functions
  */
 function manage($verb, $args, &$message, &$messageParams)
 {
     if (!parent::manage($verb, $args, $message, $messageParams)) {
         return false;
     }
     switch ($verb) {
         case 'settings':
             $journal =& Request::getJournal();
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $pageCrumbs = array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'manager'), 'user.role.manager'), array(Request::url(null, 'manager', 'plugins'), __('manager.plugins'), true));
             $templateMgr->assign('pageHierarchy', $pageCrumbs);
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             $form->readInputData();
             if (Request::getUserVar('addBlock')) {
                 // Add a block
                 $editData = true;
                 $blocks = $form->getData('blocks');
                 array_push($blocks, '');
                 $form->_data['blocks'] = $blocks;
             } else {
                 if (($delBlock = Request::getUserVar('delBlock')) && count($delBlock) == 1) {
                     // Delete an block
                     $editData = true;
                     list($delBlock) = array_keys($delBlock);
                     $delBlock = (int) $delBlock;
                     $blocks = $form->getData('blocks');
                     if (isset($blocks[$delBlock]) && !empty($blocks[$delBlock])) {
                         $deletedBlocks = explode(':', $form->getData('deletedBlocks'));
                         array_push($deletedBlocks, $blocks[$delBlock]);
                         $form->setData('deletedBlocks', join(':', $deletedBlocks));
                     }
                     array_splice($blocks, $delBlock, 1);
                     $form->_data['blocks'] = $blocks;
                 } else {
                     if (Request::getUserVar('save')) {
                         $editData = true;
                         $form->execute();
                     } else {
                         $form->initData();
                     }
                 }
             }
             if (!isset($editData) && $form->validate()) {
                 $form->execute();
                 $form->display();
                 exit;
             } else {
                 $form->display();
                 exit;
             }
             return true;
         default:
             // Unknown management verb
             assert(false);
             return false;
     }
 }
开发者ID:reconciler,项目名称:ojs,代码行数:62,代码来源:CustomBlockManagerPlugin.inc.php

示例8: manage

 function manage($verb, $args, &$message)
 {
     $returner = true;
     $journal =& Request::getJournal();
     switch ($verb) {
         case 'settings':
             Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_MANAGER));
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, null, 'plugins');
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         case 'enable':
             $this->updateSetting($journal->getId(), 'enabled', true);
             $message = Locale::translate('plugins.generic.webfeed.enabled');
             $returner = false;
             break;
         case 'disable':
             $this->updateSetting($journal->getId(), 'enabled', false);
             $message = Locale::translate('plugins.generic.webfeed.disabled');
             $returner = false;
             break;
     }
     return $returner;
 }
开发者ID:philschatz,项目名称:ojs,代码行数:37,代码来源:WebFeedPlugin.inc.php

示例9: manage

 /**
  * @see PKPPlugin::manage()
  */
 function manage($verb, $args, &$message, &$messageParams, &$pluginModalContent = null)
 {
     if (!parent::manage($verb, $args, $message, $messageParams)) {
         return false;
     }
     $request =& $this->getRequest();
     switch ($verb) {
         case 'settings':
             $journal = $request->getJournal();
             $templateMgr = TemplateManager::getManager($request);
             $templateMgr->register_function('plugin_url', array($this, 'smartyPluginUrl'));
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             $form->readInputData();
             if ($request->getUserVar('addBlock')) {
                 // Add a block
                 $editData = true;
                 $blocks = $form->getData('blocks');
                 array_push($blocks, '');
                 $form->_data['blocks'] = $blocks;
             } else {
                 if (($delBlock = $request->getUserVar('delBlock')) && count($delBlock) == 1) {
                     // Delete an block
                     $editData = true;
                     list($delBlock) = array_keys($delBlock);
                     $delBlock = (int) $delBlock;
                     $blocks = $form->getData('blocks');
                     if (isset($blocks[$delBlock]) && !empty($blocks[$delBlock])) {
                         $deletedBlocks = explode(':', $form->getData('deletedBlocks'));
                         array_push($deletedBlocks, $blocks[$delBlock]);
                         $form->setData('deletedBlocks', join(':', $deletedBlocks));
                     }
                     array_splice($blocks, $delBlock, 1);
                     $form->_data['blocks'] = $blocks;
                 } else {
                     if ($request->getUserVar('save')) {
                         $editData = true;
                         $form->execute();
                     } else {
                         $form->initData();
                     }
                 }
             }
             if (!isset($editData) && $form->validate()) {
                 $form->execute();
                 $form->display();
                 exit;
             } else {
                 $form->display();
                 exit;
             }
             return true;
         default:
             // Unknown management verb
             assert(false);
             return false;
     }
 }
开发者ID:jalperin,项目名称:ojs,代码行数:61,代码来源:CustomBlockManagerPlugin.inc.php

示例10: manage

 function manage($verb, $args, &$message)
 {
     $returner = true;
     $conference =& Request::getConference();
     switch ($verb) {
         case 'settings':
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $conference->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     $returner = false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         case 'enable':
             $this->updateSetting($conference->getId(), 0, 'enabled', true);
             $message = __('plugins.generic.announcementfeed.enabled');
             $returner = false;
             break;
         case 'disable':
             $this->updateSetting($conference->getId(), 0, 'enabled', false);
             $message = __('plugins.generic.announcementfeed.enabled');
             $returner = false;
             break;
     }
     return $returner;
 }
开发者ID:sedici,项目名称:ocs,代码行数:36,代码来源:AnnouncementFeedPlugin.inc.php

示例11: manage

 /**
  * @see GenericPlugin::manage()
  */
 function manage($verb, $args, &$message, &$messageParams)
 {
     if (!parent::manage($verb, $args, $message, $messageParams)) {
         return false;
     }
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
     $journal =& Request::getJournal();
     switch ($verb) {
         case 'connect':
             $this->import('classes.form.DataverseAuthForm');
             $form = new DataverseAuthForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, 'manager', 'plugin', array('generic', $this->getName(), 'select'));
                     return false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             return true;
         case 'select':
             $this->import('classes.form.DataverseSelectForm');
             $form = new DataverseSelectForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, 'manager', 'plugin', array('generic', $this->getName(), 'settings'));
                     return false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             return true;
         case 'settings':
             $this->import('classes.form.SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, 'manager', 'plugin', array('generic'));
                     return false;
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             return true;
         default:
             // Unknown management verb
             assert(false);
             return false;
     }
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:69,代码来源:DataversePlugin.inc.php

示例12: manage

 /**
  * Perform management functions
  */
 function manage($verb, $args)
 {
     $returner = true;
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
     $pageCrumbs = array(array(Request::url(null, null, 'user'), 'navigation.user'), array(Request::url(null, null, 'manager'), 'user.role.manager'));
     $conference =& Request::getConference();
     switch ($verb) {
         case 'enable':
             $this->setEnabled(true);
             break;
         case 'disable':
             $this->setEnabled(false);
             break;
         case 'settings':
             $pageCrumbs[] = array(Request::url(null, null, 'manager', 'plugins'), Locale::translate('manager.plugins'), true);
             $templateMgr->assign('pageHierarchy', $pageCrumbs);
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $conference->getId());
             $form->readInputData();
             if (Request::getUserVar('addBlock')) {
                 // Add a block
                 $editData = true;
                 //$blocks = is_null($form->getData('blocks'))?array():$form->getData('blocks');
                 $blocks = $form->getData('blocks');
                 array_push($blocks, '');
                 $form->_data['blocks'] = $blocks;
             } else {
                 if (($delBlock = Request::getUserVar('delBlock')) && count($delBlock) == 1) {
                     // Delete an block
                     $editData = true;
                     list($delBlock) = array_keys($delBlock);
                     $delBlock = (int) $delBlock;
                     $blocks = $form->getData('blocks');
                     if (isset($blocks[$delBlock]) && !empty($blocks[$delBlock])) {
                         $deletedBlocks = explode(':', $form->getData('deletedBlocks'));
                         array_push($deletedBlocks, $blocks[$delBlock]);
                         $form->setData('deletedBlocks', join(':', $deletedBlocks));
                     }
                     array_splice($blocks, $delBlock, 1);
                     $form->_data['blocks'] = $blocks;
                 } else {
                     if (Request::getUserVar('save')) {
                         $editData = true;
                         $form->execute();
                     } else {
                         $form->initData();
                     }
                 }
             }
             if (!isset($editData) && $form->validate()) {
                 $form->execute();
                 $form->display();
                 exit;
             } else {
                 $form->display();
                 exit;
             }
             $returner = true;
             break;
     }
     $returner = false;
 }
开发者ID:jalperin,项目名称:ocs,代码行数:66,代码来源:CustomBlockManagerPlugin.inc.php


注:本文中的SettingsForm::display方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。