Пример #1
0
 public function __construct($config = array())
 {
     if (version_compare(JVERSION, '3.0', 'lt')) {
         $this->option = JRequest::getCmd('option');
     } else {
         $app = Factory::getApplication();
         $this->option = $app->input->get('option');
     }
     $info = ExtensionHelper::getExtensionInfoFromElement($this->option);
     $this->extension = Factory::getExtension($info['namespace'], $info['type']);
 }
Пример #2
0
 public static function addCustomFooterIntoNativeComponentOutput($element)
 {
     // Check if the specified extension is from Alledia
     $extension = ExtensionHelper::getExtensionForElement($element);
     $footer = $extension->getFooterMarkup();
     if (!empty($footer)) {
         // Inject the custom footer
         if (version_compare(JVERSION, '3.0', 'lt')) {
             $body = JResponse::getBody();
             $body = preg_replace('#(<p\\salign="center">Joomla!\\s[0-9.\\s&;]*</p>)#i', $footer . '$1', $body);
             JResponse::setBody($body);
         } else {
             $app = Factory::getApplication();
             $body = $app->getBody();
             $body = str_replace('</section>', '</section>' . $footer, $body);
             $app->setBody($body);
         }
     }
 }
Пример #3
0
 /**
  * Return an array of Alledia extensions
  *
  * @todo Move this method for the class Alledia\Framework\Joomla\Extension\Helper, but keep as deprecated
  *
  * @param  string $license
  * @return array
  */
 public static function getAllediaExtensions($license = '')
 {
     // Get the extensions ids
     $db = \JFactory::getDbo();
     $query = $db->getQuery(true)->select($db->quoteName('extension_id'))->select($db->quoteName('type'))->select($db->quoteName('element'))->select($db->quoteName('folder'))->from('#__extensions')->where($db->quoteName('custom_data') . " LIKE '%\"author\":\"Alledia\"%'")->group($db->quoteName('extension_id'));
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     $extensions = array();
     foreach ($rows as $row) {
         $extensionInfo = ExtensionHelper::getExtensionInfoFromElement($row->element);
         $extension = new Joomla\Extension\Licensed($extensionInfo['namespace'], $row->type, $row->folder);
         if (!empty($license)) {
             if ($license === 'pro' && !$extension->isPro()) {
                 continue;
             } elseif ($license === 'free' && $extension->isPro()) {
                 continue;
             }
         }
         $extensions[$row->extension_id] = $extension;
     }
     return $extensions;
 }
Пример #4
0
<?php

/**
 * @package   OSDownloads
 * @contact   www.alledia.com, hello@alledia.com
 * @copyright 2015 Open Source Training, LLC. All rights reserved
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */
defined('_JEXEC') or die;
use Alledia\Framework\Joomla\Extension\Helper as ExtensionHelper;
// Alledia Framework
if (!defined('ALLEDIA_FRAMEWORK_LOADED')) {
    $allediaFrameworkPath = JPATH_SITE . '/libraries/allediaframework/include.php';
    if (file_exists($allediaFrameworkPath)) {
        require_once $allediaFrameworkPath;
    } else {
        JFactory::getApplication()->enqueueMessage('[OSDownloads] Alledia framework not found', 'error');
    }
}
define('OSDOWNLOADS_MEDIA_PATH', JPATH_SITE . 'media/com_osdownloads');
define('OSDOWNLOADS_MEDIA_URI', JUri::root() . 'media/com_osdownloads');
ExtensionHelper::loadLibrary('com_osdownloads');
Пример #5
0
<?php

/**
 * @package   OSEmbed
 * @contact   www.joomlashack.com, help@joomlashack.com
 * @copyright 2016 Open Source Training, LLC. All rights reserved
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */
use Alledia\Framework;
defined('_JEXEC') or die;
define('OSEMBED_PLUGIN_PATH', __DIR__);
// Alledia Framework
if (!defined('ALLEDIA_FRAMEWORK_LOADED')) {
    $allediaFrameworkPath = JPATH_SITE . '/libraries/allediaframework/include.php';
    if (file_exists($allediaFrameworkPath)) {
        require_once $allediaFrameworkPath;
    } else {
        $app = JFactory::getApplication();
        if ($app->isAdmin()) {
            $app->enqueueMessage('[OSEmbed] Alledia framework not found', 'error');
        }
    }
}
if (defined('ALLEDIA_FRAMEWORK_LOADED') && !defined('OSEMBED_LOADED')) {
    include_once 'library/autoload.php';
    Framework\Joomla\Extension\Helper::loadLibrary('plg_content_osembed');
    define('OSEMBED_LOADED', 1);
}
Пример #6
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with OSMap. If not, see <http://www.gnu.org/licenses/>.
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
use Alledia\Framework\Joomla\Extension\Helper as ExtensionHelper;
// Alledia Framework
if (!defined('ALLEDIA_FRAMEWORK_LOADED')) {
    $allediaFrameworkPath = JPATH_SITE . '/libraries/allediaframework/include.php';
    if (file_exists($allediaFrameworkPath)) {
        require_once $allediaFrameworkPath;
    } else {
        JFactory::getApplication()->enqueueMessage('[OSMap] Alledia framework not found', 'error');
    }
}
ExtensionHelper::loadLibrary('com_osmap');
jimport('joomla.application.component.controller');
JTable::addIncludePath(JPATH_COMPONENT . '/tables');
jimport('joomla.form.form');
JForm::addFieldPath(JPATH_COMPONENT . '/models/fields');
// Register helper class
JLoader::register('OSMapHelper', dirname(__FILE__) . '/helpers/osmap.php');
# For compatibility with older versions of Joola 2.5
if (!class_exists('JControllerLegacy')) {
    class JControllerLegacy extends JController
    {
    }
}