Esempio n. 1
0
	public function display() {
		static $cssadded = false;

		require_once (KUNENA_PATH_LIB . DS . 'kunena.link.class.php');
		require_once (KUNENA_PATH_LIB . DS . 'kunena.image.class.php');
		require_once (KUNENA_PATH_LIB . DS . 'kunena.timeformat.class.php');
		require_once (KUNENA_PATH_FUNCS . DS . 'latestx.php');
		require_once (JPATH_ADMINISTRATOR . '/components/com_kunena/libraries/html/parser.php');
		$this->kunena_config = KunenaFactory::getConfig ();
		$this->myprofile = KunenaFactory::getUser ();

		// load Kunena main language file so we can leverage langaueg strings from it
		KunenaFactory::loadLanguage();

		// Initialize session
		$session = KunenaFactory::getSession ();
		$session->updateAllowedForums();

		$this->latestdo = null;

		if ($this->params->get ( 'choosemodel' ) != 'latest') {
			$this->latestdo = $this->params->get ( 'choosemodel' );
		}

		$this->ktemplate = KunenaFactory::getTemplate();
		$this->klistpost = modKunenaLatestHelper::getKunenaLatestList ( $this->params );
		$this->topic_ordering = modKunenaLatestHelper::getTopicsOrdering($this->myprofile, $this->kunena_config);

		require (JModuleHelper::getLayoutPath ( 'mod_kunenalatest' ));
	}
Esempio n. 2
0
    function render()
    {
        // create instances of basic Joomla! classes
        $document = JFactory::getDocument();
        if (in_array('plus.google.com', $headData_keys)) {
            $link_founded = true;
        }
        if ($this->config['cookie_conset'] == 0) {
            $type = '<script type="text/javascript">';
        } else {
            $type = '<script type="text/plain" class="cc-onconsent-social">';
        }
        if ($this->config['gplus_badge_style'] == 'standard_badge') {
            // async script mode
            $content = $type . 'window.___gcfg = {lang: \'' . $this->config['gplus_lang_code'] . '\'};
		        (function() {
		            var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
		            po.src = \'https://apis.google.com/js/platform.js\';
		            var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);
		          })();</script>';
        }
        // if gplus script file doesn't exists in document head section
        if ($this->config['gplus_user'] != '' && $this->config['gplus_badge_style'] == 'standard_badge') {
            echo $content;
        }
        // select proper layout to load
        if ($this->config['gplus_badge_style'] == 'standard_badge') {
            require JModuleHelper::getLayoutPath('mod_social_gk5', 'gplusBadge');
        } else {
            require JModuleHelper::getLayoutPath('mod_social_gk5', 'gplusIcon');
        }
    }
Esempio n. 3
0
 function renderItem(&$item, &$params, &$access)
 {
     global $mainframe;
     $user =& JFactory::getUser();
     $item->text = $item->introtext;
     $item->groups = '';
     $item->readmore = trim($item->fulltext) != '';
     $item->metadesc = '';
     $item->metakey = '';
     $item->created = '';
     $item->modified = '';
     if ($params->get('readmore') || $params->get('link_titles')) {
         if ($params->get('intro_only')) {
             // Check to see if the user has access to view the full article
             if ($item->access <= $user->get('aid', 0)) {
                 $itemparams = new JParameter($item->attribs);
                 $readmoretxt = $itemparams->get('readmore', JText::_('Read more text'));
                 $item->linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid));
                 $item->linkText = $readmoretxt;
             } else {
                 $item->linkOn = JRoute::_('index.php?option=com_user&view=login');
                 $item->linkText = JText::_('Login To Read More');
             }
         }
     }
     if (!$params->get('image')) {
         $item->text = preg_replace('/<img[^>]*>/', '', $item->text);
     }
     $results = $mainframe->triggerEvent('onAfterDisplayTitle', array(&$item, &$params, 1));
     $item->afterDisplayTitle = trim(implode("\n", $results));
     $results = $mainframe->triggerEvent('onBeforeDisplayContent', array(&$item, &$params, 1));
     $item->beforeDisplayContent = trim(implode("\n", $results));
     require JModuleHelper::getLayoutPath('mod_newsflash', '_item');
 }
Esempio n. 4
0
 public static function button($button)
 {
     ob_start();
     require JModuleHelper::getLayoutPath('mod_imageshow_quickicon', 'default_button');
     $html = ob_get_clean();
     return $html;
 }
Esempio n. 5
0
 function get_image($num)
 {
     // used variables
     $url = false;
     $output = '';
     // select the proper image function
     if ($this->mode == 'com_content') {
         // load necessary com_content View class
         if (!class_exists('NSP_GK5_com_content_View')) {
             require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_content/view');
         }
         // generate the com_content image URL only
         $url = NSP_GK5_com_content_View::image($this->parent->config, $this->parent->content[$num], true, true);
     } else {
         if ($this->mode == 'com_k2') {
             // load necessary k2 View class
             if (!class_exists('NSP_GK5_com_k2_View')) {
                 require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_k2/view');
             }
             // generate the K2 image URL only
             $url = NSP_GK5_com_k2_View::image($this->parent->config, $this->parent->content[$num], true, true);
         }
     }
     // check if the URL exists
     if ($url === FALSE) {
         return false;
     } else {
         // if URL isn't blank - return it!
         if ($url != '') {
             return $url;
         } else {
             return false;
         }
     }
 }
Esempio n. 6
0
 /**
  * Entry point for CLI script
  *
  * @return  void
  *
  * @since   3.0
  */
 public function doExecute()
 {
     $response = new stdClass();
     $response->needsOtp = 'false';
     $response->form = "";
     // Session check
     if (JSession::checkToken('POST')) {
         $db = JFactory::getDbo();
         // Check if TFA is enabled. If not, just return false
         $query = $db->getQuery(true)->select('COUNT(*)')->from('#__extensions')->where('enabled=' . $db->q(1))->where('folder=' . $db->q('twofactorauth'));
         $db->setQuery($query);
         $tfaCount = $db->loadResult();
         if ($tfaCount > 0) {
             $username = JRequest::getVar('u', '', 'POST', 'username');
             $query = $db->getQuery(true)->select('id, password, otpKey')->from('#__users')->where('username='******'') {
                 //jimport('sourcecoast.utilities');
                 //SCStringUtilities::loadLanguage('mod_sclogin');
                 JFactory::getLanguage()->load('mod_sclogin');
                 //$password = JRequest::getString('p', '', 'POST', JREQUEST_ALLOWRAW);
                 //if (JUserHelper::verifyPassword($password, $result->password, $result->id))
                 //{
                 $response->needsOtp = 'true';
                 ob_start();
                 require JModuleHelper::getLayoutPath('mod_sclogin', 'otp');
                 $response->form = ob_get_clean();
                 //}
             }
         }
     }
     echo json_encode($response);
     exit;
 }
Esempio n. 7
0
 public function __construct($params)
 {
     static $cssadded = false;
     require_once KUNENA_PATH_LIB . DS . 'kunena.link.class.php';
     require_once KUNENA_PATH_LIB . DS . 'kunena.image.class.php';
     require_once KUNENA_PATH_LIB . DS . 'kunena.timeformat.class.php';
     require_once KUNENA_PATH_FUNCS . DS . 'latestx.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_kunena/libraries/html/parser.php';
     $this->kunena_config = KunenaFactory::getConfig();
     $this->myprofile = KunenaFactory::getUser();
     // load Kunena main language file so we can leverage langaueg strings from it
     KunenaFactory::loadLanguage();
     // Initialize session
     $session = KunenaFactory::getSession();
     $session->updateAllowedForums();
     $this->document = JFactory::getDocument();
     $kloadcss = $params->get('kunena_load_css');
     if ($cssadded == false && $kloadcss) {
         $this->document->addStyleSheet(JURI::root() . 'modules/mod_kunenalatest/tmpl/css/kunenalatest.css');
         $cssadded = true;
     }
     $this->latestdo = null;
     if ($params->get('choosemodel') != 'latest') {
         $this->latestdo = $params->get('choosemodel');
     }
     $this->params = $params;
     $this->ktemplate = KunenaFactory::getTemplate();
     $this->klistpost = modKunenaLatestHelper::getKunenaLatestList($params);
     $this->topic_ordering = modKunenaLatestHelper::getTopicsOrdering($this->myprofile, $this->kunena_config);
     require JModuleHelper::getLayoutPath('mod_kunenalatest');
 }
Esempio n. 8
0
 function renderItem(&$item, &$params, &$access)
 {
     global $mainframe;
     $user =& JFactory::getUser();
     $item->text = $item->introtext;
     $item->groups = '';
     $item->readmore = trim($item->fulltext) != '';
     $item->metadesc = '';
     $item->metakey = '';
     $item->access = '';
     $item->created = '';
     $item->modified = '';
     if ($params->get('readmore') || $params->get('link_titles')) {
         if ($params->get('intro_only')) {
             // Check to see if the user has access to view the full article
             if ($item->access <= $user->get('aid', 0)) {
                 $linkOn = ContentHelperRoute::getArticleRoute($item->slug, $item->catslug);
             } else {
                 $linkOn = JRoute::_('index.php?option=com_user&task=register');
             }
         }
         $item->linkOn = $linkOn;
     }
     $results = $mainframe->triggerEvent('onAfterDisplayTitle', array(&$item, &$params, 1));
     $item->afterDisplayTitle = trim(implode("\n", $results));
     $results = $mainframe->triggerEvent('onBeforeDisplayContent', array(&$item, &$params, 1));
     $item->beforeDisplayContent = trim(implode("\n", $results));
     require JModuleHelper::getLayoutPath('mod_yoo_drawer', '_item');
 }
Esempio n. 9
0
 function display()
 {
     $this->stats = $this->getStats();
     require JModuleHelper::getLayoutPath('mod_kunenastats');
     $this->document = JFactory::getDocument();
     $this->document->addStyleSheet(JURI::root() . 'modules/mod_kunenastats/tmpl/css/kunenastats.css');
 }
Esempio n. 10
0
 /**
  * Send email whith user data from form
  *
  * @param   array  $params An object containing the module parameters
  *
  * @access public
  */
 public static function sendMail($params)
 {
     $sender = $params->get('sender');
     $recipient = $params->get('recipient');
     $subject = $params->get('subject');
     // Getting the site name
     $sitename = JFactory::getApplication()->get('sitename');
     // Getting user form data-------------------------------------------------
     $name = JFilterInput::getInstance()->clean(JRequest::getVar('name'));
     $phone = JFilterInput::getInstance()->clean(JRequest::getVar('phone'));
     $email = JFilterInput::getInstance()->clean(JRequest::getVar('email'));
     $message = JFilterInput::getInstance()->clean(JRequest::getVar('message'));
     // Set the massage body vars
     $nameLabel = JText::_('MOD_JCALLBACK_FORM_NAME_LABEL_VALUE');
     $phoneLabel = JText::_('MOD_JCALLBACK_FORM_PHONE_LABEL_VALUE');
     $emailLabel = JText::_('MOD_JCALLBACK_FORM_EMAIL_LABEL_VALUE');
     $messageLabel = JText::_('MOD_JCALLBACK_FORM_MESSAGE_LABEL_VALUE');
     $emailLabel = $email ? "<b>{$emailLabel}:</b> {$email}" : "";
     $messageLabel = $message ? "<b>{$messageLabel}:</b> {$message}" : "";
     // Get the JMail ogject
     $mailer = JFactory::getMailer();
     // Set JMail object params------------------------------------------------
     $mailer->setSubject($subject);
     $params->get('useSiteMailfrom') ? $mailer->setSender(JFactory::getConfig()->get('mailfrom')) : $mailer->setSender($sender);
     $mailer->addRecipient($recipient);
     // Get the mail message body
     require JModuleHelper::getLayoutPath('mod_jcallback', 'default_email_message');
     $mailer->isHTML(true);
     $mailer->Encoding = 'base64';
     $mailer->setBody($body);
     $mailer->Send();
     // The mail sending errors will be shown in the Joomla Warning Message from JMail object..
 }
Esempio n. 11
0
 protected function _display()
 {
     $this->type = $this->params->get('type', 'general');
     $this->items = (int) $this->params->get('items', 5);
     $this->stats_link = $this->_getStatsLink(JText::_('MOD_KUNENASTATS_LINK'), JText::_('MOD_KUNENASTATS_LINK'));
     $this->stats = $this->getStats();
     require JModuleHelper::getLayoutPath('mod_kunenastats');
 }
Esempio n. 12
0
 public function submitAction()
 {
     $recipientEmail = $this->params->get('email', '');
     $post = JRequest::get('post');
     $post["username"] = $post["name"];
     $subject = $post["src_title"];
     $body = $this->renderpart(JModuleHelper::getLayoutPath(self::$moduleName, 'email'), $post, true);
     JUTility::sendMail($post["email"], $post["name"], $recipientEmail, $subject, $body, true);
     print "ok";
     jexit();
 }
Esempio n. 13
0
 function renderEmphasis(&$review)
 {
     $Pro_Item = modEmphasisNewsHelper::GetItemId($review);
     $link = JRoute::_("index.php?option=com_u_re&controller=projects&Itemid=" . $Pro_Item . "&task=view&id=" . $review->id);
     if (file_exists('images/project/' . $review->id . '/preview.jpg')) {
         $review->image = "images/project/" . $review->id . "/preview.jpg";
     } else {
         $review->image = "images/noimage.jpg";
     }
     require JModuleHelper::getLayoutPath('mod_jea_newsfp', '_emphasis');
 }
Esempio n. 14
0
 protected function _display()
 {
     $this->ksearch_button = $this->params->get('ksearch_button', '');
     $this->ksearch_button_pos = $this->params->get('ksearch_button_pos', 'right');
     $this->ksearch_button_txt = $this->params->get('ksearch_button_txt', JText::_('Search'));
     $this->ksearch_width = intval($this->params->get('ksearch_width', 20));
     $this->ksearch_maxlength = $this->ksearch_width > 20 ? $this->ksearch_width : 20;
     $this->ksearch_txt = $this->params->get('ksearch_txt', JText::_('Search...'));
     $this->ksearch_moduleclass_sfx = $this->params->get('moduleclass_sfx', '');
     $this->url = KunenaRoute::_('index.php?option=com_kunena');
     require JModuleHelper::getLayoutPath('mod_kunenasearch');
 }
Esempio n. 15
0
 function display()
 {
     $this->list = KunenaMenuHelper::getList($this->parameters);
     $this->app = JFactory::getApplication();
     $this->menu = $this->app->getMenu();
     $this->active = $this->menu->getActive();
     $this->active_id = isset($this->active) ? $this->active->id : $this->menu->getDefault()->id;
     $this->path = isset($this->active) ? $this->active->tree : array();
     $this->showAll = $this->parameters->get('showAllChildren');
     $this->class_sfx = htmlspecialchars($this->parameters->get('class_sfx'));
     if (count($this->list)) {
         require JModuleHelper::getLayoutPath('mod_kunenamenu', $this->parameters->get('layout', 'default'));
     }
 }
Esempio n. 16
0
    /**
     * Helper method to generate a button in administrator panel
     *
     * @param   array   A named array with keys link, image, text, access and imagePath
     * @return  string  HTML for button
     */
    public static function button($button)
    {
        if ( !empty($button['access']) )
        {
            if ( !JFactory::getUser()->authorize($button['access']) ) {
                return '';
            }
        }

        ob_start();
        require JModuleHelper::getLayoutPath('mod_myshortcuts', 'button');
        $html = ob_get_clean();
        return $html;
    }
Esempio n. 17
0
 function display()
 {
     KunenaForum::setup();
     KunenaFactory::loadLanguage();
     KunenaFactory::loadLanguage('com_kunena.templates');
     $this->params->def('greeting', 1);
     $this->document = JFactory::getDocument();
     $this->me = KunenaFactory::getUser();
     $token = JUtility::getToken();
     // Load CSS only once
     if (self::$cssadded == false) {
         $this->document->addStyleSheet(JURI::root(true) . '/modules/mod_kunenalogin/tmpl/css/kunenalogin.css');
         self::$cssadded = true;
     }
     $cache = JFactory::getCache('com_kunena', 'output');
     if ($cache->start("{$this->me->userid}.{$token}", 'mod_kunenalogin')) {
         return;
     }
     $login = KunenaLogin::getInstance();
     if (!$this->me->exists()) {
         $this->type = 'login';
         $this->login = null;
         if ($login) {
             $this->lostPasswordUrl = $login->getResetURL();
             $this->lostUsernameUrl = $login->getRemindURL();
             $this->registerUrl = $login->getRegistrationURL();
             $this->remember = JPluginHelper::isEnabled('system', 'remember');
         }
     } else {
         $this->type = 'logout';
         $this->logout = null;
         $this->lastvisitDate = new KunenaDate($this->me->lastvisitDate);
         if ($login) {
             $this->logout = $login->getLogoutURL();
             $this->recentPosts = JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=topics', JText::_('MOD_KUNENALOGIN_RECENT'));
             $this->myPosts = JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=topics&layout=user&mode=default', JText::_('MOD_KUNENALOGIN_MYPOSTS'));
         }
         // Private messages
         $private = KunenaFactory::getPrivateMessaging();
         $this->privateMessages = '';
         if ($this->params->get('showmessage') && $private) {
             $count = $private->getUnreadCount($this->me->userid);
             $this->privateMessages = $private->getInboxLink($count ? JText::sprintf('COM_KUNENA_PMS_INBOX_NEW', $count) : JText::_('COM_KUNENA_PMS_INBOX'));
         }
     }
     $this->return = $this->getReturnURL();
     require JModuleHelper::getLayoutPath('mod_kunenalogin');
     $cache->end();
 }
Esempio n. 18
0
 /**
  * Helper method to generate a button in administrator panel
  *
  * @param	array	A named array with keys link, image, text, access and imagePath
  * @return	string	HTML for button
  */
 public static function button($button)
 {
     if (!empty($button['access'])) {
         if (!JFactory::getUser()->authorize($button['access'])) {
             return '';
         }
     }
     if (empty($button['imagePath'])) {
         $template = JFactory::getApplication()->getTemplate();
         $button['imagePath'] = '/templates/' . $template . '/images/header/';
     }
     ob_start();
     require JModuleHelper::getLayoutPath('mod_quickicon', 'button');
     $html = ob_get_clean();
     return $html;
 }
Esempio n. 19
0
 function display()
 {
     $this->login = CKunenaLogin::getloginFields();
     $this->logout = CKunenaLogin::getlogoutFields();
     $this->my = JFactory::getUser();
     $this->private = KunenaFactory::getPrivateMessaging();
     $this->PMCount = $this->private->getUnreadCount($this->my->id);
     $this->PMlink = $this->private->getInboxLink($this->PMCount ? JText::sprintf('MOD_KUNENALOGIN_NEW_MESSAGE', $this->PMCount) : JText::_('MOD_KUNENALOGIN_MYMESSAGES'));
     $this->params->def('greeting', 1);
     $this->type = $this->getType();
     $this->return = $this->getReturnURL();
     $this->loadCSS = $this->loadCSS('mod_kunenalogin');
     // load CSS stylesheet
     $this->user = KunenaFactory::getUser();
     require JModuleHelper::getLayoutPath('mod_kunenalogin');
 }
Esempio n. 20
0
 public function render()
 {
     $module_name = JFactory::getApplication()->input->getString('module');
     $module_id = JFactory::getApplication()->input->getInt('moduleid');
     $db = JFactory::getDBO();
     if (isset($module_name) && $module_name != '') {
         $query = "SELECT * from #__modules where title=" . $db->quote($module_name);
     } else {
         if (isset($module_id) && $module_id != '') {
             $query = "SELECT * from #__modules where id=" . $module_id;
         } else {
             die;
         }
     }
     $db->setQuery($query);
     $result = $db->loadObject();
     if ($result) {
         $page = JFactory::getApplication()->input->getInt('page', 2);
         $module = JModuleHelper::getModule($result->module);
         $module->params = $result->params;
         $params = new JRegistry($result->params);
         $rokminievents3 = new RokMiniEvents3();
         $events = $rokminievents3->getEvents($params);
         $pages = ceil(count($events) / $params->get('events_pane'));
         $per_pane = $params->get('events_pane');
         //$output = $renderer->render($module, $options);
         $output = new stdClass();
         $output->status = 'success';
         $output->message = '';
         $output->id = $module_id;
         $output->page = $page;
         $output->payload = array();
         if (count($events)) {
             $start = $page * $per_pane - ($per_pane - 1) - 1;
             $stop = count($events) < $page * $per_pane ? count($events) - 1 : $page * $per_pane - 1;
             $output->payload['html'] = '';
             for ($i = $start; $i <= $stop; $i++) {
                 $event = $events[$i];
                 ob_start();
                 include JModuleHelper::getLayoutPath('mod_rokminievents3', 'default_item');
                 $output->payload['html'][] = ob_get_clean();
             }
         }
         echo json_encode($output);
     }
 }
Esempio n. 21
0
 public function display()
 {
     // Load CSS only once
     if (self::$cssadded == false) {
         $this->document->addStyleSheet(JURI::root(true) . '/modules/mod_kunenasearch/tmpl/css/kunenasearch.css');
         self::$cssadded = true;
     }
     $this->ksearch_button = $this->params->get('ksearch_button', '');
     $this->ksearch_button_pos = $this->params->get('ksearch_button_pos', 'right');
     $this->ksearch_button_txt = $this->params->get('ksearch_button_txt', JText::_('Search'));
     $this->ksearch_width = intval($this->params->get('ksearch_width', 20));
     $this->ksearch_maxlength = $this->ksearch_width > 20 ? $this->ksearch_width : 20;
     $this->ksearch_txt = $this->params->get('ksearch_txt', JText::_('Search...'));
     $this->ksearch_moduleclass_sfx = $this->params->get('moduleclass_sfx', '');
     $this->url = KunenaRoute::_('index.php?option=com_kunena');
     require JModuleHelper::getLayoutPath('mod_kunenasearch');
 }
Esempio n. 22
0
 public function __construct($params)
 {
     $this->document = JFactory::getDocument();
     require_once KUNENA_PATH_LIB . '/kunena.link.class.php';
     // Initialize session
     $session = KunenaFactory::getSession();
     $session->updateAllowedForums();
     $this->ksearch_button = $params->get('ksearch_button', '');
     $this->ksearch_button_pos = $params->get('ksearch_button_pos', 'right');
     $this->ksearch_button_txt = $params->get('ksearch_button_txt', JText::_('Search'));
     $this->ksearch_width = intval($params->get('ksearch_width', 20));
     $this->ksearch_maxlength = $this->ksearch_width > 20 ? $this->ksearch_width : 20;
     $this->ksearch_txt = $params->get('ksearch_txt', JText::_('Search...'));
     $this->ksearch_moduleclass_sfx = $params->get('moduleclass_sfx', '');
     $this->params = $params;
     require JModuleHelper::getLayoutPath('mod_kunenasearch');
 }
Esempio n. 23
0
 /**
  * Helper method to generate a button in administrator panel
  *
  * @param	array	A named array with keys link, image, text, access and imagePath
  *
  * @return	string	HTML for button
  * @since	1.6
  */
 public static function button($button)
 {
     if (!empty($button['access'])) {
         if (is_bool($button['access']) && $button['access'] == false) {
             return '';
         }
         // Take each pair of permission, context values.
         for ($i = 0, $n = count($button['access']); $i < $n; $i += 2) {
             if (!JFactory::getUser()->authorise($button['access'][$i], $button['access'][$i + 1])) {
                 return '';
             }
         }
     }
     ob_start();
     require JModuleHelper::getLayoutPath('mod_quickicon', 'default_button');
     $html = ob_get_clean();
     return $html;
 }
 public static function loadObject($object, &$dbType, &$params) {
     JHTML::stylesheet('media/mod_advsearch/css/default.css');
     if (empty($object)) {
         require_once JModuleHelper::getLayoutPath('mod_advsearch', $params->get('layout', 'default'));
     } else {
         if (array_key_exists('error', $object)) {
             echo $object['error'];
         } else {
             echo '<div class="advSearchScroll">';
             require dirname(__FILE__) . '/tmpl/head_' . $dbType . '.php';
             foreach ($object as $key => $value) {
                 extract($value);
                 require dirname(__FILE__) . '/tmpl/' . $dbType . '.php';
             }
             echo '</div>';
         }
     }
 }
function DefaultEventsLegend($view)
{
    $cfg =& JEVConfig::getInstance();
    $theme = JEV_CommonFunctions::getJEventsViewName();
    $modpath = JModuleHelper::getLayoutPath('mod_jevents_legend', $theme . DS . "legend");
    if (!file_exists($modpath)) {
        return;
    }
    // load the helper class
    require_once JPATH_SITE . '/modules/mod_jevents_legend/helper.php';
    require_once $modpath;
    $viewclass = ucfirst($theme) . "ModLegendView";
    $module = JModuleHelper::getModule("mod_jevents_legend", false);
    $params = new JParameter($module->params);
    $modview = new $viewclass($params, $module->id);
    echo $modview->displayCalendarLegend("block");
    echo "<br style='clear:both'/>";
}
Esempio n. 26
0
 function get_link($num)
 {
     if ($this->mode == 'com_content') {
         // load necessary com_content View class
         if (!class_exists('NSP_GK5_com_content_View')) {
             require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_content/view');
         }
         return NSP_GK5_com_content_View::itemLink($this->parent->content[$num], $this->parent->config);
     } else {
         if ($this->mode == 'com_k2') {
             // load necessary k2 View class
             if (!class_exists('NSP_GK5_com_k2_View')) {
                 require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_k2/view');
             }
             return NSP_GK5_com_k2_View::itemLink($this->parent->content[$num], $this->parent->config);
         } else {
             return false;
         }
     }
 }
Esempio n. 27
0
 protected function _display()
 {
     // Load language files.
     KunenaFactory::loadLanguage();
     KunenaFactory::loadLanguage('com_kunena.templates');
     $this->params->def('greeting', 1);
     $this->document = JFactory::getDocument();
     $this->me = KunenaFactory::getUser();
     $token = JSession::getFormToken();
     $login = KunenaLogin::getInstance();
     if (!$this->me->exists()) {
         $this->type = 'login';
         $this->login = null;
         if ($login) {
             $this->lostPasswordUrl = $login->getResetURL();
             $this->lostUsernameUrl = $login->getRemindURL();
             $this->registerUrl = $login->getRegistrationURL();
             $this->remember = JPluginHelper::isEnabled('system', 'remember');
         }
     } else {
         $this->type = 'logout';
         $this->logout = null;
         $this->lastvisitDate = KunenaDate::getInstance($this->me->lastvisitDate);
         if ($login) {
             $this->logout = $login->getLogoutURL();
             $this->recentPosts = JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=topics', JText::_('MOD_KUNENALOGIN_RECENT'));
             $this->myPosts = JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=topics&layout=user&mode=default', JText::_('MOD_KUNENALOGIN_MYPOSTS'));
         }
         // Private messages
         $private = KunenaFactory::getPrivateMessaging();
         $this->privateMessages = '';
         if ($this->params->get('showmessage') && $private) {
             $count = $private->getUnreadCount($this->me->userid);
             $this->privateMessages = $private->getInboxLink($count ? JText::sprintf('COM_KUNENA_PMS_INBOX_NEW', $count) : JText::_('COM_KUNENA_PMS_INBOX'));
         }
     }
     $this->return = $this->getReturnURL();
     require JModuleHelper::getLayoutPath('mod_kunenalogin');
 }
Esempio n. 28
0
 /**
  * Helper method to generate a button in administrator panel
  *
  * @param	array	A named array with keys link, image, text, access and imagePath
  *
  * @return	string	HTML for button
  * @since	1.6
  */
 public static function button($button)
 {
     if (!empty($button['access'])) {
         if (is_bool($button['access']) && $button['access'] == false) {
             return '';
         }
         // Take each pair of permission, context values.
         for ($i = 0, $n = count($button['access']); $i < $n; $i += 2) {
             if (!JFactory::getUser()->authorise($button['access'][$i], $button['access'][$i + 1])) {
                 return '';
             }
         }
     }
     if (empty($button['imagePath'])) {
         $template = JFactory::getApplication()->getTemplate();
         $button['imagePath'] = '/templates/' . $template . '/images/header/';
     }
     ob_start();
     require JModuleHelper::getLayoutPath('mod_pj_quickicon', 'default');
     $html = ob_get_clean();
     return $html;
 }
Esempio n. 29
0
function DefaultEventsLegend($view)
{
    $cfg = JEVConfig::getInstance();
    if ($cfg->get('com_calShowLegend', 1) == 1) {
        $theme = JEV_CommonFunctions::getJEventsViewName();
        $modpath = JModuleHelper::getLayoutPath('mod_jevents_legend', $theme . '/' . "legend");
        if (!file_exists($modpath) || !file_exists(JPATH_SITE . '/modules/mod_jevents_legend/helper.php')) {
            return;
        }
        // load the helper class
        require_once JPATH_SITE . '/modules/mod_jevents_legend/helper.php';
        require_once $modpath;
        $viewclass = ucfirst($theme) . "ModLegendView";
        $module = JModuleHelper::getModule("mod_jevents_legend", false);
        $params = new JRegistry($module->params);
        $modview = new $viewclass($params, $module->id);
        echo $modview->displayCalendarLegend("block");
        echo "<br style='clear:both;height:0px;line-height:0px;'/>";
    } else {
        //Do nothing
    }
}
Esempio n. 30
0
 function renderItem(&$item, &$params, &$access)
 {
     global $mainframe;
     $user =& JFactory::getUser();
     $item->text = $item->introtext;
     $item->groups = '';
     $item->readmore = trim($item->fulltext) != '';
     $item->metadesc = '';
     $item->metakey = '';
     $item->access = '';
     $item->created = '';
     $item->modified = '';
     if ($params->get('readmore')) {
         // Check to see if the user has access to view the full article
         if ($item->access <= $user->get('aid', 0)) {
             $linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid));
         } else {
             $linkOn = JRoute::_('index.php?option=com_user&task=register');
         }
         $item->linkOn = $linkOn;
     }
     require JModuleHelper::getLayoutPath('mod_yoo_accordion', '_item');
 }