Example #1
1
	function __construct() {
		
		$app	= JFactory::getApplication();
		
		parent::__construct();
		
		$config = JFactory::getConfig();		
		
		$paramsC 			= JComponentHelper::getParams('com_phocadownload') ;
		$defaultPagination	= $paramsC->get( 'default_pagination', '20' );
		$file_ordering		= $paramsC->get( 'file_ordering', 1 );
		$context			= $this->_context.'.';
		
		// Get the pagination request variables
		$this->setState('limit', $app->getUserStateFromRequest($context.'limit', 'limit', $defaultPagination, 'int'));
		$this->setState('limitstart', $app->input->get('limitstart', 0, 'int'));

		// In case limit has been changed, adjust limitstart accordingly
		$this->setState('limitstart', ($this->getState('limit') != 0 ? (floor($this->getState('limitstart') / $this->getState('limit')) * $this->getState('limit')) : 0));
		
		$this->setState('filter.language',$app->getLanguageFilter());
		
		$this->setState('fileordering', $app->getUserStateFromRequest($context .'fileordering', 'fileordering', $file_ordering, 'int'));

		// Get the filter request variables
		$this->setState('filter_order', JRequest::getCmd('filter_order', 'ordering'));
		$this->setState('filter_order_dir', JRequest::getCmd('filter_order_Dir', 'ASC'));
		
	}
 /**
  * Method to load the Chosen JavaScript framework and supporting CSS into the document head
  *
  * If debugging mode is on an uncompressed version of Chosen is included for easier debugging.
  *
  * @param   string  $selector  Class for Chosen elements.
  * @param   mixed   $debug     Is debugging mode on? [optional]
  * @param   array   $options   the possible Chosen options as name => value [optional]
  *
  * @return  void
  *
  * @since   3.0
  */
 public static function chosen($selector = '.advancedSelect', $debug = null, $options = array())
 {
     if (isset(static::$loaded[__METHOD__][$selector])) {
         return;
     }
     // If no debugging value is set, use the configuration setting
     if ($debug === null) {
         $config = JFactory::getConfig();
         $debug = (bool) $config->get('debug');
     }
     // Default settings
     if (!isset($options['disable_search_threshold'])) {
         $options['disable_search_threshold'] = 10;
     }
     // Allow searching contains space in query
     if (!isset($options['search_contains'])) {
         $options['search_contains'] = true;
     }
     if (!isset($options['allow_single_deselect'])) {
         $options['allow_single_deselect'] = true;
     }
     if (!isset($options['placeholder_text_multiple'])) {
         $options['placeholder_text_multiple'] = JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS');
     }
     if (!isset($options['placeholder_text_single'])) {
         $options['placeholder_text_single'] = JText::_('JGLOBAL_SELECT_AN_OPTION');
     }
     if (!isset($options['no_results_text'])) {
         $options['no_results_text'] = JText::_('JGLOBAL_SELECT_NO_RESULTS_MATCH');
     }
     $displayData = array('debug' => $debug, 'options' => $options, 'selector' => $selector);
     JLayoutHelper::render('joomla.html.formbehavior.chosen', $displayData);
     static::$loaded[__METHOD__][$selector] = true;
     return;
 }
Example #3
1
 function addEvForm()
 {
     $listid = JRequest::getInt('listid');
     $viewName = 'calendar';
     $usersConfig = JComponentHelper::getParams('com_fabrik');
     $model =& $this->getModel($viewName);
     $id = JRequest::getInt('visualizationid', $usersConfig->get('visualizationid', 0));
     $model->setId($id);
     $model->setupEvents();
     if (array_key_exists($listid, $model->_events)) {
         $datefield = $model->_events[$listid][0]['startdate'];
     } else {
         $config = JFactory::getConfig();
         $prefix = $config->getValue('config.dbprefix');
         $datefield = $prefix . 'fabrik_calendar_events___start_date';
     }
     $rowid = JRequest::getInt('rowid');
     $listModel = JModel::getInstance('list', 'FabrikFEModel');
     $listModel->setId($listid);
     $table = $listModel->getTable();
     JRequest::setVar('view', 'form');
     JRequest::setVar('formid', $table->form_id);
     JRequest::setVar('tmpl', 'component');
     JRequest::setVar('ajax', '1');
     $link = 'index.php?option=com_fabrik&view=form&formid=' . $table->form_id . '&rowid=' . $rowid . '&tmpl=component&ajax=1';
     $link .= '&jos_fabrik_calendar_events___visualization_id=' . JRequest::getInt('jos_fabrik_calendar_events___visualization_id');
     $start_date = JRequest::getVar('start_date', '');
     if (!empty($start_date)) {
         $link .= "&{$datefield}=" . $start_date;
     }
     // $$$ rob have to add this to stop the calendar filtering itself after adding an new event?
     $link .= '&clearfilters=1';
     $this->setRedirect($link);
 }
Example #4
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..
 }
Example #5
0
 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         $this->SetViewTitle('', $this->item->title);
         $this->addStandardEditViewCommandsPopup();
     } else {
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommandsEditInline();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->items = $model->getItemList(vRequest::getCmd('search', false));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
 /**
  * constructs a VmModel
  * setMainTable defines the maintable of the model
  * @author Max Milbers
  */
 function __construct()
 {
     parent::__construct('virtuemart_manufacturercategories_id');
     $this->setMainTable('manufacturercategories');
     $this->addvalidOrderingFieldName(array('mf_category_name'));
     $config = JFactory::getConfig();
 }
Example #7
0
 public function postflight($type, $parent)
 {
     // Clear Joomla system cache.
     /** @var JCache|JCacheController $cache */
     $cache = JFactory::getCache();
     $cache->clean('_system');
     // Clear Gantry5 cache.
     $path = JFactory::getConfig()->get('cache_path', JPATH_SITE . '/cache') . '/gantry5';
     if (is_dir($path)) {
         JFolder::delete($path);
     }
     // Make sure that PHP has the latest data of the files.
     clearstatcache();
     // Remove all compiled files from opcode cache.
     if (function_exists('opcache_reset')) {
         @opcache_reset();
     } elseif (function_exists('apc_clear_cache')) {
         @apc_clear_cache();
     }
     if ($type == 'uninstall') {
         return true;
     }
     /** @var JInstallerAdapter $parent */
     $manifest = $parent->getManifest();
     // Enable and lock extensions to prevent uninstalling them individually.
     $this->prepareExtensions($manifest, 1);
     // Make sure that all file formats used by Gantry 5 are editable from template manager.
     $this->adjustTemplateSettings();
     return true;
 }
Example #8
0
	function plgSystemmyApiOpenGraph(&$subject, $config){
		parent::__construct($subject, $config);
		if(!class_exists('plgSystemmyApiConnect')) return;
		
		$cache = & JFactory::getCache('plgSystemmyApiOpenGraph - FB Admins query');
		$cache->setCaching( 1 );
		$config 	=& JFactory::getConfig();
		$connect_plugin 	=& JPluginHelper::getPlugin('system', 'myApiConnect');
		$connect_params 	= new JParameter( $connect_plugin->params );
		
		$plugin =& JPluginHelper::getPlugin('system', 'myApiOpenGraph');
		$plugin_params = new JParameter( $plugin->params );
		
		$db_admins = $cache->call( array( 'plgSystemmyApiOpenGraph', 'getFbAdmins'));
		$param_admins = ($plugin_params->get('fbadmins') != '') ? explode(',',$plugin_params->get('fbadmins')) : array();
		$admins = array_merge($db_admins,$param_admins);
		
		$ogptags_default					= array();
		$ogptags_default['og:title']		= $config->getValue( 'config.sitename' );
		$ogptags_default['og:type'] 		= 'website';
		$ogptags_default['og:url'] 			= JURI::getInstance()->toString();
		$ogptags_default['og:site_name']	= $config->getValue( 'config.sitename' );
		$ogptags_default['fb:app_id'] 		= $connect_params->get('appId');
		$ogptags_default['fb:admins']		= implode(',',$admins);
		if($plugin_params->get('ogimage') != '' && $plugin_params->get('ogimage') != -1) $ogptags_default['og:image'] = JURI::base().'images/'.$plugin_params->get('ogimage');
		if($plugin_params->get('fbpageid') != '') $ogptags_default['fb:page_id'] = $plugin_params->get('fbpageid');
		
		
		plgSystemmyApiOpenGraph::setTags($ogptags_default);
	}
Example #9
0
 /**
  * Loads the configuration from the Joomla! global configuration itself. The component's options are loaded into
  * the options key. For example, an option called foobar is accessible as $config->get('options.foobar');
  *
  * @param string  $filePath Ignored
  * @param Phpfunc $phpfunc  Ignored
  *
  * @return  void
  */
 public function loadConfiguration($filePath = null, Phpfunc $phpfunc = null)
 {
     // Get the Joomla! configuration object
     $jConfig = \JFactory::getConfig();
     // Create the basic configuration data
     $data = array('timezone' => $jConfig->get('offset', 'UTC'), 'fs' => array('driver' => 'file'), 'dateformat' => \JText::_('DATE_FORMAT_LC2'), 'base_url' => \JUri::base() . '/index.php?option=com_' . strtolower($this->container->application_name), 'live_site' => \JUri::base() . '/index.php?option=com_' . strtolower($this->container->application_name), 'cms_url' => \JUri::base(), 'options' => array());
     // Get the Joomla! FTP layer options
     if (!class_exists('JClientHelper')) {
         \JLoader::import('joomla.client.helper');
     }
     $ftpOptions = \JClientHelper::getCredentials('ftp');
     // If the FTP layer is enabled, enable the Hybrid filesystem engine
     if ($ftpOptions['enabled'] == 1) {
         $data['fs'] = array('driver' => 'hybrid', 'host' => $ftpOptions['host'], 'port' => empty($ftpOptions['port']) ? '21' : $ftpOptions['port'], 'directory' => rtrim($ftpOptions['root'], '/\\'), 'ssl' => false, 'passive' => true, 'username' => $ftpOptions['user'], 'password' => $ftpOptions['pass']);
     }
     // Populate the options key with the component configuration
     $db = $this->container->db;
     $sql = $db->getQuery(true)->select($db->qn('params'))->from($db->qn('#__extensions'))->where($db->qn('element') . " = " . $db->q('com_' . strtolower($this->container->application_name)));
     try {
         $configJson = $db->setQuery($sql)->loadResult();
     } catch (\Exception $e) {
         $configJson = null;
     }
     if (!empty($configJson)) {
         $data['options'] = json_decode($configJson, true);
     }
     // Finally, load the data to the registry class
     $this->data = new \stdClass();
     $this->loadArray($data);
 }
Example #10
0
 public function display($tpl = null)
 {
     $this->params = $this->get('Params');
     $this->formId = $this->get('FormId');
     $this->document = JFactory::getDocument();
     $title = $this->params->get('page_title', '');
     if (empty($title)) {
         $title = JFactory::getConfig()->get('sitename');
     } elseif (JFactory::getConfig()->get('sitename_pagetitles', 0) == 1) {
         $title = JText::sprintf('JPAGETITLE', JFactory::getConfig()->get('sitename'), $title);
     } elseif (JFactory::getConfig()->get('sitename_pagetitles', 0) == 2) {
         $title = JText::sprintf('JPAGETITLE', $title, JFactory::getConfig()->get('sitename'));
     }
     $this->document->setTitle($title);
     if ($this->params->get('robots')) {
         $this->document->setMetadata('robots', $this->params->get('robots'));
     }
     if ($this->params->get('menu-meta_description')) {
         $this->document->setDescription($this->params->get('menu-meta_description'));
     }
     if ($this->params->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
     }
     parent::display($tpl);
 }
Example #11
0
 public static function getTableCreate($tables)
 {
     $res = JFactory::getDbo()->getTableCreate($tables);
     $res = str_replace(JFactory::getConfig()->get('dbprefix'), '#__', $res);
     $res = str_replace('CREATE TABLE `#__', 'CREATE TABLE IF NOT EXISTS `#__', $res);
     return $res;
 }
Example #12
0
 /**
  * Method to load the Chosen JavaScript framework and supporting CSS into the document head
  *
  * If debugging mode is on an uncompressed version of Chosen is included for easier debugging.
  *
  * @param   string  $selector  Class for Chosen elements.
  * @param   mixed   $debug     Is debugging mode on? [optional]
  * @param   array   $options   the possible Chosen options as name => value [optional]
  *
  * @return  void
  *
  * @since   3.0
  */
 public static function chosen($selector = '.advancedSelect', $debug = null, $options = array())
 {
     if (isset(static::$loaded[__METHOD__][$selector])) {
         return;
     }
     // Include jQuery
     JHtml::_('jquery.framework');
     // If no debugging value is set, use the configuration setting
     if ($debug === null) {
         $config = JFactory::getConfig();
         $debug = (bool) $config->get('debug');
     }
     // Default settings
     $options['disable_search_threshold'] = isset($options['disable_search_threshold']) ? $options['disable_search_threshold'] : 10;
     $options['allow_single_deselect'] = isset($options['allow_single_deselect']) ? $options['allow_single_deselect'] : true;
     $options['placeholder_text_multiple'] = isset($options['placeholder_text_multiple']) ? $options['placeholder_text_multiple'] : JText::_('JGLOBAL_SELECT_SOME_OPTIONS');
     $options['placeholder_text_single'] = isset($options['placeholder_text_single']) ? $options['placeholder_text_single'] : JText::_('JGLOBAL_SELECT_AN_OPTION');
     $options['no_results_text'] = isset($options['no_results_text']) ? $options['no_results_text'] : JText::_('JGLOBAL_SELECT_NO_RESULTS_MATCH');
     // Options array to json options string
     $options_str = json_encode($options, $debug && defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : false);
     JHtml::_('script', 'jui/chosen.jquery.min.js', false, true, false, false, $debug);
     JHtml::_('stylesheet', 'jui/chosen.css', false, true);
     JFactory::getDocument()->addScriptDeclaration("\r\n\t\t\t\tjQuery(document).ready(function (){\r\n\t\t\t\t\tjQuery('" . $selector . "').chosen(" . $options_str . ");\r\n\t\t\t\t});\r\n\t\t\t");
     static::$loaded[__METHOD__][$selector] = true;
     return;
 }
Example #13
0
 public function __construct($component)
 {
     if (!defined('SOBIPRO')) {
         define('SOBIPRO', true);
         defined('SOBI_CMS') || version_compare(JVERSION, '1.6.0', 'ge') ? define('SOBI_CMS', 'joomla16') : define('SOBI_CMS', 'joomla15');
         defined('SOBI_TASK') || define('SOBI_TASK', 'task');
         defined('SOBI_DEFLANG') || define('SOBI_DEFLANG', JFactory::getConfig()->get('config.language'));
         defined('SOBI_ACL') || define('SOBI_ACL', 'front');
         defined('SOBI_ROOT') || define('SOBI_ROOT', JPATH_ROOT);
         defined('SOBI_MEDIA') || define('SOBI_MEDIA', implode(DIRECTORY_SEPARATOR, array(JPATH_ROOT, 'media', 'sobipro')));
         defined('SOBI_MEDIA_LIVE') || define('SOBI_MEDIA_LIVE', JURI::root() . '/media/sobipro');
         defined('SOBI_PATH') || define('SOBI_PATH', SOBI_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_sobipro');
         defined('SOBI_LIVE_PATH') || define('SOBI_LIVE_PATH', 'components/com_sobipro');
         $this->addFile(SOBI_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'base' . DIRECTORY_SEPARATOR . 'fs' . DIRECTORY_SEPARATOR . 'loader.php');
     }
     SPLoader::loadController('interface');
     SPLoader::loadClass('base.filter');
     SPLoader::loadClass('base.request');
     SPLoader::loadClass('base.const');
     SPLoader::loadClass('base.factory');
     SPLoader::loadClass('base.object');
     SPLoader::loadClass('base.filter');
     SPLoader::loadClass('base.request');
     SPLoader::loadClass('sobi');
     SPLoader::loadClass('base.config');
     SPLoader::loadClass('base.exception');
     SPLoader::loadClass('cms.base.lang');
     SPLoader::loadClass('mlo.input');
     parent::__construct($component);
 }
Example #14
0
function setTitle()
{
    $easyset = AKEasyset::getInstance();
    $doc = JFactory::getDocument();
    $config = JFactory::getConfig();
    $siteName = $config->get('sitename');
    $view = JRequest::getVar('view');
    $title = $doc->getTitle();
    // fix for YOOTheme
    $title = explode('|', $title);
    $title = $title[0];
    if (AKHelper::isHome()) {
        $easyset->_siteTitle = $config->get('sitename');
    } else {
        $separator = trim($easyset->params->get('titleSeparator'));
        $replace['{%SITE%}'] = $siteName;
        $replace['{%TITLE%}'] = $title;
        if ('category' == $view || 'categories' == $view) {
            $replace['{%CATEGORY%}'] = '';
        } else {
            $replace['{%CATEGORY%}'] = $easyset->_catName;
        }
        $siteTitle = strtr($easyset->params->get('titleFix'), $replace);
        $siteTitle = explode('|', $siteTitle);
        foreach ($siteTitle as $k => $v) {
            if (!trim($v)) {
                unset($siteTitle[$k]);
                continue;
            }
            $siteTitle[$k] = trim($siteTitle[$k]);
        }
        $siteTitle = implode(" {$separator} ", $siteTitle);
        $easyset->_siteTitle = $siteTitle;
    }
}
Example #15
0
 public function parseValue($value)
 {
     if (!$this->isPublished()) {
         return null;
     }
     $config = JFactory::getConfig();
     $user = JFactory::getUser();
     $filter = strtoupper((string) $this->getFilter());
     switch ($filter) {
         case 'SERVER_UTC':
             if (intval($value)) {
                 $date = JFactory::getDate($value, 'UTC');
                 $date->setTimezone(new DateTimeZone($config->get('offset')));
                 $value = $date->format('Y-m-d H:i:s', true, false);
             }
             break;
         case 'USER_UTC':
             if (intval($value)) {
                 $date = JFactory::getDate($value, 'UTC');
                 $date->setTimezone(new DateTimeZone($user->getParam('timezone', $config->get('offset'))));
                 $value = $date->format('Y-m-d H:i:s', true, false);
             }
             break;
     }
     return $value;
 }
Example #16
0
 /**
  * Constructor
  *
  * Prevent creating instances of this class by making the contructor private
  * 
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     if (JFactory::getConfig()->getValue('config.caching')) {
         $this->_cache = JFactory::getCache('template', 'output');
     }
 }
Example #17
0
 /**
  *
  * Add Scripts and StyleSheets for this view
  * @param String $currentUrl
  */
 protected function addMedia($currentItemid, $render_url, $php_to_js)
 {
     $currentItemid = (int) $currentItemid;
     /** load libraries for the system rener **/
     $JSNTemplate = JSNFactory::getTemplate();
     $JSNMedia = JSNFactory::getMedia();
     $template = JFactory::getDocument()->template;
     $currUri = new JURI($render_url);
     JSNHtmlAsset::addStyle(JSN_POWERADMIN_STYLE_URI . 'uilayout/layout-default-latest.css');
     JSNHtmlAsset::addStyle(JSN_POWERADMIN_STYLE_URI . 'styles.css');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JS_URI . 'jquery.tinyscrollbar.js');
     JSNHtmlAsset::addScript(JSN_FRAMEWORK_ASSETS . '/3rd-party/jquery-hotkeys/jquery.hotkeys.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JS_URI . 'jquery-baseencode64.js');
     JSNHtmlAsset::addScript(JSN_FRAMEWORK_ASSETS . '/3rd-party/jquery-jstorage/jquery.jstorage.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.mousecheck.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.autodragdrop.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.rawmode.draganddrop.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.rawmode.component.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.rawmode.grid.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.functions.js');
     JSNHtmlAsset::addScript(JSN_FRAMEWORK_ASSETS . '/3rd-party/jquery-layout/js/jquery.layout-latest.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jstree/jstree.override.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.jstreecontext.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.submenu.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.menuitems.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.jquery.override.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.filter.js');
     //check sef on/off
     $sef = JFactory::getConfig()->get('sef');
     /** Add Custom Scripts **/
     $customScript = "\n\t\t\tvar jsnpoweradmin = true;\n\t\t\tvar baseUrl       = '" . JURI::root() . "';\n\t\t\tvar sef           = " . $sef . ";\n\t\t\tvar currentUrl    = '" . $render_url . "';\n\t\t\tvar lang          = '" . $JSNMedia->getLang() . "';\n\t\t\tvar positions     = new Array();\n\t\t\tvar JSNGrid, JSNComponent;\n\n\t\t\t(function(\$){\n\t\t\t    " . implode(PHP_EOL, $php_to_js) . "\n\t\t\t    \$.uiBackCompat = false;\n\t\t\t\t\$(document).ready(function(){\n\t\t\t\t\t\$('#page-loading').hide();\n\t\t\t\t\t\$('#jsn-rawmode-layout').css('visibility', 'visible');\n\t\t\t\t\tif (\$('#jsn-adminbar').size() == 0) {\n\t\t\t\t\t\t\$('body').addClass('no-adminbar');\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction setFullScreen () {\n\t\t\t\t\t\t\$('body').toggleClass('jsn-fullscreen');\n\t\t\t\t\t\tif (\$('body').hasClass('jsn-fullscreen')) {\n\t\t\t\t\t\t\t\$('.header').hide();\n\t\t\t\t\t\t\t\$('.subhead-collapse').hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\$('.header').show();\n\t\t\t\t\t\t\t\$('.subhead-collapse').show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\$(window).trigger('resize');\n\t\t\t\t\t}\n\n\t\t\t\t\t\$('a#jsn-fullscreen').click(function () {\n\t\t\t\t\t\tsetFullScreen();\n\t\t\t\t\t\t\$.cookie('jsn-fullscreen', \$('body').hasClass('jsn-fullscreen'));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\n\t\t\t\t\tvar isFullScreen = \$.cookie('jsn-fullscreen');\n\t\t\t\t\tif (isFullScreen !== undefined && (isFullScreen == 'true' || isFullScreen == '1')) {\n\t\t\t\t\t\tsetFullScreen();\n\t\t\t\t\t}\n\n\t\t\t\t\t\$.jStorage.set('selected_node', " . $currentItemid . ");\n\t\t\t\t\t\$.ajaxSetup({\n\t\t\t\t\t   timeout: 10000\n\t\t\t\t\t});\n\t\t\t\t\tJSNGrid      = new \$.JSNGrid();\n\t\t\t\t\tJSNComponent = new \$.JSNComponent('" . $currUri->getVar('option') . "', '" . $currUri->getVar('view') . "', '" . $currUri->getVar('layout') . "', '" . $currentItemid . "');\n \t\t\t\t\t\$._menuitems.mode  = 'rawmode';\n \t\t\t\t\t\$._menuitems.init();\n \t\t\t\t\t\$.jsnmouse.init();\n\t\t\t\t\tJSNFilter\t= new \$.JSNSpotligthModuleFilter(\$('#module_spotlight_filter'), {defaultText: '" . JText::_('JSN_RAWMODE_MODULE_FILTER_DEFAULT_TEXT', true) . "'});\n\t\t\t\t});\n\n\t\t\t})(JoomlaShine.jQuery);\n\t\t";
     $JSNMedia->addScriptDeclaration($customScript);
 }
 /**
  * Prepares the document
  */
 protected function _prepareDocument()
 {
     $app = JFactory::getApplication();
     $config = JFactory::getConfig();
     $menus = $app->getMenu();
     $pathway = $app->getPathway();
     $title = null;
     // Because the application sets a default page title,
     // we need to get it from the menu item itself
     $menu = $menus->getActive();
     if ($menu) {
         $this->params->def('page_heading', $this->params->get('page_title', $menu->title));
     } else {
         $this->params->def('page_heading', JText::_('COM_Pfmobileappws_DEFAULT_PAGE_TITLE'));
     }
     $title = $this->params->get('page_title', '');
     if (empty($title)) {
         $title = $config->get('sitename');
     } elseif ($config->get('sitename_pagetitles', 0) == 1) {
         $title = JText::sprintf('JPAGETITLE', $config->get('sitename'), $title);
     } elseif ($config->get('sitename_pagetitles', 0) == 2) {
         $title = JText::sprintf('JPAGETITLE', $title, $config->get('sitename'));
     }
     $this->document->setTitle($title);
     if ($this->params->get('menu-meta_description')) {
         $this->document->setDescription($this->params->get('menu-meta_description'));
     }
     if ($this->params->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
     }
     if ($this->params->get('robots')) {
         $this->document->setMetadata('robots', $this->params->get('robots'));
     }
 }
 /**
  * Method to get applicationsettings
  * @return object with data
  */
 function &getData()
 {
     // Load the data
     if (empty($this->_data)) {
         $query = ' SELECT * FROM #__hotelreservation_applicationsettings';
         $this->_db->setQuery($query);
         $this->_data = $this->_db->loadObject();
     }
     $config = JFactory::getConfig();
     $this->_data->sendmail_from = $config->get('config.mailfrom');
     $this->_data->sendmail_name = $config->get('config.fromname');
     if (!$this->_data) {
         $this->_data = new stdClass();
         $this->_data->applicationsettings_id = null;
         $this->_data->is_enable_reservation = null;
         $this->_data->currency_id = null;
         $this->_data->special_notes = null;
         $this->_data->terms_and_conditions = null;
         $this->_data->is_enable_payment = null;
         $this->_data->is_enable_https = null;
         $this->_data->is_site_online = null;
         $this->_data->css_style = null;
         $this->_data->css_module_style = null;
         $this->_data->company_name = null;
         $this->_data->company_email = null;
         $this->_data->policy = null;
         $this->_data->currencies = array();
         $this->_data->is_enable_extra_options = null;
         $config = JFactory::getConfig();
         $this->_data->sendmail_from = $config->get('config.mailfrom');
         $this->_data->sendmail_name = $config->get('config.fromname');
         $this->data->is_enable_offers = null;
         $this->data->is_email_notify_canceled_pending = null;
         $this->data->invoice_email = null;
         $this->data->send_invoice_to_email = null;
         $this->data->enable_hotel_tabs = null;
         $this->data->enable_hotel_description = null;
         $this->data->enable_hotel_facilitites = null;
         $this->data->enable_hotel_information = null;
     }
     $config = JFactory::getConfig();
     $this->_data->sendmail_from = $config->get('config.mailfrom');
     $this->_data->sendmail_name = $config->get('config.fromname');
     if ($this->_data) {
         $this->_data->card_types = array();
         $this->_data->currencies = array();
         $query = ' SELECT currency_id, description FROM #__hotelreservation_currencies';
         //$this->_db->setQuery( $query );
         $this->_data->currencies = $this->_getList($query);
         $this->_data->dateFormats = array();
         $query = ' SELECT * FROM #__hotelreservation_date_formats';
         //$this->_db->setQuery( $query );
         $this->_data->dateFormats = $this->_getList($query);
         //var_dump($this->_data);
     }
     //JPATH_COMPONENT_SITE. DS.'assets'.DS
     $this->_data->css_styles = glob(JPATH_COMPONENT_SITE . DS . 'assets' . DS . 'css' . DS . 'extension' . DS . '*.css');
     $this->_data->languages = glob(JPATH_COMPONENT_ADMINISTRATOR . DS . 'language' . DS . '*', GLOB_ONLYDIR);
     return $this->_data;
 }
 /**
  * Converts an amount from one currency into another using
  * the rate conversion table from the European Central Bank
  *
  * @param float $amountA
  * @param string $currA defaults to $vendor_currency
  * @param string $currB defaults to
  * @return mixed The converted amount when successful, false on failure
  */
 function convert($amountA, $currA = '', $currB = '', $a2rC = true, $relatedCurrency = 'EUR')
 {
     // cache subfolder(group) 'convertECB', cache method: callback
     $cache = JFactory::getCache('convertECB', 'callback');
     // save configured lifetime
     @($lifetime = $cache->lifetime);
     $cache->setLifeTime(360);
     // check 4 time per day
     // save cache conf
     $conf = JFactory::getConfig();
     // check if cache is enabled in configuration
     $cacheactive = $conf->get('caching');
     $cache->setCaching(1);
     //enable caching
     $globalCurrencyConverter = $cache->call(array('convertECB', 'getSetExchangeRates'), $this->document_address);
     // revert configuration
     $cache->setCaching($cacheactive);
     if (!$globalCurrencyConverter) {
         return $amountA;
     } else {
         $valA = isset($globalCurrencyConverter[$currA]) ? $globalCurrencyConverter[$currA] : 1.0;
         $valB = isset($globalCurrencyConverter[$currB]) ? $globalCurrencyConverter[$currB] : 1.0;
         $val = (double) $amountA * (double) $valB / (double) $valA;
         return $val;
     }
 }
Example #21
0
	function display ($tpl = null) {

		// Load the helper(s)


		jimport('joomla.filesystem.file');
		$config = JFactory::getConfig();
		$log_path = $config->get('log_path', VMPATH_ROOT . "/log");
		$layoutName = vRequest::getCmd('layout', 'default');
		VmConfig::loadJLang('com_virtuemart_log');

		if ($layoutName == 'edit') {
			$logFile = vRequest::getString('logfile', '');
			$this->SetViewTitle('LOG', $logFile);
			$fileContent = file_get_contents($log_path . DS . $logFile);
			$fileContentByLine = explode("\n", $fileContent);

			$this->assignRef('fileContentByLine', $fileContentByLine);
			JToolBarHelper::cancel();

		} else {
			if(!class_exists('JFolder')) require(VMPATH_LIBS.DS.'joomla'.DS.'filesystem'.DS.'folder.php');

			$logFiles = JFolder::files($log_path, $filter = '.', true, false, array('index.html'));

			$this->SetViewTitle('LOG');
			$this->assignRef('logFiles', $logFiles);
			$this->assignRef('path', $log_path);
		}

		parent::display($tpl);
	}
 function &getItem($translation = null)
 {
     $table = clone parent::getItem();
     // I could pick up the URL here or treat as a special content element field type?
     if ($table->type == 'component') {
         // Note that to populate the initial value of the urlparams
         $conf = JFactory::getConfig();
         $elementTable = $conf->get('falang.elementTable', false);
         foreach ($elementTable->Fields as $efield) {
             if ($efield->Name == "link" && isset($efield->translationContent->value) && $efield->translationContent->value !== "") {
                 $uri = new JURI($efield->translationContent->value);
                 if ($uri->getVar("option", false)) {
                     $table->link = $efield->translationContent->value;
                 }
             }
         }
         $url = str_replace('index.php?', '', $table->link);
         $url = str_replace('&amp;', '&', $url);
         $table->linkparts = null;
         if (strpos($url, '&amp;') !== false) {
             $url = str_replace('&amp;', '&', $url);
         }
         parse_str($url, $table->linkparts);
         $db = $this->getDBO();
         if ($component = @$table->linkparts['option']) {
             $query = 'SELECT `extension_id`' . ' FROM `#__extensions`' . ' WHERE `element` = "' . $db->escape($component) . '"';
             $db->setQuery($query);
             $table->componentid = $db->loadResult();
         }
     }
     $item = $table;
     return $item;
 }
 /**
  * Constructor.
  *
  * @since   3.1
  */
 public function __construct()
 {
     parent::__construct();
     // Overrides application config and set the configuration.php file so tokens and database works
     JFactory::$config = null;
     JFactory::getConfig(JPATH_SITE . '/configuration.php');
 }
Example #24
0
    function send_certificate()
    {
        $app = JFactory::getApplication();
        $params = $app->getParams();
        $moodle_url = $params->get('MOODLE_URL');
        $cert_id = JRequest::getVar('cert_id');
        $simple = JRequest::getVar('simple');
        $email = JRequest::getString('mailto', '', 'post');
        $sender = JRequest::getString('sender', '', 'post');
        $from = JRequest::getString('from', '', 'post');
        $user = JFactory::getUser();
        $username = $user->username;
        $subject_default = JText::sprintf('COM_JOOMDLE_CERTIFICATE_EMAIL_SUBJECT', $user->name);
        $subject = JRequest::getString('subject', $subject_default, 'post');
        if (!$subject) {
            $subject = $subject_default;
        }
        $mailer = JFactory::getMailer();
        $config = JFactory::getConfig();
        $sender = array($config->get('mailfrom'), $config->get('fromname'));
        $mailer->setSender($sender);
        $mailer->addRecipient($email);
        $body = JText::sprintf('COM_JOOMDLE_CERTIFICATE_EMAIL_BODY', $user->name);
        $mailer->setSubject($subject);
        $mailer->setBody($body);
        $session = JFactory::getSession();
        $token = md5($session->getId());
        $pdf = file_get_contents($moodle_url . '/auth/joomdle/' . $simple . 'certificate_view.php?id=' . $cert_id . '&certificate=1&action=review&username='******'&token=' . $token);
        $tmp_path = $config->get('tmp_path');
        $filename = 'certificate-' . $cert_id . '-' . $user->name . '.pdf';
        file_put_contents($tmp_path . '/' . $filename, $pdf);
        $mailer->addAttachment($tmp_path . '/' . $filename);
        $send = $mailer->Send();
        unlink($tmp_path . '/' . $filename);
        if ($send !== true) {
            JError::raiseNotice(500, JText::_('COM_JOOMDLE_EMAIL_NOT_SENT'));
        } else {
            ?>
<div style="padding: 10px;">
    <div style="text-align:right">
        <a href="javascript: void window.close()">
            <?php 
            echo JText::_('COM_JOOMDLE_CLOSE_WINDOW');
            ?>
 <?php 
            echo JHtml::_('image', 'mailto/close-x.png', NULL, NULL, true);
            ?>
</a>
    </div>

    <h2>
        <?php 
            echo JText::_('COM_JOOMDLE_EMAIL_SENT');
            ?>
    </h2>
</div>

<?php 
        }
    }
Example #25
0
 /**
  * Returns the correct configured frontend language for the
  * joomla web site.
  * The format is something like de-DE which can be passed to google.
  *
  * @return the frontend language
  */
 function getFrLanguage()
 {
     $conf =& JFactory::getConfig();
     return $conf->getValue('config.language');
     //		$params   = JComponentHelper::getParams('com_languages');
     //		return $params->get('site', 'en-GB');
 }
 /**
  * Constructor.
  *
  * @param   array  &$options  Log object options.
  *
  * @since   11.1
  */
 public function __construct(array &$options)
 {
     // Call the parent constructor.
     parent::__construct($options);
     // The name of the text file defaults to 'error.php' if not explicitly given.
     if (empty($this->options['text_file'])) {
         $this->options['text_file'] = 'error.php';
     }
     // The name of the text file path defaults to that which is set in configuration if not explicitly given.
     if (empty($this->options['text_file_path'])) {
         $this->options['text_file_path'] = JFactory::getConfig()->get('log_path');
     }
     // False to treat the log file as a php file.
     if (empty($this->options['text_file_no_php'])) {
         $this->options['text_file_no_php'] = false;
     }
     // Build the full path to the log file.
     $this->path = $this->options['text_file_path'] . '/' . $this->options['text_file'];
     // Use the default entry format unless explicitly set otherwise.
     if (!empty($this->options['text_entry_format'])) {
         $this->format = (string) $this->options['text_entry_format'];
     }
     // Build the fields array based on the format string.
     $this->parseFields();
 }
Example #27
0
 function submissionsViewFile()
 {
     $lang = JFactory::getLanguage();
     $lang->load('com_rsform', JPATH_ADMINISTRATOR);
     $hash = JRequest::getCmd('hash');
     if (strlen($hash) != 32) {
         return $this->setRedirect('index.php');
     }
     $config = JFactory::getConfig();
     $secret = $config->getValue('config.secret');
     $this->_db->setQuery("SELECT * FROM #__rsform_submission_values WHERE MD5(CONCAT(SubmissionId,'" . $this->_db->getEscaped($secret) . "',FieldName)) = '" . $hash . "'");
     $result = $this->_db->loadObject();
     // Not found
     if (empty($result)) {
         return $this->setRedirect('index.php');
     }
     // Not an upload field
     $this->_db->setQuery("SELECT c.ComponentTypeId FROM #__rsform_properties p LEFT JOIN #__rsform_components c ON (p.ComponentId=c.ComponentId) WHERE p.PropertyName='NAME' AND p.PropertyValue='" . $this->_db->getEscaped($result->FieldName) . "'");
     $type = $this->_db->loadResult();
     if ($type != 9) {
         return $this->setRedirect('index.php', JText::_('RSFP_VIEW_FILE_NOT_UPLOAD'));
     }
     jimport('joomla.filesystem.file');
     if (JFile::exists($result->FieldValue)) {
         RSFormProHelper::readFile($result->FieldValue);
     }
     $this->setRedirect('index.php', JText::_('RSFP_VIEW_FILE_NOT_FOUND'));
 }
Example #28
0
 public static function init($name, $extension, $params)
 {
     // Init
     $name_date = $params->get('filename_date', '');
     $tmp_path = JFactory::getConfig()->get('tmp_path');
     $tmp_dir = uniqid('cck_');
     // Set
     $output = new stdClass();
     $output->name = $name;
     $output->suffix = $name_date != '' ? '_' . JFactory::getDate()->format($name_date) : '';
     $output->path = $tmp_path . '/' . $tmp_dir;
     $output->root = $output->path . '/' . $extension;
     $output->output = $params->get('output', 0);
     $output->output_path = $params->get('output_path', '');
     $output->compression = $params->get('compression', 'zip');
     if ($output->output == 2 && $output->output_path != '' && JFolder::exists($output->output_path)) {
         $output->output_path = $output->output_path;
     } elseif ($output->output_path != '' && $output->output_path != 'tmp/') {
         $output->output_path = JPATH_SITE . '/' . $output->output_path;
         if (!JFolder::exists($output->output_path)) {
             jimport('cck.base.install.export');
             CCK_Export::createDir($output->output_path);
         }
     } else {
         $output->output_path = $tmp_path;
     }
     return $output;
 }
Example #29
0
 /**
  * Constructor
  *
  * @param   JDatabaseDriver  $db  Database driver object.
  *
  * @since   11.1
  */
 public function __construct(JDatabaseDriver $db)
 {
     parent::__construct('#__categories', 'id', $db);
     JTableObserverTags::createObserver($this, array('typeAlias' => '{extension}.category'));
     JTableObserverContenthistory::createObserver($this, array('typeAlias' => '{extension}.category'));
     $this->access = (int) JFactory::getConfig()->get('access');
 }
 /**
  * Constructor
  *
  * @since 1.5
  */
 function __construct()
 {
     parent::__construct();
     //Get configuration
     $app = JFactory::getApplication();
     $config = JFactory::getConfig();
     // Get the pagination request variables
     $this->setState('limit', $app->getUserStateFromRequest('com_search.limit', 'limit', $config->get('list_limit'), 'uint'));
     $this->setState('limitstart', JRequest::getUInt('limitstart', 0));
     // Get parameters.
     $params = $app->getParams();
     if ($params->get('searchphrase') == 1) {
         $searchphrase = 'any';
     } elseif ($params->get('searchphrase') == 2) {
         $searchphrase = 'exact';
     } else {
         $searchphrase = 'all';
     }
     // Set the search parameters
     $keyword = urldecode(JRequest::getString('searchword'));
     $match = JRequest::getWord('searchphrase', $searchphrase);
     $ordering = JRequest::getWord('ordering', $params->get('ordering', 'newest'));
     $this->setSearch($keyword, $match, $ordering);
     //Set the search areas
     $areas = JRequest::getVar('areas');
     $this->setAreas($areas);
 }