Esempio n. 1
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;
 }
Esempio n. 2
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';