本文整理汇总了PHP中GenericPlugin::manage方法的典型用法代码示例。如果您正苦于以下问题:PHP GenericPlugin::manage方法的具体用法?PHP GenericPlugin::manage怎么用?PHP GenericPlugin::manage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericPlugin
的用法示例。
在下文中一共展示了GenericPlugin::manage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: manage
function manage($verb, $args)
{
if (!parent::manage($verb, $args, $message)) {
return false;
}
$this->import('CustomLocaleHandler');
$customLocaleHandler = new CustomLocaleHandler();
switch ($verb) {
case 'edit':
$customLocaleHandler->edit($args);
return true;
case 'saveLocaleChanges':
$customLocaleHandler->saveLocaleChanges($args);
return true;
case 'editLocaleFile':
$customLocaleHandler->editLocaleFile($args);
return true;
case 'saveLocaleFile':
$customLocaleHandler->saveLocaleFile($args);
return true;
default:
$customLocaleHandler->index();
return true;
}
}
示例2: manage
function manage($verb, $args, &$message)
{
if (!parent::manage($verb, $args, $message)) {
return false;
}
switch ($verb) {
case 'settings':
$templateMgr =& TemplateManager::getManager();
$templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
$journal =& Request::getJournal();
$this->import('ReferralPluginSettingsForm');
$form = new ReferralPluginSettingsForm($this, $journal->getId());
if (Request::getUserVar('save')) {
$form->readInputData();
if ($form->validate()) {
$form->execute();
Request::redirect(null, 'manager', 'plugin');
return false;
} else {
$this->setBreadCrumbs(true);
$form->display();
}
} else {
$this->setBreadCrumbs(true);
$form->initData();
$form->display();
}
return true;
default:
// Unknown management verb
assert(false);
}
}
示例3: manage
/**
* @see GenericPlugin::manage()
*/
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();
$message = NOTIFICATION_TYPE_SUCCESS;
$messageParams = array('contents' => __('plugins.generic.alm.settings.saved'));
return false;
} else {
$form->display();
}
} else {
$form->initData();
$form->display();
}
return true;
default:
// Unknown management verb
assert(false);
return false;
}
}
示例4: manage
function manage($verb, $args, &$message, &$messageParams)
{
if (!parent::manage($verb, $args, $message, $messageParams)) {
return false;
}
switch ($verb) {
case 'translate':
Request::redirect('index', 'translate');
return false;
default:
// Unknown management verb
assert(false);
return false;
}
}
示例5: 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 'translate':
$request->redirect('index', 'translate');
return false;
default:
// Unknown management verb
assert(false);
return false;
}
}
示例6: 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;
}
}
示例7: manage
/**
* @see Plugin::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());
if ($request->getUserVar('save')) {
$form->readInputData();
if ($form->validate()) {
$form->execute();
return false;
} else {
$form->display($request);
}
} else {
$form->initData();
$form->display($request);
}
return true;
default:
// Unknown management verb
assert(false);
return false;
}
}
示例8: 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;
}
}
示例9: manage
function manage($verb, $args, &$message, &$messageParams)
{
if (!parent::manage($verb, $args, $message, $messageParams)) {
return false;
}
switch ($verb) {
case 'settings':
$templateMgr =& TemplateManager::getManager();
$journal =& Request::getJournal();
$this->import('OpenAdsSettingsForm');
$this->import('OpenAdsConnection');
$openAdsConnection = new OpenAdsConnection($this, $this->getInstallationPath());
$openAdsConnection->loadConfig();
$form = new OpenAdsSettingsForm($this, $openAdsConnection, $journal->getId());
if (array_shift($args) == 'save') {
$form->readInputData();
$form->execute();
Request::redirect(null, 'manager', 'plugins');
return false;
} else {
$form->initData();
$form->display();
return true;
}
default:
// Unknown management verb
assert(false);
return false;
}
}
示例10: manage
/**
* Perform management functions
*/
function manage($verb, $args, &$message, &$messageparams)
{
if (!parent::manage($verb, $args, $message, $messageParams)) {
return false;
}
$request =& $this->getRequest();
$conference =& $request->getConference();
$templateMgr =& TemplateManager::getManager();
$templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
$templateMgr->assign('pagesPath', $request->url(null, null, 'pages', 'view', 'REPLACEME'));
$pageCrumbs = array(array($request->url(null, null, 'user'), 'navigation.user'), array($request->url(null, null, 'manager'), 'user.role.manager'));
switch ($verb) {
case 'settings':
$this->import('StaticPagesSettingsForm');
$form = new StaticPagesSettingsForm($this, $conference->getId());
$templateMgr->assign('pageHierarchy', $pageCrumbs);
$form->initData($request);
$form->display();
return true;
case 'edit':
case 'add':
$this->import('StaticPagesEditForm');
$staticPageId = isset($args[0]) ? (int) $args[0] : null;
$form = new StaticPagesEditForm($this, $conference->getId(), $staticPageId);
if ($form->isLocaleResubmit()) {
$form->readInputData();
$form->addTinyMCE($request);
} else {
$form->initData();
}
$pageCrumbs[] = array($request->url(null, null, 'manager', 'plugin', array('generic', $this->getName(), 'settings')), $this->getDisplayName(), true);
$templateMgr->assign('pageHierarchy', $pageCrumbs);
$form->display();
return true;
case 'save':
$this->import('StaticPagesEditForm');
$staticPageId = isset($args[0]) ? (int) $args[0] : null;
$form = new StaticPagesEditForm($this, $conference->getId(), $staticPageId);
if ($request->getUserVar('edit')) {
$form->readInputData();
if ($form->validate()) {
$form->save();
$templateMgr->assign(array('currentUrl' => $request->url(null, null, null, null, array($this->getCategory(), $this->getName(), 'settings')), 'pageTitle' => 'plugins.generic.staticPages.displayName', 'pageHierarchy' => $pageCrumbs, 'message' => 'plugins.generic.staticPages.pageSaved', 'backLink' => $request->url(null, null, null, null, array($this->getCategory(), $this->getName(), 'settings')), 'backLinkLabel' => 'common.continue'));
$templateMgr->display('common/message.tpl');
exit;
} else {
$form->addTinyMCE($request);
$form->display();
exit;
}
}
$request->redirect(null, null, null, 'manager', 'plugins');
return false;
case 'delete':
$staticPageId = isset($args[0]) ? (int) $args[0] : null;
$staticPagesDao = DAORegistry::getDAO('StaticPagesDAO');
$staticPagesDao->deleteStaticPageById($staticPageId);
$templateMgr->assign(array('currentUrl' => $request->url(null, null, null, null, array($this->getCategory(), $this->getName(), 'settings')), 'pageTitle' => 'plugins.generic.staticPages.displayName', 'message' => 'plugins.generic.staticPages.pageDeleted', 'backLink' => $request->url(null, null, null, null, array($this->getCategory(), $this->getName(), 'settings')), 'backLinkLabel' => 'common.continue'));
$templateMgr->assign('pageHierarchy', $pageCrumbs);
$templateMgr->display('common/message.tpl');
return true;
default:
// Unknown management verb
assert(false);
return false;
}
}
示例11: manage
/**
* @see Plugin::manage()
*/
function manage($args, $request)
{
if (!parent::manage($args, $request)) {
return false;
}
switch (array_shift($args)) {
case 'settings':
$templateMgr = TemplateManager::getManager($request);
$templateMgr->register_function('plugin_url', array($this, 'smartyPluginUrl'));
$journal = $request->getJournal();
$this->import('classes.form.BrowseSettingsForm');
$form = new BrowseSettingsForm($this, $journal->getId());
if ($request->getUserVar('save')) {
$form->readInputData();
if ($form->validate()) {
$form->execute();
$request->redirect(null, 'manager', 'plugins');
return false;
} else {
$form->display();
}
} else {
$form->initData();
$form->display();
}
return true;
default:
// Unknown management verb
assert(false);
return false;
}
}
示例12: manage
/**
* @copydoc PKPPlugin::manage()
*/
function manage($verb, $args, &$message, &$messageParams)
{
$journal =& Request::getJournal();
switch ($verb) {
case 'settings':
$templateMgr =& TemplateManager::getManager();
$templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
$this->import('classes.form.PLNSettingsForm');
$form = new PLNSettingsForm($this, $journal->getId());
if (Request::getUserVar('save')) {
$form->readInputData();
if ($form->validate()) {
$form->execute();
$message = NOTIFICATION_TYPE_SUCCESS;
$messageParams = array('contents' => __('plugins.generic.pln.settings.saved'));
return false;
} else {
$this->setBreadcrumbs('settings');
$form->display();
}
} else {
if (Request::getUserVar('refresh')) {
$this->getServiceDocument($journal->getId());
}
$this->setBreadcrumbs('settings');
$form->initData();
$form->display();
}
return true;
case 'status':
$templateMgr =& TemplateManager::getManager();
$templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
$this->import('classes.form.PLNStatusForm');
$form = new PLNStatusForm($this, $journal->getId());
if (Request::getUserVar('reset')) {
$journal =& Request::getJournal();
$deposit_ids = array_keys(Request::getUserVar('reset'));
$depositDao =& DAORegistry::getDAO('DepositDAO');
foreach ($deposit_ids as $deposit_id) {
$deposit =& $depositDao->getDepositById($journal->getId(), $deposit_id);
$deposit->setStatus(PLN_PLUGIN_DEPOSIT_STATUS_NEW);
$depositDao->updateDeposit($deposit);
}
}
$this->setBreadCrumbs('status');
$form->display();
return true;
default:
return parent::manage($verb, $args, $message, $messageParams);
}
}
示例13: manage
/**
* @see PKPPlugin::manage()
*/
function manage($verb, $args, &$message, &$messageParams, &$pluginModalContent = null)
{
if (!parent::manage($verb, $args, $message, $messageParams)) {
return false;
}
$request =& $this->getRequest();
AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_PKP_USER);
$templateMgr = TemplateManager::getManager($request);
$templateMgr->register_function('plugin_url', array($this, 'smartyPluginUrl'));
$journal = $request->getJournal();
$journalId = $journal->getId();
switch ($verb) {
case 'delete':
if (!empty($args)) {
$externalFeedId = !isset($args) || empty($args) ? null : (int) $args[0];
$externalFeedDao = DAORegistry::getDAO('ExternalFeedDAO');
// Ensure externalFeed is for this journal
if ($externalFeedDao->getExternalFeedJournalId($externalFeedId) == $journalId) {
$externalFeedDao->deleteExternalFeedById($externalFeedId);
}
}
$request->redirect(null, 'manager', 'plugin', array('generic', $this->getName(), 'feeds'));
return true;
case 'move':
$externalFeedId = !isset($args) || empty($args) ? null : (int) $args[0];
$externalFeedDao = DAORegistry::getDAO('ExternalFeedDAO');
// Ensure externalFeed is valid and for this journal
if ($externalFeedId != null && $externalFeedDao->getExternalFeedJournalId($externalFeedId) == $journalId) {
$feed =& $externalFeedDao->getExternalFeed($externalFeedId);
$direction = $this->getRequest()->getUserVar('dir');
if ($direction != null) {
// moving with up or down arrow
$isDown = $direction == 'd';
$feed->setSeq($feed->getSeq() + ($isDown ? 1.5 : -1.5));
$externalFeedDao->updateExternalFeed($feed);
$externalFeedDao->resequenceExternalFeeds($feed->getJournalId());
}
}
$this->getRequest()->redirect(null, 'manager', 'plugin', array('generic', $this->getName(), 'feeds'));
return true;
case 'create':
case 'edit':
$externalFeedId = !isset($args) || empty($args) ? null : (int) $args[0];
$externalFeedDao = DAORegistry::getDAO('ExternalFeedDAO');
// Ensure externalFeed is valid and for this journal
if ($externalFeedId != null && $externalFeedDao->getExternalFeedJournalId($externalFeedId) == $journalId || $externalFeedId == null) {
$this->import('ExternalFeedForm');
if ($externalFeedId == null) {
$templateMgr->assign('externalFeedTitle', 'plugins.generic.externalFeed.manager.createTitle');
} else {
$templateMgr->assign('externalFeedTitle', 'plugins.generic.externalFeed.manager.editTitle');
}
$journalSettingsDao = DAORegistry::getDAO('JournalSettingsDAO');
$journalSettings =& $journalSettingsDao->getSettings($journalId);
$externalFeedForm = new ExternalFeedForm($this, $externalFeedId, $journalId);
if ($externalFeedForm->isLocaleResubmit()) {
$externalFeedForm->readInputData();
} else {
$externalFeedForm->initData();
}
$templateMgr->assign('journalSettings', $journalSettings);
$externalFeedForm->display();
} else {
$this->getRequest()->redirect(null, 'manager', 'plugin', array('generic', $this->getName(), 'feeds'));
}
return true;
case 'update':
$externalFeedId = $this->getRequest()->getUserVar('feedId') == null ? null : (int) $this->getRequest()->getUserVar('feedId');
$externalFeedDao = DAORegistry::getDAO('ExternalFeedDAO');
if ($externalFeedId != null && $externalFeedDao->getExternalFeedJournalId($externalFeedId) == $journalId || $externalFeedId == null) {
$this->import('ExternalFeedForm');
$externalFeedForm = new ExternalFeedForm($this, $externalFeedId, $journalId);
$externalFeedForm->readInputData();
if ($externalFeedForm->validate()) {
$externalFeedForm->execute();
if ($this->getRequest()->getUserVar('createAnother')) {
$this->getRequest()->redirect(null, 'manager', 'plugin', array('generic', $this->getName(), 'create'));
} else {
$this->getRequest()->redirect(null, 'manager', 'plugin', array('generic', $this->getName(), 'feeds'));
}
} else {
if ($externalFeedId == null) {
$templateMgr->assign('externalFeedTitle', 'plugins.generic.externalFeed.manager.createTitle');
} else {
$templateMgr->assign('externalFeedTitle', 'plugins.generic.externalFeed.manager.editTitle');
}
$journalSettingsDao = DAORegistry::getDAO('JournalSettingsDAO');
$journalSettings =& $journalSettingsDao->getSettings($journalId);
$templateMgr->assign('journalSettings', $journalSettings);
$externalFeedForm->display();
}
} else {
$this->getRequest()->redirect(null, 'manager', 'plugin', array('generic', $this->getName(), 'feeds'));
}
return true;
case 'settings':
$this->import('ExternalFeedSettingsForm');
//.........这里部分代码省略.........
示例14: manage
function manage($verb, $args, &$message, &$messageParams)
{
if (!parent::manage($verb, $args, $message, $messageParams)) {
return false;
}
$request =& $this->getRequest();
switch ($verb) {
case 'settings':
$templateMgr =& TemplateManager::getManager();
$templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
$conference =& $request->getConference();
$this->import('GoogleAnalyticsSettingsForm');
$form = new GoogleAnalyticsSettingsForm($this, $conference->getId());
if ($request->getUserVar('save')) {
$form->readInputData();
if ($form->validate()) {
$form->execute();
$request->redirect(null, null, 'manager', 'plugin');
return false;
} else {
$this->setBreadCrumbs(true);
$form->display();
}
} else {
$this->setBreadCrumbs(true);
$form->initData();
$form->display();
}
return true;
default:
// Unknown management verb
assert(false);
return false;
}
}
示例15: manage
/**
* @see PKPPlugin::manage()
*/
function manage($args, $request)
{
$this->import('UsageStatsSettingsForm');
switch ($request->getUserVar('verb')) {
case 'settings':
$settingsForm = new UsageStatsSettingsForm($this);
$settingsForm->initData();
return new JSONMessage(true, $settingsForm->fetch($request));
case 'save':
$settingsForm = new UsageStatsSettingsForm($this);
$settingsForm->readInputData();
if ($settingsForm->validate()) {
$settingsForm->execute();
$notificationManager = new NotificationManager();
$notificationManager->createTrivialNotification($request->getUser()->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('plugins.generic.usageStats.settings.saved')));
return new JSONMessage(true);
}
return new JSONMessage(true, $settingsForm->fetch($request));
}
return parent::manage($args, $request);
}