本文整理汇总了PHP中cssJSToolbox::import方法的典型用法代码示例。如果您正苦于以下问题:PHP cssJSToolbox::import方法的具体用法?PHP cssJSToolbox::import怎么用?PHP cssJSToolbox::import使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cssJSToolbox
的用法示例。
在下文中一共展示了cssJSToolbox::import方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBlocksIterator
/**
* put your comment there...
*
* @param mixed $blocks
*/
protected function getBlocksIterator($blocks)
{
// Import iterator class file!
cssJSToolbox::import('includes:installer:upgrade:0.2:includes:block.class.php');
// Instantiate blocks iterator object!
return new CJTInstallerBlocks02($blocks);
}
示例2: create
/**
* put your comment there...
*
* @param mixed $blockId
*/
public function create(&$pin = null)
{
// Import dependecnes.
cssJSToolbox::import('tables:block-pins.php');
// Change metabox status to be created.
$this->setState(self::STATE_CREATED);
// Add post pin to pins table.
$blockPinsTable = new CJTBlockPinsTable($this->dbDriver);
// Pin data.
$pin = (object) array();
// Import CJTBlockModel class.
CJTModel::import('block');
/** @todo Only temporary in version 6.0. Later versions should group all post types by post type name! */
switch ($this->getPost()->post_type) {
case 'page':
$pin->pin = 'pages';
$pin->flag = CJTBlockModel::PINS_PAGES_CUSTOM_PAGE;
break;
default:
$pin->pin = 'posts';
$pin->flag = CJTBlockModel::PINS_POSTS_CUSTOM_POST;
break;
}
$pin->value = $this->getPost()->ID;
// Add pin record.
$blockPinsTable->insertRaw($this->getMetaboxId(), array($pin));
// Chains!
return $this;
}
示例3: upgrade
/**
* put your comment there...
*
*/
public function upgrade()
{
// Save backup in backup table!
$backup = $this->current();
// Change 'time' field to 'created'!
// Convert formatted date to mysal date!
$backup['created'] = $backup['time'];
// User author Id instead of name and change 'author' field to 'owner'!
$backup['owner'] = get_user_by('login', $backup['author'])->ID;
$backup['type'] = 'blocks';
// For now we support only blocks backups!
// Load blocks into blocks iterator before destroying deprectaed fields.
$blocks = new CJTInstallerBlocks03($backup['data'], CJTInstallerBlocks03::BLOCK_TYPE_BACKUP);
// Remove deprecated fields!
$backup = array_diff_key($backup, array_flip(array('time', 'author', 'data')));
/// Add backup and get its ID using OLD style table (not xTable)!!
// Import dependecneis.
cssJSToolbox::import('tables:backups.php');
// Insert backup record.
$backupsTable = new CJTBackupsTable(cssJSToolbox::getInstance()->getDBDriver());
$backupsTable->insert($backup);
$backupId = $backupsTable->getDBDriver()->processQueue()->getInsertId();
// Insert all blocks!
foreach ($blocks as &$block) {
// Associate every block with the created backup!
$block['backupId'] = $backupId;
// Upgrade block!
$blocks->upgrade();
$blocks->model->save();
}
return $this;
}
示例4: extra_tablenav
/**
* put your comment there...
*
* @param mixed $which
*/
function extra_tablenav($which)
{
// Import dependencies.
cssJSToolbox::import('framework:html:list.php');
// Define filters.
$filters = array();
$filters['states'] = 'State';
$filters['types'] = 'Type';
$filters['authors'] = 'Author';
$filters['versions'] = 'Version';
$filters['creation-dates'] = 'Date Created';
$filters['development-states'] = 'Release';
$filters['last-modified-dates'] = 'Last Modified';
// Get the HTML field for each filter antput the result.
$filtersName = array();
foreach ($filters as $name => $text) {
// Output field markup.
$fieldName = "filter_{$name}";
$classes = "filter filter_{$name}";
echo CJTListField::getInstance("template-{$name}", 'templates-manager', $fieldName, isset($_REQUEST[$fieldName]) ? $_REQUEST[$fieldName] : null, null, $classes, null, null, null, cssJSToolbox::getText($text))->getInput();
// Complete list of filters names!
$filtersName[] = $fieldName;
}
if ($which == 'top') {
// Output all filter names list!
$filtersName = implode(',', $filtersName);
echo "<input type='hidden' name='allFiltersName' value='{$filtersName}' />";
}
}
示例5: enableAction
/**
* put your comment there...
*
*/
protected function enableAction()
{
// Initializing!
$model = $this->model;
$cjtWebServer = cssJSToolbox::getCJTWebSiteURL();
$extensions =& CJTPlugin::getInstance()->extensions();
// Get all CJT-Plugins (Include CJT Plugin itself + all its extensions) that has activate
// license key!
$activeLicenses = $model->getStatedLicenses();
// Import EDD updater Class!
cssJSToolbox::import('framework:third-party:easy-digital-download:auto-upgrade.class.php');
// Activate Automatic upgrade for all activated licenses/components!
foreach ($activeLicenses as $name => $state) {
// Get extension def doc.
// Act only if extension has XMl DOC! This might happened i fthe extension
// removed while its key still in the database
if ($extDef = $extensions->getDefDoc(dirname($state['component']['pluginBase']))) {
// Check CJT Server only if updateSrc points to Wordpress Repository
$updateSrcServer = (string) $extDef->license->attributes()->updateSrc;
if (!$updateSrcServer || $updateSrcServer == 'CJT') {
// Initializingn vars for a single state/component!
$pluginFile = ABSPATH . PLUGINDIR . '/' . $state['component']['pluginBase'];
// Stop using Cached Data as it causes issue, always
// get fresh plugin data.
$plugin = get_plugin_data($pluginFile);
$license =& $state['license'];
// Edd API parameter to be send along with he check!
$requestParams = array('version' => $plugin['Version'], 'author' => $plugin['AuthorName'], 'license' => $license['key'], 'item_name' => $name);
// Set EDD Automatic Updater!
$updated = new CJT_EDD_SL_Plugin_Updater($cjtWebServer, $pluginFile, $requestParams);
}
}
}
}
示例6: database
/**
* put your comment there...
*
*/
public function database()
{
// Upgrade database tables.
cssJSToolbox::import('framework:installer:dbfile.class.php');
CJTDBFileInstaller::getInstance(cssJSToolbox::resolvePath('includes:installer:upgrade:1.0-CE:db:mysql:structure.sql'))->exec();
// Chaining.
return $this;
}
示例7: finalize
/**
* put your comment there...
*
*/
public function finalize()
{
// Upgrade database internal version number using
// installer class.
cssJSToolbox::import('includes:installer:installer:installer.class.php');
CJTInstaller::getInstance()->finalize();
// Chaining.
return $this;
}
示例8: __construct
/**
* put your comment there...
*
* @param mixed $blocks
* @param mixed $type
* @return CJTInstallerBlocks03
*/
public function __construct($blocks, $type = null)
{
// Initialize object!
$this->type = $type ? $type : self::BLOCK_TYPE_BLOCK;
// Initialize block base iterator.
parent::__construct($blocks);
// import dependencies.
cssJSToolbox::import('tables:blocks.php');
}
示例9: template
/**
* put your comment there...
*
*/
public function template()
{
static $template = null;
// Instantiate Template library only when used.
if (!$template) {
cssJSToolbox::import('framework:developer:lib:template:template.php');
$template = new CJT_Framework_Developer_Lib_Template($this->source);
}
return $template;
}
示例10: __construct
/**
* put your comment there...
*
*/
public function __construct()
{
// Import dependencies!
cssJSToolbox::import('includes:installer:upgrade:block.class.php', 'includes:installer:upgrade:template.class.php');
// Load blocks into installer iterator!
$this->blocks = $this->getBlocksIterator(get_option(self::BLOCKS_POINTER));
// Load templates into templates iterator!
$driver = cssJSToolbox::getInstance()->getDBDriver();
$templates = $driver->select('SELECT title as `name`, type, `code` FROM ' . self::TEMPLATES_TABLE . ';', ARRAY_A);
$this->templates = new CJTInstallerTemplate($templates);
}
示例11: uninstall
/**
* put your comment there...
*
*/
public static function uninstall()
{
// For the uninstaller to be run eraseData setting must be enabled.
cssJSToolbox::import('models:settings:uninstall.php');
$settings = new CJTSettingsUninstallPage();
if ($settings->eraseData) {
// Get the only instance we've for the main access point!
$mainAccessPointObject = self::$instance;
// Load default controller!
$mainAccessPointObject->controllerName = 'default';
$controller = $mainAccessPointObject->route(false)->setAction('uninstall')->_doAction();
}
}
示例12: __construct
/**
* put your comment there...
*
*/
public function __construct($type)
{
// Save type data for later use!
$this->type = cssJSToolbox::$config->templates->types[$type];
$this->type->name = $type;
// Get which Wordpress queue (wp_script, wp_styles) object to fetch data from.
$wpQueueName = self::$typesMap[$type];
/**
* @var CJTCouplingModel
*/
$coupling = CJTModel::getInstance('coupling');
// Initialize ArrayIterator with templates list!
parent::__construct($coupling->getQueueObject($wpQueueName)->registered);
// Import dependencies!
cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
CJTxTable::import('template');
CJTxTable::import('author');
}
示例13: transit
/**
* Do nothing!
*
*/
public function transit()
{
// Initialize.
$model = CJTModel::getInstance('template');
$node = $this->getNode();
$register = $this->register();
// Prepare object + getting item to be saved into database.
$template = $register['packageParser']->getItem($node);
// Insert template only if not exists.
if (!$model->exists($template['name'])) {
// Import template(s) helper.
cssJSToolbox::import('includes:templates:templates.class.php');
// Set template revision.
$model->inputs['item']['revision']['code'] = $template['code'];
unset($template['code']);
// Set template main data.
$model->inputs['item']['template'] = $template;
/** Get template Type!
* Get type from external file extension if
* the template code was linked to file.
* If the template code were inline
* then the type must be provided under
* TYPE element!
*/
// If no type specified get it from the external file extension
if (!isset($model->inputs['item']['template']['type'])) {
// @WARNING: Get locatted file!
$codeFileName = (string) $node->code->attributes()->locatted;
if ($codeFileName) {
// Get type from extension.
$fileComponent = pathinfo($codeFileName);
$model->inputs['item']['template']['type'] = CJTTemplates::getExtensionType($fileComponent['extension']);
}
}
// Add template.
$addedTemplate = $model->save();
// Expose template fields to be by used by other objects.
$register['templateId'] = $addedTemplate->templateId;
$register['templateFile'] = $addedTemplate->file;
}
// Chaining.
return $this;
}
示例14: shortcode
/**
* Wordpress do shortcode callback for
* CJT Shortcodes ([cjtoolbox ....])!
*
* This method role is to load the shortcode routines
* in order to handle the request.
*
* It doesn't do anything except deferring the shortcode
* codes from loaded until shortcode is really used!
*
* @param mixed $attributes
*/
public function shortcode($attributes, $content)
{
// Instantiate Shortcode handler class.
cssJSToolbox::import('controllers:coupling:shortcode:shortcode.php');
$shortcode = new CJT_Controllers_Coupling_Shortcode($attributes, $content);
// Return Shortcode replacement!
return (string) $shortcode;
}
示例15: getBlockBy
/**
* Query Block based on the passed paramaters.
*
*/
public function getBlockBy()
{
// import dependencies.
cssJSToolbox::import('framework:db:mysql:xtable.inc.php');
return CJTxTable::getInstance('block')->set($this->inputs['filter']['field'], $this->inputs['filter']['value'])->load(array($this->inputs['filter']['field']))->getData();
}