本文整理汇总了PHP中JControllerForm::display方法的典型用法代码示例。如果您正苦于以下问题:PHP JControllerForm::display方法的具体用法?PHP JControllerForm::display怎么用?PHP JControllerForm::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JControllerForm
的用法示例。
在下文中一共展示了JControllerForm::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($key = null, $urlVar = null)
{
JRequest::setVar('view', 'feed');
JRequest::setVar('layout', 'feed');
JRequest::setVar('hidemainmenu', 1);
parent::display();
}
示例2: display
public function display($cachable = false, $urlparams = false)
{
/* // Initialise variables.
$cachable = true; // Huh? Why not just put that in the constructor?
$user = JFactory::getUser();
// Set the default view name and format from the Request.
// Note we are using w_id to avoid collisions with the router and the return page.
// Frontend is a bit messier than the backend.
$id = $this->input->getInt('w_id');
$vName = $this->input->getCmd('view', 'categories');
$this->input->set('view', $vName);
if ($user->get('id') ||($_SERVER['REQUEST_METHOD'] == 'POST' && $vName = 'categories')) {
$cachable = false;
}
$safeurlparams = array(
'id' => 'INT',
'limit' => 'INT',
'limitstart' => 'INT',
'filter_order' => 'CMD',
'filter_order_Dir' => 'CMD',
'lang' => 'CMD'
);
// Check for edit form.
if ($vName == 'form' && !$this->checkEditId('com_usernotify.edit.usersubs', $id)) {
// Somehow the person just went to the form - we don't allow that.
return JError::raiseError(403, JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
}
*/
return parent::display($cachable, $urlparams);
}
示例3: edit
function edit()
{
JRequest::setVar('view', 'feed');
JRequest::setVar('layout', 'feed');
JRequest::setVar('hidemainmenu', 1);
parent::display();
}
示例4: display
/**
* Proxy for getModel.
*/
function display()
{
switch (JRequest::getVar('task')) {
case 'delete':
$this->delete();
break;
case 'copyItem':
$this->copyItem();
break;
case 'remove_confirmed':
$this->remove_confirmed();
break;
case 'categories.delete':
$this->delete();
break;
case 'categories.copyItem':
$this->copyItem();
break;
case 'categories.remove_confirmed':
$this->remove_confirmed();
break;
default:
JRequest::setVar('view', 'categories');
parent::display();
break;
}
}
示例5: add
public function add()
{
JRequest::setVar('view', 'template');
JRequest::setVar('layout', 'add');
JRequest::setVar('hidemainmenu', 1);
parent::display();
}
示例6: DisplayView
function DisplayView()
{
$submenu = JRequest::getVar('view');
// Add submenu
VideotranslationHelper::addSubmenu($submenu);
parent::display();
}
示例7: display
/**
* Proxy for getModel.
*/
function display($cachable = false, $urlparams = array())
{
$task = $_POST['task'];
if ($task == 'linksform.add' or $task == 'add' or $task == 'linksform.edit' or $task == 'edit') {
$this->setRedirect('index.php?option=com_youtubegallery&view=settings&layout=edit');
return true;
}
JRequest::setVar('view', 'settings');
JRequest::setVar('layout', 'edit');
switch (JRequest::getVar('task')) {
case 'apply':
$this->save();
break;
case 'settings.apply':
$this->save();
break;
case 'save':
$this->save();
break;
case 'settings.save':
$this->save();
break;
case 'cancel':
$this->cancel();
break;
case 'settings.cancel':
$this->cancel();
break;
default:
parent::display();
break;
}
}
示例8: save
public function save($key = null, $urlVar = null)
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$model = $this->getModel('form');
$preconfig = $app->input->post->get('config', array(), 'array');
$task = $this->getTask();
$config = $model->store($preconfig);
$id = $config['pk'];
if ($config['validate'] == 'retry') {
parent::display();
return true;
}
if ($id) {
if ($config['stage'] > -1) {
$link = 'index.php?option=' . CCK_COM . '&view=form&type=' . $preconfig['type'] . '&id=' . $id . $this->_getRedirectQuery();
if ($config['stage'] > 0) {
$link .= '&stage=' . $config['stage'];
}
$this->setRedirect(htmlspecialchars_decode($link));
return;
}
if ($config['message_style']) {
if (isset($config['message'])) {
$msg = $config['doTranslation'] ? JText::_('COM_CCK_' . str_replace(' ', '_', trim($config['message']))) : $config['message'];
} else {
$msg = JText::_('COM_CCK_SUCCESSFULLY_SAVED');
}
$msgType = $config['message_style'];
} else {
$msg = '';
$msgType = '';
}
} else {
$msg = JText::_('JERROR_AN_ERROR_HAS_OCCURRED');
$msgType = 'error';
}
switch ($task) {
case 'apply':
$link = 'index.php?option=' . CCK_COM . '&view=form&type=' . $preconfig['type'] . '&id=' . $id . $this->_getRedirectQuery();
break;
case 'save2new':
$link = 'index.php?option=' . CCK_COM . '&view=form&type=' . $preconfig['type'] . $this->_getRedirectQuery();
break;
case 'save2view':
$location = JCckDatabase::loadResult('SELECT storage_location FROM #__cck_core WHERE id = ' . (int) $id);
$sef = 0;
$itemId2 = 0;
if ($location) {
require_once JPATH_SITE . '/plugins/cck_storage_location/' . $location . '/' . $location . '.php';
$link = JCck::callFunc_Array('plgCCK_Storage_Location' . $location, 'getRoute', array($config['pk'], $sef, $itemId2, array('type' => $config['type'])));
$link = str_replace('/administrator/', '/', $link);
break;
}
default:
$link = $this->_getRedirectQuery(true);
break;
}
$this->setRedirect(htmlspecialchars_decode($link), $msg, $msgType);
}
示例9: display
function display()
{
switch (JRequest::getVar('task')) {
case 'cancel':
$this->cancel();
break;
default:
JRequest::setVar('view', 'themeexport');
parent::display();
break;
}
}
示例10: display
/**
* Proxy for getModel.
*/
function display($cachable = false, $urlparams = array())
{
$task = $_POST['task'];
if ($task == 'linksform.add' or $task == 'add') {
$this->setRedirect('index.php?option=com_youtubegallery&view=linksform&layout=edit');
return true;
}
if ($task == 'linksform.edit' or $task == 'edit') {
$cid = JRequest::getVar('cid', array(), 'post', 'array');
if (!count($cid)) {
$this->setRedirect('index.php?option=com_youtubegallery&view=linkslist', JText::_('COM_YOUTUBEGALLERY_NO_VIDEOLISTS_SELECTED'), 'error');
return false;
}
$this->setRedirect('index.php?option=com_youtubegallery&view=linksform&layout=edit&id=' . $cid[0]);
return true;
}
JRequest::setVar('view', 'linksform');
JRequest::setVar('layout', 'edit');
switch (JRequest::getVar('task')) {
case 'apply':
$this->save();
break;
case 'linksform.apply':
$this->save();
break;
case 'save':
$this->save();
break;
case 'linksform.save':
$this->save();
break;
case 'cancel':
$this->cancel();
break;
case 'linksform.cancel':
$this->cancel();
break;
default:
parent::display();
break;
}
}
示例11: display
/**
* Proxy for getModel.
*/
function display()
{
$task = $_POST['task'];
if ($task == 'themeform.add' or $task == 'add') {
$this->setRedirect('index.php?option=com_youtubegallery&view=themeform&layout=edit');
return true;
}
if ($task == 'themeform.edit' or $task == 'edit') {
$cid = JRequest::getVar('cid', array(), 'post', 'array');
if (!count($cid)) {
$this->setRedirect('index.php?option=com_youtubegallery&view=themelist', JText::_('COM_YOUTUBEGALLERY_NO_THEME_SELECTED'), 'error');
return false;
}
$this->setRedirect('index.php?option=com_youtubegallery&view=themeform&layout=edit&id=' . $cid[0]);
return true;
}
JRequest::setVar('hidemainmenu', true);
JRequest::setVar('view', 'themeform');
JRequest::setVar('layout', 'edit');
switch ($task) {
case 'apply':
$this->save();
break;
case 'themeform.apply':
$this->save();
break;
case 'save':
$this->save();
break;
case 'themeform.save':
$this->save();
break;
case 'cancel':
$this->cancel();
break;
case 'themeform.cancel':
$this->cancel();
break;
}
parent::display();
}
示例12: display
public function display($cachable = false, $urlparams = false)
{
parent::display($cachable, $urlparams);
}
示例13: iframe
public function iframe()
{
parent::display();
flush();
JFactory::getApplication()->close();
}
示例14: import
function import()
{
JRequest::setVar('view', 'newsletter');
$id = JRequest::getInt('id', 0);
$type = JRequest::getString('type', 'cvs');
if ($type == 'manual') {
$csvtemp = JRequest::getVar('csvtemp', array());
$path_abs_root = JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR;
$path_rel = 'com_jinc' . DIRECTORY_SEPARATOR . 'csvtemp.csv';
if ($fh = fopen($path_abs_root . $path_rel, 'w')) {
fwrite($fh, implode(',', $csvtemp));
fclose($fh);
}
$csvfile = array();
$csvfile['name'] = 'csvtemp.csv';
$csvfile['type'] = 'application/x-csv';
$csvfile['tmp_name'] = $path_abs_root . $path_rel;
$csvfile['error'] = 0;
$csvfile['size'] = 0;
} else {
$csvfile = JRequest::getVar('csvfile', array(), 'FILES');
}
$view = $this->getView('newsletter', 'html');
if (isset($csvfile['tmp_name']) && $csvfile['tmp_name'] != '' && !is_null($csvfile['tmp_name'])) {
$mime = $csvfile['type'];
if (true || $mime == 'application/x-csv' || $mime == 'text/csv' || $mime == 'application/csv' || $mime == 'application/excel' || $mime == 'application/vnd.ms-excel' || $mime == 'application/vnd.msexcel') {
$model = $this->getModel('newsletter');
if ($result = $model->import($id, $csvfile['tmp_name'])) {
$view->setLayout('import');
$view->assignRef('result', $result);
if ($type == 'manual') {
JRequest::setVar('tmpl', 'component');
}
parent::display();
} else {
$msg = JText::_('COM_JINC_ERR004');
$link = 'index.php?option=com_jinc&view=newsletter&layout=uploadcsv&id=' . $id;
$this->setRedirect($link, $msg);
}
} else {
$msg = JText::_('COM_JINC_ERR014') . ' ' . $csvfile['type'];
$link = 'index.php?option=com_jinc&view=newsletter&layout=uploadcsv&id=' . $id;
$this->setRedirect($link, $msg);
}
} else {
$msg = JText::_('COM_JINC_ERR004');
$link = 'index.php?option=com_jinc&view=newsletter&layout=uploadcsv&id=' . $id;
$this->setRedirect($link, $msg);
}
}
示例15: copy
/**
* Method to copy a newsletter
*
* @access public
*
* @return void
*/
public function copy()
{
// Check for request forgeries
if (!JSession::checkToken()) {
jexit(JText::_('JINVALID_TOKEN'));
}
$app = JFactory::getApplication();
// Access check.
if (!self::allowAdd()) {
$app->enqueueMessage(JText::_('COM_BWPOSTMAN_NL_COPY_CREATE_RIGHTS_MISSING'), 'error');
return false;
}
$model = $this->getModel('newsletter');
// Get the newsletter IDs to copy
$cid = $this->input->get('cid', array(), 'array');
$res = $model->copy($cid);
if ($res === true) {
$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('bwpostman');
$dispatcher->trigger('onBwPostmanAfterNewsletterCopy', array());
}
parent::display();
}