本文整理汇总了PHP中SettingsForm::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP SettingsForm::setData方法的具体用法?PHP SettingsForm::setData怎么用?PHP SettingsForm::setData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SettingsForm
的用法示例。
在下文中一共展示了SettingsForm::setData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
}
示例2: 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;
}
}
示例3: 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;
}