Exemple #1
0
 public function display($cachable = false, $urlparams = false)
 {
     // Redirect profile to integrated component if profile integration is turned on
     $redirect = 1;
     $active = $this->app->getMenu()->getActive();
     if (!empty($active)) {
         $params = $active->params;
         $redirect = $params->get('integration', 1);
     }
     if ($redirect && JRequest::getCmd('format', 'html') == 'html') {
         $profileIntegration = KunenaFactory::getProfile();
         $layout = JRequest::getCmd('layout', 'default');
         if ($profileIntegration instanceof KunenaProfileKunena) {
             // Continue
         } elseif ($layout == 'default') {
             $url = $this->me->getUrl(false);
         } elseif ($layout == 'list') {
             $url = $profileIntegration->getUserListURL('', false);
         }
         if (!empty($url)) {
             $this->setRedirect($url);
             return;
         }
     }
     $layout = JRequest::getCmd('layout', 'default');
     if ($layout == 'list') {
         if (KunenaFactory::getConfig()->userlist_allowed && JFactory::getUser()->guest) {
             $this->redirectBack();
         }
     }
     parent::display();
 }
Exemple #2
0
 public function display($cachable = false, $urlparams = false)
 {
     // Redirect profile to integrated component if profile integration is turned on
     $redirect = 1;
     $active = $this->app->getMenu()->getActive();
     if (!empty($active)) {
         if (version_compare(JVERSION, '1.6', '>')) {
             // Joomla 1.6+
             $params = $active->params;
         } else {
             // Joomla 1.5
             $params = new JParameter($active->params);
         }
         $redirect = $params->get('integration', 1);
     }
     if ($redirect && JRequest::getCmd('format') == 'html') {
         $profileIntegration = KunenaFactory::getProfile();
         if ($profileIntegration instanceof KunenaProfileKunena) {
             // Continue
         } elseif (JRequest::getCmd('layout', 'default') == 'default') {
             $url = $this->me->getUrl(false);
         } elseif (JRequest::getCmd('layout') == 'list') {
             $url = $profileIntegration->getUserListURL('', false);
         }
         if (!empty($url)) {
             $this->setRedirect($url);
             return;
         }
     }
     parent::display();
 }
Exemple #3
0
 public function getModel($name = '', $prefix = '', $config = array())
 {
     if (empty($name)) {
         $name = 'plugin';
     }
     return parent::getModel($name, $prefix, $config);
 }
Exemple #4
0
	public function __construct($config = array()) {
		parent::__construct($config);
		$this->catid = JRequest::getInt('catid', 0);
		$this->return = JRequest::getInt('return', $this->catid);
		$this->id = JRequest::getInt('id', 0);
		$this->mesid = JRequest::getInt('mesid', 0);
	}
Exemple #5
0
 /**
  * @param   array $config
  *
  * @throws Exception
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->catid = JFactory::getApplication()->input->getInt('catid', 0);
     $this->return = JFactory::getApplication()->input->getInt('return', $this->catid);
     $this->id = JFactory::getApplication()->input->getInt('id', 0);
     $this->mesid = JFactory::getApplication()->input->getInt('mesid', 0);
 }
Exemple #6
0
	public function __construct($config = array()) {
		parent::__construct($config);
		$this->catid = JRequest::getInt('catid', 0);
		$this->return = JRequest::getInt('return', $this->catid);
		$this->id = JRequest::getInt('id', 0);
		$this->mesid = JRequest::getInt('mesid', 0);
		$this->config = KunenaFactory::getConfig();
		$this->me = KunenaUserHelper::getMyself();
	}
Exemple #7
0
 public function display($cachable = false, $urlparams = false)
 {
     $db = JFactory::getDbo();
     // Enable Kunena updates if they were disabled (but only every 6 hours or logout/login).
     $now = time();
     $timestamp = $this->app->getUserState('pkg_kunena.updateCheck', 0);
     if ($timestamp < $now) {
         $query = $db->getQuery(true)->update($db->quoteName('#__update_sites'))->set($db->quoteName('enabled') . '=1')->where($db->quoteName('location') . ' LIKE ' . $db->quote('http://update.kunena.org/%'));
         $db->setQuery($query);
         $db->execute();
         $this->app->setUserState('pkg_kunena.updateCheck', $now + 60 * 60 * 6);
     }
     parent::display($cachable, $urlparams);
 }
Exemple #8
0
	public function display($cachable = false, $urlparams = false) {
		$menu = $this->app->getMenu ();
		$home = $menu->getActive ();
		if (!$home) {
			JRequest::setVar ( 'view', 'category' );
			JRequest::setVar ( 'layout', 'list' );
			//JError::raiseError ( 500, JText::_ ( 'COM_KUNENA_NO_ACCESS' ) );

		} else {
			// Find default menu item
			$default = $this->_getDefaultMenuItem($menu, $home);
			if (!$default || $default->id == $home->id) {
				// There is no default menu item, use category view instead

				$default = $menu->getItem ( KunenaRoute::getItemID("index.php?option=com_kunena&view=category&layout=list") );
				if ($default) {
					$default = clone $default;
					$defhome = KunenaRoute::getHome($default);
					if (!$defhome || $defhome->id != $home->id) $default = clone $home;
					$default->query['view'] = 'category';
					$default->query['layout'] = 'list';
				}
			}
			if (!$default) {
				JError::raiseError ( 500, JText::_ ( 'COM_KUNENA_NO_ACCESS' ) );
			}

			// Add query variables from shown menu item
			foreach ( $default->query as $var => $value ) {
				JRequest::setVar ( $var, $value );
			}

			// Remove query variables coming from the home menu item
			JRequest::setVar ( 'defaultmenu', null );

			// Set active menu item to point the real page
			$menu->setActive ( $default->id );
		}

		// Reset our router
		KunenaRoute::initialize();

		// Run display task from our new controller
		$controller = KunenaController::getInstance();
		$controller->execute ('display');

		// Set redirect and message
		$this->setRedirect ($controller->getRedirect(), $controller->getMessage(), $controller->getMessageType());
	}
Exemple #9
0
	public function __construct($config = array()) {
		parent::__construct($config);

		$app = JFactory::getApplication ();
		$lang = JFactory::getLanguage();
		// 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, null, true);

		require_once(KPATH_ADMIN . '/install/model.php');
		$installer = new KunenaModelInstall();
		$installer->deleteMenu();
		$installer->createMenu();

		$app->enqueueMessage ( JText::_('COM_KUNENA_MENU_CREATED') );
		$this->redirectBack ();
	}
Exemple #10
0
	public function display() {
		// Redirect profile to integrated component if profile integration is turned on
		$redirect = 1;
		$active = JFactory::getApplication ()->getMenu ()->getActive ();
		if (!empty($active)) {
			$params = new JParameter($active->params);
			$redirect = $params->get('integration');
		}
		if ($redirect) {
			$profileIntegration = KunenaFactory::getProfile();
			if (!($profileIntegration instanceof KunenaProfileKunena)) {
				$url = CKunenaLink::GetProfileURL(KunenaFactory::getUser()->userid, false);
				if ($url) {
					$this->setRedirect($url);
					return;
				}
			}
		}
		parent::display();
	}
Exemple #11
0
 public function __construct($config = array())
 {
     parent::__construct($config);
 }
Exemple #12
0
	public function __construct($config = array()) {
		parent::__construct($config);
		$this->baseurl = 'index.php?option=com_kunena&view=topicicons';
	}
Exemple #13
0
// Safety check to prevent fatal error if 'System - Kunena Forum' plug-in has been disabled.
if ($app->input->getCmd('view') == 'install' || !class_exists('KunenaForum') || !KunenaForum::isCompatible('4.0')) {
    // Run installer instead..
    require_once __DIR__ . '/install/controller.php';
    $controller = new KunenaControllerInstall();
    // TODO: execute special task that checks what's wrong
    $controller->execute($app->input->getCmd('task'));
    $controller->redirect();
    return;
}
if ($app->input->getCmd('view') == 'uninstall') {
    $allowed = $app->getUserState('com_kunena.uninstall.allowed');
    if ($allowed) {
        require_once __DIR__ . '/install/controller.php';
        $controller = new KunenaControllerInstall();
        $controller->execute('uninstall');
        $controller->redirect();
        $app->setUserState('com_kunena.uninstall.allowed', null);
        return;
    }
}
// Initialize Kunena Framework.
KunenaForum::setup();
// Initialize custom error handlers.
KunenaError::initialize();
// Kunena has been successfully installed: Load our main controller.
$controller = KunenaController::getInstance();
$controller->execute($app->input->getCmd('task'));
$controller->redirect();
// Remove custom error handlers.
KunenaError::cleanup();
Exemple #14
0
	public function display() {
		global $Itemid;
		$menu = JFactory::getApplication ()->getMenu ();
		$home = $menu->getActive ();
		// TODO: maybe add error
		if (!$home) return;

		// Find default menu item
		$default = $this->_getDefaultMenuItem($menu, $home);
		if (!$default) {
			// There is no default menu item, use category view instead
			$default = clone $menu->getItem ( KunenaRoute::getItemID("index.php?option=com_kunena&view=category&layout=index") );
			$default->query['view'] = 'category';
			$default->query['layout'] = 'index';
		}
		if (!$default) {
			JError::raiseError ( 500, JText::_ ( 'COM_KUNENA_NO_ACCESS' ) );
		}

		// Check if menu item was correctly routed
		$active = $menu->getItem ( KunenaRoute::getItemID() );
		if (!$active || ($active->id != $home->id && $active->id != $default->id)) {
			// Routing has been changed, redirect or fail
			if ($active) {
				JRequest::setVar ( 'defaultmenu', null );
				// FIXME: chack possible redirect loops!
				$this->setRedirect (KunenaRoute::_(null, false));
			}
			return;
		}

		// Check if we are using default menu item
		if (!isset($default->query['layout'])) $default->query['layout'] = 'default';
		foreach ( $default->query as $var => $value ) {
			$cmp = JRequest::getVar($var, null);
			if ($var == 'defaultmenu') continue;
			if ($var == 'view' && $cmp == 'home') continue;
			if ($cmp !== null && $value != $cmp) {
				$default = $home;
				break;
			}
		}
		// Add query variables from shown menu item
		if ($default != $home) {
			foreach ( $default->query as $var => $value ) {
				JRequest::setVar ( $var, $value );
			}
		}
		// Set active menu item to point the real page
		$menu->setActive ( $default->id );

		// Joomla 1.5 hack:
		$Itemid = $default->id;
		KunenaRoute::initialize();

		if (JRequest::getVar ( 'view' ) != 'home') {
			// Run display task from our new controller
			$controller = KunenaController::getInstance(true);
			$controller->execute ('display');
			// Set redirect and message
			$this->setRedirect ($controller->getRedirect(), $controller->getMessage(), $controller->getMessageType());
		}
	}
Exemple #15
0
	public function __construct($config = array()) {
		$this->db = JFactory::getDBO ();
		parent::__construct($config);
	}
Exemple #16
0
	public function __construct($config = array()) {
		parent::__construct($config);
		$this->app = JFactory::getApplication ();
	}
Exemple #17
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->baseurl = 'administrator/index.php?option=com_kunena&view=report';
 }
Exemple #18
0
	public function __construct($config = array()) {
		parent::__construct($config);
		$this->baseurl = 'index.php?option=com_kunena&view=categories';
		$this->baseurl2 = 'index.php?option=com_kunena&view=categories';
		$this->me = KunenaUserHelper::getMyself();
	}