示例#1
1
 public function __construct(JForm $form = null)
 {
     parent::__construct($form);
     static $resources = true;
     if ($resources) {
         $resources = false;
         $name = basename(realpath(dirname(__FILE__) . "/../.."));
         $document = JFactory::getDocument();
         // $this->element is not ready on the constructor
         //$type = (string)$this->element["type"];
         $type = strtolower($this->type);
         if (file_exists(JPATH_ADMINISTRATOR . "/components/" . $name . "/js/" . $type . ".js")) {
             $document->addScript(JUri::current() . "?option=" . $name . "&view=loader&filename=" . $type . "&type=js");
         }
         if (file_exists(JPATH_ADMINISTRATOR . "/components/" . $name . "/css/" . $type . ".css")) {
             $document->addStyleSheet(JUri::base(true) . "/components/" . $name . "/css/" . $type . ".css");
         }
         $scope = JFactory::getApplication()->scope;
         if (file_exists(JPATH_ADMINISTRATOR . "/components/" . $name . "/js/" . $scope . ".js")) {
             $document->addScript(JUri::current() . "?option=" . $name . "&view=loader&filename=" . $scope . "&type=js");
         }
         if (file_exists(JPATH_ADMINISTRATOR . "/components/" . $name . "/css/" . $scope . ".css")) {
             $document->addStyleSheet(JUri::base(true) . "/components/" . $name . "/css/" . $scope . ".css");
         }
     }
 }
示例#2
1
 function defaults()
 {
     $document = JFactory::getDocument();
     $document->addScript(JUri::base(true) . '/media/cbcc/js/jquery/jquery.maskedinput.min.js');
     $document->addScript(JUri::base(true) . '/media/cbcc/js/jquery/upload/jquery.fileupload.js');
     $document->addScript(JUri::base(true) . '/media/cbcc/js/jquery.colorbox-min.js');
     $document->addScript(JUri::base(true) . '/media/cbcc/js/jquery/upload/jquery.iframe-transport.js');
     $document->addScript(JUri::base(true) . '/media/cbcc/js/bootstrap.tab.ajax.js');
     $document->addScript(JURI::base(true) . '/media/cbcc/js/jquery/jquery.cookie.js');
     $document->addScript(JURI::base(true) . '/media/cbcc/js/jstree/jquery.jstree.js');
     $document->addScript(JURI::base(true) . '/media/cbcc/js/caydonvi.js');
     $document->addScript(JURI::base(true) . '/media/cbcc/js/dataTables-1.10.0/jquery.dataTables.min.js');
     $document->addScript(JURI::base(true) . '/media/cbcc/js/dataTables-1.10.0/dataTables.bootstrap.js');
     $document->addScript(JURI::base(true) . '/media/cbcc/js/dataTables-1.10.0/dataTables.tableTools.min.js');
     $document->addScript(JURI::base(true) . '/media/cbcc/js/dataTables-1.10.0/datatables.default.config.js');
     $document->addStyleSheet(JURI::base(true) . '/media/cbcc/js/dataTables-1.10.0/css/dataTables.tableTools.css');
     $model = Core::model('Thongke/Thongke');
     $idUser = JFactory::getUser()->id;
     $idRoot = Core::getManageUnit($idUser, 'com_thongke', 'treeview', 'treethongke');
     if ($idRoot == null) {
         $this->setLayout('hoso_404');
     } else {
         $root['root_id'] = $idRoot;
         $tmp = $model->getThongtin(array('name, type'), 'ins_dept', null, array('id=' . $root['root_id']), null);
         $root['root_name'] = $tmp[0]->name;
         $root['root_showlist'] = $tmp[0]->type;
     }
     $this->assignRef('root_info', $root);
 }
示例#3
0
    /**
     * Renders the view
     *
     * @param   string  $tpl  Template name
     *
     * @return void
     */
    public function display($tpl = null)
    {
        $password = JFactory::getApplication()->getUserState('com_joomlaupdate.password', null);
        $filesize = JFactory::getApplication()->getUserState('com_joomlaupdate.filesize', null);
        $ajaxUrl = JUri::base() . 'components/com_joomlaupdate/restore.php';
        $returnUrl = 'index.php?option=com_joomlaupdate&task=update.finalise';
        // Set the toolbar information
        JToolbarHelper::title(JText::_('COM_JOOMLAUPDATE_OVERVIEW'), 'install');
        JToolBarHelper::divider();
        JToolBarHelper::help('JHELP_COMPONENTS_JOOMLA_UPDATE');
        // Add toolbar buttons
        if (JFactory::getUser()->authorise('core.admin', 'com_joomlaupdate')) {
            JToolbarHelper::preferences('com_joomlaupdate');
        }
        // Load mooTools
        JHtml::_('behavior.framework', true);
        $updateScript = <<<ENDSCRIPT
var joomlaupdate_password = '******';
var joomlaupdate_totalsize = '{$filesize}';
var joomlaupdate_ajax_url = '{$ajaxUrl}';
var joomlaupdate_return_url = '{$returnUrl}';

ENDSCRIPT;
        // Load our Javascript
        $document = JFactory::getDocument();
        $document->addScript('../media/com_joomlaupdate/json2.js');
        $document->addScript('../media/com_joomlaupdate/encryption.js');
        $document->addScript('../media/com_joomlaupdate/update.js');
        JHtml::_('script', 'system/progressbar.js', true, true);
        JHtml::_('stylesheet', 'media/mediamanager.css', array(), true);
        $document->addScriptDeclaration($updateScript);
        // Render the view
        parent::display($tpl);
    }
示例#4
0
 /**
  * Class constructor
  *
  * @param   array  $options  Associative array of options
  *
  * @since  11.1
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     // Set document type
     $this->_type = 'opensearch';
     // Set mime type
     $this->_mime = 'application/opensearchdescription+xml';
     // Add the URL for self updating
     $update = new JOpenSearchUrl();
     $update->type = 'application/opensearchdescription+xml';
     $update->rel = 'self';
     $update->template = JRoute::_(JUri::getInstance());
     $this->addUrl($update);
     // Add the favicon as the default image
     // Try to find a favicon by checking the template and root folder
     $app = JFactory::getApplication();
     $dirs = array(JPATH_THEMES . '/' . $app->getTemplate(), JPATH_BASE);
     foreach ($dirs as $dir) {
         if (file_exists($dir . '/favicon.ico')) {
             $path = str_replace(JPATH_BASE . '/', '', $dir);
             $path = str_replace('\\', '/', $path);
             $favicon = new JOpenSearchImage();
             $favicon->data = JUri::base() . $path . '/favicon.ico';
             $favicon->height = '16';
             $favicon->width = '16';
             $favicon->type = 'image/vnd.microsoft.icon';
             $this->addImage($favicon);
             break;
         }
     }
 }
示例#5
0
文件: shortcode.php 项目: rodhoff/MNW
function frameYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('style' => 'default', 'align' => 'left', 'class' => ''), $atts, 'yt_frame');
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/frame/css/frame.css", 'text/css');
    JHtml::script("plugins/system/ytshortcodes/shortcodes/frame/js/frame.js");
    return '<span class="yt-frame yt-frame-align-' . $atts['align'] . ' yt-frame-style-' . $atts['style'] . '"><span class="yt-frame-inner">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</span></span><div class="clear clearfix"></div>';
}
示例#6
0
 /**
  * Method to log in a user.
  *
  * @return  void
  *
  * @since   1.6
  */
 public function login()
 {
     JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $input = $app->input;
     $method = $input->getMethod();
     // Populate the data array:
     $data = array();
     $data['return'] = base64_decode($app->input->post->get('return', '', 'BASE64'));
     $data['username'] = $input->{$method}->get('username', '', 'USERNAME');
     $data['password'] = $input->{$method}->get('password', '', 'RAW');
     $data['secretkey'] = $input->{$method}->get('secretkey', '', 'RAW');
     // Don't redirect to an external URL.
     if (!JUri::isInternal($data['return'])) {
         $data['return'] = '';
     }
     // Set the return URL if empty.
     if (empty($data['return'])) {
         $data['return'] = 'index.php?option=com_users&view=profile';
     }
     // Set the return URL in the user state to allow modification by plugins
     $app->setUserState('users.login.form.return', $data['return']);
     // Get the log in options.
     $options = array();
     $options['remember'] = $this->input->getBool('remember', false);
     $options['return'] = $data['return'];
     // Get the log in credentials.
     $credentials = array();
     $credentials['username'] = $data['username'];
     $credentials['password'] = $data['password'];
     $credentials['secretkey'] = $data['secretkey'];
     // Perform the log in.
     if (true === $app->login($credentials, $options)) {
         $user = JFactory::getUser();
         // Success
         if ($options['remember'] == true) {
             $app->setUserState('rememberLogin', true);
         }
         $app->setUserState('users.login.form.data', array());
         foreach ($user->groups as $group) {
             if ($group == "2") {
                 $app->redirect(JUri::base() . "index.php?option=com_business&view=paymentaccount");
                 //                                $options['return'] = "index.php?option=com_business&view=paymentaccount";
             }
             if ($group == "8") {
                 $app->redirect(JUri::base() . "index.php/admin-business");
                 //                                $options['return'] = "index.php?option=com_business&view=paymentaccount";
             } else {
                 $app->redirect(JUri::base() . "index.php/business");
                 //                                $options['return'] = "index.php?option=com_business&view=business";
             }
         }
         //			$app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false));
     } else {
         // Login failed !
         $data['remember'] = (int) $options['remember'];
         $app->setUserState('users.login.form.data', $data);
         $app->redirect(JRoute::_('index.php?option=com_users&view=login', false));
     }
 }
示例#7
0
function blockquoteYTShortcode($atts, $content = null)
{
    extract(ytshortcode_atts(array("title" => '', "align" => 'none', 'border' => '#666', 'color' => '#fff', 'width' => 'auto'), $atts));
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/blockquote/css/blockquote.css");
    $source_title = $title != '' ? "<small>" . $title . "</small>" : '';
    return '<blockquote class="yt-clearfix yt-boxquote pull-' . $align . '" style="width:' . $width . '%;border-color:' . $border . ';color:' . $color . '">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . $source_title . '</blockquote>';
}
示例#8
0
 public function onBrowse($tpl = null)
 {
     AkeebaStrapper::addJSfile('media://com_akeeba/js/fsfilter.js');
     $model = $this->getModel();
     $task = $model->getState('browse_task', 'normal');
     // Add custom submenus
     $toolbar = F0FToolbar::getAnInstance($this->input->get('option', 'com_foobar', 'cmd'), $this->config);
     $toolbar->appendLink(JText::_('FILTERS_LABEL_NORMALVIEW'), JUri::base() . 'index.php?option=com_akeeba&view=fsfilter&task=normal', $task == 'normal');
     $toolbar->appendLink(JText::_('FILTERS_LABEL_TABULARVIEW'), JUri::base() . 'index.php?option=com_akeeba&view=fsfilter&task=tabular', $task == 'tabular');
     $media_folder = JUri::base() . '../media/com_akeeba/';
     // Get the root URI for media files
     $this->mediadir = AkeebaHelperEscape::escapeJS($media_folder . 'theme/');
     // Get a JSON representation of the available roots
     $filters = Factory::getFilters();
     $root_info = $filters->getInclusions('dir');
     $roots = array();
     $options = array();
     if (!empty($root_info)) {
         // Loop all dir definitions
         foreach ($root_info as $dir_definition) {
             if (is_null($dir_definition[1])) {
                 // Site root definition has a null element 1. It is always pushed on top of the stack.
                 array_unshift($roots, $dir_definition[0]);
             } else {
                 $roots[] = $dir_definition[0];
             }
             $options[] = JHTML::_('select.option', $dir_definition[0], $dir_definition[0]);
         }
     }
     $site_root = $roots[0];
     $attribs = 'onchange="akeeba.Fsfilters.activeRootChanged();"';
     $this->root_select = JHTML::_('select.genericlist', $options, 'root', $attribs, 'value', 'text', $site_root, 'active_root');
     $this->roots = $roots;
     switch ($task) {
         case 'normal':
         default:
             $this->setLayout('default');
             // Get a JSON representation of the directory data
             $model = $this->getModel();
             $json = json_encode($model->make_listing($site_root, array(), ''));
             $this->json = $json;
             break;
         case 'tabular':
             $this->setLayout('tabular');
             // Get a JSON representation of the tabular filter data
             $model = $this->getModel();
             $json = json_encode($model->get_filters($site_root));
             $this->json = $json;
             break;
     }
     // Get profile ID
     $profileid = Platform::getInstance()->get_active_profile();
     $this->profileid = $profileid;
     // Get profile name
     $pmodel = F0FModel::getAnInstance('Profiles', 'AkeebaModel');
     $pmodel->setId($profileid);
     $profile_data = $pmodel->getItem();
     $this->profilename = $this->escape($profile_data->description);
     return true;
 }
示例#9
0
 /**
  * Get the JavaScript command for the button
  *
  * @param   string  $url  URL for popup
  *
  * @return  string  JavaScript command string
  *
  * @since   3.0
  */
 private function _getCommand($url)
 {
     if (substr($url, 0, 4) !== 'http') {
         $url = JUri::base() . $url;
     }
     return $url;
 }
示例#10
0
 public function onAdd($tpl = null)
 {
     $media_folder = JUri::base() . '../media/com_akeeba/';
     // Get a JSON representation of GUI data
     $json = AkeebaHelperEscape::escapeJS(Factory::getEngineParamsProvider()->getJsonGuiDefinition(), '"\\');
     $this->json = $json;
     // Get profile ID
     $profileid = Platform::getInstance()->get_active_profile();
     $this->profileid = $profileid;
     // Get profile name
     $profileName = F0FModel::getTmpInstance('Profiles', 'AkeebaModel')->setId($profileid)->getItem()->description;
     $this->profilename = $profileName;
     // Get the root URI for media files
     $this->mediadir = AkeebaHelperEscape::escapeJS($media_folder . 'theme/');
     // Are the settings secured?
     if (Platform::getInstance()->get_platform_configuration_option('useencryption', -1) == 0) {
         $this->securesettings = -1;
     } elseif (!Factory::getSecureSettings()->supportsEncryption()) {
         $this->securesettings = 0;
     } else {
         JLoader::import('joomla.filesystem.file');
         $filename = JPATH_COMPONENT_ADMINISTRATOR . '/engine/serverkey.php';
         if (JFile::exists($filename)) {
             $this->securesettings = 1;
         } else {
             $this->securesettings = 0;
         }
     }
     // Add live help
     AkeebaHelperIncludes::addHelp('config');
 }
示例#11
0
function sectionYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('background' => '#ffffff', 'image' => '', 'repeat' => 'repeat', 'parallax' => 'yes', 'speed' => '10', 'max_width' => '960', 'margin' => '0px 0px 0px 0px', 'padding' => '30px 0px 30px 0px', 'border' => 'none', 'color' => '#333333', 'text_align' => 'inharit', 'text_shadow' => 'none', 'url_youtube' => '', 'url_webm' => '', 'url_vimeo' => '', 'font_size' => '12px', 'class' => ''), $atts, 'section');
    $id_section = uniqid('sec_') . rand() . time();
    $id_video = uniqid('svb_sec_') . rand() . time();
    $background = $atts['image'] ? sprintf('%s %s url(\'%s\') repeat %s', $atts['background'], '50% 0', yt_image_media($atts['image']), $atts['parallax'] === 'yes' ? 'fixed' : 'scroll') : $atts['background'];
    if ($atts['image'] && $atts['parallax'] === 'yes') {
        $atts['class'] .= ' yt-section-parallax';
    }
    if ($atts['url_youtube']) {
        $atts['class'] .= ' yt-panel-clickable';
    }
    JHtml::_('jquery.framework');
    if ($atts['image'] && $atts['parallax'] === 'yes' or $atts['url_youtube']) {
        JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/section.js");
    }
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/modernizr.video.js");
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/swfobject.js");
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/js/video_background.js");
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/section/css/section.css", 'text/css');
    $atts['text_align'] = $atts['text_align'] != 'inherit' ? 'text-align:' . $atts['text_align'] . ';' : '';
    $atts['text_shadow'] = $atts['text_shadow'] ? ' -webkit-text-shadow:' . $atts['text_shadow'] . ';-moz-text-shadow:' . $atts['text_shadow'] . ';text-shadow:' . $atts['text_shadow'] . ';' : '';
    if ($atts['url_youtube'] != '') {
        return '<div class="yt-section-forcefullwidth"><div id="' . $id_section . '" class="yt-section-wrapper" data-id="' . $id_section . '"><div class="yt-section ' . trim($atts['class']) . ' " data-speed="' . $atts['speed'] . '" style="background:' . $background . ';margin:' . $atts['margin'] . ';padding:' . $atts['padding'] . ';border-top:' . $atts['border'] . ';border-bottom:' . $atts['border'] . '"><div class="yt-section-content yt-content-wrap" style="max-width:' . $atts['max_width'] . 'px; ' . $atts['text_align'] . ' color:' . $atts['color'] . ';' . $atts['text_shadow'] . ' font-size:' . $atts['font_size'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div><div class="yt-section-overlay"></div><div class="yt-section-video" id="' . $id_video . '" data-id="' . $id_video . '" data-loop="true" data-muted="true" data-autoplay="true" data-ratio="1.77" data-overlay="" data-swfpath=""  data-youtube="' . $atts['url_youtube'] . '"><div id="video_background_video_1" style="z-index: 0; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; overflow: hidden;"></div></div></div></div></div>';
    } else {
        if ($atts['url_webm'] != '') {
            return '<div class="yt-section-forcefullwidth"><div id="' . $id_section . '" class="yt-section-wrapper" data-id="' . $id_section . '"><div class="yt-section ' . trim($atts['class']) . ' " data-speed="' . $atts['speed'] . '" style="background:' . $background . ';margin:' . $atts['margin'] . ';padding:' . $atts['padding'] . ';border-top:' . $atts['border'] . ';border-bottom:' . $atts['border'] . '"><div class="yt-section-content yt-content-wrap" style="max-width:' . $atts['max_width'] . 'px; ' . $atts['text_align'] . ' color:' . $atts['color'] . ';' . $atts['text_shadow'] . ' font-size:' . $atts['font_size'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />"), " ", $content)) . '</div><div class="yt-section-overlay"></div><div class="yt-section-video" id="' . $id_video . '" data-id="' . $id_video . '" data-loop="true" data-muted="true" data-autoplay="true" data-ratio="1.77" data-overlay="" data-swfpath=""  data-webm="' . $atts['url_webm'] . '"><div id="video_background_video_1" style="z-index: 0; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; overflow: hidden;"><video  autoplay="" loop="" onended="this.play()"><source src="' . $atts['url_webm'] . '" type="video/webm"></video></div></div></div></div></div>';
        } else {
            return '<div class="yt-section ' . trim($atts['class']) . ' " data-speed="' . $atts['speed'] . '" style="background:' . $background . ';margin:' . $atts['margin'] . ';padding:' . $atts['padding'] . ';border-top:' . $atts['border'] . ';border-bottom:' . $atts['border'] . '"><div class="yt-section-content yt-content-wrap" style="max-width:' . $atts['max_width'] . 'px; ' . $atts['text_align'] . ' color:' . $atts['color'] . ';' . $atts['text_shadow'] . ' font-size:' . $atts['font_size'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div></div>';
        }
    }
}
 public function display($tpl = null)
 {
     $this->app = JFactory::getApplication();
     $this->option = JFactory::getApplication()->input->get('option');
     // Get model state.
     $this->state = $this->get('State');
     $this->item = $this->get('Item');
     // Get params
     $this->params = $this->state->get('params');
     /** @var  $this->params Joomla\Registry\Registry */
     $model = $this->getModel();
     $userId = JFactory::getUser()->get('id');
     if (!$this->item or $model->isRestricted($this->item, $userId)) {
         $this->app->enqueueMessage(JText::_('COM_CROWDFUNDING_ERROR_INVALID_PROJECT'), 'notice');
         $this->app->redirect(JRoute::_('index.php?option=com_crowdfunding&view=discover', false));
         return;
     }
     $this->container = Prism\Container::getContainer();
     $this->prepareMoneyFormatter($this->container, $this->params);
     // Get the path to the images.
     $this->imageFolder = $this->params->get('images_directory', 'images/crowdfunding');
     $this->defaultAvatar = JUri::base() . $this->params->get('integration_avatars_default');
     $this->avatarsSize = $this->params->get('integration_avatars_size', 'small');
     // Prepare the link that points to project page.
     $host = JUri::getInstance()->toString(array('scheme', 'host'));
     $this->item->link = $host . JRoute::_(CrowdfundingHelperRoute::getDetailsRoute($this->item->slug, $this->item->catslug));
     // Prepare the link that points to project image.
     $this->item->link_image = $host . '/' . $this->imageFolder . '/' . $this->item->image;
     // Get the current screen.
     $this->screen = $this->app->input->getCmd('screen', 'home');
     $this->prepareDocument();
     // Import content plugins
     JPluginHelper::importPlugin('content');
     switch ($this->screen) {
         case 'updates':
             $this->prepareUpdatesScreen();
             break;
         case 'comments':
             $this->prepareCommentsScreen();
             break;
         case 'funders':
             $this->prepareFundersScreen();
             break;
         default:
             // Home
             break;
     }
     // Events
     $dispatcher = JEventDispatcher::getInstance();
     $this->item->event = new stdClass();
     $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_crowdfunding.details', &$this->item, &$this->params));
     $this->item->event->beforeDisplayContent = trim(implode("\n", $results));
     $results = $dispatcher->trigger('onContentAfterDisplayMedia', array('com_crowdfunding.details', &$this->item, &$this->params));
     $this->item->event->onContentAfterDisplayMedia = trim(implode("\n", $results));
     $results = $dispatcher->trigger('onContentAfterDisplay', array('com_crowdfunding.details', &$this->item, &$this->params));
     $this->item->event->onContentAfterDisplay = trim(implode("\n", $results));
     // Count hits
     $model->hit($this->item->id);
     parent::display($tpl);
 }
示例#13
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $this->params =& $params;
     $this->item = $this->get('Item');
     $this->form = $this->get('Form');
     $this->mediafilelist = listHTraininglogsHelper::getMediafilelist();
     $wrapper = new stdClass();
     $wrapper->load = 'onload="iFrameHeight()"';
     $wrapper->url = JUri::base() . 'images/htraininglogs/' . $this->item->user_id . '/media/bigthumbs/' . $this->item->filename;
     //echo $wrapper->url;exit;//http://localhost/jo32/images/htraininglogs/413/media/cci080220160003.jpg
     if (!file_exists(JPATH_SITE . '/images/htraininglogs/' . $this->item->user_id . '/media/bigthumbs/' . $this->item->filename)) {
         $wrapper->url = JUri::base() . 'images/htraininglogs/' . $this->item->user_id . '/media/' . $this->item->filename;
     }
     //echo $wrapper->url;exit;http://localhost/jo32/images/htraininglogs/413/media/cci080220160003.jpg
     $this->wrapper = $wrapper;
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $doc = JFactory::getDocument();
     $doc->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/site.stylesheet.css');
     parent::display($tpl);
 }
示例#14
0
 /**
  * Class constructor.
  *
  * @since   3.1
  */
 public function __construct()
 {
     // Run the parent constructor
     parent::__construct();
     // Load and set the dispatcher
     $this->loadDispatcher();
     // Enable sessions by default.
     if (is_null($this->config->get('session'))) {
         $this->config->set('session', true);
     }
     // Set the session default name.
     if (is_null($this->config->get('session_name'))) {
         $this->config->set('session_name', 'installation');
     }
     // Create the session if a session name is passed.
     if ($this->config->get('session') !== false) {
         $this->loadSession();
         // Register the session with JFactory
         JFactory::$session = $this->getSession();
     }
     // Store the debug value to config based on the JDEBUG flag
     $this->config->set('debug', JDEBUG);
     // Register the config to JFactory
     JFactory::$config = $this->config;
     // Register the application to JFactory
     JFactory::$application = $this;
     // Register the application name
     $this->_name = 'installation';
     // Register the client ID
     $this->_clientId = 2;
     // Set the root in the URI one level up.
     $parts = explode('/', JUri::base(true));
     array_pop($parts);
     JUri::root(null, implode('/', $parts));
 }
 protected function getLabel()
 {
     $cn = basename(realpath(dirname(__FILE__) . '/../..'));
     $direction = intval(JFactory::getLanguage()->get('rtl', 0));
     $left = $direction ? "right" : "left";
     $right = $direction ? "left" : "right";
     $db = JFactory::getDBO();
     $sql = "SELECT value FROM #__" . substr($cn, 4) . "_settings WHERE name = '" . $this->element['triggerkey'] . "';";
     $db->setQuery($sql);
     $method = $db->loadResult();
     if (!$method) {
         $style = 'clear:both; background:#f4f4f4; border:1px solid silver; padding:5px; margin:5px 0;';
         $image = '<img style="margin:0; float:' . $left . ';" src="' . JUri::base() . '../media/' . $cn . '/images/exclamation-16.png">';
         return '<div style="' . $style . '">' . $image . '<span style="padding-' . $left . ':5px; line-height:16px;">' . 'Problems with database' . '</span>' . '</div>';
     }
     if ($method != $this->element['triggervalue']) {
         return "";
     }
     echo '<div class="clr"></div>';
     $image = '';
     $icon = (string) $this->element['icon'];
     if (!empty($icon)) {
         $image .= '<img style="margin:0; float:' . $left . ';" src="' . JUri::base() . '../media/' . $cn . '/images/' . $icon . '">';
     }
     $style = 'background:#f4f4f4; border:1px solid silver; padding:5px; margin:5px 0;';
     if ($this->element['default']) {
         return '<div style="' . $style . '">' . $image . '<span style="padding-' . $left . ':5px; line-height:16px;">' . 'error' . '</span>' . '</div>';
     } else {
         return parent::getLabel();
     }
     echo '<div class="clr"></div>';
 }
示例#16
0
function animationYTShortcode($atts, $content = null)
{
    $atts = ytshortcode_atts(array('type' => 'bounceIn', 'duration' => 1, 'delay' => 0, 'inline_block' => 'no', 'class' => ''), $atts, 'animation');
    $id = uniqid('yta') . rand() . time();
    $inline = $atts['inline_block'] === 'yes' ? ' display: inline-block;' : '';
    $style = array('duration' => array(), 'delay' => array());
    // CSS Prefix manage
    foreach (array('-webkit-', '-moz-', '-ms-', '-o-', '') as $vendor) {
        $style['duration'][] = $vendor . 'animation-duration:' . $atts['duration'] . 's';
        $style['delay'][] = $vendor . 'animation-delay:' . $atts['delay'] . 's';
    }
    // Get Css in $css variable
    $css = '#' . $id . ' {visibility:hidden;' . $inline . implode(';', $style['duration']) . ';' . implode(';', $style['delay']) . '}';
    // Add CSS in head
    $doc = JFactory::getDocument();
    $doc->addStyleDeclaration($css);
    // Add CSS file in head
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/assets/css/animate.css");
    JHtml::_('jquery.framework');
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/assets/js/jquery.appear.js");
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/animation/js/animate.js");
    // Output HTML
    $output = '<div id="' . $id . '" class="yt-clearfix yt-animate " data-animation="' . $atts['type'] . '">' . parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content)) . '</div>';
    return $output;
}
示例#17
0
 /**
  * Method to cancel module editing.
  *
  * @return  boolean  True on success.
  *
  * @since   3.2
  */
 public function execute()
 {
     // Check if the user is authorized to do this.
     $user = JFactory::getUser();
     if (!$user->authorise('module.edit.frontend', 'com_modules.module.' . $this->input->get('id'))) {
         $this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'));
         $this->app->redirect('index.php');
     }
     $this->context = 'com_config.config.global';
     // Get returnUri
     $returnUri = $this->input->post->get('return', null, 'base64');
     if (!empty($returnUri)) {
         $this->redirect = base64_decode(urldecode($returnUri));
     } else {
         $this->redirect = JUri::base();
     }
     $id = $this->input->getInt('id');
     // Access back-end com_module
     JLoader::register('ModulesControllerModule', JPATH_ADMINISTRATOR . '/components/com_modules/controllers/module.php');
     JLoader::register('ModulesViewModule', JPATH_ADMINISTRATOR . '/components/com_modules/views/module/view.json.php');
     JLoader::register('ModulesModelModule', JPATH_ADMINISTRATOR . '/components/com_modules/models/module.php');
     $cancelClass = new ModulesControllerModule();
     $cancelClass->cancel($id);
     parent::execute();
 }
示例#18
0
 /**
  * Render the document
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return  string   The rendered data
  *
  * @since   11.1
  */
 public function render($cache = false, $params = array())
 {
     // If no error object is set return null
     if (!isset($this->_error)) {
         return;
     }
     // Set the status header
     JResponse::setHeader('status', $this->_error->getCode() . ' ' . str_replace("\n", ' ', $this->_error->getMessage()));
     $file = 'error.php';
     // Check template
     $directory = isset($params['directory']) ? $params['directory'] : 'templates';
     $template = isset($params['template']) ? JFilterInput::getInstance()->clean($params['template'], 'cmd') : 'system';
     if (!file_exists($directory . '/' . $template . '/' . $file)) {
         $template = 'system';
     }
     // Set variables
     $this->baseurl = JUri::base(true);
     $this->template = $template;
     $this->debug = isset($params['debug']) ? $params['debug'] : false;
     $this->error = $this->_error;
     // Load
     $data = $this->_loadTemplate($directory . '/' . $template, $file);
     parent::render();
     return $data;
 }
示例#19
0
 protected function getInput()
 {
     jimport('joomla.filesystem.folder');
     jimport('joomla.filesystem.file');
     JHtml::_('behavior.modal');
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $document->addStyleDeclaration('.tmpl_button{padding: 2px; font-size: 110%;}.tmpl_button img { padding: 0 2px 0 0; margin: 0px;}');
     $document->addScript(JUri::base(true) . '/components/com_cobalt/library/js/main.js');
     $tmpltype = $this->element['tmpltype'];
     $invite_label = $this->element['invite_label'];
     $tmpl_select = $this->element['tmpl_select'];
     $noparams = $this->element['noparams'];
     $options = array();
     if ((string) $this->element['select'] == '1') {
         $options[] = JHTML::_('select.option', '', JText::_('CSELECTTEMPLATE'));
     }
     $options = array_merge($options, $this->getTmplObjectList($tmpltype));
     $options = array_merge($this->getOptions(), $options);
     $multi = $this->element['multi'] ? 'size="5" multiple="multiple"' : NULL;
     $script = "<script type='text/javascript'>\n\t\t\tCobalt.addTmplEditLink('{$tmpltype}', '{$this->id}', '" . $app->input->get('tmpl') . "', '" . JUri::root() . "');\n\t\t</script>";
     $javascript = " onchange=\"Cobalt.addTmplEditLink('{$tmpltype}', '{$this->id}', '" . $app->input->get('tmpl') . "', '" . JUri::root() . "')\"";
     if ($noparams) {
         $script = $javascript = null;
     }
     $out = sprintf('<div class="row-fluid"><div class="span8">%s</div><div class="span4" id="%s_link"></div></div>%s', JHTML::_('select.genericlist', $options, $this->name . ($multi ? '[]' : NULL), $multi . $javascript, 'value', 'text', $this->value, "{$this->id}"), str_replace(array(']', '['), '', $this->id), $script);
     return $out;
 }
示例#20
0
 /**
  * save a ad fields 
  */
 function save()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit('Invalid Token');
     $input = JFactory::getApplication()->input;
     $model = $this->getModel('settings');
     $post = JRequest::get('post');
     // allow name only to contain html
     $model->setState('request', $post);
     if ($model->store()) {
         $msg = JText::_('C_SAVE_M_S');
     } else {
         $msg = JText::_('C_SAVE_M_NS');
     }
     $task = $input->get('task', '', 'STRING');
     switch ($task) {
         case 'cancel':
             $cancelmsg = JText::_('FIELD_CANCEL_MSG');
             $this->setRedirect('index.php?option=com_socialads', $msg);
             break;
         case 'save':
             $this->setRedirect(JUri::base() . "index.php?option=com_socialads&view=settings", $msg);
             break;
     }
 }
示例#21
0
文件: shortcode.php 项目: rodhoff/MNW
function columnsYTShortcode($atts, $content = null)
{
    extract(ytshortcode_atts(array("grid" => 'no'), $atts));
    $show_grid = $grid == 'yes' ? 'show-grid' : '';
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/columns/css/columns.css");
    return '<div class="yt-clearfix yt-show-grid ' . $show_grid . ' ">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />"), " ", $content)) . '</div>';
}
示例#22
0
function notificationYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('effect' => 1, 'button_text' => 'Open notification', 'button_class' => '', 'close_button' => '', 'title' => 'notification Title', 'title_background' => 'rgba(0,0,0,0.1)', 'title_color' => '#222222', 'background' => '#ffffff', 'color' => '#666666', 'border' => 'none', 'shadow' => '0 solid #000000', 'width' => '640px', 'height' => 'auto', 'overlay_background' => '#000', 'class' => ''), $atts, 'notification');
    $id = uniqid('ytmodal_') . rand() . time();
    $id_over = uniqid() . rand() . time();
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/notification/css/notification.css", 'text/css');
    JHtml::_('jquery.framework');
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/shortcodes/notification/js/notification.js");
    $css = '
          #' . $id . ' .yt-modal-content-wrapper { height: ' . $atts['height'] . '; width: ' . $atts['width'] . '; background: ' . $atts['background'] . '; color: ' . $atts['color'] . '; border: ' . $atts['border'] . '; box-shadow: ' . $atts['shadow'] . '; }
          #' . $id . ' .yt-modal-title-wrapper { background: ' . $atts['title_background'] . '; }
          #' . $id . ' .yt-modal-title-wrapper h3 { color: ' . $atts['title_color'] . '; }
        ';
    $doc = JFactory::getDocument();
    $doc->addStyleDeclaration($css);
    $overlay_style = 'style=" background-color: ' . $atts['overlay_background'] . ';"';
    $close_button = $atts['close_button'] === 'yes' ? '<a href="javascript:void(0);" class="yt-modal-close"><i class="fa fa-remove"></i></a>' : '';
    $return = '<div class="yt-modal-wrapper">';
    $return .= '<a href="javascript:void(0);" class="yt-modal-trigger ' . $atts['button_class'] . '" data-modal="' . $id . '">' . $atts['button_text'] . '</a>';
    $return .= '<div class="yt-modal yt-modal-effect-' . $atts['effect'] . '" id="' . $id . '">
            <div class="yt-modal-content-wrapper">';
    $return .= '<div class="yt-modal-title-wrapper">';
    $return .= '<h3>' . $atts['title'] . '</h3>';
    $return .= $close_button;
    $return .= '</div>';
    $return .= '<div class="yt-content">';
    $return .= parse_shortcode(str_replace(array("<br/>", "<br />", "<p></p>"), " ", $content));
    $return .= '</div>
            </div>
        </div>
        <div class="yt-modal-overlay ' . $id . '" ' . $overlay_style . '></div>';
    $return .= '</div>';
    return $return;
}
示例#23
0
 public function onBeforeDispatch()
 {
     $result = parent::onBeforeDispatch();
     if ($result) {
         // Load Akeeba Strapper
         include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php';
         AkeebaStrapper::$tag = AKEEBAMEDIATAG;
         AkeebaStrapper::bootstrap();
         AkeebaStrapper::jQueryUI();
         AkeebaStrapper::addJSfile('media://com_akeeba/js/gui-helpers.js');
         AkeebaStrapper::addJSfile('media://com_akeeba/js/akeebaui.js');
         AkeebaStrapper::addJSfile('media://com_akeeba/js/piecon.min.js');
         jimport('joomla.filesystem.file');
         if (JFile::exists(F0FTemplateUtils::parsePath('media://com_akeeba/plugins/js/akeebaui.js', true))) {
             AkeebaStrapper::addJSfile('media://com_akeeba/plugins/js/akeebaui.js');
         }
         AkeebaStrapper::addCSSfile('media://com_akeeba/theme/akeebaui.css');
         // Control Check
         $view = F0FInflector::singularize($this->input->getCmd('view', $this->defaultView));
         if ($view == 'liveupdate') {
             $url = JUri::base() . 'index.php?option=com_akeeba';
             JFactory::getApplication()->redirect($url);
             return;
         }
     }
     return $result;
 }
示例#24
0
function galleryYTShortcode($atts, $content = null)
{
    global $gwidth, $gheight, $gcolumns, $galleryArray, $cation_gallery, $border_gallery, $padding_item, $id_uniq, $hover_gallery;
    $gwidth = 100;
    $gheight = 100;
    JHtml::script(JUri::base() . "plugins/system/ytshortcodes/assets/js/jquery.prettyPhoto.js");
    JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/gallery/css/gallery.css");
    extract(ytshortcode_atts(array("title" => '', "width" => 100, "height" => 100, "columns" => 3, "align" => 'center', "caption" => '0', "border" => '0px solid #4e9e41', "border_size" => '0px', "border_color" => '#4e9e41', "border_style" => 'solid', "padding" => '0px', "hover" => '1'), $atts));
    //$border_gallery = ($border_size =='0px') ? '' : "border:".$border_size." ".$border_style." #4e9e41;";
    $border_gallery = "border: " . $border . "";
    switch ($caption) {
        case '1':
            $cation_gallery = 'caption_gallery_1';
            break;
        case '2':
            $cation_gallery = 'caption_gallery_2';
            break;
        default:
            $cation_gallery = '';
            break;
    }
    $hover_gallery = $hover;
    $padding_item = $padding == '0px' ? '' : "padding:" . $padding . "";
    $id_uniq = uniqid("yt") . rand() . time();
    $gwidth = $width;
    $gheight = $height;
    $gcolumns = $columns;
    $gallery = '';
    $galleryArray = array();
    parse_shortcode($content);
    $tags = array();
    $tags = '';
    foreach ($galleryArray as $key => $item) {
        $tags .= ',' . strtolower($item['tag']);
    }
    $tags = ltrim($tags, ',');
    $tags = explode(',', $tags);
    $newtags = array();
    foreach ($tags as $tag) {
        $newtags[] = trim($tag);
    }
    $tags = array_values(array_unique($newtags));
    if ($align != '') {
        $align = 'pull-' . $align;
    } else {
        $align = '';
    }
    $gallery .= '<div class="yt-gallery clearfix ' . $align . '" style="margin:0 auto">';
    $gallery .= '<div class = "yt-gallery-tabbed" style="display:table; margin-bottom:10px;">';
    $gallery .= '<ul class="tabnav">';
    $gallery .= '<li class="showall active ' . $id_uniq . '"><span >Show all</span></li>';
    foreach ($tags as $tag) {
        $gallery .= '<li id=' . trim($tag) . $id_uniq . ' class="' . $id_uniq . '"><span>' . ucfirst(trim($tag)) . '</span></li>';
    }
    $gallery .= '</ul>';
    $gallery .= '</div>';
    $gallery .= '<ul class="gallery-list clearfix">' . parse_shortcode(str_replace(array("<br/>", "<br>", "<br />", "<p>", "</p>"), " ", $content)) . '</ul>';
    $gallery .= '</div>';
    return $gallery;
}
示例#25
0
function image_compareYTShortcode($atts = null, $content = null)
{
    $atts = ytshortcode_atts(array('before_image' => '', 'after_image' => '', 'orientation' => '', 'before_text' => 'Original', 'after_text' => 'Modified', 'class' => ''), $atts, 'image_compare');
    // Unique Id
    $id = uniqid("ytic") . rand() . time();
    if (yt_image_media($atts['before_image']) && yt_image_media($atts['after_image'])) {
        $orientation = $atts['orientation'] == 'horizontal' ? 'data-orientation="horizontal"' : '';
        $css = '#' . $id . ' .twentytwenty-before-label:before {content: "' . $atts['before_text'] . '"}';
        $css .= '#' . $id . ' .twentytwenty-after-label:before {content: "' . $atts['after_text'] . '"}';
        // Css Adding in Head
        JHtml::stylesheet(JUri::base() . "plugins/system/ytshortcodes/shortcodes/image_compare/css/image_compare.css", 'text/css');
        // JavaScipt additon in Head
        JHtml::_('jquery.framework');
        JHtml::script(JUri::base() . "plugins/system/ytshortcodes/assets/js/jquery.twentytwenty.js");
        JHtml::script(JUri::base() . "plugins/system/ytshortcodes/assets/js/jquery.event.move.js");
        // OUtput Structure in  here
        $return = '
            <div id="' . $id . '" class="twentytwenty-container' . trim($atts['class']) . '" data-orientation="horizontal">
                <img src="' . yt_image_media($atts['before_image']) . '" alt="' . $atts['before_text'] . '">
                <img src="' . yt_image_media($atts['after_image']) . '" alt="' . $atts['before_text'] . '">
            </div>';
        $js = 'jQuery(window).load(function(){
              jQuery("#' . $id . '").twentytwenty({orientation: \'' . $atts['orientation'] . '\'});
            });';
        $doc = JFactory::getDocument();
        $doc->addStyleDeclaration($css);
        $doc->addScriptDeclaration($js);
    } else {
        $return = yt_alert_box('You can compare two images by using this shortcode', 'warning');
    }
    return $return;
}
示例#26
0
 /**
  * This method is called when the Quick Icons module is constructing its set
  * of icons. You can return an array which defines a single icon and it will
  * be rendered right after the stock Quick Icons.
  *
  * @param   string  $context  The calling context
  *
  * @return  array  A list of icon definition associative arrays, consisting of the
  *                 keys link, image, text and access.
  *
  * @since   2.5
  */
 public function onGetIcons($context)
 {
     //Load helper methods
     require_once JPATH_ADMINISTRATOR . '/components/com_playjoomupdate/helpers/playjoomupdate.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_playjoomupdate/helpers/pjversion.php';
     // Define the Joomla version if not already defined.
     if (!defined('PJVERSION')) {
         $jversion = new PJVersion();
         define('PJVERSION', $jversion->getShortVersion());
     }
     if (!class_exists('InstallerHelper')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php';
     }
     $this->UpdateConf = InstallerHelper::getConfig('Update', JPATH_ADMINISTRATOR . '/components/com_playjoomupdate/playjoomupdate.conf.php');
     $PJ_Extension_ID = $this->UpdateConf->get('PJUpdate_extension_id');
     if ($context != $this->params->get('context', 'mod_pj_quickicon') || !JFactory::getUser()->authorise('core.manage', 'com_installer')) {
         return;
     }
     JHtml::_('jquery.framework');
     $cur_template = JFactory::getApplication()->getTemplate();
     $url = JUri::base() . 'index.php?option=com_playjoomupdate';
     $ajax_url = JUri::base() . 'index.php?option=com_installer&view=update&task=update.ajax';
     $script = array();
     $script[] = 'var plg_quickicon_playjoomupdate_url = \'' . $url . '\';';
     $script[] = 'var plg_quickicon_playjoomupdate_ajax_url = \'' . $ajax_url . '\';';
     $script[] = 'var plg_quickicon_playjoomupdatecheck_pjversion = \'' . PJVERSION . '\'';
     $script[] = 'var plg_quickicon_playjoomupdatecheck_pjextensionid = \'' . $PJ_Extension_ID . '\'';
     $script[] = 'var plg_quickicon_playjoomupdate_text = {' . '"UPTODATE" : "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPTODATE', true) . '",' . '"UPDATEFOUND": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND', true) . '",' . '"UPDATEFOUND_MESSAGE": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_MESSAGE', true) . '",' . '"UPDATEFOUND_BUTTON": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_BUTTON', true) . '",' . '"ERROR": "' . JText::_('PLG_QUICKICON_JOOMLAUPDATE_ERROR', true) . '",' . '};';
     $script[] = 'var plg_quickicon_playjoomupdate_img = {' . '"UPTODATE" : "' . JUri::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-jupdate-uptodate.png",' . '"UPDATEFOUND": "' . JUri::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-jupdate-updatefound.png",' . '"ERROR": "' . JUri::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-deny.png",' . '};';
     //load javascripts
     $document = JFactory::getDocument();
     $document->addScriptDeclaration(implode("\n", $script));
     $document->addScript(JURI::root(true) . '/plugins/quickicon/playjoomupdate/js/pj_update_checker.js', 'text/javascript', true, false);
     return array(array('link' => 'index.php?option=com_playjoomupdate', 'image' => 'fa fa-download', 'icon' => 'header/icon-48-download.png', 'text' => JText::_('PLG_QUICKICON_JOOMLAUPDATE_CHECKING'), 'id' => 'plg_quickicon_joomlaupdate', 'group' => 'MOD_QUICKICON_MAINTENANCE'));
 }
示例#27
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);
 }
示例#28
0
文件: t3.php 项目: lazarch/t3
 /**
  * Switch template for thememagic
  */
 function onAfterInitialise()
 {
     include_once dirname(__FILE__) . '/includes/core/defines.php';
     include_once dirname(__FILE__) . '/includes/core/t3.php';
     include_once dirname(__FILE__) . '/includes/core/bot.php';
     //must be in frontend
     $app = JFactory::getApplication();
     if ($app->isAdmin()) {
         return;
     }
     $input = $app->input;
     if ($input->getCmd('themer', 0) && ($t3tmid = $input->getCmd('t3tmid', 0))) {
         $user = JFactory::getUser();
         if ($t3tmid > 0 && ($user->authorise('core.manage', 'com_templates') || isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], JUri::base()) !== false)) {
             $current = T3::getDefaultTemplate();
             if (!$current || $current->id != $t3tmid) {
                 $db = JFactory::getDbo();
                 $query = $db->getQuery(true);
                 $query->select('home, template, params')->from('#__template_styles')->where('client_id = 0 AND id= ' . (int) $t3tmid)->order('id ASC');
                 $db->setQuery($query);
                 $tm = $db->loadObject();
                 if (is_object($tm) && file_exists(JPATH_THEMES . '/' . $tm->template)) {
                     $app->setTemplate($tm->template, new JRegistry($tm->params));
                     // setTemplate is buggy, we need to update more info
                     // update the template
                     $template = $app->getTemplate(true);
                     $template->id = $t3tmid;
                     $template->home = $tm->template;
                 }
             }
         }
     }
 }
示例#29
0
 function onPromoteData($id)
 {
     $db = JFactory::getDBO();
     $Itemid = JRequest::getInt('Itemid');
     $jschk = $this->_chkextension();
     if (!empty($jschk)) {
         $query = "SELECT cf.id FROM #__community_fields as cf\n\t\t\t\t\t\t\t\tLEFT JOIN #__community_fields_values AS cfv ON cfv.field_id=cf.id\n\t\t\t\t\t\t\t\t\tWHERE cf.name like '%About me%' AND cfv.user_id=" . $id;
         $db->setQuery($query);
         $fieldid = $db->loadresult();
         $query = "SELECT u.name AS title, cu.avatar AS image, cfv.value AS bodytext\n\t\t\t\t\t\t\t\t\tFROM #__users AS u\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__community_users AS cu ON u.id=cu.userid\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__community_fields_values AS cfv ON cu.userid=cfv.user_id\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__community_fields AS cf ON cfv.field_id=cf.id\n\t\t\t\t\t\t\t\t\tWHERE cu.userid =" . $id;
         if ($fieldid) {
             $query .= " AND cfv.field_id=" . $fieldid;
         }
         $db->setQuery($query);
         $previewdata = $db->loadObjectlist();
         if (!$fieldid) {
             $previewdata[0]->bodytext = '';
         }
         // Include Jomsocial core
         $jspath = JPATH_ROOT . DS . 'components' . DS . 'com_community';
         include_once $jspath . DS . 'libraries' . DS . 'core.php';
         $previewdata[0]->url = JUri::root() . substr(CRoute::_('index.php?option=com_community&view=profile&userid=' . $id), strlen(JUri::base(true)) + 1);
         if ($previewdata[0]->image == '') {
             $previewdata[0]->image = 'components/com_community/assets/user-Male.png';
         }
         return $previewdata;
     } else {
         return '';
     }
 }
示例#30
0
 public function __construct(&$params, FoxMessageBoard &$messageboard)
 {
     parent::__construct($params, $messageboard);
     $this->ValidateEmail();
     // email can have text without being valid
     // Load required js only once
     if (!isset($GLOBALS[$GLOBALS["ext_name"] . '_js_loaded'])) {
         // The easy way to include chosen. It taunts the page source with tons of embedded javascripts.
         // JHtml::_("jquery.framework"); // jquery
         // JHtml::_('behavior.framework', true); // mootools
         // JHtml::_('formbehavior.chosen', 'select'); // chosen
         // We need jQuery to be loaded before our scripts
         JHtml::_("jquery.framework");
         $foxDocument = FoxDocument::getInstance();
         $min = JFactory::getConfig()->get("debug") ? "" : ".min";
         $foxDocument->addResource(array("root" => "components", "filename" => "jtext", "type" => "js"));
         $foxDocument->addScript(JUri::base(true) . "/components/" . $GLOBALS["com_name"] . "/js/fileuploader" . $min . ".js");
         $document = JFactory::getDocument();
         // chosen.jquery requires core for Joomla.JText
         $uncompressed = JFactory::getConfig()->get("debug") ? "-uncompressed" : "";
         $document->addScript(JUri::base(true) . "/media/system/js/core" . $uncompressed . ".js");
         $document->addScript(JUri::base(true) . "/media/jui/js/chosen.jquery" . $min . ".js");
         $GLOBALS[$GLOBALS["ext_name"] . '_js_loaded'] = true;
     }
     $this->isvalid = intval($this->ValidateForm());
     // Are all fields valid?
     $lang_handler = new FLangHandler();
     if ($lang_handler->HasMessages()) {
         $messageboard->Append($lang_handler->GetMessages(), FoxMessageBoard::warning);
     }
     $conflict = new FoxConflicting();
     if ($conflict->HasMessages()) {
         $messageboard->Append($conflict->GetMessages(), FoxMessageBoard::warning);
     }
 }