Example #1
1
 function display($tpl = null)
 {
     global $mainframe;
     // Check if registration is allowed
     $usersConfig =& JComponentHelper::getParams('com_users');
     if (!$usersConfig->get('allowUserRegistration')) {
         JError::raiseError(403, JText::_('Access Forbidden'));
         return;
     }
     $pathway =& $mainframe->getPathway();
     $document =& JFactory::getDocument();
     $params =& $mainframe->getParams();
     // Page Title
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     // because the application sets a default page title, we need to get it
     // right from the menu item itself
     if (is_object($menu)) {
         $menu_params = new JParameter($menu->params);
         if (!$menu_params->get('page_title')) {
             $params->set('page_title', JText::_('Registration'));
         }
     } else {
         $params->set('page_title', JText::_('Registration'));
     }
     $document->setTitle($params->get('page_title'));
     $pathway->addItem(JText::_('New'));
     // Load the form validation behavior
     JHTML::_('behavior.formvalidation');
     $user =& JFactory::getUser();
     $this->assignRef('user', $user);
     $this->assignRef('params', $params);
     parent::display($tpl);
 }
Example #2
0
 function __construct()
 {
     $this->Log = new FLogger();
     $this->DebugLog = new FDebugLogger("file uploader");
     $this->Session = JFactory::getSession();
     $cid = JRequest::getVar("cid", NULL, 'GET');
     // Component id. We need to load parameters for it
     if ($cid) {
         $site = new JSite();
         // @ avoids Warning: ini_set() has been disabled for security reasons in /var/www/libraries/joomla/[...]
         $wholemenu = @$site->getMenu();
         $this->Params = $wholemenu->getParams($cid);
         // Component parameters
     } else {
         $db = JFactory::getDbo();
         jimport("joomla.database.databasequery");
         //$query = new JDatabaseQuery;  // On J 1.7 Raises Fatal error: Cannot instantiate abstract class JDatabaseQuery
         $query = $db->getQuery(true);
         $query->select('id, title, module, params');
         $query->from('#__modules');
         $query->where('id = ' . intval(JRequest::getVar("mid", 0, 'GET')));
         $db->setQuery($query);
         $module = $db->loadObject();
         if ($db->getErrorNum()) {
             $this->Log->Write(JText::_("Error loading module. " . $db->getErrorMsg()));
         }
         $this->Params = new JRegistry();
         if (is_object($module)) {
             $this->Params->loadJSON($module->params);
         }
     }
 }
 /**
  * Displays the form
  *
  * @param   string  $tpl  - The templates
  *
  * @return  mixed|void
  */
 public function display($tpl = null)
 {
     $uuid = JFactory::getApplication()->input->get('uuid', 0);
     $model = $this->getModel();
     $params = JComponentHelper::getParams('com_matukio');
     $menuitemid = JFactory::getApplication()->input->get('Itemid');
     if ($menuitemid) {
         $site = new JSite();
         $menu = $site->getMenu();
         $menuparams = $menu->getParams($menuitemid);
         $params->merge($menuparams);
     }
     // Raise error
     if (empty($uuid)) {
         throw new Exception(JText::_("COM_MATUKIO_NO_ID"), 404);
     }
     $booking = $model->getBooking($uuid);
     if (empty($booking)) {
         throw new Exception(JText::_("COM_MATUKIO_NO_BOOKING_FOUND"), 404);
     }
     $model = JModelLegacy::getInstance('Event', 'MatukioModel');
     $event = $model->getItem($booking->semid);
     $this->booking = $booking;
     $this->title = JText::_("COM_MATUKIO_BOOKING_DETAILS");
     $title = JFactory::getDocument()->getTitle();
     JFactory::getDocument()->setTitle($title . " - " . $this->title);
     $this->event = $event;
     $this->user = JFactory::getUser();
     parent::display($tpl);
 }
Example #4
0
 /**
  * @param array $app
  * @param array $config
  * @throws AppException
  */
 public function __construct($app, $config = array())
 {
     parent::__construct($app, $config);
     $this->_jbrequest = $this->app->jbrequest;
     $task = $this->_jbrequest->getWord('task');
     $ctrl = $this->_jbrequest->getCtrl();
     if (!method_exists($this, $task)) {
         throw new AppException('Action method not found!  ' . $ctrl . ' :: ' . $task . '()');
     }
     // internal vars
     $this->application = $this->app->zoo->getApplication();
     $this->_params = $this->application->getParams('frontpage');
     $this->joomla = $this->app->system->application;
     $isSite = $this->app->jbenv->isSite();
     if (!$isSite) {
         $this->app->document->addStylesheet("root:administrator/templates/system/css/system.css");
         $this->app->jbassets->uikit(true, true);
         $this->_setToolbarTitle();
     } else {
         $this->params = $this->joomla->getParams();
         $this->pathway = $this->joomla->getPathway();
         $this->app->jbassets->setAppCSS();
         $this->app->jbassets->setAppJS();
     }
     $this->_config = JBModelConfig::model();
 }
Example #5
0
 /**
  * Displays the form
  *
  * @param   bool  $cachable   - Is it cachable
  * @param   bool  $urlparams  - The url params
  *
  * @return JControllerLegacy|void
  */
 public function display($cachable = false, $urlparams = false)
 {
     MatukioHelperUtilsBasic::loginUser();
     $document = JFactory::getDocument();
     $viewName = JFactory::getApplication()->input->get('view', 'event');
     $viewType = $document->getType();
     $view = $this->getView($viewName, $viewType);
     $model = $this->getModel('Event', 'MatukioModel');
     $view->setModel($model, true);
     $tmpl = MatukioHelperSettings::getSettings("event_template", "default");
     $params = JComponentHelper::getParams('com_matukio');
     $menuitemid = JFactory::getApplication()->input->getInt('Itemid');
     if ($menuitemid) {
         $site = new JSite();
         $menu = $site->getMenu();
         $menuparams = $menu->getParams($menuitemid);
         $params->merge($menuparams);
     }
     $ptmpl = $params->get('event_template', '');
     if (!empty($ptmpl)) {
         $tmpl = $ptmpl;
     }
     $view->setLayout($tmpl);
     $view->display();
 }
Example #6
0
 public function getCampaigns()
 {
     $params = JComponentHelper::getParams('com_joomailermailchimpintegration');
     $menuitemid = JRequest::getInt('Itemid', 0);
     if ($menuitemid) {
         $jSite = new JSite();
         $menu = $jSite->getMenu();
         $menuparams = $menu->getParams($menuitemid);
         $params->merge($menuparams);
     }
     $filters = array('status' => 'sent');
     $page = 0;
     $limit = $params->get('limit', 10);
     $cacheGroup = 'joomlamailerReports';
     $cacheID = 'Campaigns_' . implode('_', $filters) . '_' . $page . '_' . $limit;
     if (!$this->cache($cacheGroup)->get($cacheID, $cacheGroup)) {
         $campaigns = $this->getMcObject()->campaigns($filters, $page, $limit);
         $Jconfig = JFactory::getConfig();
         $tzoffset = $Jconfig->get('offset');
         if ($tzoffset != 'UTC') {
             foreach ($campaigns as $index => $campaign) {
                 date_default_timezone_set('Europe/London');
                 $datetime = new DateTime($campaign['send_time']);
                 $timeZone = new DateTimeZone($tzoffset);
                 $datetime->setTimezone($timeZone);
                 $campaigns[$index]['send_time'] = $datetime->format('Y-m-d H:i:s');
             }
         }
         $this->cache($cacheGroup)->store(json_encode($campaigns), $cacheID, $cacheGroup);
     }
     return json_decode($this->cache($cacheGroup)->get($cacheID, $cacheGroup), true);
 }
Example #7
0
 protected function getParameters()
 {
     // If we are not in embedded mode, get variable from application
     if (!$this->embedded) {
         return $this->app->getParams('com_kunena');
     }
     return $this->params;
 }
Example #8
0
 function __construct()
 {
     parent::__construct();
     $JSite = new JSite();
     $menu = $JSite->getMenu();
     // pass the link for which you want the ItemId.
     $items = $menu->getItems('link', 'index.php?option=com_socialads&view=socialads');
     if (isset($items[0])) {
         $Itemid = $items[0]->id;
     }
 }
 /**
  * Displays the form
  *
  * @param   string  $tpl  - The templates
  *
  * @return  mixed|void
  */
 public function display($tpl = null)
 {
     $orga_id = JFactory::getApplication()->input->get('id', 0);
     $model = $this->getModel();
     $params = JComponentHelper::getParams('com_matukio');
     $menuitemid = JFactory::getApplication()->input->get('Itemid');
     if ($menuitemid) {
         $site = new JSite();
         $menu = $site->getMenu();
         $menuparams = $menu->getParams($menuitemid);
         $params->merge($menuparams);
     }
     if (empty($orga_id)) {
         $orga_id = $params->get('organizerId', 0);
     }
     // Raise error
     if (empty($orga_id)) {
         JError::raise(E_ERROR, 403, JText::_("COM_MATUKIO_NO_ID"));
     }
     $organizer = $model->getOrganizer($orga_id);
     if (!empty($organizer)) {
         // Get the Joomla user obj
         $organizer_user = JFactory::getUser($organizer->userId);
     } else {
         $organizer_user = null;
     }
     $ue_title = $params->get('title', '');
     if (empty($ue_title)) {
         // Set the title to the name
         $ue_title = $organizer->name;
     }
     $title = JFactory::getDocument()->getTitle();
     JFactory::getDocument()->setTitle($title . " - " . JText::_($organizer->name));
     // Plugin support
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('content');
     $this->jevent = new stdClass();
     $results = $dispatcher->trigger('onContentAfterDisplay', array('com_matukio.organizer', &$organizer, &$params, 0));
     $this->jevent->afterDisplayContent = trim(implode("\n", $results));
     $this->organizer = $organizer;
     $this->organizer_user = $organizer_user;
     $this->title = $ue_title;
     $this->user = JFactory::getUser();
     // Upcoming events since 3.1
     if (MatukioHelperSettings::getSettings("organizer_show_upcoming", 1) && !empty($organizer_user)) {
         $this->upcoming_events = $model->getUpcomingEvents($organizer_user->id);
     }
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     $this->mainframe = JFactory::getApplication();
     $this->option = JRequest::getCmd('option');
     $filter_order = $this->mainframe->getUserStateFromRequest($this->option . '.polls.filter_order', 'filter_order', 'm.title', 'string');
     $filter_order_Dir = $this->mainframe->getUserStateFromRequest($this->option . '.polls.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $this->mainframe->getUserStateFromRequest($this->option . '.polls.search', 'search', '', 'string');
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     JHTML::_('behavior.tooltip');
     if (MijopollsHelper::is15()) {
         $params = $this->mainframe->getParams();
     } else {
         $menu = JSite::getMenu()->getActive();
         $menu_params = new JRegistry($menu->params);
         $params = clone $this->mainframe->getParams();
         $params->merge($menu_params);
     }
     $this->lists = $lists;
     $this->params = $params;
     $this->items = $this->get('Data');
     $this->pagination = $this->get('Pagination');
     if (MijopollsHelper::is30()) {
         $tpl = '30';
     }
     parent::display($tpl);
 }
Example #11
0
    public function getParameters()
    {
        $menu   = JSite::getMenu();
        $active = $menu->getActive();
        $parameters = $active ? $menu->getParams($active->id) : $parameters = $menu->getParams(null);

        $parameters->def('show_page_title', 1);

        if(!$parameters->get('page_title')) {
            $parameters->set('page_title', JText::_('Login'));
        }

        if(!$active) {
            $parameters->def('header_login', '');
        }

        $parameters->def('pageclass_sfx', '');
        $parameters->def('login', 'index.php');
        $parameters->def('description_login', 1);
        $parameters->def('description_login_text', JText::_('LOGIN_DESCRIPTION'));
        $parameters->def('image_login', 'key.jpg');
        $parameters->def('image_login_align', 'right');
        $parameters->def('registration', JComponentHelper::getParams('com_users')->get('allowUserRegistration'));

        return $parameters;
    }
Example #12
0
 function _displayForm($tpl = null)
 {
     global $mainframe;
     // Load the form validation behavior
     JHTML::_('behavior.formvalidation');
     $user =& JFactory::getUser();
     $params =& $mainframe->getParams();
     // check to see if Frontend User Params have been enabled
     $usersConfig =& JComponentHelper::getParams('com_users');
     $check = $usersConfig->get('frontend_userparams');
     if ($check == '1' || $check == 1 || $check == NULL) {
         if ($user->authorize('com_user', 'edit')) {
             $params = $user->getParameters(true);
         }
     }
     $params->merge($params);
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     // because the application sets a default page title, we need to get it
     // right from the menu item itself
     if (is_object($menu)) {
         $menu_params = new JParameter($menu->params);
         if (!$menu_params->get('page_title')) {
             $params->set('page_title', JText::_('Edit Your Details'));
         }
     } else {
         $params->set('page_title', JText::_('Edit Your Details'));
     }
     $document =& JFactory::getDocument();
     $document->setTitle($params->get('page_title'));
     $this->assignRef('user', $user);
     $this->assignRef('params', $params);
     parent::display($tpl);
 }
Example #13
0
 function display()
 {
     global $mainframe, $option;
     $document =& JFactory::getDocument();
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     // Get the page/component configuration
     $params =& $mainframe->getParams();
     //set page title
     $document->setTitle($menu->name);
     $url = $params->def('url', '');
     $row = new stdClass();
     if ($params->def('add_scheme', 1)) {
         // adds 'http://' if none is set
         if (substr($url, 0, 1) == '/') {
             // relative url in component. use server http_host.
             $row->url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
         } elseif (!strstr($url, 'http') && !strstr($url, 'https')) {
             $row->url = 'http://' . $url;
         } else {
             $row->url = $url;
         }
     } else {
         $row->url = $url;
     }
     require_once JPATH_COMPONENT . DS . 'views' . DS . 'wrapper' . DS . 'view.php';
     $view = new WrapperViewWrapper();
     $view->assignRef('params', $params);
     $view->assignRef('wrapper', $row);
     $view->display();
 }
Example #14
0
function modChrome_submenu($module, &$params, &$attribs)
{
    global $Itemid;
    $start = $params->get('startLevel');
    $tabmenu =& JSite::getMenu();
    $item = $tabmenu->getItem($Itemid);
    if (isset($item)) {
        $tparent = $tabmenu->getItem($item->parent);
        $menuname = "";
        while ($tparent != null) {
            $item = $tabmenu->getItem($item->parent);
            if ($tparent->parent == $start - 1) {
                break;
            }
            $tparent = $tabmenu->getItem($item->parent);
        }
        if (!empty($module->content) && strlen($module->content) > 40) {
            ?>
			<div class="side-mod">
				<div class="moduletable">
					<h3 class="module-title"><?php 
            echo $item->name;
            ?>
 Menu</h3>
					<?php 
            echo $module->content;
            ?>
				</div>
			</div>
	    	<?php 
        }
    }
}
Example #15
0
 function prepareMenuItem(&$node,&$params) {
         $link_query = parse_url( $node->link );
         parse_str( html_entity_decode($link_query['query']), $link_vars);
         $id = intval(xmap_com_eventlist::getParam($link_vars,'id',0));
         $view = xmap_com_eventlist::getParam($link_vars,'view',0);
         if ( !$id ) {
                 $menu =& JSite::getMenu();
                 $params = $menu->getParams($node->id);
                 $id = $params->get('id',0);
 }
 if ( $id ) {
             if ( $view == 'details' ) {
                 $node->uid = 'com_eventliste'.$id;
                 $node->expandible = false;
             } elseif ( $view == 'categoryevents'  ) {
                 $node->expandible = true;
                 $node->uid = 'com_eventlistc'.$id;
             } elseif ( $view == 'venueevents'  ) {
                 $node->expandible = true;
                 $node->uid = 'com_eventlistv'.$id;
             }
         } else {
             $node->expandible = true;
         }
 }
Example #16
0
 function display($tpl = null)
 {
     global $mainframe, $option;
     jimport('joomla.utilities.simplexml');
     $showCaseID = JRequest::getInt('showcase_id', 0);
     if ($showCaseID == 0) {
         $menu =& JSite::getMenu();
         $item = $menu->getActive();
         $params =& $menu->getParams($item->id);
         $showcase_id = $params->get('showcase_id', 0);
     } else {
         $showcase_id = $showCaseID;
     }
     $objUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $URL = $objUtils->overrideURL();
     $objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase');
     $row = $objJSNShowcase->getShowCaseByID($showcase_id);
     if (count($row) <= 0) {
         header("HTTP/1.0 404 Not Found");
         exit;
     }
     $objJSNJSON = JSNISFactory::getObj('classes.jsn_is_json');
     $dataObj = $objJSNShowcase->getShowcase2JSON($row, $URL);
     echo $objJSNJSON->encode($dataObj);
     jexit();
 }
Example #17
0
 function __construct()
 {
     parent::__construct();
     global $mainframe, $option;
     $component = JComponentHelper::getComponent('com_properties');
     $params = new JParameter($component->params);
     $this->Mostrar = $params->get('cantidad_productos');
     if (!JRequest::getVar('limitstart')) {
         $this->setState('limit', $this->Mostrar);
         $this->setState('limitstart', 0);
     } else {
         $limit = $this->Mostrar;
         $this->setState('limit', $this->Mostrar);
         $limitstart = JRequest::getVar('limitstart');
         $this->setState('limitstart', $limitstart);
         $start = JRequest::getVar('start');
         $this->setState('start', $start);
     }
     $ShowOrderByDefault = $params->get('ShowOrderByDefault');
     $ShowOrderDefault = $params->get('ShowOrderDefault');
     $this->filter_order = $mainframe->getUserStateFromRequest("{$option}.filter_order", 'filter_order', $ShowOrderByDefault, 'cmd');
     $this->filter_order_Dir = $mainframe->getUserStateFromRequest("{$option}.filter_order_Dir", 'filter_order_Dir', $ShowOrderDefault, 'word');
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     $menu_params = new JParameter($menu->params);
     $DetailsMarket = $menu_params->get('DetailsMarket');
     $this->DetailsMarket = $DetailsMarket;
     $this->pathway();
 }
Example #18
0
 public function display($tpl = null)
 {
     $menu = JSite::getMenu();
     $params = $menu->getParams($menu->getActive()->id);
     $url = KFactory::tmp('lib.koowa.filter.url')->sanitize($params->get('url'));
     KFactory::get('lib.joomla.application')->redirect($url);
 }
Example #19
0
 /**
  * Display function
  *
  * @since 1.5
  */
 function display($tpl = null)
 {
     jimport('joomla.html.html');
     $mainframe =& JFactory::getApplication();
     // Get the page/component configuration
     $params =& $mainframe->getParams();
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     // because the application sets a default page title, we need to get it
     // right from the menu item itself
     if (is_object($menu)) {
         $menu_params = new JParameter($menu->params);
         if (!$menu_params->get('page_title')) {
             $params->set('page_title', JText::_('FORGOT_YOUR_USERNAME'));
         }
     } else {
         $params->set('page_title', JText::_('FORGOT_YOUR_USERNAME'));
     }
     $document =& JFactory::getDocument();
     $document->setTitle($params->get('page_title'));
     // Load the form validation behavior
     JHTML::_('behavior.formvalidation');
     // Add the tooltip behavior
     JHTML::_('behavior.tooltip');
     $this->assignRef('params', $params);
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     // redirect guests to login page
     $mainframe =& JFactory::getApplication();
     $user =& JFactory::getUser();
     if ($user->id != 0) {
         $Lists = $this->get('Lists');
         $this->assignRef('lists', $Lists);
         //--Creating a link to the edit form
         $this->assignRef('editlink', JRoute::_('index.php?option=com_joomailermailchimpintegration&view=subscriptions&task=edit'));
         // retrieve page title from the menuitem
         $menus =& JSite::getMenu();
         $menu = $menus->getActive();
         $menu_params = new JParameter($menu->params);
         $this->assignRef('page_title', $menu_params->get('page_title'));
         parent::display($tpl);
     } else {
         // Redirect to login
         $uri = JFactory::getURI();
         $return = $uri->toString();
         if (version_compare(JVERSION, '1.6.0', 'ge')) {
             $url = 'index.php?option=com_users&view=login';
         } else {
             $url = 'index.php?option=com_user&view=login';
         }
         $url .= '&return=' . base64_encode($return);
         $mainframe->redirect($url, JText::_('JM_ONLY_LOGGED_IN_USERS_CAN_VIEW_SUBSCRIPTIONS'));
     }
 }
Example #21
0
function PhocaguestbookParseRoute($segments)
{
    $vars = array();
    //Get the active menu item
    $menu =& JSite::getMenu();
    $item =& $menu->getActive();
    if (is_object($item)) {
        if (isset($item->query['view']) && $item->query['view'] == 'phocaguestbook' && isset($segments[0])) {
            $vars['view'] = 'phocaguestbook';
            $vars['id'] = $segments[0];
        }
    } else {
        // Count route segments
        $count = count($segments);
        // Check if there are any route segments to handle.
        if ($count) {
            if (count($segments[0]) == 1) {
                $vars['view'] = 'phocaguestbook';
                $vars['id'] = $segments[$count - 1];
            } else {
                $vars['view'] = 'phocaguestbook';
                $vars['id'] = $segments[$count - 1];
            }
        }
    }
    return $vars;
}
Example #22
0
function DuukaParseRoute($segments)
{
    $vars = array();
    //Get the active menu item
    $menu = JSite::getMenu();
    $item = $menu->getActive();
    $count = count($segments);
    if ($segments[$count - 2] == 'item') {
        $uri = JFactory::getURI();
        $uri->setPath(str_replace('/item/', '/', $uri->getPath()));
        $app = JFactory::getApplication();
        $app->redirect($uri->toString());
    }
    if ($segments[$count - 2] == 'product') {
        $uri = JFactory::getURI();
        $uri->setPath(str_replace('/product/', '/', $uri->getPath()));
        $app = JFactory::getApplication();
        $app->redirect($uri->toString());
    }
    //Handle View and Identifier
    switch ($item->query['view']) {
        case 'items':
            $vars['id'] = $segments[$count - 1];
            $vars['view'] = 'item';
            break;
    }
    return $vars;
}
Example #23
0
 function _findItem($needles)
 {
     static $items;
     if (!$items) {
         $component =& JComponentHelper::getComponent('com_weblinks');
         $menu =& JSite::getMenu();
         $items = $menu->getItems('componentid', $component->id);
     }
     if (!is_array($items)) {
         return null;
     }
     $match = null;
     foreach ($needles as $needle => $id) {
         foreach ($items as $item) {
             if (@$item->query['view'] == $needle && @$item->query['id'] == $id) {
                 $match = $item->id;
                 break;
             }
         }
         if (isset($match)) {
             break;
         }
     }
     return $match;
 }
Example #24
0
 function display($tpl = null)
 {
     global $mainframe, $option;
     $limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'), '', 'int');
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     $options['limit'] = $limit;
     $options['limitstart'] = $limitstart;
     $user =& JFactory::getUser();
     $pathway =& $mainframe->getPathway();
     $document =& JFactory::getDocument();
     $model =& $this->getModel();
     // Get the parameters of the active menu item
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     // Push a model into the view
     $model =& $this->getModel();
     $jobType = JRequest::getVar('jobType');
     $options['jobType'] = $jobType;
     $order = Jrequest::getVar('orderby');
     $options['order'] = $order;
     $catsone = $model->getCatsone($options);
     $total = count($catsone);
     // Set the document page title
     $document->setTitle(JText::_("Catsone module"));
     jimport('joomla.html.pagination');
     $pagination = new JPagination($total, $limitstart, $limit);
     $this->assignRef('catsone', $catsone);
     $this->assignRef('jobType', $jobType);
     $this->assignRef('pagination', $pagination);
     //JHTML::_('behavior.formvalidation');
     parent::display($tpl);
 }
Example #25
0
 /**
  * Prepares the document
  */
 protected function _prepareDocument()
 {
     $app =& JFactory::getApplication();
     $pathway =& $app->getPathway();
     $menus =& JSite::getMenu();
     $title = null;
     // Because the application sets a default page title,
     // we need to get it from the menu item itself
     if ($menu = $menus->getActive()) {
         if (isset($menu->query['view']) && $menu->query['view'] == 'form') {
             $menuParams = new JParameter($menu->params);
             $title = $menuParams->get('page_title');
         }
     }
     if (empty($title)) {
         $title = JText::_('Content_Form_Edit_Article');
     }
     $this->document->setTitle($title);
     $this->params->set('page_title', $title);
     $pathway =& $app->getPathWay();
     $pathway->addItem($title, '');
     // If there is a pagebreak heading or title, add it to the page title
     if (!empty($this->item->page_title)) {
         $article->title = $article->title . ' - ' . $article->page_title;
         $this->document->setTitle($article->page_title . ' - ' . JText::sprintf('Page %s', $this->state->get('page.offset') + 1));
     }
 }
 function search()
 {
     $post['searchword'] = JRequest::getString('searchword', null, 'post');
     $post['ordering'] = JRequest::getWord('ordering', null, 'post');
     $post['searchphrase'] = JRequest::getWord('searchphrase', 'all', 'post');
     $post['limit'] = JRequest::getInt('limit', null, 'post');
     if ($post['limit'] === null) {
         unset($post['limit']);
     }
     $areas = JRequest::getVar('areas', null, 'post', 'array');
     if ($areas) {
         foreach ($areas as $area) {
             $post['areas'][] = JFilterInput::clean($area, 'cmd');
         }
     }
     // set Itemid id for links
     $menu =& JSite::getMenu();
     $items = $menu->getItems('link', 'index.php?option=com_search_lucene&view=search');
     if (isset($items[0])) {
         $post['Itemid'] = $items[0]->id;
     }
     unset($post['task']);
     unset($post['submit']);
     $uri = JURI::getInstance();
     $uri->setQuery($post);
     $uri->setVar('option', 'com_search_lucene');
     $this->setRedirect(JRoute::_('index.php' . $uri->toString(array('query', 'fragment')), false));
 }
 public function onAfterDispatch()
 {
     $app = JFactory::getApplication();
     if (!$app->isSite()) {
         return;
     }
     $params = $this->params;
     $document = JFactory::getDocument();
     $menu = JSite::getMenu();
     $is_frontpage = $menu->getActive() == $menu->getDefault();
     $sitename = $params->get('sitename') ? $params->get('sitename') : $app->getCfg('sitename');
     if ($is_frontpage) {
         if ($params->get('frontpage_sitename')) {
             $sitename = $params->get('frontpage_sitename');
         }
         if ($params->get('frontpage') == '1') {
             return $document->setTitle($sitename);
         }
     }
     // {s} is used to protect the leading and trailing spaces
     $separator = str_replace('{s}', ' ', $params->get('separator'));
     $current = $document->getTitle();
     // Joomla 1.6 already sets title to the site name if there is no active menu item
     if ($current === $sitename) {
         return;
     }
     if ($params->get('position') == 'after') {
         $title = $current . $separator . $sitename;
     } else {
         $title = $sitename . $separator . $current;
     }
     $document->setTitle($title);
 }
Example #28
0
function modChrome_submenu($module, &$params, &$attribs)
{
    if (!empty($module->content) && strlen($module->content) > 40) {
        $parent_menu = JSite::getMenu()->getActive()->tree[0];
        ?>
	<div class="<?php 
        echo $params->get('moduleclass_sfx');
        ?>
 rokmodtools-<?php 
        echo $module->id;
        ?>
">
		<div class="side-mod">
			<div class="module-header"><div class="module-header2">
			<h3 class="side">
				<?php 
        echo JSite::getMenu()->getItem($parent_menu)->title;
        ?>
 Menu
			</h3>
			</div></div>
			<div class="module">
				<?php 
        echo $module->content;
        ?>
			</div>
			</div>
	</div>
	<?php 
    }
}
Example #29
0
 /**
  * Class constructor
  */
 function __construct($options = array())
 {
     //Initialise the array
     $this->_pathway = array();
     $menu =& JSite::getMenu();
     if ($item = $menu->getActive()) {
         $menus = $menu->getMenu();
         $home = $menu->getDefault();
         if (is_object($home) && $item->id != $home->id) {
             foreach ($item->tree as $menupath) {
                 $url = '';
                 $link = $menu->getItem($menupath);
                 switch ($link->type) {
                     case 'menulink':
                     case 'url':
                         $url = $link->link;
                         break;
                     case 'separator':
                         $url = null;
                         break;
                     default:
                         $url = 'index.php?Itemid=' . $link->id;
                 }
                 $this->addItem($menus[$menupath]->name, $url);
             }
             // end foreach
         }
     }
     // end if getActive
 }
Example #30
0
 /**
  * Prepares the document
  */
 protected function _prepareDocument()
 {
     $app =& JFactory::getApplication();
     $menus =& JSite::getMenu();
     $pathway =& $app->getPathway();
     // Because the application sets a default page title,
     // we need to get it from the menu item itself
     if ($menu = $menus->getActive()) {
         $menuParams = new JParameter($menu->params);
         if ($title = $menuParams->get('page_title')) {
             $this->document->setTitle($title);
         } else {
             $this->document->setTitle(JText::_('WEB_LINKS'));
         }
         // Set breadcrumbs.
         if ($menu->query['view'] != 'category') {
             $pathway->addItem($this->category->title, '');
         }
     } else {
         $this->document->setTitle(JText::_('WEB_LINKS'));
     }
     // Add alternate feed link
     if ($this->params->get('show_feed_link', 1) == 1) {
         $link = '&view=category&id=' . $this->category->slug . '&format=feed&limitstart=';
         $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
         $this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
         $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
         $this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
     }
 }