Пример #1
0
 /**
  * Class constructor that instantiate the free and pro library, if installed
  */
 public function __construct($namespace)
 {
     parent::__construct($namespace, 'component');
     JModelLegacy::addIncludePath(JPATH_COMPONENT . '/models');
     JTable::addIncludePath(JPATH_COMPONENT . '/tables');
     $this->loadLibrary();
 }
Пример #2
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;
 }
 /**
  * Class constructor that instantiate the free and pro library, if installed
  *
  * @param string $namespace  Namespace
  * @param object $module     The base module, instance of stdClass
  */
 public function __construct($namespace, $module = null)
 {
     parent::__construct($namespace, 'module');
     $this->loadLibrary();
     if (is_object($module)) {
         $this->id = $module->id;
         $this->title = $module->title;
         $this->module = $module->module;
         $this->position = $module->position;
         $this->content = $module->content;
         $this->showtitle = $module->showtitle;
         $this->menuid = $module->menuid;
         $this->name = $module->name;
         $this->style = $module->style;
         $this->params = new JRegistry($module->params);
     }
 }
Пример #4
0
 /**
  * Class constructor that instantiate the free and pro library, if installed
  */
 public function __construct($namespace)
 {
     parent::__construct($namespace, 'component');
     $this->loadLibrary();
 }
Пример #5
0
 * any later version.
 *
 * OSMap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * 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;
use Alledia\Framework\Joomla\Extension\Licensed;
// 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');
    }
}
$osmap = new Licensed('OSMap', 'component');
if (!defined('OSMAP_LICENSE')) {
    $license = $osmap->isPro() ? 'pro' : 'free';
    define('OSMAP_LICENSE', $license);
}
$osmap->loadLibrary();
require_once JPATH_ADMINISTRATOR . '/components/com_osmap/include.php';
require_once JPATH_COMPONENT . '/displayer.php';
Пример #6
0
 /**
  * Class constructor that instantiate the free and pro library, if installed
  */
 public function __construct($namespace)
 {
     parent::__construct($namespace, 'module');
     $this->loadLibrary();
 }