本文整理汇总了PHP中JControllerLegacy::display方法的典型用法代码示例。如果您正苦于以下问题:PHP JControllerLegacy::display方法的具体用法?PHP JControllerLegacy::display怎么用?PHP JControllerLegacy::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JControllerLegacy
的用法示例。
在下文中一共展示了JControllerLegacy::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($cachable = false, $urlparams = false)
{
//$view = JRequest::getCmd('view', 'lic');
//$layout = JRequest::getCmd('layout', 'main');
//$id = JRequest::getInt('id');
$mName = 'lic';
if ($model = $this->getModel($mName)) {
} else {
echo "Ошибка!!! Нет модели.";
}
$row = $model->getDataOfLic();
//print_r($row);
if (empty($row)) {
$this->lic = -1;
echo '<h2>Внимание!!! Ошибка. Пользователь не обнаружен в базе лицевых счетов.</h2>';
} else {
foreach ($row as $rows) {
}
if ($rows->lic == 1) {
$this->lic = 1;
} else {
$this->lic = 0;
}
}
//echo $this->lic;
JRequest::setVar('lic', $this->lic);
// задаем вид по умолчанию для компонента если в адресной строке не будет передан view
//$this->default_view = 'tsj';
// получаем текущий вид и передаем ему управление
parent::display($cachable, $urlparams);
}
示例2: display
public function display($cachable = false, $url_params = false)
{
$user =& JFactory::getUser();
$view = JRequest::getVar("view");
if ($view == 'advancedopenportal') {
JRequest::setVar("view", "listcases");
$view = "listcases";
}
if (SugarCasesConnection::isValidPortalUser($user) && !SugarCasesConnection::isUserBlocked($user)) {
parent::display($cachable, $url_params);
} else {
if (!$user->id) {
$msg = JText::_('COM_ADVANCEDOPENPORTAL_LOGIN_REQUIRED');
} elseif (SugarCasesConnection::isUserBlocked($user)) {
$msg = JText::_('COM_ADVANCEDOPENPORTAL_PORTAL_USER_BLOCKED');
} else {
$msg = JText::_('COM_ADVANCEDOPENPORTAL_NO_PORTAL_ACCOUNT');
}
if ($view != 'listcases') {
JFactory::getApplication()->redirect(JURI::base(), $msg, 'error');
} else {
JFactory::getApplication()->enqueueMessage($msg, 'error');
parent::display($cachable, $url_params);
}
}
}
示例3: display
/**
* display task
*
* @param bool $cachable
* @param array $urlparams
*
* @throws Exception
* @return void
*/
function display($cachable = false, $urlparams = [])
{
// set default view if not set
$input = JFactory::getApplication()->input;
// call parent behavior
parent::display($cachable);
}
示例4: display
/**
* Typical view method for MVC based architecture
*
* This function is provide as a default implementation, in most cases
* you will need to override it in your own controllers.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JControllerLegacy A JControllerLegacy object to support chaining.
*/
public function display($cachable = false, $urlparams = array())
{
$input = JFactory::getApplication()->input;
$input->set('view', $input->get('view', 'dashboard'));
$input->set('task', $input->get('task', 'display'));
return parent::display($cachable, $urlparams);
}
示例5: add
function add()
{
$swt = JRequest::getVar('swt', '');
JRequest::setVar('view', 'swtturnierinfo');
JRequest::setVar('swt', $swt);
parent::display();
}
示例6: edit
/**
* display the edit form
* @return void
*/
function edit()
{
JRequest::setVar('view', 'wall_detail');
JRequest::setVar('layout', 'form');
JRequest::setVar('hidemainmenu', 1);
parent::display();
}
示例7: showExtras
function showExtras()
{
//$log = Logger::getInstance(JPATH_COMPONENT."/logs/site-log-".date("d-m-Y").'.log',1);
//$log->LogDebug("showExtras");
//add room if does not exist
$reservedItems = JRequest::getVar("reservedItems");
$hotelId = JRequest::getVar("hotelId");
UserDataService::updateRooms($hotelId, $reservedItems);
$userData = UserDataService::getUserData();
$userData->hotelId = $hotelId;
$appSetting = JHotelUtil::getApplicationSettings();
if (!isset($userData->currency)) {
$hotel = HotelService::getHotel($hotelId);
UserDataService::setCurrency($hotel->hotel_currency, $hotel->currency_symbol);
}
//dump($userData->reservedItems);
//dump($userData->hotelId);
//$log->LogDebug(serialize($userData->reservedItems));
$model = $this->getModel("ExtraOptions");
$extraOptions = $model->getExtraOptions();
if (count($extraOptions) > 0 && PROFESSIONAL_VERSION == 1 && $appSetting->is_enable_extra_options) {
//dump("show extra view");
JRequest::setVar("view", "extraoptions");
parent::display();
} else {
if (count($userData->reservedItems) < $userData->rooms) {
$this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&task=hotel.showHotel&hotel_id=' . $userData->hotelId . "&reservedItems=" . $reservedItems, false));
} else {
$this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&view=guestDetails&reservedItems=' . $reservedItems, false));
}
}
//exit;
//$log->LogDebug(serialize($userData->reservedItems));
//$log->LogDebug("End showExtras");
}
示例8: display
public function display($cachable = false, $urlparams = false)
{
$app = JFactory::getApplication();
$id = $app->input->getInt('id');
$layout = $app->input->get('layout', 'default');
$view = $app->input->get('view', $this->default_view);
// _setUIX
$this->_setUIX($view, $layout);
if (!($view == 'box' || $view == 'form' || $view == 'list')) {
require_once JPATH_COMPONENT . '/helpers/helper_admin.php';
require_once JPATH_COMPONENT . '/helpers/helper_folder.php';
if (!($layout == 'edit' || $layout == 'edit2')) {
if (!(JCck::on() && $view == $this->default_view)) {
Helper_Admin::addSubmenu($this->default_view, $view);
}
}
if ($view == 'template' && $layout == 'edit' && !$this->checkEditId(CCK_COM . '.edit.template', $id) || $view == 'type' && $layout == 'edit' && !$this->checkEditId(CCK_COM . '.edit.type', $id) || $view == 'field' && $layout == 'edit' && !$this->checkEditId(CCK_COM . '.edit.field', $id) || $view == 'search' && $layout == 'edit' && !$this->checkEditId(CCK_COM . '.edit.search', $id) || $view == 'folder' && $layout == 'edit' && !$this->checkEditId(CCK_COM . '.edit.folder', $id) || $view == 'site' && $layout == 'edit' && !$this->checkEditId(CCK_COM . '.edit.site', $id) || $view == 'version' && $layout == 'edit' && !$this->checkEditId(CCK_COM . '.edit.version', $id)) {
// $this->setError( JText::sprintf( 'JLIB_APPLICATION_ERROR_UNHELD_ID', $id ) );
// $this->setMessage( $this->getError(), 'error' );
// $this->setRedirect( JRoute::_( CCK_LINK.'&view='.$view.'s', false ) );
// return false;
}
}
parent::display();
return $this;
}
示例9: display
/**
* Method to display a view.
*
* @param boolean If true, the view output will be cached
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
$cachable = true;
$safeurlparams = array('catid' => 'INT', 'id' => 'INT', 'cid' => 'ARRAY', 'year' => 'INT', 'month' => 'INT', 'limit' => 'UINT', 'limitstart' => 'UINT', 'showall' => 'INT', 'return' => 'BASE64', 'filter' => 'STRING', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'filter-search' => 'STRING', 'print' => 'BOOLEAN', 'lang' => 'CMD');
parent::display($cachable, $safeurlparams);
return $this;
}
示例10: display
public function display($cachable = false, $urlparams = false)
{
require_once JPATH_COMPONENT . '/helpers/djimageslider.php';
DJImageSliderHelper::addSubmenu(JRequest::getCmd('view', 'cpanel'));
parent::display();
return $this;
}
示例11: next
function next()
{
$model = $this->getModel('swtturniererg');
if ($model->store()) {
$rfirst = JRequest::getVar('rfirst');
$rlast = JRequest::getVar('rlast');
$rrange = JRequest::getVar('rrange');
$rcount = JRequest::getVar('rcount');
$this->_message = JText::_('SWT_STORE_SUCCESS');
if ($rlast == $rcount) {
JRequest::setVar('view', 'swt');
JFactory::getApplication()->enqueueMessage(JText::_('SWT_STORE_SUCCESS'), 'message');
parent::display();
} else {
JRequest::setVar('rfirst', $rlast + 1);
JRequest::setVar('view', 'swtturniererg');
parent::display();
}
/* JRequest::setVar('view', 'swt');
JFactory::getApplication()->enqueueMessage( JText::_( 'SWT_STORE_SUCCESS' ),'message' );
parent::display (); */
} else {
JRequest::setVar('view', 'swtturniererg');
JFactory::getApplication()->enqueueMessage(JFactory::getDBO()->getErrorMsg(), 'error');
parent::display();
}
}
示例12: display
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param boolean $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return TemplatesController This object to support chaining.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
$view = $this->input->get('view', 'styles');
$layout = $this->input->get('layout', 'default');
$id = $this->input->getInt('id');
$document = JFactory::getDocument();
// For JSON requests
if ($document->getType() == 'json') {
$view = new TemplatesViewStyle();
// Get/Create the model
if ($model = new TemplatesModelStyle()) {
$model->addTablePath(JPATH_ADMINISTRATOR . '/components/com_templates/tables');
// Push the model into the view (as default)
$view->setModel($model, true);
}
$view->document = $document;
return $view->display();
}
// Check for edit form.
if ($view == 'style' && $layout == 'edit' && !$this->checkEditId('com_templates.edit.style', $id)) {
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_templates&view=styles', false));
return false;
}
return parent::display();
}
示例13: display
public function display($cachable = false, $urlparams = false)
{
$app = JFactory::getApplication();
$app->input->set('view', $app->input->get('view', 'dashboard'));
$view = $app->input->get('view', 'dashboard');
$layout = $app->input->get('layout', 'default');
$id = $app->input->getInt('id', 0);
switch ($view) {
case 'category':
case 'document':
$redirect = 'listcats';
break;
case 'dashboard':
$redirect = 'dashboard';
break;
default:
$redirect = $view . 's';
break;
}
if ($view && $layout == 'edit' && !$this->checkEditId('com_judownload.edit.' . $view, $id)) {
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_judownload&view=' . $redirect, false));
return false;
}
parent::display($cachable, $urlparams);
return $this;
}
示例14: display
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array|boolean $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}
*
* @return JController This object to support chaining.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
$view = $this->input->get('view', 'modules');
$layout = $this->input->get('layout', 'default');
$id = $this->input->getInt('id');
$document = JFactory::getDocument();
// For JSON requests
if ($document->getType() == 'json') {
$view = new ModulesViewModule();
// Get/Create the model
if ($model = new ModulesModelModule()) {
// Checkin table entry
if (!$model->checkout($id)) {
JFactory::getApplication()->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_CHECKIN_USER_MISMATCH'), 'error');
return false;
}
// Push the model into the view (as default)
$view->setModel($model, true);
}
$view->document = $document;
return $view->display();
}
require_once JPATH_COMPONENT . '/helpers/modules.php';
// Load the submenu.
ModulesHelper::addSubmenu($this->input->get('view', 'modules'));
return parent::display();
}
示例15: modal
function modal()
{
JRequest::setVar('layout', 'modal');
JRequest::setVar('view', 'events');
JRequest::setVar('hidemainmenu', 1);
parent::display();
}