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


PHP KunenaVersion::getVersionWarning方法代码示例

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


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

示例1: display

 /**
  * Method to display the view.
  *
  * @param	string	A template file to load.
  * @return	mixed	JError object on failure, void on success.
  * @throws	object	JError
  * @since	1.6
  */
 public function display($tpl = null)
 {
     if ($this->getLayout() == 'schema') {
         parent::display($tpl);
         return;
     }
     // Initialize variables.
     $user = JFactory::getUser();
     // Load the view data.
     $this->model = $this->get('Model');
     $this->state = $this->get('State');
     $this->step = $this->get('Step');
     $this->steps = $this->get('Steps');
     $this->status = $this->get('Status');
     $this->error = $this->get('Error');
     $this->requirements = $this->get('Requirements');
     $this->versions = $this->get('DetectVersions');
     require_once KPATH_ADMIN . '/install/version.php';
     $version = new KunenaVersion();
     $this->versionWarning = $version->getVersionWarning('COM_KUNENA_INSTALL_WARNING');
     // Render the layout.
     $app = JFactory::getApplication();
     if (!empty($this->requirements->fail) || !empty($this->error)) {
         $app->enqueueMessage(JText::_('COM_KUNENA_INSTALL_FAILED'), 'error');
     } else {
         if ($this->step && isset($this->steps[$this->step + 1])) {
             $app->enqueueMessage(JText::_('COM_KUNENA_INSTALL_DO_NOT_INTERRUPT'), 'notice');
         } else {
             if (!isset($this->steps[$this->step + 1])) {
                 $app->enqueueMessage(JText::_('COM_KUNENA_INSTALL_SUCCESS'));
             } else {
                 if (!empty($this->versionWarning)) {
                     $app->enqueueMessage($this->versionWarning, 'notice');
                 }
             }
         }
     }
     JRequest::setVar('hidemainmenu', 1);
     $this->go = JRequest::getCmd('go', '');
     $session = JFactory::getSession();
     $this->cnt = $session->get('kunena.reload', 1);
     if ($this->step) {
         // Output enqueued messages from previous reloads (to show Joomla warnings)
         $queue = (array) $session->get('kunena.queue');
         foreach ($queue as $item) {
             if (is_array($item) && $item['type'] != 'message') {
                 $app->enqueueMessage($item['message'], $item['type']);
             }
         }
     }
     parent::display($tpl);
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:60,代码来源:view.php

示例2: KunenaModelInstall

        // Start by loading English strings and override them by current locale
        $lang->load('com_kunena.install', JPATH_ADMINISTRATOR, 'en-GB');
        $lang->load('com_kunena.install', JPATH_ADMINISTRATOR);
        require_once KPATH_ADMIN . '/install/model.php';
        $installer = new KunenaModelInstall();
        $installer->deleteMenu();
        $installer->createMenu();
        $kunena_app->enqueueMessage(JText::_('COM_KUNENA_MENU_CREATED'));
        // No break! Need to display the control panel
    // No break! Need to display the control panel
    case 'cpanel':
    default:
        html_Kunena::controlPanel();
        break;
}
$kn_version_warning = $kn_version->getVersionWarning('COM_KUNENA_VERSION_INSTALLED');
if (!empty($kn_version_warning)) {
    $kunena_app->enqueueMessage($kn_version_warning, 'notice');
}
if (!$kn_version->checkVersion()) {
    $kunena_app->enqueueMessage(sprintf(JText::_('COM_KUNENA_ERROR_UPGRADE'), Kunena::version()), 'notice');
    $kunena_app->enqueueMessage(JText::_('COM_KUNENA_ERROR_UPGRADE_WARN'));
    $kunena_app->enqueueMessage(sprintf(JText::_('COM_KUNENA_ERROR_UPGRADE_AGAIN'), Kunena::version()));
    $kunena_app->enqueueMessage(JText::_('COM_KUNENA_ERROR_INCOMPLETE_SUPPORT') . ' <a href="http://www.kunena.org">www.kunena.org</a>');
}
// Detect errors in CB integration
// TODO: do we need to enable this?
/*
if (is_object ( $kunenaProfile )) {
	$kunenaProfile->enqueueErrors ();
}
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:31,代码来源:admin.kunena.php

示例3: display

 /**
  * Method to display a view.
  *
  * @param   boolean    $cachable   If true, the view output will be cached
  * @param   array|bool $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 = false)
 {
     KUNENA_PROFILER ? $this->profiler->mark('beforeDisplay') : null;
     KUNENA_PROFILER ? KunenaProfiler::instance()->start('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
     // Get the document object.
     $document = JFactory::getDocument();
     // Set the default view name and format from the Request.
     $vName = JRequest::getWord('view', $this->app->isAdmin() ? 'cpanel' : 'home');
     $lName = JRequest::getWord('layout', 'default');
     $vFormat = $document->getType();
     if ($this->app->isAdmin()) {
         // Load admin language files
         KunenaFactory::loadLanguage('com_kunena.install', 'admin');
         KunenaFactory::loadLanguage('com_kunena.views', 'admin');
         // Load last to get deprecated language files to work
         KunenaFactory::loadLanguage('com_kunena', 'admin');
         // Version warning
         require_once KPATH_ADMIN . '/install/version.php';
         $version = new KunenaVersion();
         $version_warning = $version->getVersionWarning();
         if (!empty($version_warning)) {
             $this->app->enqueueMessage($version_warning, 'notice');
         }
     } else {
         // Load site language files
         KunenaFactory::loadLanguage('com_kunena.views');
         KunenaFactory::loadLanguage('com_kunena.templates');
         // Load last to get deprecated language files to work
         KunenaFactory::loadLanguage('com_kunena');
         $menu = $this->app->getMenu();
         $active = $menu->getActive();
         // Check if menu item was correctly routed
         $routed = $menu->getItem(KunenaRoute::getItemID());
         if ($vFormat == 'html' && !empty($routed->id) && (empty($active->id) || $active->id != $routed->id)) {
             // Routing has been changed, redirect
             // FIXME: check possible redirect loops!
             $route = KunenaRoute::_(null, false);
             $activeId = !empty($active->id) ? $active->id : 0;
             JLog::add("Redirect from " . JUri::getInstance()->toString(array('path', 'query')) . " ({$activeId}) to {$route} ({$routed->id})", JLog::DEBUG, 'kunena');
             $this->app->redirect($route);
         }
         // Joomla 2.5+ multi-language support
         /* // FIXME:
         			if (isset($active->language) && $active->language != '*') {
         				$language = JFactory::getDocument()->getLanguage();
         				if (strtolower($active->language) != strtolower($language)) {
         					$route = KunenaRoute::_(null, false);
         					JLog::add("Language redirect from ".JUri::getInstance()->toString(array('path', 'query'))." to {$route}", JLog::DEBUG, 'kunena');
         					$this->redirect ($route);
         				}
         			}
         			*/
     }
     $view = $this->getView($vName, $vFormat);
     if ($view) {
         if ($this->app->isSite() && $vFormat == 'html') {
             $common = $this->getView('common', $vFormat);
             $model = $this->getModel('common');
             $common->setModel($model, true);
             $view->ktemplate = $common->ktemplate = KunenaFactory::getTemplate();
             $view->common = $common;
         }
         // Set the view layout.
         $view->setLayout($lName);
         // Get the appropriate model for the view.
         $model = $this->getModel($vName);
         // Push the model into the view (as default).
         $view->setModel($model, true);
         // Push document object into the view.
         $view->document = $document;
         // Render the view.
         if ($vFormat == 'html') {
             JPluginHelper::importPlugin('kunena');
             $dispatcher = JDispatcher::getInstance();
             $dispatcher->trigger('onKunenaDisplay', array('start', $view));
             $view->displayAll();
             $dispatcher->trigger('onKunenaDisplay', array('end', $view));
         } else {
             $view->displayLayout();
         }
     }
     KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
     return $this;
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:92,代码来源:controller.php

示例4: display

 /**
  * Method to display a view.
  *
  * @return	void
  * @since	1.6
  */
 public function display($cachable = false, $urlparams = false)
 {
     KUNENA_PROFILER ? $this->profiler->mark('beforeDisplay') : null;
     KUNENA_PROFILER ? KunenaProfiler::instance()->start('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
     $app = JFactory::getApplication();
     if ($app->isAdmin()) {
         // Version warning
         require_once KPATH_ADMIN . '/install/version.php';
         $version = new KunenaVersion();
         $version_warning = $version->getVersionWarning();
         if (!empty($version_warning)) {
             $app->enqueueMessage($version_warning, 'notice');
         }
     } else {
         $menu = $app->getMenu();
         $active = $menu->getActive();
         // Check if menu item was correctly routed
         $routed = $menu->getItem(KunenaRoute::getItemID());
         /*
         			if (!$active) {
         				// FIXME: we may want to resctrict access only to menu items
         				JError::raiseError ( 500, JText::_ ( 'COM_KUNENA_NO_ACCESS' ) );
         			}
         */
         if ($active->id != $routed->id) {
             // Routing has been changed, redirect
             // FIXME: check possible redirect loops!
             $app->redirect(KunenaRoute::_(null, false));
         }
         // Joomla 1.6+ multi-language support
         /* // FIXME:
         			if (isset($active->language) && $active->language != '*') {
         				$language = JFactory::getDocument()->getLanguage();
         				if (strtolower($active->language) != strtolower($language)) {
         					$this->redirect (KunenaRoute::_(null, false));
         				}
         			}
         			*/
     }
     // Get the document object.
     $document = JFactory::getDocument();
     // Set the default view name and format from the Request.
     $vName = JRequest::getWord('view', 'none');
     $lName = JRequest::getWord('layout', 'default');
     $vFormat = $document->getType();
     $view = $this->getView($vName, $vFormat);
     if ($view) {
         if ($app->isSite() && $vFormat == 'html') {
             $common = $this->getView('common', $vFormat);
             $model = $this->getModel('common');
             $common->setModel($model, true);
             $view->ktemplate = $common->ktemplate = KunenaFactory::getTemplate();
             $view->common = $common;
         }
         // Get the appropriate model for the view.
         $model = $this->getModel($vName);
         // Push the model into the view (as default).
         $view->setModel($model, true);
         // Set the view layout.
         $view->setLayout($lName);
         // Push document object into the view.
         $view->document = $document;
         // Render the view.
         if ($vFormat == 'html') {
             JPluginHelper::importPlugin('kunena');
             $dispatcher = JDispatcher::getInstance();
             $dispatcher->trigger('onKunenaDisplay', array('start', $view));
             $view->displayAll();
             $dispatcher->trigger('onKunenaDisplay', array('end', $view));
         } else {
             $view->displayLayout();
         }
     }
     KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:81,代码来源:controller.php

示例5: display

	/**
	 * Method to display a view.
	 *
	 * @return	void
	 * @since	1.6
	 */
	public function display() {
		KUNENA_PROFILER ? $this->profiler->mark('beforeDisplay') : null;
		KUNENA_PROFILER ? KunenaProfiler::instance()->start('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
		$app = JFactory::getApplication();
		if ($app->isAdmin()) {
			// Version warning
			require_once KPATH_ADMIN . '/install/version.php';
			$version = new KunenaVersion();
			$version_warning = $version->getVersionWarning('COM_KUNENA_VERSION_INSTALLED');
			if (! empty ( $version_warning )) {
				$app->enqueueMessage ( $version_warning, 'notice' );
			}
		} else {
			// Initialize profile integration
			$integration = KunenaFactory::getProfile();
			$integration->open();

			/*if (!$app->getMenu ()->getActive ()) {
				// FIXME:
				JError::raiseError ( 500, JText::_ ( 'COM_KUNENA_NO_ACCESS' ) );
			}*/
		}

		// Get the document object.
		$document = JFactory::getDocument ();

		// Set the default view name and format from the Request.
		$vName = JRequest::getWord ( 'view', 'none' );
		$lName = JRequest::getWord ( 'layout', 'default' );
		$vFormat = $document->getType ();

		$view = $this->getView ( $vName, $vFormat );
		if ($view) {
			if ($app->isSite() && $vFormat=='html') {
				$view->template = KunenaFactory::getTemplate();
				$common = $this->getView ( 'common', $vFormat );
				$common->setModel ( $this->getModel ( 'common' ), true );
				$view->common = $common;
				$templatepath = KPATH_SITE."/{$view->template->getPath()}/html/";
				$view->addTemplatePath($templatepath.$vName);
				$view->common->addTemplatePath($templatepath.'common');
			}

			// Do any specific processing for the view.
			switch ($vName) {
				default :
					// Get the appropriate model for the view.
					$model = $this->getModel ( $vName );
					break;
			}

			// Push the model into the view (as default).
			$view->setModel ( $model, true );

			// Set the view layout.
			$view->setLayout ( $lName );

			// Push document object into the view.
			$view->assignRef ( 'document', $document );

			// Render the view.
			if ($vFormat=='html') {
				$view->displayAll ();
			} else {
				$view->displayLayout ();
			}
		}

		if ($app->isSite()) {
			// Close profile integration
			$integration = KunenaFactory::getProfile();
			$integration->close();
		}
		KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
	}
开发者ID:rich20,项目名称:Kunena,代码行数:81,代码来源:controller.php


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