當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JDeveloperLoader::import方法代碼示例

本文整理匯總了PHP中JDeveloperLoader::import方法的典型用法代碼示例。如果您正苦於以下問題:PHP JDeveloperLoader::import方法的具體用法?PHP JDeveloperLoader::import怎麽用?PHP JDeveloperLoader::import使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JDeveloperLoader的用法示例。


在下文中一共展示了JDeveloperLoader::import方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getItems

 /**
  * Method to get an array of data items.
  *
  * @return  array  An array of data items
  *
  * @since   12.2
  */
 public function getItems()
 {
     JDeveloperLoader::import("archive");
     $extension = JTable::getInstance("Extension", "JTable");
     // Get a storage key.
     $store = $this->getStoreId('getItems');
     // Load the list items.
     $items = parent::getItems();
     // Add information
     foreach ($items as $item) {
         // Is Component already installed?
         $item->createDir = JDeveloperArchive::getArchiveDir() . "/" . JDeveloperArchive::getArchiveName("mod_", $item->name, $item->version);
         $item->installed = JDeveloperInstall::isInstalled("module", "mod_" . $item->name);
         if ($item->installed) {
             $extension->load(array("name" => "mod_" . $item->name, "type" => "module"));
             $item->enabled = (bool) $extension->enabled;
         } else {
             $item->enabled = false;
         }
     }
     // If emtpy or an error, just return.
     if (empty($items)) {
         return array();
     }
     // Add the items to the internal cache.
     $this->cache[$store] = $items;
     return $this->cache[$store];
 }
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:35,代碼來源:modules.php

示例2: create

 /**
  * Create ZIP file of plugins
  *
  * @param	array	$ids	The primary keys of the items
  */
 public function create($ids = array())
 {
     // Initialize
     $user = JFactory::getUser();
     $app = JFactory::getApplication();
     $this->setRedirect(JRoute::_('index.php?option=com_jdeveloper&view=plugin', false));
     if (empty($ids)) {
         $ids = $app->input->get('cid', array(), 'array');
     }
     // Check access
     if (!$user->authorise('plugins.create', 'com_jdeveloper')) {
         $this->setMessage(JText::_('COM_JDEVELOPER_ACTION_NOT_ALLOWED'), 'warning');
         return;
     }
     // Load classes
     JDeveloperLoader::import('archive');
     JDeveloperLoader::import('template');
     JDeveloperLoader::import('plugin', JDeveloperCREATE);
     jimport('joomla.filesystem.folder');
     // Create Plugin for each id
     foreach ($ids as $id) {
         $plugin = $this->getModel()->getItem($id);
         $path = $plugin->createDir;
         // Delete old archive if exists
         JFile::exists($path . '.zip') ? JFile::delete($path . '.zip') : null;
         // Create Plugin
         try {
             JDeveloperCreatePlugin::execute(array("item_id" => $id));
         } catch (JDeveloperException $e) {
             $this->setMessage($e->getMessage(), "error");
             return;
         }
         // Create HTML files for each folder, zip the folder and delete the folder
         JDeveloperArchive::html($path);
         // Create ZIP archive and delete folder
         JDeveloperArchive::zip($path);
         JFolder::delete($path);
     }
     $this->setMessage(JText::sprintf('COM_JDEVELOPER_PLUGIN_MESSAGE_ZIP_CREATED', count($ids)));
 }
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:45,代碼來源:plugins.php

示例3: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Create.Plugin
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("plugin", JDeveloperCREATE);
/**
 * Plugin Create Class
 *
 * @package     JDeveloper
 * @subpackage  Create.Plugin
 */
class JDeveloperCreatePluginFolder extends JDeveloperCreatePlugin
{
    /**
     * Get the template object
     *
     * @return	JDeveloperTemplate
     */
    protected function getTemplate()
    {
        $this->templateFile = $this->item->folder . ".php";
        return parent::getTemplate();
    }
    /**
     * @see JDeveloperCreate
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:31,代碼來源:folder.php

示例4: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Create.Form
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("form", JDeveloperCREATE);
/**
 * Form Create Class
 *
 * @package     JDeveloper
 * @subpackage  Create.Form
 */
class JDeveloperCreateFormChild extends JDeveloperCreateForm
{
    /**
     * The template file
     *
     * @var	string
     */
    protected $templateFile = "form_child.xml";
    /**
     * @see	JDeveloperCreate
     */
    protected function initialize()
    {
        $this->template->addAreas(array("filter" => (bool) $this->item->filter, "validation" => (bool) $this->item->validation, "disabled" => (bool) $this->item->disabled, "readonly" => (bool) $this->item->readonly, "required" => (bool) $this->item->required, "list" => !empty($this->item->options)));
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:31,代碼來源:child.php

示例5: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Controllers
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("controllers.list");
/**
 * JDeveloper Forms Controller
 *
 * @package     JDeveloper
 * @subpackage  Controllers
 */
class JDeveloperControllerForms extends JDeveloperControllerList
{
    /**
     * The URL view list variable.
     *
     * @var    string
     * @since  12.2
     */
    protected $view_list = 'Forms';
    /**
     * Rebuild the nested set tree.
     *
     * @return  bool  False on failure or error, true on success.
     *
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:31,代碼來源:forms.php

示例6: _getSource

 /**
  * Get the template
  *
  * @param	string	$type		The extension type (component, module, plugin, template)
  * @param	string	$name		The template name
  * @param	int		$item_id	The extension id (primary key of table shere item is stored)
  *
  * @return string	The template
  */
 private function _getSource($type, $name, $item_id)
 {
     JDeveloperLoader::import("create");
     $input = JFactory::getApplication()->input;
     $dir = JDeveloperCREATE . "/" . implode("/", explode(".", $type));
     foreach (JFolder::files($dir, "php\$") as $file) {
         $create = JDeveloperCreate::getInstance($type . "." . JFile::stripExt($file), array("item_id" => $item_id));
         if ($create->templateFile == $name) {
             return $create->getBuffer();
         }
     }
     return "";
 }
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:22,代碼來源:override.php

示例7: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Create.Component
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("component", JDeveloperCREATE);
/**
 * Table Create Class
 *
 * @package     JDeveloper
 * @subpackage  Create.Component
 */
class JDeveloperCreateComponentAdminViewComponent extends JDeveloperCreateComponent
{
    /**
     * The template file
     *
     * @var	string
     */
    protected $templateFile = "admin.views.component.view.html.php";
    /**
     * Check whether file should be created or not
     *
     * @return	boolean
     */
    protected function condition()
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:31,代碼來源:view.component.php

示例8: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Views
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("create");
$input = JFactory::getApplication()->input;
$id = $input->get("id", 0, "int");
if ($id) {
    echo JHtml::_("code.form", JDeveloperCreate::getInstance("table.admin.form.singular", array("item_id" => $id))->getBuffer());
}
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:16,代碼來源:form.php

示例9: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Models
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("models.admin");
/**
 * JDeveloper Field Model
 *
 * @package     JDeveloper
 * @subpackage  Models
 */
class JDeveloperModelField extends JDeveloperModelAdmin
{
    /**
     * Method to get a table object, load it if necessary.
     *
     * @param   string  $name     The table name. Optional.
     * @param   string  $prefix   The class prefix. Optional.
     * @param   array   $options  Configuration array for model. Optional.
     *
     * @return  JTable  A JTable object
     *
     * @since   12.2
     * @throws  Exception
     */
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:31,代碼來源:field.php

示例10: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Create.Template
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("template", JDeveloperCREATE);
/**
 * Template Create Class
 *
 * @package     JDeveloper
 * @subpackage  Create.Template
 */
class JDeveloperCreateTemplateHtml extends JDeveloperCreateTemplate
{
    /**
     * The template file
     *
     * @var	string
     */
    protected $templateFile = "index.php";
}
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:26,代碼來源:html.php

示例11: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Models
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("models.extension");
/**
 * JDeveloper Module Model
 *
 * @package     JDeveloper
 * @subpackage  Models
 */
class JDeveloperModelModule extends JDeveloperModelExtension
{
    /**
     * Method to get a table object, load it if necessary.
     *
     * @param   string  $name     The table name. Optional.
     * @param   string  $prefix   The class prefix. Optional.
     * @param   array   $options  Configuration array for model. Optional.
     *
     * @return  JTable  A JTable object
     *
     * @since   12.2
     * @throws  Exception
     */
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:31,代碼來源:module.php

示例12: create

 /**
  * Create component ids
  *
  * @param	array	$ids	The component 
  */
 public function create($ids = array())
 {
     // Initialize
     $user = JFactory::getUser();
     $app = JFactory::getApplication();
     $this->setRedirect(JRoute::_('index.php?option=com_jdeveloper&view=component', false));
     if (empty($ids)) {
         $ids = $app->input->get('cid', array(), 'array');
     }
     // Check access
     if (!$user->authorise('components.create', 'com_jdeveloper')) {
         $this->setMessage(JText::_('COM_JDEVELOPER_ACTION_NOT_ALLOWED'), 'warning');
         return;
     }
     // Load classes
     JDeveloperLoader::import('archive');
     JDeveloperLoader::import('template');
     JDeveloperLoader::import('component', JDeveloperCREATE);
     JDeveloperLoader::import('table', JDeveloperCREATE);
     jimport('joomla.filesystem.folder');
     // Create component for each id
     foreach ($ids as $id) {
         $component = $this->getModel()->getItem($id);
         $path = $component->createDir;
         // Delete old archive if exists
         JFile::exists($path . '.zip') ? JFile::delete($path . '.zip') : null;
         // Create component
         JDeveloperCreateComponent::execute("admin", array("item_id" => $id));
         JDeveloperCreateTable::execute("admin", array("item_id" => $id));
         // Create component for frontend
         if ($component->get('site', 0)) {
             JDeveloperCreateComponent::execute("site", array("item_id" => $id));
             JDeveloperCreateTable::execute("site", array("item_id" => $id));
         }
         // Get language files content
         $buffer = JDeveloperLanguage::getInstance("com_" . $component->name)->sort()->toINI();
         $buffer_sys = JDeveloperLanguage::getInstance("com_" . $component->name . "_sys")->sort()->toINI();
         // Write language files
         foreach ($component->params["languages"] as $lang) {
             JFile::write($component->createDir . "/admin/language/{$lang}.com_" . strtolower($component->name) . ".ini", $buffer);
             JFile::write($component->createDir . "/admin/language/{$lang}.com_" . strtolower($component->name) . ".sys.ini", $buffer_sys);
             $component->site ? JFile::write($component->createDir . "/site/language/{$lang}.com_" . strtolower($component->name) . ".ini", $buffer) : null;
         }
         // Create HTML files for each folder
         JDeveloperArchive::html($path . '/admin');
         (int) $component->get('site', 0) ? JDeveloperArchive::html($path . '/site') : null;
         // Create ZIP archive and delete folder
         JDeveloperArchive::zip($path);
         JFolder::delete($path);
     }
     $this->setMessage(JText::sprintf('COM_JDEVELOPER_COMPONENT_CREATED', count($ids)));
 }
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:57,代碼來源:components.php

示例13: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Create.Library
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("library", JDeveloperCREATE);
/**
 * Library Create Class
 *
 * @package     JDeveloper
 * @subpackage  Create.Library
 */
class JDeveloperCreateLibraryManifest extends JDeveloperCreateLibrary
{
    /**
     * The template file
     *
     * @var	string
     */
    protected $templateFile = "library.xml";
    protected function initialize()
    {
        $this->template->addPlaceHolders(array("author" => $this->item->get('author'), "author_email" => $this->item->get('author_email'), "author_url" => $this->item->get('author_url'), "copyright" => $this->item->get('copyright'), "creationdate" => date("M Y"), "licence" => $this->item->get('licence'), "languages" => $this->lang(), "version" => $this->item->get('version')));
        return parent::initialize();
    }
    /**
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:31,代碼來源:manifest.php

示例14: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Controllers
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("controllers.item");
/**
 * JDeveloper Template Controller
 *
 * @package     JDeveloper
 * @subpackage  Controllers
 */
class JDeveloperControllerTemplate extends JDeveloperControllerItem
{
}
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:20,代碼來源:template.php

示例15: defined

<?php

/**
 * @package     JDeveloper
 * @subpackage  Models
 *
 * @copyright  	Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
JDeveloperLoader::import("models.admin");
JDeveloperLoader::import("install");
/**
 * JDeveloper Component Model
 *
 * @package     JDeveloper
 * @subpackage  Models
 */
class JDeveloperModelComponent extends JDeveloperModelAdmin
{
    /**
     * Method to delete one or more records.
     *
     * @param   array  &$pks  An array of record primary keys.
     *
     * @return  boolean  True if successful, false if an error occurs.
     */
    public function delete(&$pks)
    {
        // Delete tables which belong to the component
        if ((int) JComponentHelper::getParams('com_jdeveloper')->get('delete_tables')) {
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:31,代碼來源:component.php


注:本文中的JDeveloperLoader::import方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。