Example #1
1
 /**
  * Function for getting the list of languages
  *
  * @return	array  Language list
  */
 public static function getList()
 {
     $app = JFactory::getApplication();
     $languages = JLanguageHelper::getLanguages();
     $db = JFactory::getDbo();
     $Itemid = $app->input->getInt('Itemid', 0);
     $uri = new JURI(Juri::current());
     $uri->delVar('lang');
     $uri->delVar('Itemid');
     $location = htmlspecialchars($uri->getQuery());
     if (!empty($location)) {
         $location .= '&';
     }
     if (!$Itemid) {
         $active = $app->getMenu()->getActive();
         if ($active) {
             $Itemid = $active->id;
         }
     }
     // For every language we load menu items language specific alias and params
     foreach ($languages as $i => $language) {
         $db->forceLanguageTranslation = $language->lang_code;
         RMenu::resetJoomlaMenuItems();
         $db->forceLanguageTranslation = false;
         $languages[$i]->active = $language->lang_code == JFactory::getLanguage()->getTag();
         $languages[$i]->link = RRoute::_('index.php?' . $location . 'lang=' . $language->sef . ($Itemid > 0 ? '&Itemid=' . $Itemid : ''));
     }
     // After we are done we reset it the way it was
     RMenu::resetJoomlaMenuItems();
     return $languages;
 }
Example #2
0
 function mark()
 {
     $markid = $this->input->getInt('markid');
     $line = "option=com_jotcache&view=main";
     $this->model->resetMark();
     $uri = Juri::getInstance();
     $domain = $uri->toString(array('host'));
     $parts = explode('.', $domain);
     $last = count($parts) - 1;
     if ($last >= 1 && is_numeric($parts[$last]) === false) {
         $domain = $parts[$last - 1] . '.' . $parts[$last];
     }
     switch ($markid) {
         case 0:
             setcookie('jotcachemark', '0', '0', '/', $domain);
             $this->setRedirect('index.php?' . $line . "&filter_mark=", JText::_('JOTCACHE_RS_MSG_RESET'));
             break;
         case 1:
             setcookie('jotcachemark', '1', '0', '/', $domain);
             $this->setRedirect('index.php?' . $line, JText::_('JOTCACHE_RS_MSG_SET'));
             break;
         case 2:
             setcookie('jotcachemark', '2', '0', '/', $domain);
             $this->setRedirect('index.php?' . $line, JText::_('JOTCACHE_RS_MSG_RENEW'));
             break;
         default:
             break;
     }
 }
 /**
  * Method to get the field input markup for a spacer.
  * The spacer does not have accept input.
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getInput()
 {
     $apiHelper = new mauticApiHelper();
     $settings = $apiHelper->getApiSettings();
     $url = Juri::root() . 'administrator/?plugin=mautic';
     $text = 'PLG_MAUTIC_AUTHORIZE_BTN';
     if (!empty($settings['accessToken'])) {
         $url .= '&reauthorize=true';
         $text = 'PLG_MAUTIC_REAUTHORIZE_BTN';
     } else {
         $url .= '&authorize=true';
     }
     if (!empty($settings['clientKey']) && !empty($settings['clientSecret'])) {
         // Note: style is added for Joomla 2.5
         $btn = Jhtml::link($url, JText::_($text), array('class' => 'btn btn-small btn-success', 'style' => 'float: left;'));
         if (!empty($settings['accessToken'])) {
             $resetUrl = Juri::root() . 'administrator/?plugin=mautic&reset=true';
             $btn .= ' <span style="float: left;  padding: 0 4px;">|</span> ';
             $btn .= Jhtml::link($resetUrl, JText::_('PLG_MAUTIC_RESET_BTN'), array('class' => 'btn btn-small btn-default pull-right', 'style' => 'float: left;'));
         }
         return $btn;
     } else {
         return JText::_('PLG_MAUTIC_SAVE_KEYS_FIRST');
     }
 }
Example #4
0
 public function display($tpl = null)
 {
     JHTML::stylesheet(Juri::base() . 'media/openhrm/assets/css/stylesheet.css');
     JHTML::Script(Juri::base() . 'media/openhrm/assets/js/jwplayer/jwplayer.js');
     $this->lesson = $this->get("Items");
     $this->pagination = $this->get('Pagination');
     // Display the view
     parent::display($tpl);
 }
Example #5
0
 public function display($tpl = null)
 {
     JHTML::stylesheet(Juri::base() . 'media/englishconcept/assets/css/stylesheet.css');
     //JHTML::Script(Juri::base() . 'media/englishconcept/assets/js/jQuery.jPlayer/jquery.jplayer.min.js');
     JHTML::Script(Juri::base() . 'media/englishconcept/assets/js/jwplayer/jwplayer.js');
     $this->lesson = $this->get("Items");
     $this->pagination = $this->get('Pagination');
     // Display the view
     parent::display($tpl);
 }
Example #6
0
 /**
  * Get the necessary data for our stats report
  *
  * @return array
  */
 public function getData()
 {
     $data = array();
     $db = JFactory::getDbo();
     $data['php'] = phpversion();
     $data['mysql'] = $db->getVersion() . ' ' . $db->name;
     $data['domain'] = Juri::root();
     $data['joomla'] = JVERSION;
     $data['os'] = php_uname();
     $data['server'] = $_SERVER['SERVER_SOFTWARE'] . ' ' . (function_exists('php_sapi_name') ? php_sapi_name() : '');
     $data['language'] = implode(',', array_keys(JLanguage::getKnownLanguages(JPATH_BASE)));
     $data['timezone'] = JFactory::getConfig()->get('offset');
     $data['extension'] = $this->extension;
     $data['version'] = CompojoomComponentHelper::getManifest($this->extension)->get('version');
     $data['config'] = $this->getConfig();
     $customData = $this->getCustomExtensionData();
     if ($customData) {
         $data = array_merge($data, $customData);
     }
     return $data;
 }
Example #7
0
 public static function getFullUrl($file, $path)
 {
     $path = str_replace('administrator/', '', $path);
     $url = Juri::base();
     if (file_exists(JPATH_SITE . DS . $path . $file)) {
         $url = str_replace('/administrator', '/', $url);
     }
     if (substr($url, -1) !== '/' && substr($path, 0, 1) !== '/') {
         $url .= '/';
     }
     if (substr($path, -1) !== '/' && substr($file, 0, 1) !== '/') {
         $path .= '/';
     }
     if (!defined('OPCVERSION')) {
         include JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'version.php';
     }
     if (defined('OPCVERSION')) {
         $v = str_replace('.', '_', OPCVERSION);
         if (stripos($file, '?') === false) {
             $file .= '?opcversion=' . $v;
         }
     }
     return $url . $path . $file;
 }
Example #8
0
    protected function getInput()
    {
        $template = basename(dirname(dirname(dirname(__FILE__))));
        $directory = basename($this->element['directory']);
        $viewonclick = "if (document.getElementById('" . $this->id . "').value) { SqueezeBox.open('" . Juri::root() . 'templates/' . $template . '/images/' . $directory . "/'+document.getElementById('" . $this->id . "').value); };";
        $clearonclick = "document.getElementById('" . $this->id . "').value='';";
        $html = '<div class="input-prepend input-append">
			<a class="btn" title="View image" href="javascript:void(0);" onclick="' . $viewonclick . '" >
				<i class="icon-eye"> </i>
			</a>
			<input type="text" class="input-small" name="' . $this->name . '" id="' . $this->id . '" value="' . $this->value . '" />
			&nbsp;
			<a class="modal btn" title="Select an image"
				 href="index.php?option=com_jxtc&view=files&tmpl=component&fld=' . $this->id . '&id=' . JRequest::getInt('id') . '&f=' . $directory . '" 
				 rel="{handler: \'iframe\', size: {x: 755, y: 495}}">' . JText::_('JSELECT') . '
		  </a>';
        if (!$this->element['hide_none']) {
            $html .= '<a class="btn btn-danger" title="' . JText::_('JLIB_FORM_BUTTON_CLEAR') . '" href="javascript:void(0);" onclick="' . $clearonclick . '">
				<i class="icon-remove icon-white"></i>
			</a>';
        }
        $html .= '</div>';
        return $html;
    }

<?php 
foreach ($condominiums as $key => $condominium) {
    $resourceName = "";
    // BFCHelper::getLanguage($condominium->Name, $this->language);
    //$route = JRoute::_('index.php?option=com_bookingforconnector&view=condominium&ResourceId=' . $condominium->CondominiumId . ':' . BFCHelper::getSlug($resourceName));
    $currUri = $uri . '&resourceId=' . $condominium->CondominiumId . ':' . BFCHelper::getSlug($resourceName);
    if ($itemId != 0) {
        $currUri .= '&Itemid=' . $itemId;
    }
    $route = JRoute::_($currUri);
    $merchantLat = $condominium->XGooglePos;
    $merchantLon = $condominium->YGooglePos;
    $showMerchantMap = $merchantLat != null && $merchantLon != null;
    $merchantImageUrl = Juri::root() . "components/com_bookingforconnector/assets/images/defaults/default-s6.jpeg";
    $routeInfoRequest = JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&layout=contactspopup&tmpl=component&merchantId=' . $condominium->MerchantId . ':' . BFCHelper::getSlug($condominium->MerchantName));
    $currUriMerchant = $uriMerchant . '&merchantId=' . $condominium->MerchantId . ':' . BFCHelper::getSlug($condominium->MerchantName);
    if ($itemIdMerchant != 0) {
        $currUriMerchant .= '&Itemid=' . $itemIdMerchant;
    }
    $routeMerchant = JRoute::_($currUriMerchant);
    ?>
			<div class="<?php 
    echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL;
    ?>
12 com_bookingforconnector-item-col" >
				<div class="com_bookingforconnector-search-merchant com_bookingforconnector-item  <?php 
    echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW;
    ?>
" >
Example #10
0
components/com_javoice/asset/images/rss.gif" alt="RSS help"/>
		</a>
	</div>
</div>
<?php 
} else {
    echo JText::_("PLEASE_CREATE_NEW_FORUM_AND_VOICE_TYPE");
}
?>


<!--< New Loading Image and Text >-->
<!-- Loading -->
<div id="loader">
	<img src="<?php 
echo Juri::root();
?>
components/com_javoice/asset/images/loading.gif" alt="<?php 
echo JText::_("LOADER_TITLE");
?>
"/>
	<?php 
echo '<br>';
?>
	<?php 
echo JText::_('LOADING');
?>
</div>
<!--< End New Loading Image and Text >-->

<div id="jav-msg-loading" style="display:none"></div>
    $itemId = $itemIdMerchant;
}
$uriFav = 'index.php?option=com_bookingforconnector&view=resources&layout=favorites';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uriFav) . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1 LIMIT 1');
//$itemIdFav = ($db->getErrorNum())? 0 : intval($db->loadResult());
$itemIdFav = intval($db->loadResult());
//-------------------pagina per i l redirect di tutte le risorsein vendita
if ($itemIdFav != 0) {
    $routeFav = JRoute::_($uriFav . '&Itemid=' . $itemIdFav);
} else {
    $routeFav = JRoute::_($uriFav);
}
$img = JURI::root() . "/media/com_bookingfor/images/default.png";
$imgError = JURI::root() . "/media/com_bookingfor/images/default.png";
$merchantLogo = Juri::root() . "/media/com_bookingfor/images/default.png";
$offersDefault = Juri::root() . "/media/com_bookingfor/images/offertDefault.jpg";
$merchantLogoPath = BFCHelper::getImageUrlResized('merchant', "[img]", 'merchant_list_default');
$merchantLogoPathError = BFCHelper::getImageUrl('merchant', "[img]", 'merchant_list_default');
?>
<form action="<?php 
echo htmlspecialchars(JFactory::getURI()->toString());
?>
" method="post" name="bookingforsearchForm" id="bookingforsearchForm">
<script type="text/javascript">
<!--
var urlCheck = "<?php 
echo JRoute::_('index.php?option=com_bookingforconnector');
?>
";	
var cultureCode = '<?php 
echo $language;
Example #12
0
 /**
  * Clear the history until the uri.
  * Two uris are equal if their view and id vars are the same.
  *
  * @param   mixed  $uri  The uri until
  *
  * @return  void
  */
 public function clearHistoryUntil($uri = null)
 {
     $history = $this->history->getQueue();
     if (empty($history)) {
         return;
     }
     if (null === $uri) {
         $uri = str_replace(Juri::base(), '', Juri::getInstance()->toString());
     }
     $uri = new JURI($uri);
     $view = $uri->getVar('view');
     $id = $uri->getVar('id');
     $newHistory = array();
     foreach ($history as $oldLink) {
         $oldUri = new Juri($oldLink);
         $oldView = $oldUri->getVar('view');
         $oldId = $oldUri->getVar('id');
         if ($oldView === $view && $oldId === $id) {
             break;
         }
         $newHistory[] = $oldLink;
     }
     $this->history->setQueue($newHistory);
 }
Example #13
0
	<input class="radiobutton ckoption" type="radio" value="horizontal" id="orientationhorizontal" name="orientation" />
	<label class="radiobutton first" for="orientationhorizontal" style="width:auto;" onclick="change_menu_orientation('horizontal')"><?php 
echo JText::_('CK_HORIZONTAL');
?>
	</label><input class="radiobutton ckoption" type="radio" value="vertical" id="orientationvertical" name="orientation" />
	<label class="radiobutton"  for="orientationvertical" style="width:auto;" onclick="change_menu_orientation('vertical')"><?php 
echo JText::_('CK_VERTICAL');
?>
</label>
</div>
<hr />
<?php 
$path = JPATH_ROOT . '/modules/mod_maximenuck/tmpl';
$files = JFolder::files($path, '.php');
natsort($files);
$i = 1;
echo '<div class="clearfix" style="min-height:35px;margin: 0 5px;">';
foreach ($files as $file) {
    $thumb_title = '';
    $file = JFile::stripExt($file);
    if (file_exists($path . '/' . $file . '.png')) {
        $thumb = Juri::root(true) . '/modules/mod_maximenuck/tmpl/' . $file . '.png';
    } else {
        $thumb = Juri::root(true) . '/administrator/components/com_maximenuck/images/what.png style="display:block;margin:0 auto;" width="90 height="90';
        $thumb_title = JText::_('CK_LAYOUT_PREVIEW_NOT_FOUND');
    }
    $active = $layout == $file ? 'selected' : '';
    echo '<div class="layoutthumb ' . $active . '" data-name="' . $file . '" onclick="change_layout(\'' . $file . '\')">' . '<img src="' . $thumb . '" style="margin:0;padding:0;" title="' . $thumb_title . '" class="hasTip" />' . '<div class="layoutname">' . $file . '</div>' . '</div>';
    $i++;
}
echo '</div>';
Example #14
0
 /**
  * Get the web path to a file
  *
  * @param   string  $file     - the file name
  * @param   int     $id       - the id
  * @param   bool    $isThumb  - are we dealing with a thumb
  *
  * @return string
  */
 public function getWebFilePath($file, $id, $isThumb = false)
 {
     $params = JComponentHelper::getParams($this->component);
     $path = Juri::root() . $params->get('image_path', 'images') . '/' . $this->typeAlias . '/' . $id;
     if ($isThumb) {
         $path .= '/thumbs';
     }
     $path .= '/' . $file;
     return $path;
 }
<?php

$document = JFactory::getDocument();
$document->addScript(Juri::base(true) . '/plugins/content/plg_clm_sbnrw_ext/modal.js');
$document->addStylesheet(Juri::base(true) . '/plugins/content/plg_clm_sbnrw_ext/modal.css');
Example #16
0
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$merchant = $this->item;
$sitename = $this->sitename;
$language = $this->language;
//$this->document->setTitle($this->item->Name);
//$this->document->setDescription( BFCHelper::getLanguage($this->item->Description, $this->language));
$this->document->setTitle(sprintf(JTEXT::_('COM_BOOKINGFORCONNECTOR_VIEW_MERCHANTDETAILS_RESOURCES_TITLE'), $merchant->Name, $sitename));
$db = JFactory::getDBO();
$uri = 'index.php?option=com_bookingforconnector&view=resource';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uri) . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1 LIMIT 1');
//$itemId = ($db->getErrorNum())? 0 : intval($db->loadResult());
$itemId = intval($db->loadResult());
$resourceImageUrl = Juri::root() . "media/com_bookingfor/images/default.png";
$merchantImageUrl = Juri::root() . "media/com_bookingfor/images/DefaultLogoList.jpg";
$resourceLogoPath = BFCHelper::getImageUrlResized('resources', "[img]", 'onsellunit_list_default');
$resourceLogoPathError = BFCHelper::getImageUrl('resources', "[img]", 'onsellunit_list_default');
$merchantLogoPath = BFCHelper::getImageUrlResized('merchant', "[img]", 'resource_list_merchant_logo');
$merchantLogoPathError = BFCHelper::getImageUrl('merchant', "[img]", 'resource_list_merchant_logo');
?>
<script type="text/javascript">
<!--
var cultureCode = '<?php 
echo $language;
?>
';
//-->
</script>
<div class="com_bookingforconnector_merchantdetails com_bookingforconnector_merchantdetails-t<?php 
echo BFCHelper::showMerchantRatingByCategoryId($merchant->MerchantTypeId);
 * @license   GNU General Public License version 3, or later
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.modal', 'a.boxed');
$activeMenu = JFactory::getApplication()->getMenu()->getActive();
$language = $this->language;
$results = $this->items;
$language = $this->language;
$listsId = array();
//$resourceImageUrl = Juri::base() . "images/default.jpg";
//$merchantImageUrl = Juri::base() . "images/DefaultLogoList.jpg";
//$resourceLogoPath = BFCHelper::getImageUrl('onsellunits',"[img]", 'onsellunit_list_default');
//$merchantLogoPath = BFCHelper::getImageUrl('merchant',"[img]", 'resource_list_merchant_logo');
$resourceImageUrl = Juri::root() . "images/default.png";
$merchantImageUrl = Juri::root() . "images/DefaultLogoList.jpg";
$resourceLogoPath = BFCHelper::getImageUrlResized('onsellunits', "[img]", 'onsellunit_list_default');
$resourceLogoPathError = BFCHelper::getImageUrl('onsellunits', "[img]", 'onsellunit_list_default');
$merchantLogoPath = BFCHelper::getImageUrlResized('merchant', "[img]", 'resource_list_merchant_logo');
$merchantLogoPathError = BFCHelper::getImageUrl('merchant', "[img]", 'resource_list_merchant_logo');
//-------------------pagina per i l redirect di tutte le risorsein vendita
$db = JFactory::getDBO();
$uri = 'index.php?option=com_bookingforconnector&view=onsellunit';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uri) . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1  LIMIT 1');
$itemId = $db->getErrorNum() ? 0 : intval($db->loadResult());
//-------------------pagina per i l redirect di tutte le risorsein vendita
//-------------------pagina per il redirect di tutti i merchant
$uriMerchant = 'index.php?option=com_bookingforconnector&view=merchantdetails';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uriMerchant . '%') . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1  LIMIT 1');
$itemIdMerchant = $db->getErrorNum() ? 0 : intval($db->loadResult());
//-------------------pagina per il redirect di tutti i merchant
Example #18
0
 /**
  * The default method that will display the output of this view which is called by
  * Joomla
  *
  * @param	string template	Template file name
  **/
 public function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $model = $this->getModel('Activities');
     $activities = $model->getActivities();
     foreach ($activities as $key => $activity) {
         $param = new CParameter($activity->params);
         switch ($activity->app) {
             case 'users.featured':
                 $user = CFactory::getUser($param->get('userid'));
                 $activities[$key]->title = JText::sprintf('COM_COMMUNITY_MEMBER_IS_FEATURED', '<a href="' . CRoute::_(JUri::root() . $param->get('owner_url')) . '" class="cStream-Author">' . $user->getDisplayName() . '</a>');
                 break;
             case 'events.wall':
             case 'groups.wall':
             case 'profile':
                 $user = CFactory::getUser($activity->actor);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ';
                 if ($activity->eventid) {
                     $event = JTable::getInstance('Event', 'cTable');
                     $event->load($activity->eventid);
                     $html .= '➜ <a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id . '">' . $event->title . '</a>';
                 } elseif ($activity->groupid) {
                     $group = JTable::getInstance('Group', 'cTable');
                     $group->load($activity->groupid);
                     $html .= '➜ <a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id . '">' . $group->name . '</a>';
                 } elseif (!empty($activity->target) && $activity->target != $activity->actor) {
                     $target = CFactory::getUser($activity->target);
                     $html .= '➜ <a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $target->id . '">' . $target->getDisplayName() . '</a> ';
                     $html .= CActivities::format($activity->title);
                 } else {
                     $html .= ' posted: "' . CActivities::format($activity->title) . '"';
                 }
                 $activities[$key]->title = $html;
                 break;
             case 'groups.avatar.upload':
                 $user = CFactory::getUser($activity->actor);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ';
                 $html .= JText::_('COM_COMMUNITY_ACTIVITIES_NEW_GROUP_AVATAR');
                 $activities[$key]->title = $html;
                 break;
             case 'profile.avatar.upload':
                 $user = CFactory::getUser($activity->actor);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ';
                 $html .= JText::_('COM_COMMUNITY_ACTIVITIES_NEW_AVATAR');
                 $activities[$key]->title = $html;
                 break;
             case 'albums.comment':
             case 'albums':
                 $album = JTable::getInstance('Album', 'CTable');
                 $album->load($activity->cid);
                 $user = CFactory::getUser($activity->actor);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ';
                 $html .= JText::sprintf('COM_COMMUNITY_ACTIVITIES_WALL_POST_ALBUM', CRoute::_($album->getURI()), $this->escape($album->name));
                 $activities[$key]->title = $html;
                 break;
             case 'profile.like':
             case 'groups.like':
             case 'events.like':
             case 'photo.like':
             case 'videos.like':
             case 'album.like':
                 $actors = $param->get('actors');
                 $user = CFactory::getUser($activity->actor);
                 $users = explode(',', $actors);
                 $userCount = count($users);
                 switch ($activity->app) {
                     case 'profile.like':
                         $cid = CFactory::getUser($activity->cid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $cid->id;
                         $name = $cid->getDisplayName();
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_PROFILE';
                         break;
                     case 'groups.like':
                         $cid = JTable::getInstance('Group', 'CTable');
                         $cid->load($activity->groupid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $cid->id;
                         $name = $cid->name;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_GROUP';
                         break;
                     case 'events.like':
                         $cid = JTable::getInstance('Event', 'CTable');
                         $cid->load($activity->eventid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $cid->id;
                         $name = $cid->title;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_EVENT';
                         break;
                     case 'photo.like':
                         $cid = JTable::getInstance('Photo', 'CTable');
                         $cid->load($activity->cid);
                         $urlLink = JUri::root() . 'index.php?option=com_community&view=photos&task=photo&albumid=' . $cid->albumid . '&userid=' . $cid->creator . '&photoid=' . $cid->id;
                         $name = $cid->caption;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_PHOTO';
                         break;
                     case 'videos.like':
                         $cid = JTable::getInstance('Video', 'CTable');
                         $cid->load($activity->cid);
                         $urlLink = JURI::root() . 'index.php?option=com_community&view=videos&task=video&userid=' . $cid->creator . '&videoid=' . $cid->id;
                         $name = $cid->getTitle();
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_VIDEO';
                         break;
                     case 'album.like':
                         $cid = JTable::getInstance('Album', 'CTable');
                         $cid->load($activity->cid);
                         $urlLink = Juri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $cid->id . '&userid=' . $cid->creator;
                         $name = $cid->name;
                         $element = 'COM_COMMUNITY_STREAM_LIKES_ELEMENT_ALBUM';
                         break;
                 }
                 $slice = 2;
                 if ($userCount > 2) {
                     $slice = 1;
                 }
                 $users = array_slice($users, 0, $slice);
                 $actorsHTML = array();
                 foreach ($users as $actor) {
                     $user = CFactory::getUser($actor);
                     $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                 }
                 $others = '';
                 if ($userCount > 2) {
                     $others = JText::sprintf('COM_COMMUNITY_STREAM_OTHERS_JOIN_GROUP', $userCount - 1);
                 }
                 $jtext = $userCount > 1 ? 'COM_COMMUNITY_STREAM_LIKES_PLURAL' : 'COM_COMMUNITY_STREAM_LIKES_SINGULAR';
                 $activities[$key]->title = implode(' ' . JText::_('COM_COMMUNITY_AND') . ' ', $actorsHTML) . $others . JText::sprintf($jtext, $urlLink, $name, JText::_($element));
                 break;
             case 'cover.upload':
                 $user = CFactory::getUser($activity->actor);
                 $type = $param->get('type');
                 $extraMessage = '';
                 if (strtolower($type) !== 'profile') {
                     $id = strtolower($type . 'id');
                     $cTable = JTable::getInstance(ucfirst($type), 'CTable');
                     $cTable->load($activity->{$id});
                     if ($type == 'group') {
                         $extraMessage = ', <a target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $cTable->id . '">' . $cTable->name . '</a>';
                     }
                     if ($type == 'event') {
                         $extraMessage = ', <a target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $cTable->id . '">' . $cTable->title . '</a>';
                     }
                 }
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ';
                 if ($type == 'profile') {
                     $html .= JText::_('COM_COMMUNITY_PHOTOS_COVER_UPLOAD_PROFILE');
                 } else {
                     $html .= JText::sprintf('COM_COMMUNITY_PHOTOS_COVER_UPLOAD', strtolower(Jtext::_('COM_COMMUNITY_COVER_' . strtoupper($type)))) . $extraMessage;
                 }
                 $activities[$key]->title = $html;
                 break;
             case 'events.attend':
             case 'events':
                 $user = CFactory::getUser($activity->actor);
                 $action = $param->get('action');
                 $event = JTable::getInstance('Event', 'CTable');
                 $event->load($activity->eventid);
                 switch ($action) {
                     case 'events.create':
                         $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> -';
                         $html .= JText::sprintf('COM_COMMUNITY_EVENTS_ACTIVITIES_NEW_EVENT', JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id, $event->title);
                         $activities[$key]->title = $html;
                         break;
                     case 'events.attendence.attend':
                         $users = explode(',', $param->get('actors'));
                         $actorsHTML = array();
                         foreach ($users as $actor) {
                             if (!$actor) {
                                 $actor = $activity->actor;
                             }
                             $user = CFactory::getUser($actor);
                             $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                         }
                         $activities[$key]->title = implode(', ', $actorsHTML) . ' - ' . JText::sprintf('COM_COMMUNITY_ACTIVITIES_EVENT_ATTEND', JUri::root() . 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id, $event->title);
                         break;
                 }
                 break;
             case 'friends.connect':
                 $user1 = CFactory::getUser($activity->actor);
                 $user2 = CFactory::getUser($activity->target);
                 $html = JText::sprintf('COM_COMMUNITY_STREAM_OTHER_FRIENDS', $user1->getDisplayName(), $user2->getDisplayName(), JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user1->id, JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user2->id);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.bulletin':
                 $user = CFactory::getUser($activity->actor);
                 $bulletin = JTable::getInstance('Bulletin', 'CTable');
                 $bulletin->load($activity->cid);
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($bulletin->groupid);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_NEW_GROUP_NEWS', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewbulletin&groupid=' . $group->id . '&bulletinid=' . $bulletin->id), $bulletin->title);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.discussion':
                 $user = CFactory::getUser($activity->actor);
                 $discussion = JTable::getInstance('Discussion', 'CTable');
                 $discussion->load($activity->cid);
                 $discussionLink = CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $discussion->groupid . '&topicid=' . $discussion->id);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_NEW_GROUP_DISCUSSION', $discussionLink, $discussion->title);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.discussion.reply':
                 $user = CFactory::getUser($activity->actor);
                 $discussion = JTable::getInstance('Discussion', 'CTable');
                 $discussion->load($activity->cid);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>' . JText::sprintf('COM_COMMUNITY_GROUPS_REPLY_DISCUSSION', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $discussion->groupid . '&topicid=' . $discussion->id), $discussion->title);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.join':
                 $user = CFactory::getUser($activity->actor);
                 $users = explode(',', $param->get('actors'));
                 $userCount = count($users);
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($activity->cid);
                 $slice = 2;
                 if ($userCount > 2) {
                     $slice = 1;
                 }
                 $users = array_slice($users, 0, $slice);
                 $actorsHTML = array();
                 foreach ($users as $actor) {
                     $user = CFactory::getUser($actor);
                     $actorsHTML[] = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                 }
                 $others = '';
                 if ($userCount > 2) {
                     $others = JText::sprintf('COM_COMMUNITY_STREAM_OTHERS_JOIN_GROUP', $userCount - 1);
                 }
                 $html = implode(' ' . JText::_('COM_COMMUNITY_AND') . ' ', $actorsHTML) . $others . JText::sprintf('COM_COMMUNITY_GROUPS_GROUP_JOIN', JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id, $group->name);
                 $activities[$key]->title = $html;
                 break;
             case 'groups.update':
                 $user = CFactory::getUser($activity->actor);
                 $group = JTable::getInstance('Group', 'CTable');
                 $group->load($activity->cid);
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> - ' . JText::sprintf('COM_COMMUNITY_GROUPS_GROUP_UPDATED', JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id, $group->name);
                 $activities[$key]->title = $html;
                 break;
             case 'photos':
                 $user = CFactory::getUser($activity->actor);
                 $album = JTable::getInstance('Album', 'CTable');
                 $album->load($activity->cid);
                 $html = '';
                 if ($activity->groupid) {
                     $group = JTable::getInstance('Group', 'CTable');
                     $group->load($activity->groupid);
                     $html .= '<a class="cStream-Reference" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $group->id . '">' . $group->name . '</a> -';
                 }
                 $html .= ' <a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a>';
                 $count = $param->get('count', 1);
                 $url = Juri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $album->id . '&userid=' . $user->id;
                 if (CStringHelper::isPlural($count)) {
                     $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_PHOTO_UPLOAD_TITLE_MANY', $count, $url, CStringHelper::escape($album->name));
                 } else {
                     $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_PHOTO_UPLOAD_TITLE', $url, CStringHelper::escape($album->name));
                 }
                 $activities[$key]->title = $html;
                 break;
             case 'photos.comment':
                 $user = CFactory::getUser($activity->actor);
                 $wall = JTable::getInstance('Wall', 'CTable');
                 $wall->load($param->get('wallid'));
                 $photo = JTable::getInstance('Photo', 'CTable');
                 $photo->load($activity->cid);
                 $url = JUri::root() . 'index.php?option=com_community&view=photos&task=photo&albumid=' . $photo->albumid . '&userid=' . $photo->creator . '&photoid=' . $photo->id;
                 $html = '<a class="cStream-Author" target="_blank" href="' . JUri::root() . 'index.php?option=com_community&view=profile&userid=' . $user->id . '">' . $user->getDisplayName() . '</a> ' . JText::sprintf('COM_COMMUNITY_ACTIVITIES_WALL_POST_PHOTO', $url, $this->escape($photo->caption));
                 $activities[$key]->title = $html;
                 break;
             case 'system.message':
             case 'system.videos.popular':
             case 'system.photos.popular':
             case 'system.members.popular':
             case 'system.photos.total':
             case 'system.groups.popular':
             case 'system.members.registered':
                 $action = $param->get('action');
                 switch ($action) {
                     case 'registered_users':
                         $usersModel = CFactory::getModel('user');
                         $now = new JDate();
                         $date = CTimeHelper::getDate();
                         $users = $usersModel->getLatestMember(10);
                         $totalRegistered = count($users);
                         $title = JText::sprintf('COM_COMMUNITY_TOTAL_USERS_REGISTERED_THIS_MONTH_ACTIVITY_TITLE', $totalRegistered, $date->monthToString($now->format('%m')));
                         $activities[$key]->title = $title;
                         break;
                     case 'total_photos':
                         $photosModel = CFactory::getModel('photos');
                         $total = $photosModel->getTotalSitePhotos();
                         $activities[$key]->title = JText::sprintf('COM_COMMUNITY_TOTAL_PHOTOS_ACTIVITY_TITLE', CRoute::_(JURI::root() . 'index.php?option=com_community&view=photos'), $total);
                         break;
                     case 'top_videos':
                         $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_VIDEOS');
                         break;
                     case 'top_photos':
                         $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_PHOTOS');
                         break;
                     case 'top_users':
                         $activities[$key]->title = JText::_('COM_COMMUNITY_ACTIVITIES_TOP_MEMBERS');
                         break;
                     case 'top_groups':
                         $groupsModel = $this->getModel('groups');
                         $activeGroup = $groupsModel->getMostActiveGroup();
                         if (is_null($activeGroup)) {
                             $title = JText::_('COM_COMMUNITY_GROUPS_NONE_CREATED');
                         } else {
                             $title = JText::sprintf('COM_COMMUNITY_MOST_POPULAR_GROUP_ACTIVITY_TITLE', CRoute::_(JUri::root() . 'index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $activeGroup->id), $activeGroup->name);
                         }
                         $activities[$key]->title = $title;
                         break;
                     case 'message':
                         break;
                 }
                 break;
             case 'videos.linking':
             case 'videos':
                 $video = JTable::getInstance('Video', 'CTable');
                 $video->load($activity->cid);
                 $actor = CFactory::getUser($activity->actor);
                 $html = $this->_getUserLink($activity->actor);
                 $html .= JText::sprintf('COM_COMMUNITY_ACTIVITY_VIDEO_SHARE_TITLE', JUri::root() . $video->getViewURI(false), $this->escape($video->title));
                 $activities[$key]->title = $html;
                 break;
             case 'videos.featured':
                 $video = JTable::getInstance('Video', 'CTable');
                 $video->load($activity->cid);
                 $activities[$key]->title = JText::sprintf('COM_COMMUNITY_VIDEOS_IS_FEATURED', '<a href="' . CRoute::_(JUri::root() . 'index.php?option=com_community&view=videos&task=video&userid=' . $video->creator . '&videoid=' . $video->id) . '" class="cStream-Title">' . $this->escape($video->title) . '</a>');
                 break;
             case 'albums.featured':
                 $album = JTable::getInstance('Album', 'CTable');
                 $album->load($activity->cid);
                 $activities[$key]->title = JText::sprintf('COM_COMMUNITY_ALBUM_IS_FEATURED', '<a href="' . CRoute::_(JUri::root() . 'index.php?option=com_community&view=photos&task=album&albumid=' . $album->id . '&userid=' . $album->creator) . '" class="cStream-Title">' . $this->escape($album->name) . '</a>');
                 break;
         }
     }
     //exit;
     $userModel = $this->getModel('Users', false);
     $currentUser = $jinput->request->get('actor', JText::_('COM_COMMUNITY_ACTIVITIES_ENTER_NAME_VALUE'), 'NONE');
     $currentArchived = $jinput->request->get('archived', 0, 'NONE');
     $currentApp = $jinput->request->get('app', 'none', 'NONE');
     $filterApps = $model->getFilterApps();
     $this->assignRef('filterApps', $filterApps);
     $this->assignRef('currentApp', $currentApp);
     $this->assignRef('currentUser', $currentUser);
     $this->assignRef('currentArchive', $currentArchived);
     $this->assignRef('pagination', $model->getPagination());
     $this->assignRef('activities', $activities);
     parent::display($tpl);
 }
Example #19
0
 public function setupJavascript()
 {
     $needsBootstrap = $this->params->get('displayType') == 'modal' || !$this->user->guest && ($this->params->get('showUserMenu') && $this->params->get('userMenuStyle') == 0);
     if (!$this->isJFBConnectInstalled) {
         if ($this->params->get('loadJQuery')) {
             $this->doc->addScript(JURI::base(true) . '/media/sourcecoast/js/jq-bootstrap-1.8.3.js');
         }
         if ($needsBootstrap || $this->tfaLoaded) {
             $this->doc->addScriptDeclaration('if (typeof jfbcJQuery == "undefined") jfbcJQuery = jQuery;');
         }
     }
     if ($this->tfaLoaded) {
         $this->doc->addScript(Juri::base(true) . '/media/sourcecoast/js/mod_sclogin.js');
         $this->doc->addScriptDeclaration('sclogin.token = "' . JSession::getFormToken() . '";' . "window.onload = function() {\n                    sclogin.init();\n                };\n                sclogin.base = '" . JURI::base() . "';\n");
     }
 }
Example #20
0
        </div>
    </div>
    <!---->
    <!-- Swiper JS -->
    <!--<script src="js/idangerous/swiper.min.js"></script>-->
   <!-- Initialize Swiper -->
    <script>
    //responsive menu
    jQuery(document).ready(function(){
        jQuery('#responsive-menu-button').sidr({
            name: 'sidr',
            source: '#navigation',
            side: 'left',
           forceclick:true
        });
       //flowtype handles responsive text
    //$('body').flowtype();    
    //$('body').flowtype({
      //  minimum   : 800,
       // maximum   : 1200,
       // minFont   : 12,
        //maxFont   : 40,
        //fontRatio : 30
    //});
});
    </script>
    <?php 
JHtml::script(Juri::base() . 'templates/apaExpo/js/main.js', $mootools);
?>
</body>
</html>
<?php

$document = JFactory::getDocument();
$document->addScript(Juri::base(true) . '/plugins/content/plg_clm_sbnrw_ext/under.js');
Example #22
0
 public static function getItems($cid, &$params, $counttotal = false)
 {
     jimport('joomla.filesystem.file');
     $mainframe = JFactory::getApplication();
     $app = JFactory::getApplication();
     $appParams = $app->getParams();
     $itemCount = '';
     $limit = 0;
     $limitation = $params->get('itemCount');
     $start = $app->input->getInt('ajax_reslisting_start', 0);
     if (isset($limitation) && (int) $limitation >= 0) {
         $limit = (int) $limitation;
     }
     //$limit = $params->get('itemCount', 5);
     //$cid = $params->get('category_id', NULL);
     $ordering = $params->get('itemsOrdering', '');
     $componentParams = JComponentHelper::getParams('com_k2');
     $limitstart = JRequest::getInt('limitstart');
     $user = JFactory::getUser();
     $aid = $user->get('aid');
     $db = JFactory::getDBO();
     $jnow = JFactory::getDate();
     $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
     $nullDate = $db->getNullDate();
     $query = "SELECT i.*, CASE WHEN i.modified = 0 THEN i.created ELSE i.modified END as lastChanged, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams";
     if ($ordering == 'best') {
         $query .= ", (r.rating_sum/r.rating_count) AS rating";
     }
     if ($ordering == 'comments') {
         $query .= ", COUNT(comments.id) AS numOfComments";
     }
     $query .= " FROM #__k2_items as i RIGHT JOIN #__k2_categories c ON c.id = i.catid";
     if ($ordering == 'best') {
         $query .= " LEFT JOIN #__k2_rating r ON r.itemID = i.id";
     }
     if ($ordering == 'comments') {
         $query .= " LEFT JOIN #__k2_comments comments ON comments.itemID = i.id";
     }
     if (K2_JVERSION != '15') {
         $query .= " WHERE i.published = 1 AND i.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ") AND i.trash = 0 AND c.published = 1 AND c.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ")  AND c.trash = 0";
     } else {
         $query .= " WHERE i.published = 1 AND i.access <= {$aid} AND i.trash = 0 AND c.published = 1 AND c.access <= {$aid} AND c.trash = 0";
     }
     $query .= " AND ( i.publish_up = " . $db->Quote($nullDate) . " OR i.publish_up <= " . $db->Quote($now) . " )";
     $query .= " AND ( i.publish_down = " . $db->Quote($nullDate) . " OR i.publish_down >= " . $db->Quote($now) . " )";
     if (!is_null($cid)) {
         if (is_array($cid)) {
             $catidpreload = $params->get('category_preload');
             $list = self::getCategoriesFull($cid, $params);
             $catids = array();
             if (!empty($list)) {
                 foreach ($list as $item) {
                     $catids[] = $item->id;
                 }
             }
             if (in_array($catidpreload, $catids)) {
                 array_unshift($catids, $catidpreload);
             }
             $cids = array_unique($catids);
             JArrayHelper::toInteger($cids);
             $query .= " AND i.catid IN(" . implode(',', $cids) . ")";
         }
     }
     if ($params->get('FeaturedItems') == '0') {
         $query .= " AND i.featured != 1";
     }
     if ($params->get('FeaturedItems') == '2') {
         $query .= " AND i.featured = 1";
     }
     if ($params->get('videosOnly')) {
         $query .= " AND (i.video IS NOT NULL AND i.video!='')";
     }
     if ($ordering == 'comments') {
         $query .= " AND comments.published = 1";
     }
     if (K2_JVERSION != '15') {
         if ($mainframe->getLanguageFilter()) {
             $languageTag = JFactory::getLanguage()->getTag();
             $query .= " AND c.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ") AND i.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ")";
         }
     }
     switch ($ordering) {
         case 'date':
             $orderby = 'i.created ASC';
             break;
         case 'rdate':
             $orderby = 'i.created DESC';
             break;
         case 'alpha':
             $orderby = 'i.title';
             break;
         case 'ralpha':
             $orderby = 'i.title DESC';
             break;
         case 'order':
             if ($params->get('FeaturedItems') == '2') {
                 $orderby = 'i.featured_ordering';
             } else {
                 $orderby = 'i.ordering';
             }
             break;
         case 'rorder':
             if ($params->get('FeaturedItems') == '2') {
                 $orderby = 'i.featured_ordering DESC';
             } else {
                 $orderby = 'i.ordering DESC';
             }
             break;
         case 'hits':
             if ($params->get('popularityRange')) {
                 $datenow = JFactory::getDate();
                 $date = K2_JVERSION == '15' ? $datenow->toMySQL() : $datenow->toSql();
                 $query .= " AND i.created > DATE_SUB('{$date}',INTERVAL " . $params->get('popularityRange') . " DAY) ";
             }
             $orderby = 'i.hits DESC';
             break;
         case 'rand':
             $orderby = 'RAND()';
             break;
         case 'best':
             $orderby = 'rating DESC';
             break;
         case 'comments':
             if ($params->get('popularityRange')) {
                 $datenow = JFactory::getDate();
                 $date = K2_JVERSION == '15' ? $datenow->toMySQL() : $datenow->toSql();
                 $query .= " AND i.created > DATE_SUB('{$date}',INTERVAL " . $params->get('popularityRange') . " DAY) ";
             }
             $query .= " GROUP BY i.id ";
             $orderby = 'numOfComments DESC';
             break;
         case 'modified':
             $orderby = 'lastChanged DESC';
             break;
         case 'publishUp':
             $orderby = 'i.publish_up DESC';
             break;
         default:
             $orderby = 'i.id DESC';
             break;
     }
     $query .= " ORDER BY " . $orderby;
     if ($counttotal) {
         $db->setQuery($query);
         $items = $db->loadObjectList();
         return count($items);
     } else {
         $db->setQuery($query, $start, $limit);
         $items = $db->loadObjectList();
     }
     $model = K2Model::getInstance('Item', 'K2Model');
     if (count($items)) {
         foreach ($items as $item) {
             $item->event = new stdClass();
             //Clean title
             $item->title = JFilterOutput::ampReplace($item->title);
             //Images
             if ($params->get('itemImage')) {
                 $date = JFactory::getDate($item->modified);
                 $timestamp = '?t=' . $date->toUnix();
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_XS.jpg')) {
                     $item->imageXSmall = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_XS.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageXSmall .= $timestamp;
                     }
                 }
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_S.jpg')) {
                     $item->imageSmall = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_S.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageSmall .= $timestamp;
                     }
                 }
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_M.jpg')) {
                     $item->imageMedium = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_M.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageMedium .= $timestamp;
                     }
                 }
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_L.jpg')) {
                     $item->imageLarge = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_L.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageLarge .= $timestamp;
                     }
                 }
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_XL.jpg')) {
                     $item->imageXLarge = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_XL.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageXLarge .= $timestamp;
                     }
                 }
                 if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $item->id) . '_Generic.jpg')) {
                     $item->imageGeneric = JURI::base(true) . '/media/k2/items/cache/' . md5("Image" . $item->id) . '_Generic.jpg';
                     if ($componentParams->get('imageTimestamp')) {
                         $item->imageGeneric .= $timestamp;
                     }
                 }
                 $image = 'image' . $params->get('itemImgSize', 'Small');
                 if (isset($item->{$image})) {
                     $item->image = $item->{$image};
                 }
             }
             //Read more link
             $item->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id . ':' . urlencode($item->alias), $item->catid . ':' . urlencode($item->categoryalias))));
             //Tags
             if ($params->get('itemTags')) {
                 $tags = $model->getItemTags($item->id);
                 for ($i = 0; $i < sizeof($tags); $i++) {
                     $tags[$i]->link = JRoute::_(K2HelperRoute::getTagRoute($tags[$i]->name));
                 }
                 $item->tags = $tags;
             }
             //Category link
             //if ($params->get('itemCategory'))
             $item->categoryLink = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($item->catid . ':' . urlencode($item->categoryalias))));
             //Extra fields
             if ($params->get('itemExtraFields')) {
                 $item->extra_fields = $model->getItemExtraFields($item->extra_fields, $item);
             }
             //Comments counter
             //if ($params->get('itemCommentsCounter'))
             $item->numOfComments = $model->countItemComments($item->id);
             $item->rating = $model->getRating($item->id);
             //Attachments
             if ($params->get('itemAttachments')) {
                 $item->attachments = $model->getItemAttachments($item->id);
             }
             //Import plugins
             // if ($format != 'feed')
             // {
             // $dispatcher = JDispatcher::getInstance();
             // JPluginHelper::importPlugin('content');
             // }
             //Video
             if ($params->get('itemVideo') && $format != 'feed') {
                 $params->set('vfolder', 'media/k2/videos');
                 $params->set('afolder', 'media/k2/audio');
                 $item->text = $item->video;
                 if (K2_JVERSION == '15') {
                     $dispatcher->trigger('onPrepareContent', array(&$item, &$params, $limitstart));
                 } else {
                     $dispatcher->trigger('onContentPrepare', array('mod_k2_content.', &$item, &$params, $limitstart));
                 }
                 $item->video = $item->text;
             }
             // Introtext
             $item->text = $item->introtext;
             // if ($params->get('itemIntroText'))
             // {
             // // Word limit
             // if ($params->get('itemIntroTextWordLimit'))
             // {
             // $item->text .= K2HelperUtilities::wordLimit($item->introtext, $params->get('itemIntroTextWordLimit'));
             // }
             // else
             // {
             // $item->text .= $item->introtext;
             // }
             // }
             // if ($format != 'feed')
             // {
             // $params->set('parsedInModule', 1);
             // // for plugins to know when they are parsed inside this module
             // if ($params->get('JPlugins', 1))
             // {
             // //Plugins
             // if (K2_JVERSION != '15')
             // {
             // $item->event->BeforeDisplay = '';
             // $item->event->AfterDisplay = '';
             // $dispatcher->trigger('onContentPrepare', array('mod_k2_content', &$item, &$params, $limitstart));
             // $results = $dispatcher->trigger('onContentAfterTitle', array('mod_k2_content', &$item, &$params, $limitstart));
             // $item->event->AfterDisplayTitle = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onContentBeforeDisplay', array('mod_k2_content', &$item, &$params, $limitstart));
             // $item->event->BeforeDisplayContent = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onContentAfterDisplay', array('mod_k2_content', &$item, &$params, $limitstart));
             // $item->event->AfterDisplayContent = trim(implode("\n", $results));
             // }
             // else
             // {
             // $results = $dispatcher->trigger('onBeforeDisplay', array(&$item, &$params, $limitstart));
             // $item->event->BeforeDisplay = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onAfterDisplay', array(&$item, &$params, $limitstart));
             // $item->event->AfterDisplay = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onAfterDisplayTitle', array(&$item, &$params, $limitstart));
             // $item->event->AfterDisplayTitle = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onBeforeDisplayContent', array(&$item, &$params, $limitstart));
             // $item->event->BeforeDisplayContent = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onAfterDisplayContent', array(&$item, &$params, $limitstart));
             // $item->event->AfterDisplayContent = trim(implode("\n", $results));
             // $dispatcher->trigger('onPrepareContent', array(&$item, &$params, $limitstart));
             // }
             // }
             // //Init K2 plugin events
             // $item->event->K2BeforeDisplay = '';
             // $item->event->K2AfterDisplay = '';
             // $item->event->K2AfterDisplayTitle = '';
             // $item->event->K2BeforeDisplayContent = '';
             // $item->event->K2AfterDisplayContent = '';
             // $item->event->K2CommentsCounter = '';
             // if ($params->get('K2Plugins', 1))
             // {
             // //K2 plugins
             // JPluginHelper::importPlugin('k2');
             // $results = $dispatcher->trigger('onK2BeforeDisplay', array(&$item, &$params, $limitstart));
             // $item->event->K2BeforeDisplay = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onK2AfterDisplay', array(&$item, &$params, $limitstart));
             // $item->event->K2AfterDisplay = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onK2AfterDisplayTitle', array(&$item, &$params, $limitstart));
             // $item->event->K2AfterDisplayTitle = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onK2BeforeDisplayContent', array(&$item, &$params, $limitstart));
             // $item->event->K2BeforeDisplayContent = trim(implode("\n", $results));
             // $results = $dispatcher->trigger('onK2AfterDisplayContent', array(&$item, &$params, $limitstart));
             // $item->event->K2AfterDisplayContent = trim(implode("\n", $results));
             // $dispatcher->trigger('onK2PrepareContent', array(&$item, &$params, $limitstart));
             // if ($params->get('itemCommentsCounter'))
             // {
             // $results = $dispatcher->trigger('onK2CommentsCounter', array(&$item, &$params, $limitstart));
             // $item->event->K2CommentsCounter = trim(implode("\n", $results));
             // }
             // }
             // }
             // Restore the intotext variable after plugins execution
             $item->introtext = $item->text;
             //Clean the plugin tags
             $item->introtext = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $item->introtext);
             //Author
             if ($params->get('itemAuthor')) {
                 if (!empty($item->created_by_alias)) {
                     $item->author = $item->created_by_alias;
                     $item->authorGender = NULL;
                     $item->authorDescription = NULL;
                     if ($params->get('itemAuthorAvatar')) {
                         $item->authorAvatar = K2HelperUtilities::getAvatar('alias');
                     }
                     $item->authorLink = Juri::root(true);
                 } else {
                     $author = JFactory::getUser($item->created_by);
                     $item->author = $author->name;
                     $query = "SELECT `description`, `gender` FROM #__k2_users WHERE userID=" . (int) $author->id;
                     $db->setQuery($query, 0, 1);
                     $result = $db->loadObject();
                     if ($result) {
                         $item->authorGender = $result->gender;
                         $item->authorDescription = $result->description;
                     } else {
                         $item->authorGender = NULL;
                         $item->authorDescription = NULL;
                     }
                     if ($params->get('itemAuthorAvatar')) {
                         $item->authorAvatar = K2HelperUtilities::getAvatar($author->id, $author->email, $componentParams->get('userImageWidth'));
                     }
                     //Author Link
                     $item->authorLink = JRoute::_(K2HelperRoute::getUserRoute($item->created_by));
                 }
             }
             // Extra fields plugins
             if (is_array($item->extra_fields)) {
                 foreach ($item->extra_fields as $key => $extraField) {
                     if ($extraField->type == 'textarea' || $extraField->type == 'textfield') {
                         $tmp = new JObject();
                         $tmp->text = $extraField->value;
                         if ($params->get('JPlugins', 1)) {
                             if (K2_JVERSION != '15') {
                                 $dispatcher->trigger('onContentPrepare', array('mod_k2_content', &$tmp, &$params, $limitstart));
                             } else {
                                 $dispatcher->trigger('onPrepareContent', array(&$tmp, &$params, $limitstart));
                             }
                         }
                         if ($params->get('K2Plugins', 1)) {
                             $dispatcher->trigger('onK2PrepareContent', array(&$tmp, &$params, $limitstart));
                         }
                         $extraField->value = $tmp->text;
                     }
                 }
             }
             $rows[] = $item;
         }
         return $rows;
     }
 }
Example #23
0
/**
 * @package		Skillset
 * @subpackage	Skillset
 * @author		Joomla Bamboo - design@joomlabamboo.com
 * @copyright 	Copyright (c) 2014 Joomla Bamboo. All rights reserved.
 * @license		GNU General Public License version 2 or later
 * @version		1.0.0
 */
// no direct access
defined('_JEXEC') or die;
// include the syndicate functions only once
require_once dirname(__FILE__) . '/helper.php';
$class_sfx = htmlspecialchars($params->get('class_sfx'));
$display = $params->get('display');
if ($params->get('css-load')) {
    JHtml::stylesheet(Juri::base() . 'modules/mod_skillset/css/skillset.css');
}
if ($params->get('jquery-load')) {
    JLoader::import('joomla.version');
    $version = new JVersion();
    if (version_compare($version->RELEASE, '2.5', '<=')) {
        if (JFactory::getApplication()->get('jquery') !== true) {
            // load jQuery here
            JFactory::getApplication()->set('jquery', true);
        }
    } else {
        JHtml::_('jquery.framework');
    }
}
if ($display == "count") {
    require JModuleHelper::getLayoutPath('mod_skillset', $params->get('layout', 'count'));
Example #24
0
// Main container. To add Module class suffix in this container, add the PHP var $moduleclass_sfx
echo '<div class="lastworks-container lastworks-one-column">';
if (count($articles)) {
    foreach ($articles as $article) {
        //<-- ARTICLE LOOP.
        $images = json_decode($article->images);
        $category = modLastWorksHelper::getCategoryLW($article->catid);
        echo '<div class="lastworks-row row-fluid">
				<div class="lastworks-item span12">';
        // Title of the article
        echo '<h3>' . $article->title . '</h3>';
        // Category of the article
        /*echo '<ul class="breadcrumb">
        			<li>' . JText::_('JCATEGORY') . ': ' . JHtml::_('link', ContentHelperRoute::getCategoryRoute($article->catid), $category) . '</li>
        		</ul>';*/
        // Intro image of the article. display image only when exist in the Article >> Images & Links >> Intro Image
        if ($images->image_intro) {
            echo JHtml::_('image', Juri::base() . $images->image_intro, 'alt="' . $article->title . '"');
        }
        // Intro Text of the article
        echo $article->introtext;
        // Read more link
        echo '<p>' . JHtml::_('link', ContentHelperRoute::getArticleRoute($article->id), JText::_('MOD_LASTWORKS_READMORE', $article->catid), 'class="btn"') . '</p>';
        echo '</div>
			</div>';
    }
    //.ARTICLE LOOP -->
} else {
    echo '<div class="alert alert-block">' . JText::_('MOD_LASTWORKS_NO_ARTICLES_FOUND') . '</div>';
}
echo '</div>';
Example #25
0
 function plgVmOnSelfCallFE($type, $name, &$render)
 {
     //Klarna Ajax
     require JPATH_VMKLARNAPLUGIN . '/klarna/helpers/klarna_ajax.php';
     if (!class_exists('VmModel')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'vmmodel.php';
     }
     $model = VmModel::getModel('paymentmethod');
     $payment = $model->getPayment();
     if (!class_exists('vmParameters')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'parameterparser.php';
     }
     $parameters = new vmParameters($payment, $payment->payment_element, 'plugin', 'vmpayment');
     $method = $parameters->getParamByName('data');
     $country = JRequest::getWord('country');
     $country = KlarnaHandler::convertToThreeLetterCode($country);
     if (!class_exists('klarna_virtuemart')) {
         require JPATH_VMKLARNAPLUGIN . '/klarna/helpers/klarna_virtuemart.php';
     }
     $settings = KlarnaHandler::getCountryData($method, $country);
     $klarna = new Klarna_virtuemart();
     $klarna->config($settings['eid'], $settings['secret'], $settings['country'], $settings['language'], $settings['currency'], KlarnaHandler::getKlarnaMode($method), VMKLARNA_PC_TYPE, KlarnaHandler::getKlarna_pc_type(), true);
     $SelfCall = new KlarnaAjax($klarna, (int) $settings['eid'], JPATH_VMKLARNAPLUGIN, Juri::base());
     $action = JRequest::getWord('action');
     $jlang = JFactory::getLanguage();
     $currentLang = substr($jlang->getDefault(), 0, 2);
     $newIso = JRequest::getWord('newIso');
     if ($currentLang != $newIso) {
         $iso = array("sv" => "sv-SE", "da" => "da-DK", "en" => "en-GB", "de" => "de-DE", "nl" => "nl-NL", "nb" => "nb-NO", "fi" => "fi-FI");
         if (array_key_exists($newIso, $iso)) {
             $jlang->load('plg_vmpayment_klarna', JPATH_ADMINISTRATOR, $iso[$newIso], true);
         }
     }
     echo $SelfCall->{$action}();
     jexit();
 }
<?php

/**
 * B-Accessibility Module Entry Point
 * 
 * @package    Joomla
 * @subpackage Modules
 * @license    GNU/GPL, see LICENSE.php
 * mod_baccessibility is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */
// No direct access
defined('_JEXEC') or die;
// Include the syndicate functions only once
require_once dirname(__FILE__) . '/helper.php';
$doc = JFactory::getDocument();
$modBaseUrl = Juri::base() . 'modules/mod_baccessibility';
$doc->addStyleSheet($modBaseUrl . '/asset/css/style.css');
if ($params->get('use_awesome')) {
    $doc->addStyleSheet($params['awesome_path']);
}
//$doc->addScript( $modBaseUrl . '/asset/js/toolbar.js' );
$doc->addScript($modBaseUrl . '/asset/js/baccessibility.jquery.js');
$doc->addScript($modBaseUrl . '/asset/js/grayscale.js');
require JModuleHelper::getLayoutPath('mod_baccessibility');
Example #27
0
 public static function getListItems($cid, &$params)
 {
     $mainframe = JFactory::getApplication();
     $limit = $params->get('itemCount', 5);
     $ordering = $params->get('itemsOrdering', '');
     $user = JFactory::getUser();
     $aid = $user->get('aid');
     $db = JFactory::getDBO();
     $jnow = JFactory::getDate();
     $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
     $nullDate = $db->getNullDate();
     $query = "SELECT i.*, CASE WHEN i.modified = 0 THEN i.created ELSE i.modified END as lastChanged, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams";
     if ($ordering == 'best') {
         $query .= ", (r.rating_sum/r.rating_count) AS rating";
     }
     if ($ordering == 'comments') {
         $query .= ", COUNT(comments.id) AS numOfComments";
     }
     $query .= " FROM #__k2_items as i RIGHT JOIN #__k2_categories c ON c.id = i.catid";
     if ($ordering == 'best') {
         $query .= " LEFT JOIN #__k2_rating r ON r.itemID = i.id";
     }
     if ($ordering == 'comments') {
         $query .= " LEFT JOIN #__k2_comments comments ON comments.itemID = i.id";
     }
     if (K2_JVERSION != '15') {
         $query .= " WHERE i.published = 1 AND i.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ") AND i.trash = 0 AND c.published = 1 AND c.access IN(" . implode(',', $user->getAuthorisedViewLevels()) . ")  AND c.trash = 0";
     } else {
         $query .= " WHERE i.published = 1 AND i.access <= {$aid} AND i.trash = 0 AND c.published = 1 AND c.access <= {$aid} AND c.trash = 0";
     }
     $query .= " AND ( i.publish_up = " . $db->Quote($nullDate) . " OR i.publish_up <= " . $db->Quote($now) . " )";
     $query .= " AND ( i.publish_down = " . $db->Quote($nullDate) . " OR i.publish_down >= " . $db->Quote($now) . " )";
     if (!is_null($cid)) {
         if (is_array($cid)) {
             if ($params->get('getChildren')) {
                 $itemListModel = K2Model::getInstance('Itemlist', 'K2Model');
                 $categories = $itemListModel->getCategoryTree($cid);
                 $sql = @implode(',', $categories);
                 $query .= " AND i.catid IN ({$sql})";
             } else {
                 JArrayHelper::toInteger($cid);
                 $query .= " AND i.catid IN(" . implode(',', $cid) . ")";
             }
         } else {
             if ($params->get('getChildren')) {
                 $itemListModel = K2Model::getInstance('Itemlist', 'K2Model');
                 $categories = $itemListModel->getCategoryTree($cid);
                 $sql = @implode(',', $categories);
                 $query .= " AND i.catid IN ({$sql})";
             } else {
                 $query .= " AND i.catid=" . (int) $cid;
             }
         }
     }
     if ($params->get('FeaturedItems') == '0') {
         $query .= " AND i.featured != 1";
     }
     if ($params->get('FeaturedItems') == '2') {
         $query .= " AND i.featured = 1";
     }
     if ($params->get('videosOnly')) {
         $query .= " AND (i.video IS NOT NULL AND i.video!='')";
     }
     if ($ordering == 'comments') {
         $query .= " AND comments.published = 1";
     }
     if (K2_JVERSION != '15') {
         if ($mainframe->getLanguageFilter()) {
             $languageTag = JFactory::getLanguage()->getTag();
             $query .= " AND c.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ") AND i.language IN (" . $db->Quote($languageTag) . ", " . $db->Quote('*') . ")";
         }
     }
     switch ($ordering) {
         case 'date':
             $orderby = 'i.created ASC';
             break;
         case 'rdate':
             $orderby = 'i.created DESC';
             break;
         case 'alpha':
             $orderby = 'i.title';
             break;
         case 'ralpha':
             $orderby = 'i.title DESC';
             break;
         case 'order':
             if ($params->get('FeaturedItems') == '2') {
                 $orderby = 'i.featured_ordering';
             } else {
                 $orderby = 'i.ordering';
             }
             break;
         case 'rorder':
             if ($params->get('FeaturedItems') == '2') {
                 $orderby = 'i.featured_ordering DESC';
             } else {
                 $orderby = 'i.ordering DESC';
             }
             break;
         case 'hits':
             if ($params->get('popularityRange')) {
                 $datenow = JFactory::getDate();
                 $date = K2_JVERSION == '15' ? $datenow->toMySQL() : $datenow->toSql();
                 $query .= " AND i.created > DATE_SUB('{$date}',INTERVAL " . $params->get('popularityRange') . " DAY) ";
             }
             $orderby = 'i.hits DESC';
             break;
         case 'rand':
             $orderby = 'RAND()';
             break;
         case 'best':
             $orderby = 'rating DESC';
             break;
         case 'comments':
             if ($params->get('popularityRange')) {
                 $datenow = JFactory::getDate();
                 $date = K2_JVERSION == '15' ? $datenow->toMySQL() : $datenow->toSql();
                 $query .= " AND i.created > DATE_SUB('{$date}',INTERVAL " . $params->get('popularityRange') . " DAY) ";
             }
             $query .= " GROUP BY i.id ";
             $orderby = 'numOfComments DESC';
             break;
         case 'modified':
             $orderby = 'lastChanged DESC';
             break;
         case 'publishUp':
             $orderby = 'i.publish_up DESC';
             break;
         default:
             $orderby = 'i.id DESC';
             break;
     }
     $query .= " ORDER BY " . $orderby;
     $db->setQuery($query, 0, $limit);
     $items = $db->loadObjectList();
     $model = K2Model::getInstance('Item', 'K2Model');
     $show_introtext = $params->get('item_desc_display', 0);
     $introtext_limit = $params->get('item_desc_max_characs', 100);
     $show_title = $params->get('item_title_display', 1);
     $title_limit = $params->get('item_title_max_characs', 20);
     $item_title_ending_char = $params->get('item_title_ending_char', '');
     $item_desc_ending_char = $params->get('item_desc_ending_char', '');
     $show_other_title = $params->get('other_title_display', 1);
     $other_title_limit = $params->get('other_title_max_characs', 20);
     $other_item_title_ending_char = $params->get('other_item_title_ending_char', '');
     if (count($items)) {
         foreach ($items as $item) {
             //Clean title
             $item->title = JFilterOutput::ampReplace($item->title);
             $item->displaytitle = $show_title ? self::truncate($item->title, $title_limit, $item_title_ending_char) : '';
             //Read more link
             $item->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id . ':' . urlencode($item->alias), $item->catid . ':' . urlencode($item->categoryalias))));
             //Author
             if (!empty($item->created_by_alias)) {
                 $item->author = $item->created_by_alias;
                 $item->authorGender = NULL;
                 $item->authorDescription = NULL;
                 if ($params->get('itemAuthorAvatar')) {
                     $item->authorAvatar = K2HelperUtilities::getAvatar('alias');
                 }
                 $item->authorLink = Juri::root(true);
             } else {
                 $author = JFactory::getUser($item->created_by);
                 $item->author = $author->name;
                 $query = "SELECT `description`, `gender` FROM #__k2_users WHERE userID=" . (int) $author->id;
                 $db->setQuery($query, 0, 1);
                 $result = $db->loadObject();
                 if ($result) {
                     $item->authorGender = $result->gender;
                     $item->authorDescription = $result->description;
                 } else {
                     $item->authorGender = NULL;
                     $item->authorDescription = NULL;
                 }
                 if ($params->get('itemAuthorAvatar')) {
                     $item->authorAvatar = K2HelperUtilities::getAvatar($author->id, $author->email, $componentParams->get('userImageWidth'));
                 }
                 //Author Link
                 $item->authorLink = JRoute::_(K2HelperRoute::getUserRoute($item->created_by));
             }
             //Tags
             $item->tags = '';
             if ($params->get('item_tags_display')) {
                 $tags = $model->getItemTags($item->id);
                 for ($i = 0; $i < sizeof($tags); $i++) {
                     $tags[$i]->link = JRoute::_(K2HelperRoute::getTagRoute($tags[$i]->name));
                 }
                 $item->tags = $tags;
             }
             // Restore the intotext variable after plugins execution
             self::getK2Images($item, $params);
             //Clean the plugin tags
             $item->introtext = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $item->introtext);
             if ($item->fulltext != '') {
                 $item->fulltext = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $item->fulltext);
                 $item->_introtext = self::_cleanText($item->introtext . $item->fulltext);
             } else {
                 $item->_introtext = self::_cleanText($item->introtext);
             }
             $item->displayIntrotext = $show_introtext ? self::truncate($item->_introtext, $introtext_limit, $item_desc_ending_char) : '';
             $item->othertitle = self::truncate($item->title, $other_title_limit, $other_item_title_ending_char);
             $rows[] = $item;
         }
         return $rows;
     }
 }
Example #28
0
		<div class="com_bookingforconnector_resource-image">
			<img src="<?php 
    echo BFCHelper::getImageUrl('onsellunits', $images[0], 'resource_mono_full_rapidview');
    ?>
" />
		</div>
		<?php 
}
?>
		</div>
		<div class="<?php 
echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL;
?>
6" id="divmapstatic">
			<img src="<?php 
echo Juri::base();
?>
images/nomap.jpg" alt="nomap.jpg" style="max-width:100%;" />
		</div>
	</div>
	<!--  -->
	<div class="details" >
		<div class="<?php 
echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW;
?>
" >
			<div class="<?php 
echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL;
?>
6">
				<div style="padding:5px;">
Example #29
0
<?php

defined('_JEXEC') or die;
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
require JModuleHelper::getLayoutPath('mod_grandsocial', $params->get('layout', 'default'));
// Add Params
$app = JFactory::getApplication();
$params = $app->getParams();
// Add Style
$doc = JFactory::getDocument();
$doc->AddStyleSheet(Juri::root() . 'modules/mod_grandsocial/css/font-awesome.min.css');
$doc->AddStyleSheet(Juri::root() . 'modules/mod_grandsocial/css/grand.css');
Example #30
0
 function getUrl()
 {
     static $myurl;
     if (!empty($myurl)) {
         return $myurl;
     }
     if (!class_exists('VmConfig')) {
         require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
     }
     VmConfig::loadConfig();
     $useSSL = VmConfig::get('useSSL', 0);
     $root = Juri::root();
     if (substr($root, -1) != '/') {
         $root .= '/';
     }
     $root = str_replace('administrator/', '', $root);
     if ($useSSL) {
         $root = str_replace('http:', 'https:', $root);
     }
     $myurl = $root;
     return $root;
 }