本文整理汇总了PHP中JLoader::import方法的典型用法代码示例。如果您正苦于以下问题:PHP JLoader::import方法的具体用法?PHP JLoader::import怎么用?PHP JLoader::import使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JLoader
的用法示例。
在下文中一共展示了JLoader::import方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListing
public function getListing()
{
JLoader::import('joomla.filesystem.folder');
$this->applyPath();
$relpath = $this->getState('filter_path', '');
$path = JPATH_ROOT . DIRECTORY_SEPARATOR . $relpath;
$folders_raw = JFolder::folders($path);
$files_raw = JFolder::files($path);
if (!empty($relpath)) {
$relpath .= '/';
}
$folders = array();
if (!empty($folders_raw)) {
foreach ($folders_raw as $folder) {
$perms = $this->getPerms($relpath . $folder);
$currentperms = @fileperms(JPATH_ROOT . DIRECTORY_SEPARATOR . $relpath . $folder);
$owneruser = function_exists('fileowner') ? fileowner(JPATH_ROOT . DIRECTORY_SEPARATOR . $relpath . $folder) : false;
$ownergroup = function_exists('filegroup') ? filegroup(JPATH_ROOT . DIRECTORY_SEPARATOR . $relpath . $folder) : false;
$folders[] = array('item' => $folder, 'path' => $relpath . $folder, 'perms' => $perms, 'realperms' => $currentperms, 'uid' => $owneruser, 'gid' => $ownergroup);
}
}
$files = array();
if (!empty($files_raw)) {
foreach ($files_raw as $file) {
$perms = $this->getPerms($relpath . $file);
$currentperms = @fileperms(JPATH_ROOT . DIRECTORY_SEPARATOR . $relpath . $file);
$owneruser = function_exists('fileowner') ? @fileowner(JPATH_ROOT . DIRECTORY_SEPARATOR . $relpath . $file) : false;
$ownergroup = function_exists('filegroup') ? @filegroup(JPATH_ROOT . DIRECTORY_SEPARATOR . $relpath . $file) : false;
$files[] = array('item' => $file, 'path' => $relpath . $file, 'perms' => $perms, 'realperms' => $currentperms, 'uid' => $owneruser, 'gid' => $ownergroup);
}
}
$crumbs = explode('/', $relpath);
return array('folders' => $folders, 'files' => $files, 'crumbs' => $crumbs);
}
示例2: onAdd
protected function onAdd($tpl = null)
{
/** @var AkeebaModelCpanels $model */
$model = $this->getModel();
$aeconfig = Factory::getConfiguration();
// Load the helper classes
$this->loadHelper('utils');
$this->loadHelper('status');
$statusHelper = AkeebaHelperStatus::getInstance();
// Load the model
if (!class_exists('AkeebaModelStatistics')) {
JLoader::import('models.statistics', JPATH_COMPONENT_ADMINISTRATOR);
}
$statmodel = new AkeebaModelStatistics();
$this->profileid = $model->getProfileID();
// Active profile ID
$this->profilelist = $model->getProfilesList();
// List of available profiles
$this->statuscell = $statusHelper->getStatusCell();
// Backup status
$this->detailscell = $statusHelper->getQuirksCell();
// Details (warnings)
$this->statscell = $statmodel->getLatestBackupDetails();
$this->fixedpermissions = $model->fixMediaPermissions();
// Fix media/com_akeeba permissions
$this->needsdlid = $model->needsDownloadID();
$this->needscoredlidwarning = $model->mustWarnAboutDownloadIDInCore();
$this->extension_id = $model->getState('extension_id', 0, 'int');
// Should I ask for permission to display desktop notifications?
JLoader::import('joomla.application.component.helper');
$this->desktop_notifications = \Akeeba\Engine\Util\Comconfig::getValue('desktop_notifications', '0') ? 1 : 0;
$this->statsIframe = F0FModel::getTmpInstance('Stats', 'AkeebaModel')->collectStatistics(true);
return $this->onDisplay($tpl);
}
示例3: _getFieldTypes
protected function _getFieldTypes()
{
$data = array();
$core_path = COM_TZ_PORTFOLIO_PLUS_ADDON_PATH . DIRECTORY_SEPARATOR . 'extrafields';
if ($plg_ex = TZ_Portfolio_PlusPluginHelper::getPlugin('extrafields')) {
$lang = JFactory::getLanguage();
$field = $this->form->getData();
$field = $field->toObject();
foreach ($plg_ex as $i => $plg) {
$folder = $plg->name;
$core_f_xml_path = $core_path . DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR . $folder . '.xml';
if (JFile::exists($core_f_xml_path)) {
$core_class = 'TZ_Portfolio_PlusExtraField' . $folder;
if (!class_exists($core_class)) {
JLoader::import('com_tz_portfolio_plus.addons.extrafields.' . $folder . '.' . $folder, JPATH_SITE . DIRECTORY_SEPARATOR . 'components');
}
$core_class = new $core_class($field);
$data[$i] = new stdClass();
$data[$i]->value = $folder;
$core_class->loadLanguage($folder);
$key_lang = 'PLG_EXTRAFIELDS_' . strtoupper($folder) . '_TITLE';
if ($lang->hasKey($key_lang)) {
$data[$i]->text = JText::_($key_lang);
} else {
$data[$i]->text = (string) $folder;
}
}
}
}
return $data;
}
示例4: plgSystemFabrik
/**
* Constructor
*
* For php4 compatibility we must not use the __constructor as a constructor for plugins
* because func_get_args ( void ) returns a copy of all passed arguments NOT references.
* This causes problems with cross-referencing necessary for the observer design pattern.
*
* @param object &$subject The object to observe
* @param array $config An array that holds the plugin configuration
*
* @since 1.0
*/
public function plgSystemFabrik(&$subject, $config)
{
/**
* Moved these from defines.php to here, to fix an issue with Kunena. Kunena imports the J!
* JForm class in their system plugin, in the class constructor So if we wait till onAfterInitialize
* to do this, we blow up. So, import them here, and make sure the Fabrik plugin has a lower ordering
* than Kunena's. We might want to set our default to -1.
*/
$app = JFactory::getApplication();
$version = new JVersion();
$base = 'components.com_fabrik.classes.' . str_replace('.', '', $version->RELEASE);
// Test if Kunena is loaded - if so notify admins
if (class_exists('KunenaAccess')) {
$msg = 'Fabrik: Please ensure the Fabrik System plug-in is ordered before the Kunena system plugin';
if ($app->isAdmin()) {
$app->enqueueMessage($msg, 'error');
}
} else {
JLoader::import($base . '.field', JPATH_SITE . '/administrator', 'administrator.');
JLoader::import($base . '.form', JPATH_SITE . '/administrator', 'administrator.');
}
if (version_compare($version->RELEASE, '3.1', '<=')) {
JLoader::import($base . '.layout.layout', JPATH_SITE . '/administrator', 'administrator.');
JLoader::import($base . '.layout.base', JPATH_SITE . '/administrator', 'administrator.');
JLoader::import($base . '.layout.file', JPATH_SITE . '/administrator', 'administrator.');
JLoader::import($base . '.layout.helper', JPATH_SITE . '/administrator', 'administrator.');
}
parent::__construct($subject, $config);
}
示例5: process
/**
* do the plug-in action
* @param object parameters
* @param object table model
* @param array custom options
*/
function process(&$params, &$model, $opts = array())
{
JLoader::import('webservice', JPATH_SITE . '/components/com_fabrik/models/');
$params = $this->getParams();
$fk = $params->get('webservice_foreign_key');
$formModel = $model->getFormModel();
$fk = $formModel->getElement($fk, true)->getElement()->name;
$credentials = $this->getCredentials();
$driver = $params->get('webservice_driver');
$opts = array('driver' => $driver, 'endpoint' => $params->get('webservice_url'), 'credentials' => $credentials);
$service = FabrikWebService::getInstance($opts);
if (JError::isError($service)) {
echo $service->getMessage();
JError::raiseError(500, $service->getMessage());
jexit();
}
$filters = $this->getServiceFilters($service);
$service->setMap($this->getMap($formModel));
$filters = array_merge($opts['credentials'], $filters);
$method = $params->get('webservice_get_method');
$startPoint = $params->get('webservice_start_point');
$serviceData = $service->get($method, $filters, $startPoint, null);
$update = (bool) $params->get('webservice_update_existing', false);
$service->storeLocally($model, $serviceData, $fk, $update);
$this->msg = JText::sprintf($params->get('webservice_msg'), $service->addedCount, $service->updateCount);
return true;
}
示例6: authenticate
/**
* Tries to authenticate the user and start the backup, or send him back to the default task
*/
public function authenticate()
{
// Enforce raw mode - I need to be in full control!
if (!$this->_checkPermissions()) {
parent::redirect();
} else {
$session = JFactory::getSession();
$session->set('litemodeauthorized', 1, 'akeeba');
$this->_setProfile();
JLoader::import('joomla.utilities.date');
AECoreKettenrad::reset(array('maxrun' => 0));
AEUtilTempvars::reset(AKEEBA_BACKUP_ORIGIN);
$kettenrad = AECoreKettenrad::load(AKEEBA_BACKUP_ORIGIN);
$dateNow = new JDate();
/*
$user = JFactory::getUser();
$userTZ = $user->getParam('timezone',0);
$dateNow->setOffset($userTZ);
*/
$description = JText::_('BACKUP_DEFAULT_DESCRIPTION') . ' ' . $dateNow->format(JText::_('DATE_FORMAT_LC2'), true);
$options = array('description' => $description, 'comment' => '');
$kettenrad->setup($options);
$ret = $kettenrad->tick();
AECoreKettenrad::save(AKEEBA_BACKUP_ORIGIN);
JFactory::getApplication()->redirect(JURI::base() . 'index.php?option=com_akeeba&view=light&task=step&key=' . urlencode($this->input->get('key', '', 'none', 2)) . '&profile=' . $this->input->get('profile', 1, 'int') . '&format=raw');
}
}
示例7: __construct
/**
* Constructor
*
* @since 0.1
*/
function __construct()
{
// Include the tables in path
JLoader::import('xmlrpc', JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'phpxmlrpc');
JLoader::import('xmlrpcs', JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'phpxmlrpc');
parent::__construct();
}
示例8: doInstall
/**
* Method run when installing MageBridge
*/
public function doInstall()
{
// Try to include the file
$file = 'administrator/components/com_magebridge/helpers/install.php';
if (is_file(JPATH_ROOT . '/' . $file)) {
require_once JPATH_ROOT . '/' . $file;
} else {
if (is_file(dirname(__FILE__) . '/' . $file)) {
require_once dirname(__FILE__) . '/' . $file;
} else {
return true;
}
}
// Check for PHP version
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
return false;
}
// Check for Joomla version
JLoader::import('joomla.version');
$jversion = new JVersion();
if (version_compare($jversion->RELEASE, '3.0.0', '<')) {
return false;
}
// Done
return true;
}
示例9: display
public function display($tpl = null)
{
// Add toolbar buttons
JToolBarHelper::title(JText::_('AKEEBA') . ': <small>' . JText::_('VIEWLOG') . '</small>', 'akeeba');
JToolBarHelper::back('AKEEBA_CONTROLPANEL', 'index.php?option=' . JRequest::getCmd('option'));
JToolBarHelper::spacer();
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::base() . '../media/com_akeeba/theme/akeebaui.css?' . AKEEBAMEDIATAG);
// Add live help
AkeebaHelperIncludes::addHelp();
// Get a list of log names
if (!class_exists('AkeebaModelLog')) {
JLoader::import('models.log', JPATH_COMPONENT_ADMINISTRATOR);
}
$model = new AkeebaModelLog();
$this->assign('logs', $model->getLogList());
$tag = JRequest::getCmd('tag', null);
if (empty($tag)) {
$tag = null;
}
$this->assign('tag', $tag);
// Get profile ID
$profileid = AEPlatform::getInstance()->get_active_profile();
$this->assign('profileid', $profileid);
// Get profile name
if (!class_exists('AkeebaModelProfiles')) {
JLoader::import('models.profiles', JPATH_COMPONENT_ADMINISTRATOR);
}
$model = new AkeebaModelProfiles();
$model->setId($profileid);
$profile_data = $model->getProfile();
$this->assign('profilename', $profile_data->description);
AkeebaHelperIncludes::includeMedia(false);
parent::display($tpl);
}
示例10: createNewUser
public function createNewUser($params)
{
$user = new JUser(0);
JLoader::import('joomla.application.component.helper');
$usersConfig = JComponentHelper::getParams('com_users');
$newUsertype = $usersConfig->get('new_usertype');
// get the New User Group from com_users' settings
if (empty($newUsertype)) {
$newUsertype = 2;
}
$params['groups'] = array($newUsertype);
$params['sendEmail'] = 0;
// Set the user's default language to whatever the site's current language is
if (version_compare(JVERSION, '3.0', 'ge')) {
$params['params'] = array('language' => JFactory::getConfig()->get('language'));
} else {
$params['params'] = array('language' => JFactory::getConfig()->getValue('config.language'));
}
JLoader::import('joomla.user.helper');
$params['block'] = 0;
$randomString = JUserHelper::genRandomPassword();
if (version_compare(JVERSION, '3.2', 'ge')) {
$hash = JApplication::getHash($randomString);
} else {
$hash = JFactory::getApplication()->getHash($randomString);
}
$params['activation'] = $hash;
$user->bind($params);
$userIsSaved = $user->save();
if ($userIsSaved) {
return $user->id;
} else {
return false;
}
}
示例11: onBeforeMain
public function onBeforeMain()
{
// Load system defines
if (file_exists(APATH_ROOT . '/defines.php')) {
include_once APATH_ROOT . '/defines.php';
}
if (!defined('_JDEFINES')) {
define('JPATH_BASE', APATH_SITE);
require_once JPATH_BASE . '/includes/defines.php';
}
// Load the rest of the framework include files
if (file_exists(JPATH_LIBRARIES . '/import.legacy.php')) {
require_once JPATH_LIBRARIES . '/import.legacy.php';
} else {
require_once JPATH_LIBRARIES . '/import.php';
}
require_once JPATH_LIBRARIES . '/cms.php';
// 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/com_akeeba/helpers/jsonlib.php';
}
// Load the JApplicationCli class
JLoader::import('joomla.application.web');
require_once APATH_INSTALLATION . '/angie/assets/runscripts.php';
$run = JApplicationWeb::getInstance('RunScripts');
$run->execute();
return false;
}
示例12: createCoupon
public function createCoupon($key, $pwd)
{
// Do I have a key/pwd pair?
if (!$key || !$pwd) {
return array('error' => JText::_('COM_AKEEBASUBS_APICOUPONS_INVALID_CREDENTIALS'));
}
$table = $this->getTable();
$table->load(array('key' => $key, 'password' => $pwd));
// Are they valid?
if (!$table->akeebasubs_apicoupon_id || !$table->enabled) {
return array('error' => JText::_('COM_AKEEBASUBS_APICOUPONS_INVALID_CREDENTIALS'));
}
// Do I hit a limit?
if (!$this->performApiChecks($table)) {
return array('error' => JText::_('COM_AKEEBASUBS_APICOUPONS_LIMIT_EXCEEDED'));
}
// If I'm here, I'm clear to go
JLoader::import('joomla.user.helper');
$coupon = F0FTable::getAnInstance('Coupon', 'AkeebasubsTable');
$data['akeebasubs_apicoupon_id'] = $table->akeebasubs_apicoupon_id;
$data['title'] = 'API coupon for: ' . $table->title;
$data['coupon'] = strtoupper(JUserHelper::genRandomPassword(10));
$data['subscriptions'] = $table->subscriptions;
// By default I want the coupon to be single-use
$data['hitslimit'] = 1;
$data['userhits'] = 1;
$data['type'] = $table->type;
$data['value'] = $table->value;
if (!$coupon->save($data)) {
return array('error' => JText::_('COM_AKEEBASUBS_APICOUPONS_COUPON_ERROR'));
}
return array('coupon' => $coupon->coupon);
}
示例13: prepareKbi
public static function prepareKbi($lmUrl)
{
//TODO vazba na totožnou metodu v dbconnectModelConnections
$configArr = array('type' => 'LISPMINER', 'name' => 'TEST', 'method' => 'POST', 'url' => $lmUrl);
JLoader::import('KBIntegrator', JPATH_LIBRARIES . DS . 'kbi');
return KBIntegrator::create($configArr);
}
示例14: getInput
protected function getInput()
{
if (version_compare(JVERSION, '3.0.0') == -1) {
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
if (version_compare(PHP_VERSION, '5.2.4') == -1) {
$app->enqueueMessage(JText::sprintf('MOD_PWEBCONTACT_CONFIG_MSG_PHP_VERSION', '5.2.4'), 'error');
}
// jQuery and Bootstrap in Joomla 2.5
if (!class_exists('JHtmlJquery')) {
$error = null;
if (!is_file(JPATH_PLUGINS . '/system/pwebj3ui/pwebj3ui.php')) {
$error = JText::sprintf('MOD_PWEBCONTACT_CONFIG_INSTALL_PWEBLEGACY', '<a href="http://www.perfect-web.co/blog/joomla/62-jquery-bootstrap-in-joomla-25" target="_blank">', '</a>');
} elseif (!JPluginHelper::isEnabled('system', 'pwebj3ui')) {
$error = JText::sprintf('MOD_PWEBCONTACT_CONFIG_ENABLE_PWEBLEGACY', '<a href="index.php?option=com_plugins&view=plugins&filter_search=' . urlencode('Perfect Joomla! 3 User Interface') . '" target="_blank">', '</a>');
} else {
JLoader::import('cms.html.jquery', JPATH_PLUGINS . DIRECTORY_SEPARATOR . 'system' . DIRECTORY_SEPARATOR . 'pwebj3ui' . DIRECTORY_SEPARATOR . 'libraries');
}
if ($error) {
$app->enqueueMessage($error, 'error');
$doc->addScriptDeclaration('window.addEvent("domready", function(){' . 'new Element("div", {class: "pweb-fields-tip", html: \'<span class="badge badge-important">' . $error . '</span>\'}).inject(document.id("jform_params_fields"),"top");' . '});');
}
}
$doc->addStyleSheet(JUri::root(true) . '/media/mod_pwebcontact/css/admin_j25.css');
}
return null;
}
示例15: getInvoiceListParameters
private function getInvoiceListParameters()
{
JLoader::import('joomla.utilities.date');
$jNow = new JDate();
$month = $this->input->getInt('month', 0);
if ($month < 1 || $month > 12) {
$month = (int) $jNow->format('m');
$month--;
}
$year = $this->input->getInt('year', 0);
if ($year < 2010 || $year > 2100) {
$year = (int) $jNow->format('Y');
}
if ($month <= 0) {
$month = 12;
$year--;
}
$vies = false;
$vatmoss = false;
switch ($this->getTask()) {
case 'vies':
$vies = true;
break;
case 'vatmoss':
$vatmoss = true;
break;
}
$invoiceExtension = $this->input->getCmd('extension', 'akeebasubs');
return array('month' => $month, 'year' => $year, 'vies' => $vies, 'vatmoss' => $vatmoss, 'extension' => $invoiceExtension);
}