コード例 #1
0
 public function onBeforeDispatch()
 {
     // You can't fix stupid… but you can try working around it
     if (!function_exists('json_encode') || !function_exists('json_decode')) {
         require_once JPATH_ADMINISTRATOR . '/components/' . $this->component . '/helpers/jsonlib.php';
     }
     $result = parent::onBeforeDispatch();
     if ($result) {
         // Merge the language overrides
         $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR);
         $jlang = JFactory::getLanguage();
         $jlang->load($this->component, $paths[0], 'en-GB', true);
         $jlang->load($this->component, $paths[0], null, true);
         $jlang->load($this->component, $paths[1], 'en-GB', true);
         $jlang->load($this->component, $paths[1], null, true);
         $jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
         $jlang->load($this->component . '.override', $paths[0], null, true);
         $jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
         $jlang->load($this->component . '.override', $paths[1], null, true);
         // Load Akeeba Strapper
         if (!defined('AKEEBASUBSMEDIATAG')) {
             $staticFilesVersioningTag = md5(AKEEBASUBS_VERSION . AKEEBASUBS_DATE);
             define('AKEEBASUBSMEDIATAG', $staticFilesVersioningTag);
         }
         include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php';
         AkeebaStrapper::$tag = AKEEBASUBSMEDIATAG;
         AkeebaStrapper::bootstrap();
         AkeebaStrapper::jQueryUI();
         AkeebaStrapper::addCSSfile('media://com_akeebasubs/css/backend.css');
         AkeebaStrapper::addJSfile('media://com_akeebasubs/js/backend.js');
     }
     return $result;
 }
コード例 #2
0
ファイル: image.php プロジェクト: jonatasmm/akeebasubs
 public static function getURL($filename)
 {
     // Get the base site URL
     $url = JURI::base();
     $url = rtrim($url, '/');
     // Take into account relative URL for administrator
     list($isCLI, $isAdmin) = F0FDispatcher::isCliAdmin();
     if ($isAdmin) {
         $url .= '/..';
     }
     if (!class_exists('AkeebasubsHelperCparams')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/cparams.php';
     }
     $imagePath = trim(AkeebasubsHelperCparams::getParam('imagedir', 'images/'), '/');
     if (version_compare(JVERSION, '3.0', 'le')) {
         // Joomla! 2.5 : Pretty much straightforward
         return $url . '/' . $imagePath . '/' . $filename;
     } else {
         // Joomla! 3.0+ : Where the heck is the image?
         $testJ25 = JPATH_SITE . '/' . $imagePath . '/' . $filename;
         $testJ30 = JPATH_SITE . '/' . $filename;
         if (file_exists($testJ30)) {
             return $url . '/' . $filename;
         } else {
             return $url . '/' . $imagePath . '/' . $filename;
         }
     }
 }
コード例 #3
0
ファイル: channels.php プロジェクト: johngrange/wookeyholeweb
 /**
  * getParamsForm.
  *
  * @return	void
  */
 public function getParamsForm()
 {
     @ob_end_clean();
     header('Content-type: text/plain');
     // No JInputJSON in J2.5
     $raw = file_get_contents('php://input');
     $data = json_decode($raw, true);
     $safeHtmlFilter = JFilterInput::getInstance();
     $token = $data['token'];
     $token = $safeHtmlFilter->clean($token, 'ALNUM');
     $this->input->set($token, 1);
     // CSRF prevention
     if ($this->csrfProtection) {
         $this->_csrfProtection();
     }
     $channeltype_id = $data['channelTypeId'];
     $channeltype_id = $safeHtmlFilter->clean($channeltype_id, 'ALNUM');
     $channel_id = $data['channelId'];
     $channel_id = $safeHtmlFilter->clean($channel_id, 'ALNUM');
     // Load the model
     $channeltype = F0FModel::getTmpInstance('Channeltypes', 'AutoTweetModel');
     $view = 'nochannel';
     if ($channeltype_id) {
         $view = $channeltype->getParamsForm($channeltype_id);
     }
     $config = array('input' => array('option' => 'com_autotweet', 'view' => $view, 'task' => empty($channel_id) ? 'add' : 'edit', 'id' => $channel_id, 'channeltype_id' => $channeltype_id), 'modelName' => 'AutotweetModelChannels');
     @ob_start();
     F0FDispatcher::getTmpInstance('com_autotweet', $view, $config)->dispatch();
     $result = ob_get_contents();
     @ob_end_clean();
     $message = json_encode(array('status' => true, 'message' => $result));
     echo EJSON_START . $message . EJSON_END;
     flush();
     JFactory::getApplication()->close();
 }
コード例 #4
0
ファイル: dispatcher.php プロジェクト: BillVGN/PortalPRP
 public function onBeforeDispatch()
 {
     $result = parent::onBeforeDispatch();
     if ($result) {
         // Clear com_modules and com_plugins cache (needed when we alter module/plugin state)
         $core_components = array('com_modules', 'com_plugins');
         foreach ($core_components as $component) {
             try {
                 $cache = JFactory::getCache($component);
                 $cache->clean();
             } catch (Exception $e) {
                 // suck it up
             }
         }
         // Merge the language overrides
         $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR);
         $jlang = JFactory::getLanguage();
         $jlang->load($this->component, $paths[0], 'en-GB', true);
         $jlang->load($this->component, $paths[0], null, true);
         $jlang->load($this->component, $paths[1], 'en-GB', true);
         $jlang->load($this->component, $paths[1], null, true);
         $jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
         $jlang->load($this->component . '.override', $paths[0], null, true);
         $jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
         $jlang->load($this->component . '.override', $paths[1], null, true);
         // Load Akeeba Strapper
         if (!defined('ADMINTOOLSMEDIATAG')) {
             $staticFilesVersioningTag = md5(ADMINTOOLS_VERSION . ADMINTOOLS_DATE);
             define('ADMINTOOLSMEDIATAG', $staticFilesVersioningTag);
         }
         include_once JPATH_ROOT . '/media/akeeba_strapper/strapper.php';
         AkeebaStrapper::$tag = ADMINTOOLSMEDIATAG;
         AkeebaStrapper::bootstrap();
         AkeebaStrapper::jQueryUI();
         AkeebaStrapper::addCSSfile('admin://components/com_admintools/media/css/backend.css');
         // Work around non-transparent proxy and reverse proxy IP issues
         if (class_exists('F0FUtilsIp', true)) {
             F0FUtilsIp::workaroundIPIssues();
         }
         // Control Check
         $view = F0FInflector::singularize($this->input->getCmd('view', $this->defaultView));
         if ($view == 'liveupdate') {
             $url = JUri::base() . 'index.php?option=com_admintools';
             JFactory::getApplication()->redirect($url);
             return;
         }
         // ========== Master PW check ==========
         /** @var AdmintoolsModelMasterpw $model */
         $model = F0FModel::getAnInstance('Masterpw', 'AdmintoolsModel');
         if (!$model->accessAllowed($view)) {
             $url = $view == 'cpanel' ? 'index.php' : 'index.php?option=com_admintools&view=cpanel';
             JFactory::getApplication()->redirect($url, JText::_('ATOOLS_ERR_NOTAUTHORIZED'), 'error');
             return;
         }
     }
     return $result;
 }
コード例 #5
0
ファイル: dispatcher.php プロジェクト: jonatasmm/akeebasubs
 public function getTask($view)
 {
     $task = parent::getTask($view);
     switch ($view) {
         case 'level':
             if ($task == 'add') {
                 $task = 'read';
             }
     }
     return $task;
 }
コード例 #6
0
 /**
  * onBeforeDispatch.
  *
  * @return	void
  */
 public function onBeforeDispatch()
 {
     $result = parent::onBeforeDispatch();
     if ($result && !F0FPlatform::getInstance()->isCli()) {
         $view = $this->input->getCmd('view');
         Extly::loadStyle(false, $view != 'composer');
         $document = JFactory::getDocument();
         $document->addStyleSheet(JUri::root() . 'media/com_autotweet/css/style.css?version=' . CAUTOTWEETNG_VERSION);
     }
     return $result;
 }
コード例 #7
0
 /**
  * getComponentParam.
  *
  * @param   string  $option   Params
  * @param   string  $key      Params
  * @param   string  $default  Params
  *
  * @return	string.
  */
 public static function getComponentParam($option, $key, $default = null)
 {
     jimport('joomla.application.component.helper');
     if (F0FDispatcher::isCliAdmin()) {
         $params = JComponentHelper::getParams($option);
     } else {
         $app = JFactory::getApplication();
         $params = $app->getParams($option);
     }
     return $params->get($key, $default);
 }
コード例 #8
0
ファイル: dispatcher.php プロジェクト: mybo/com_lts
 public function onBeforeDispatch()
 {
     $result = parent::onBeforeDispatch();
     if ($result) {
         $strapperInclude = JPATH_ROOT . '/media/akeeba_strapper/strapper.php';
         if (@file_exists($strapperInclude)) {
             @(include_once $strapperInclude);
         }
         if (class_exists('AkeebaStrapper')) {
             AkeebaStrapper::bootstrap();
             AkeebaStrapper::jQueryUI();
         }
     }
     return $result;
 }
コード例 #9
0
 public function onBeforeDispatch()
 {
     $app = JFactory::getApplication();
     if ($app->isAdmin()) {
         $layout = new JLayoutFile('joomla.sidebars.submenu');
         $layout->addIncludePaths(JPATH_ADMINISTRATOR . '/components/com_j2store/layouts');
     }
     require_once JPATH_ADMINISTRATOR . '/components/com_j2store/helpers/strapper.php';
     J2StoreStrapper::addJS();
     J2StoreStrapper::addCSS();
     require_once JPATH_ADMINISTRATOR . '/components/com_j2store/helpers/j2store.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_j2store/library/popup.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_j2store/helpers/select.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_j2store/helpers/j2html.php';
     return parent::onBeforeDispatch();
 }
コード例 #10
0
ファイル: j2store.php プロジェクト: davetheapple/oakencraft
 protected function getInput()
 {
     $app = JFactory::getApplication();
     $id = $app->input->getInt('id');
     if ($app->isSite()) {
         $id = $app->input->getInt('a_id');
     }
     $productTable = F0FTable::getAnInstance('Product', 'J2StoreTable');
     $productTable->load(array('product_source' => 'com_content', 'product_source_id' => $id));
     $product_id = isset($productTable->j2store_product_id) ? $productTable->j2store_product_id : '';
     $inputvars = array('task' => 'edit', 'render_toolbar' => '0', 'product_source_id' => $id, 'id' => $product_id, 'product_source' => 'com_content', 'product_source_view' => 'article', 'form_prefix' => 'jform[attribs][j2store]');
     $input = new F0FInput($inputvars);
     @ob_start();
     F0FDispatcher::getTmpInstance('com_j2store', 'product', array('layout' => 'form', 'tmpl' => 'component', 'input' => $input))->dispatch();
     $html = ob_get_contents();
     ob_end_clean();
     return $html;
 }
コード例 #11
0
 /**
  * Autoload Toolbars
  *
  * @param   string  $class_name  The name of the class to load
  *
  * @return  void
  */
 public function autoload_fof_toolbar($class_name)
 {
     F0FPlatform::getInstance()->logDebug(__METHOD__ . "() autoloading {$class_name}");
     static $isCli = null, $isAdmin = null;
     if (is_null($isCli) && is_null($isAdmin)) {
         list($isCli, $isAdmin) = F0FDispatcher::isCliAdmin();
     }
     if (strpos($class_name, 'Toolbar') === false) {
         return;
     }
     // Change from camel cased into a lowercase array
     $class_modified = preg_replace('/(\\s)+/', '_', $class_name);
     $class_modified = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $class_modified));
     $parts = explode('_', $class_modified);
     // We need two parts in the name
     if (count($parts) != 2) {
         return;
     }
     // We need the second part to be "model"
     if ($parts[1] != 'toolbar') {
         return;
     }
     // Get the information about this class
     $component_raw = $parts[0];
     $component = 'com_' . $parts[0];
     $platformDirs = F0FPlatform::getInstance()->getPlatformBaseDirs();
     // Get the proper and alternate paths and file names
     $file = "/components/{$component}/toolbar.php";
     $path = $isAdmin || $isCli ? $platformDirs['admin'] : $platformDirs['public'];
     $altPath = $isAdmin || $isCli ? $platformDirs['public'] : $platformDirs['admin'];
     // Try to find the proper class in the proper path
     if (file_exists($path . $file)) {
         @(include_once $path . $file);
     }
     // Try to find the proper class in the alternate path
     if (!class_exists($class_name) && file_exists($altPath . $file)) {
         @(include_once $altPath . $file);
     }
     // No class found? Map to F0FToolbar
     if (!class_exists($class_name)) {
         $this->class_alias('F0FToolbar', $class_name, true);
     }
 }
コード例 #12
0
ファイル: toolbar.php プロジェクト: jonatasmm/akeebasubs
 public function onInvoicesBrowse()
 {
     //on frontend, buttons must be added specifically
     list($isCli, $isAdmin) = F0FDispatcher::isCliAdmin();
     if ($isAdmin || $this->renderFrontendSubmenu) {
         $this->renderSubmenu();
     }
     if (!$isAdmin && !$this->renderFrontendButtons) {
         return;
     }
     // Set toolbar title
     $subtitle_key = $this->input->getCmd('option', 'com_foobar') . '_TITLE_' . strtoupper($this->input->getCmd('view', 'cpanel'));
     JToolBarHelper::title(JText::_($this->input->getCmd('option', 'com_foobar')) . ' &ndash; <small>' . JText::_($subtitle_key) . '</small>', str_replace('com_', '', $this->input->getCmd('option', 'com_foobar')));
     // Add toolbar buttons
     if ($this->perms->delete) {
         JToolBarHelper::deleteList();
     }
 }
コード例 #13
0
 public function getJ2storeCartHtml($source_id = null)
 {
     $app = JFactory::getApplication();
     $html = '';
     $productTable = F0FTable::getAnInstance('Product', 'J2StoreTable');
     $productTable->load(array('product_source' => 'com_djcatalog2', 'product_source_id' => $app->input->getInt('id')));
     $product_id = isset($productTable->j2store_product_id) ? $productTable->j2store_product_id : '';
     $inputvars = array('task' => 'edit', 'render_toolbar' => '0', 'product_source_id' => $productTable->product_source_id, 'j2store_product_id' => $product_id, 'id' => $product_id, 'product_source' => 'com_djcatalog2', 'product_source_view' => 'item', 'form_prefix' => 'jform[params][j2store]');
     $input = new F0FInput($inputvars);
     @ob_start();
     F0FDispatcher::getTmpInstance('com_j2store', 'product', array('layout' => 'form', 'tmpl' => 'component', 'input' => $input))->dispatch();
     $html = ob_get_contents();
     ob_end_clean();
     return $html;
 }
コード例 #14
0
 /**
  * _execute
  *
  * @param   object  $article  Params
  * @param   object  $params   Params
  *
  * @return	string
  */
 private function _execute($article, $params)
 {
     $input = array('task' => 'read', 'article' => $article, 'params' => $params, 'savestate' => 0);
     $config = array('option' => 'com_autotweet', 'view' => 'feedarticle', 'input' => $input, 'cacheableTasks' => array());
     ob_start();
     F0FDispatcher::getTmpInstance('com_autotweet', 'feedarticle', $config)->dispatch();
     $html = ob_get_contents();
     ob_end_clean();
     return $html;
 }
コード例 #15
0
ファイル: dispatcher.php プロジェクト: esorone/efcpw
 public function dispatch()
 {
     if (!class_exists('AkeebaControllerDefault')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/controllers/default.php';
     }
     // Merge the language overrides
     $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR);
     $jlang = JFactory::getLanguage();
     $jlang->load($this->component, $paths[0], 'en-GB', true);
     $jlang->load($this->component, $paths[0], null, true);
     $jlang->load($this->component, $paths[1], 'en-GB', true);
     $jlang->load($this->component, $paths[1], null, true);
     $jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
     $jlang->load($this->component . '.override', $paths[0], null, true);
     $jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
     $jlang->load($this->component . '.override', $paths[1], null, true);
     F0FInflector::addWord('alice', 'alices');
     // Timezone fix; avoids errors printed out by PHP 5.3.3+ (thanks Yannick!)
     if (function_exists('date_default_timezone_get') && function_exists('date_default_timezone_set')) {
         if (function_exists('error_reporting')) {
             $oldLevel = error_reporting(0);
         }
         $serverTimezone = @date_default_timezone_get();
         if (empty($serverTimezone) || !is_string($serverTimezone)) {
             $serverTimezone = 'UTC';
         }
         if (function_exists('error_reporting')) {
             error_reporting($oldLevel);
         }
         @date_default_timezone_set($serverTimezone);
     }
     // Necessary defines for Akeeba Engine
     if (!defined('AKEEBAENGINE')) {
         define('AKEEBAENGINE', 1);
         // Required for accessing Akeeba Engine's factory class
         define('AKEEBAROOT', dirname(__FILE__) . '/akeeba');
         define('ALICEROOT', dirname(__FILE__) . '/alice');
     }
     // Setup Akeeba's ACLs, honoring laxed permissions in component's parameters, if set
     // Access check, Joomla! 1.6 style.
     $user = JFactory::getUser();
     if (!$user->authorise('core.manage', 'com_akeeba')) {
         return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
     }
     // Make sure we have a profile set throughout the component's lifetime
     $session = JFactory::getSession();
     $profile_id = $session->get('profile', null, 'akeeba');
     if (is_null($profile_id)) {
         // No profile is set in the session; use default profile
         $session->set('profile', 1, 'akeeba');
     }
     // Load Akeeba Engine and ALICE
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/engine/Factory.php';
     if (@file_exists(JPATH_COMPONENT_ADMINISTRATOR . '/alice/factory.php')) {
         require_once JPATH_COMPONENT_ADMINISTRATOR . '/alice/factory.php';
     }
     // Load the Akeeba Engine configuration
     Platform::addPlatform('joomla25', JPATH_COMPONENT_ADMINISTRATOR . '/platform/joomla25');
     $akeebaEngineConfig = Factory::getConfiguration();
     Platform::getInstance()->load_configuration();
     $jDbo = JFactory::getDbo();
     if ($jDbo->name == 'pdomysql') {
         // Prevents the "SQLSTATE[HY000]: General error: 2014" due to resource sharing with Akeeba Engine
         @JFactory::getDbo()->disconnect();
     }
     unset($akeebaEngineConfig);
     // Preload helpers
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/escape.php';
     // Load the utils helper library
     Platform::getInstance()->load_version_defines();
     // Create a versioning tag for our static files
     $staticFilesVersioningTag = md5(AKEEBA_VERSION . AKEEBA_DATE);
     define('AKEEBAMEDIATAG', $staticFilesVersioningTag);
     $this->input->set('view', $this->view);
     // Load JHtml behaviours as needed
     $this->loadJHtmlBehaviors();
     parent::dispatch();
 }
コード例 #16
0
ファイル: akeeba.php プロジェクト: WineWorld/joomlatrialcmbg
/**
 * @package AkeebaBackup
 * @copyright Copyright (c)2009-2014 Nicholas K. Dionysopoulos
 * @license GNU General Public License version 3, or later
 *
 * @since 1.3
 */
// Protect from unauthorized access
defined('_JEXEC') or die;
JDEBUG ? define('AKEEBADEBUG', 1) : null;
// Check for PHP4
if (defined('PHP_VERSION')) {
    $version = PHP_VERSION;
} elseif (function_exists('phpversion')) {
    $version = phpversion();
} else {
    // No version info. I'll lie and hope for the best.
    $version = '5.0.0';
}
// Old PHP version detected. EJECT! EJECT! EJECT!
if (!version_compare($version, '5.3.0', '>=')) {
    return JError::raise(E_ERROR, 500, 'This version of PHP is not compatible with Akeeba Backup');
}
JLoader::import('joomla.application.component.model');
// Load F0F
include_once JPATH_SITE . '/libraries/f0f/include.php';
if (!defined('F0F_INCLUDED') || !class_exists('F0FForm', true)) {
    JError::raiseError('500', 'Your Akeeba Backup installation is broken; please re-install. Alternatively, extract the installation archive and copy the fof directory inside your site\'s libraries directory.');
}
F0FDispatcher::getTmpInstance('com_akeeba')->dispatch();
コード例 #17
0
ファイル: j2store.php プロジェクト: davetheapple/oakencraft
<?php

/**
 * @package J2Store
 * @copyright Copyright (c)2014-17 Ramesh Elamathi / J2Store.org
 * @license GNU GPL v3 or later
 */
// No direct access to this file
defined('_JEXEC') or die;
// Load FOF
// Include F0F
if (!defined('F0F_INCLUDED')) {
    require_once JPATH_LIBRARIES . '/f0f/include.php';
}
if (!defined('F0F_INCLUDED')) {
    ?>
   <h2>Incomplete installation detected</h2>
<?php 
}
if (!class_exists('J2StoreStrapper')) {
    require_once JPATH_ADMINISTRATOR . '/components/com_j2store/helpers/strapper.php';
}
J2StoreStrapper::addJS();
J2StoreStrapper::addCSS();
F0FDispatcher::getTmpInstance('com_j2store')->dispatch();
コード例 #18
0
ファイル: toolbar.php プロジェクト: johngrange/wookeyholeweb
 /**
  * _onAllPages.
  *
  * @return	void
  */
 public function _onAllPages()
 {
     // On frontend, buttons must be added specifically
     list($isCli, $isAdmin) = F0FDispatcher::isCliAdmin();
     if ($isAdmin || $this->renderFrontendSubmenu) {
         $this->renderSubmenu();
     }
     if (!$isAdmin && !$this->renderFrontendButtons) {
         return;
     }
 }
コード例 #19
0
 */
// No direct access
defined('_JEXEC') or die('Restricted access');
if (!defined('AUTOTWEET_API')) {
    include_once JPATH_ADMINISTRATOR . '/components/com_autotweet/api/autotweetapi.php';
}
// To have the version helper available always
JLoader::load('VersionHelper');
$count = $params->get('count', 5);
$mode = $params->get('mode', 1);
$input = array('savestate' => 0, 'limit' => $count, 'limitstart' => 0, 'no_clear' => true, 'only_once' => true, 'task' => 'browse', 'filter_order' => 'postdate', 'filter_order_Dir' => 'DESC', 'enabled' => 1, 'caching' => false);
switch ($mode) {
    // Show latest successful Posts
    case 1:
        $input['pubstate'] = 'success';
        break;
        // Show latest error or pending Posts
    // Show latest error or pending Posts
    case 2:
        $input['pubstate'] = array('error', 'approve');
        break;
        // Show waiting (cronjob) Posts
    // Show waiting (cronjob) Posts
    case 3:
    default:
        $input['pubstate'] = 'cronjob';
        break;
}
$config = array('option' => 'com_autotweet', 'view' => 'posts', 'layout' => 'module', 'input' => $input);
F0FDispatcher::getTmpInstance('com_autotweet', 'posts', $config)->dispatch();
コード例 #20
0
ファイル: channel.php プロジェクト: johngrange/wookeyholeweb
 /**
  * renderPost
  *
  * @param   int     $channelid    Param
  * @param   string  $channeltype  Param
  * @param   string  $message      Param
  * @param   string  $data         Param
  *
  * @return  string
  */
 public function renderPost($channelid, $channeltype, $message, $data)
 {
     $input = array('task' => 'read', 'format' => 'raw', 'cid' => array(), 'id' => $channelid, 'message' => $message, 'title' => $data->title, 'fulltext' => $data->fulltext, 'url' => $data->url, 'org_url' => $data->org_url, 'image_url' => $data->image_url, 'media_mode' => $this->getMediaMode());
     $config = array('option' => 'com_autotweet', 'view' => 'channel', 'layout' => $channeltype . '-post', 'input' => $input);
     ob_start();
     F0FDispatcher::getTmpInstance('com_autotweet', 'channels', $config)->dispatch();
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }
コード例 #21
0
// no direct access
defined('_JEXEC') or die('');
// PHP version check
if (defined('PHP_VERSION')) {
    $version = PHP_VERSION;
} elseif (function_exists('phpversion')) {
    $version = phpversion();
} else {
    // No version info. I'll lie and hope for the best.
    $version = '5.0.0';
}
// Old PHP version detected. EJECT! EJECT! EJECT!
if (!version_compare($version, '5.3.0', '>=')) {
    return;
}
include_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/version.php';
include_once JPATH_LIBRARIES . '/f0f/include.php';
if (!defined('F0F_INCLUDED') || !class_exists('F0FForm', true)) {
    return;
}
require_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/format.php';
require_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/cparams.php';
$layout = $params->get('layout', 'awesome');
$ids = $params->get('ids', array());
$config = array('option' => 'com_akeebasubs', 'view' => 'levels', 'layout' => $layout, 'input' => array('savestate' => 0, 'limit' => 0, 'limitstart' => 0, 'no_clear' => true, 'only_once' => true, 'task' => 'browse', 'filter_order' => 'ordering', 'filter_order_Dir' => 'ASC', 'enabled' => 1, 'caching' => false));
if (!empty($ids)) {
    $config['input']['id'] = $ids;
}
//$fp = fopen(JPATH_SITE.'/logs/backtrace.txt', 'at');fwrite($fp, "\n\n\n".  str_repeat('*', 78)."\n\n\n");fclose($fp);
F0FDispatcher::getTmpInstance('com_akeebasubs', 'levels', $config)->dispatch();
//$fp = fopen(JPATH_SITE.'/logs/backtrace.txt', 'at');fwrite($fp, "\n\n\n".  str_repeat('~', 78)."\n\n\n");fclose($fp);
コード例 #22
0
ファイル: todo.php プロジェクト: mybo/com_lts
<?php

/*
 * @package todo
 * @copyright Copyright (c)2014 Nicholas K. Dionysopoulos / AkeebaBackup.com
 * @license GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
// Load FOF
include_once JPATH_LIBRARIES . '/f0f/include.php';
if (!defined('F0F_INCLUDED')) {
    JError::raiseError('500', 'FOF is not installed');
    return;
}
F0FDispatcher::getTmpInstance('com_todo')->dispatch();
コード例 #23
0
    include_once JPATH_ADMINISTRATOR . '/components/com_autotweet/api/autotweetapi.php';
}
$base_url = EParameter::getComponentParam(CAUTOTWEETNG, 'base_url');
if (defined('AUTOTWEET_CRONJOB_RUNNING') && AUTOTWEET_CRONJOB_RUNNING && !filter_var($base_url, FILTER_VALIDATE_URL)) {
    throw new Exception('AUTOTWEET_CRONJOB: Url base not set.');
}
$config = array();
$controller = null;
// If we are processing Gplus, redirect to controller
$session = JFactory::getSession();
$channelId = $session->get('channelId');
if (!empty($channelId)) {
    $input = new F0FInput();
    // Google+ and Blogger
    $code = $input->getString('code');
    // ScoopIt
    $oauth_token = $input->getString('oauth_token');
    $oauth_verifier = $input->getString('oauth_verifier');
    // LinkedIn
    // $code = $input->getString('code');
    $state = $input->getString('state');
    if (!empty($oauth_token) && !empty($oauth_verifier) || !empty($code) && !empty($state) || !empty($code)) {
        $controller = F0FModel::getTmpInstance('Channeltypes', 'AutoTweetModel')->getAuthCallback($channelId);
        $config['input'] = array('task' => 'callback');
    } else {
        $session->set('channelId', false);
    }
}
// F0F app
F0FDispatcher::getTmpInstance('com_autotweet', $controller, $config)->dispatch();
コード例 #24
0
 public function dispatch()
 {
     if (!class_exists('AkeebaControllerDefault')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/controllers/default.php';
     }
     // Merge the language overrides
     $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR);
     $jlang = JFactory::getLanguage();
     $jlang->load($this->component, $paths[0], 'en-GB', true);
     $jlang->load($this->component, $paths[0], null, true);
     $jlang->load($this->component, $paths[1], 'en-GB', true);
     $jlang->load($this->component, $paths[1], null, true);
     $jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
     $jlang->load($this->component . '.override', $paths[0], null, true);
     $jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
     $jlang->load($this->component . '.override', $paths[1], null, true);
     F0FInflector::addWord('alice', 'alices');
     // Timezone fix; avoids errors printed out by PHP 5.3.3+ (thanks Yannick!)
     if (function_exists('date_default_timezone_get') && function_exists('date_default_timezone_set')) {
         if (function_exists('error_reporting')) {
             $oldLevel = error_reporting(0);
         }
         $serverTimezone = @date_default_timezone_get();
         if (empty($serverTimezone) || !is_string($serverTimezone)) {
             $serverTimezone = 'UTC';
         }
         if (function_exists('error_reporting')) {
             error_reporting($oldLevel);
         }
         @date_default_timezone_set($serverTimezone);
     }
     // Necessary defines for Akeeba Engine
     if (!defined('AKEEBAENGINE')) {
         define('AKEEBAENGINE', 1);
         // Required for accessing Akeeba Engine's factory class
         define('AKEEBAROOT', dirname(__FILE__) . '/akeeba');
         define('ALICEROOT', dirname(__FILE__) . '/alice');
     }
     // Setup Akeeba's ACLs, honoring laxed permissions in component's parameters, if set
     // Access check, Joomla! 1.6 style.
     $user = JFactory::getUser();
     if (!$user->authorise('core.manage', 'com_akeeba')) {
         return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
     }
     // Make sure we have a profile set throughout the component's lifetime
     $session = JFactory::getSession();
     $profile_id = $session->get('profile', null, 'akeeba');
     if (is_null($profile_id)) {
         // No profile is set in the session; use default profile
         $session->set('profile', 1, 'akeeba');
     }
     // Load the factory
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/akeeba/factory.php';
     @(include_once JPATH_COMPONENT_ADMINISTRATOR . '/alice/factory.php');
     // Load the Akeeba Backup configuration and check user access permission
     $aeconfig = AEFactory::getConfiguration();
     AEPlatform::getInstance()->load_configuration();
     $jDbo = JFactory::getDbo();
     if ($jDbo->name == 'pdomysql') {
         // Prevents the "SQLSTATE[HY000]: General error: 2014" due to resource sharing with Akeeba Engine
         @JFactory::getDbo()->disconnect();
     }
     unset($aeconfig);
     // Preload helpers
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/includes.php';
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/escape.php';
     // Load the utils helper library
     AEPlatform::getInstance()->load_version_defines();
     // Create a versioning tag for our static files
     $staticFilesVersioningTag = md5(AKEEBA_VERSION . AKEEBA_DATE);
     define('AKEEBAMEDIATAG', $staticFilesVersioningTag);
     // If JSON functions don't exist, load our compatibility layer
     if (!function_exists('json_encode') || !function_exists('json_decode')) {
         require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/jsonlib.php';
     }
     // Look for controllers in the plugins folder
     $option = $this->input->get('option', 'com_foobar', 'cmd');
     $view = $this->input->get('view', $this->defaultView, 'cmd');
     $c = F0FInflector::singularize($view);
     $alt_path = JPATH_ADMINISTRATOR . '/components/' . $option . '/plugins/controllers/' . $c . '.php';
     JLoader::import('joomla.filesystem.file');
     if (JFile::exists($alt_path)) {
         // The requested controller exists and there you load it...
         require_once $alt_path;
     }
     $this->input->set('view', $this->view);
     parent::dispatch();
 }
コード例 #25
0
ファイル: admintools.php プロジェクト: enjoy2000/smcd
    require_once $version_php;
}
// If JSON functions don't exist, load our compatibility layer
if (!function_exists('json_encode') || !function_exists('json_decode')) {
    require_once JPATH_COMPONENT_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'jsonlib.php';
}
JLoader::import('joomla.application.component.model');
require_once JPATH_ADMINISTRATOR . '/components/com_admintools/models/storage.php';
$paths = array(JPATH_ADMINISTRATOR, JPATH_ROOT);
$jlang = JFactory::getLanguage();
$jlang->load('com_admintools', $paths[0], 'en-GB', true);
$jlang->load('com_admintools', $paths[0], null, true);
$jlang->load('com_admintools', $paths[1], 'en-GB', true);
$jlang->load('com_admintools', $paths[1], null, true);
$jlang->load('com_admintools' . '.override', $paths[0], 'en-GB', true);
$jlang->load('com_admintools' . '.override', $paths[0], null, true);
$jlang->load('com_admintools' . '.override', $paths[1], 'en-GB', true);
$jlang->load('com_admintools' . '.override', $paths[1], null, true);
// Force the view and task
JFactory::getApplication()->input->set('view', 'blocks');
JFactory::getApplication()->input->set('task', 'browse');
if (class_exists('JRequest')) {
    JRequest::setVar('view', 'blocks');
    JRequest::setVar('task', 'browse');
}
// Work around non-transparent proxy and reverse proxy IP issues
if (class_exists('F0FUtilsIp', true)) {
    F0FUtilsIp::workaroundIPIssues();
}
F0FDispatcher::getTmpInstance('com_admintools')->dispatch();
コード例 #26
0
ファイル: message.php プロジェクト: jonatasmm/akeebasubs
 /**
  * Pre-processes the message text in $text, replacing merge tags with those
  * fetched based on subscription $sub
  *
  * @param   string  $text    The message to process
  * @param   AkeebasubsTableSubscription  $sub  A subscription object
  *
  * @return  string  The processed string
  */
 public static function processSubscriptionTags($text, $sub, $extras = array())
 {
     // Get the user object for this subscription
     $user = JFactory::getUser($sub->user_id);
     // Get the extra user parameters object for the subscription
     $kuser = F0FModel::getTmpInstance('Users', 'AkeebasubsModel')->user_id($sub->user_id)->getFirstItem();
     // Get the subscription level
     $level = F0FModel::getTmpInstance('Levels', 'AkeebasubsModel')->getItem($sub->akeebasubs_level_id);
     // Merge the user objects
     $userdata = array_merge((array) $user, (array) $kuser->getData());
     // Create and replace merge tags for subscriptions. Format [SUB:KEYNAME]
     if ($sub instanceof AkeebasubsTableSubscription) {
         $subData = (array) $sub->getData();
     } else {
         $subData = (array) $sub;
     }
     foreach ($subData as $k => $v) {
         if (is_array($v) || is_object($v)) {
             continue;
         }
         if (substr($k, 0, 1) == '_') {
             continue;
         }
         if ($k == 'akeebasubs_subscription_id') {
             $k = 'id';
         }
         $tag = '[SUB:' . strtoupper($k) . ']';
         if (in_array($k, array('net_amount', 'gross_amount', 'tax_amount', 'prediscount_amount', 'discount_amount', 'affiliate_comission'))) {
             $v = sprintf('%.2f', $v);
         }
         $text = str_replace($tag, $v, $text);
     }
     // Create and replace merge tags for the subscription level. Format [LEVEL:KEYNAME]
     $levelData = (array) $level->getData();
     foreach ($levelData as $k => $v) {
         if (is_array($v) || is_object($v)) {
             continue;
         }
         if (substr($k, 0, 1) == '_') {
             continue;
         }
         if ($k == 'akeebasubs_level_id') {
             $k = 'id';
         }
         $tag = '[LEVEL:' . strtoupper($k) . ']';
         $text = str_replace($tag, $v, $text);
     }
     // Create and replace merge tags for custom per-subscription data. Format [SUBCUSTOM:KEYNAME]
     if (array_key_exists('params', $subData)) {
         if (is_string($subData['params'])) {
             $custom = json_decode($subData['params'], true);
         } elseif (is_array($subData['params'])) {
             $custom = $subData['params'];
         } elseif (is_object($subData['params'])) {
             $custom = (array) $subData['params'];
         } else {
             $custom = array();
         }
         // Extra check for subcustom params: if you save a subscription form the backend,
         // custom fields are inside an array named subcustom
         if (is_array($custom) && isset($custom['subcustom'])) {
             $custom = $custom['subcustom'];
         }
         if (!empty($custom)) {
             foreach ($custom as $k => $v) {
                 if (is_object($v)) {
                     continue;
                 }
                 if (substr($k, 0, 1) == '_') {
                     continue;
                 }
                 $tag = '[SUBCUSTOM:' . strtoupper($k) . ']';
                 if (is_array($v)) {
                     continue;
                 }
                 $text = str_replace($tag, $v, $text);
             }
         }
     }
     // Create and replace merge tags for user data. Format [USER:KEYNAME]
     foreach ($userdata as $k => $v) {
         if (is_object($v) || is_array($v)) {
             continue;
         }
         if (substr($k, 0, 1) == '_') {
             continue;
         }
         if ($k == 'akeebasubs_subscription_id') {
             $k = 'id';
         }
         $tag = '[USER:'******']';
         $text = str_replace($tag, $v, $text);
     }
     // Create and replace merge tags for custom fields data. Format [CUSTOM:KEYNAME]
     if (array_key_exists('params', $userdata)) {
         if (is_string($userdata['params'])) {
             $custom = json_decode($userdata['params']);
         } elseif (is_array($userdata['params'])) {
             $custom = $userdata['params'];
         } elseif (is_object($userdata['params'])) {
             $custom = (array) $userdata['params'];
         } else {
             $custom = array();
         }
         if (!empty($custom)) {
             foreach ($custom as $k => $v) {
                 if (substr($k, 0, 1) == '_') {
                     continue;
                 }
                 $tag = '[CUSTOM:' . strtoupper($k) . ']';
                 if (is_array($v)) {
                     $v = implode(', ', $v);
                 }
                 $text = str_replace($tag, $v, $text);
             }
         }
     }
     // Extra variables replacement
     // -- Coupon code
     $couponcode = '';
     if ($sub->akeebasubs_coupon_id) {
         $couponData = F0FModel::getTmpInstance('Coupons', 'AkeebasubsModel')->savestate(0)->getItem($sub->akeebasubs_coupon_id);
         $couponcode = $couponData->coupon;
     }
     // -- Get the site name
     $config = JFactory::getConfig();
     if (version_compare(JVERSION, '3.0', 'ge')) {
         $sitename = $config->get('sitename');
     } else {
         $sitename = $config->getValue('config.sitename');
     }
     // -- First/last name
     $fullname = $user->name;
     $nameParts = explode(' ', $fullname, 2);
     $firstname = array_shift($nameParts);
     $lastname = !empty($nameParts) ? array_shift($nameParts) : '';
     // -- Get the subscription level
     $level = F0FModel::getTmpInstance('Levels', 'AkeebasubsModel')->setId($sub->akeebasubs_level_id)->getItem();
     // -- Site URL
     list($isCli, $isAdmin) = F0FDispatcher::isCliAdmin();
     if ($isCli) {
         JLoader::import('joomla.application.component.helper');
         $baseURL = JComponentHelper::getParams('com_akeebasubs')->get('siteurl', 'http://www.example.com');
         $temp = str_replace('http://', '', $baseURL);
         $temp = str_replace('https://', '', $temp);
         $parts = explode($temp, '/', 2);
         $subpathURL = count($parts) > 1 ? $parts[1] : '';
     } else {
         $baseURL = JURI::base();
         $subpathURL = JURI::base(true);
     }
     $baseURL = str_replace('/administrator', '', $baseURL);
     $subpathURL = str_replace('/administrator', '', $subpathURL);
     // -- My Subscriptions URL
     if ($isAdmin || $isCli) {
         $url = 'index.php?option=com_akeebasubs&view=subscriptions&layout=default';
     } else {
         $url = str_replace('&amp;', '&', JRoute::_('index.php?option=com_akeebasubs&view=subscriptions&layout=default'));
     }
     $url = ltrim($url, '/');
     $subpathURL = ltrim($subpathURL, '/');
     if (substr($url, 0, strlen($subpathURL) + 1) == "{$subpathURL}/") {
         $url = substr($url, strlen($subpathURL) + 1);
     }
     $mysubsurl = rtrim($baseURL, '/') . '/' . ltrim($url, '/');
     $currency = '';
     if (!class_exists('AkeebasubsHelperCparams')) {
         @(include_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/cparams.php');
     }
     if (class_exists('AkeebasubsHelperCparams')) {
         $currency = AkeebasubsHelperCparams::getParam('currencysymbol', '€');
     }
     // Dates
     JLoader::import('joomla.utilities.date');
     $jFrom = new JDate($sub->publish_up);
     $jTo = new JDate($sub->publish_down);
     // Download ID
     $dlid = md5($user->id . $user->username . $user->password);
     // User's state, human readable
     $formatted_state = '';
     $state = $kuser->state;
     if (!empty($state)) {
         if (!class_exists('AkeebasubsHelperSelect')) {
             require_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/select.php';
         }
         $formatted_state = AkeebasubsHelperSelect::formatState($state);
     }
     // User's country, human readable
     $formatted_country = '';
     $country = $kuser->country;
     if (!empty($country)) {
         if (!class_exists('AkeebasubsHelperSelect')) {
             require_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/select.php';
         }
         $formatted_country = AkeebasubsHelperSelect::formatCountry($country);
     }
     // -- The actual replacement
     $extras = array_merge(array("\\n" => "\n", '[SITENAME]' => $sitename, '[SITEURL]' => $baseURL, '[FULLNAME]' => $fullname, '[FIRSTNAME]' => $firstname, '[LASTNAME]' => $lastname, '[USERNAME]' => $user->username, '[USEREMAIL]' => $user->email, '[LEVEL]' => $level->title, '[ENABLED]' => JText::_('COM_AKEEBASUBS_SUBSCRIPTION_COMMON_' . ($sub->enabled ? 'ENABLED' : 'DISABLED')), '[PAYSTATE]' => JText::_('COM_AKEEBASUBS_SUBSCRIPTION_STATE_' . $sub->state), '[PUBLISH_UP]' => $jFrom->format(JText::_('DATE_FORMAT_LC2'), true), '[PUBLISH_UP_EU]' => $jFrom->format('d/m/Y H:i:s', true), '[PUBLISH_UP_USA]' => $jFrom->format('m/d/Y h:i:s a', true), '[PUBLISH_UP_JAPAN]' => $jFrom->format('Y/m/d H:i:s', true), '[PUBLISH_DOWN]' => $jTo->format(JText::_('DATE_FORMAT_LC2'), true), '[PUBLISH_DOWN_EU]' => $jTo->format('d/m/Y H:i:s', true), '[PUBLISH_DOWN_USA]' => $jTo->format('m/d/Y h:i:s a', true), '[PUBLISH_DOWN_JAPAN]' => $jTo->format('Y/m/d H:i:s', true), '[MYSUBSURL]' => $mysubsurl, '[URL]' => $mysubsurl, '[CURRENCY]' => $currency, '[$]' => $currency, '[DLID]' => $dlid, '[COUPONCODE]' => $couponcode, '[USER:STATE_FORMATTED]' => $formatted_state, '[USER:COUNTRY_FORMATTED]' => $formatted_country, '[NAME]' => $firstname, '[STATE]' => JText::_('COM_AKEEBASUBS_SUBSCRIPTION_STATE_' . $sub->state), '[FROM]' => $jFrom->format(JText::_('DATE_FORMAT_LC2'), true), '[TO]' => $jTo->format(JText::_('DATE_FORMAT_LC2'), true)), $extras);
     foreach ($extras as $key => $value) {
         $text = str_replace($key, $value, $text);
     }
     return $text;
 }
コード例 #27
0
ファイル: dispatcher.php プロジェクト: kidaa30/lojinha
 public function dispatch()
 {
     // Look for controllers in the plugins folder
     $option = $this->input->get('option', 'com_foobar', 'cmd');
     $view = $this->input->get('view', $this->defaultView, 'cmd');
     $c = F0FInflector::singularize($view);
     $alt_path = JPATH_SITE . '/components/' . $option . '/plugins/controllers/' . $c . '.php';
     JLoader::import('joomla.filesystem.file');
     if (JFile::exists($alt_path)) {
         // The requested controller exists and there you load it...
         require_once $alt_path;
     }
     $this->input->set('view', $this->view);
     parent::dispatch();
 }
コード例 #28
0
include_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/version.php';
include_once JPATH_LIBRARIES . '/f0f/include.php';
if (!defined('F0F_INCLUDED') || !class_exists('F0FForm', true)) {
    return;
}
require_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/format.php';
require_once JPATH_ADMINISTRATOR . '/components/com_akeebasubs/helpers/cparams.php';
$lang = JFactory::getLanguage();
$lang->load('mod_aksubslist', JPATH_SITE, 'en-GB', true);
$lang->load('mod_aksubslist', JPATH_SITE, null, true);
$lang->load('com_akeebasubs', JPATH_SITE, 'en-GB', true);
$lang->load('com_akeebasubs', JPATH_SITE, null, true);
?>
<div id="mod-aksubslist-<?php 
echo $module->id;
?>
" class="mod-aksubslist">
<?php 
if (JFactory::getUser()->guest) {
    ?>
	<span class="akeebasubs-subscriptions-itemized-nosubs">
		<?php 
    echo JText::_('COM_AKEEBASUBS_LEVELS_ITEMIZED_NOSUBS');
    ?>
	</span>
<?php 
} else {
    F0FDispatcher::getTmpInstance('com_akeebasubs', 'subscriptions', array('input' => array('savestate' => 0, 'option' => 'com_akeebasubs', 'view' => 'subscriptions', 'layout' => 'itemized', 'limit' => 0, 'limitstart' => 0, 'paystate' => 'C', 'user_id' => JFactory::getUser()->id, 'task' => 'browse')))->dispatch();
}
?>
</div>
コード例 #29
0
 /**
  * getControllerParams
  *
  * @return	array
  */
 public static function getControllerParams()
 {
     list($isCli, $isAdmin) = F0FDispatcher::isCliAdmin();
     $input = new F0FInput();
     $option = $input->get('option');
     $controller = $input->get('controller');
     $task = $input->get('task');
     $view = $input->get('view');
     $layout = $input->get('layout');
     $id = $input->get('id', null, 'int');
     if (!$id) {
         $cid = $input->get('cid', array(), 'ARRAY');
         if (is_array($cid) && count($cid) == 1) {
             $id = $cid[0];
         } elseif (is_numeric($cid) && $cid > 0) {
             $id = $cid;
         }
     }
     // EasyBlog
     if (!$id) {
         $id = $input->get('blogid', null, 'int');
     }
     // JoomShopping
     if (!$id) {
         $id = $input->get('product_id', null, 'int');
     }
     // Content - Front
     if (!$id) {
         $id = $input->get('a_id', null, 'int');
     }
     // SobiPro
     if (!$id) {
         $id = $input->get('sid', null, 'int');
     }
     // Zoo - Front
     if (!$id) {
         $id = $input->get('item_id', null, 'int');
     }
     // Joocial - Composer
     if (!$id) {
         $id = $input->get('ref_id', null, 'cmd');
     }
     return array($isAdmin, $option, $controller, $task, $view, $layout, $id);
 }