本文整理汇总了PHP中cssJSToolbox类的典型用法代码示例。如果您正苦于以下问题:PHP cssJSToolbox类的具体用法?PHP cssJSToolbox怎么用?PHP cssJSToolbox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cssJSToolbox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: downloadCodeFileAction
/**
* put your comment there...
*
*/
public function downloadCodeFileAction()
{
// BlockId, currentActiveFile.
$blockId = $_GET['blockId'];
$fileId = $_GET['fileId'];
$returnAs = $_GET['returnAs'];
// Get current File Code.
$tblCodeFile = new CJTBlockFilesTable(cssJSToolbox::getInstance()->getDBDriver());
$codeFile = $tblCodeFile->set('id', $fileId)->set('blockId', $blockId)->load()->getData();
// Return as downloadable-file or JSON.
if ($returnAs == 'file') {
// Get Download File info.
$extension = $codeFile->type ? cssJSToolbox::$config->templates->types[$codeFile->type]->extension : 'txt';
$file = "{$codeFile->name}.{$extension}";
// Response Header parameters.
header('Content-Description: File Transfer');
header("Content-Disposition: attachment; filename=\"{$file}\"");
//<<< Note the " " surrounding the file name
header('Content-Transfer-Encoding: binary');
header('Connection: Keep-Alive');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . strlen($codeFile->code));
// AJAX Controller parameters.
$this->httpContentType = 'application/octet-stream';
}
// Output code.
$this->response = $codeFile->code;
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:34,代码来源:block.php
示例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;
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:34,代码来源:metabox.php
示例3: loadString
/**
* put your comment there...
*
* @param mixed $strings
* @param mixed $content
* @return CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Parameters
*/
public function loadString($strings, $content)
{
// Get the name of the CONTENT PARAMETER -- If EXISTS!
// THEN PUSH IT AS ITS PASSED AS SHORTCODR ATTRIBUTE.
if ($contentParameter = $this->getContentParameter()) {
$strings[$contentParameter->getDefinition()->getName(true)] = $content;
}
// Load all parameters with shortcde parameters.
foreach ($this->getParams() as $name => $param) {
// Dont override default value unless parameter is passed!
if (isset($strings[$name])) {
$param->loadString($strings[$name]);
}
// Validate type!
if (!$param->validate()) {
echo cssJSToolbox::getText("Invalid Shortcode parameter: {$type->getMessage()}");
}
// Remove the value from the stringsValue allow validating if
// any invalid parameter name is passed!
// See after the loop.
unset($strings[$name]);
}
// If there is any string values still exists then invalid parameter is passed.
if (!empty($strings)) {
echo cssJSToolbox::getText("Invalid Shortcode parameter(s) has been passed! Please check parameters name.");
}
return $this;
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:35,代码来源:parameters.php
示例4: 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);
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:12,代码来源:upgrade.class.php
示例5: menu
/**
* put your comment there...
*
*/
public function menu()
{
// Setup Page.
$pageHookId = add_submenu_page(CJTPlugin::PLUGIN_REQUEST_ID, cssJSToolbox::getText('CJT Manage - Packages'), cssJSToolbox::getText('Packages'), 'administrator', CJTPlugin::PLUGIN_REQUEST_ID . '-packages', array(&$this->controller, '_doAction'));
// Process when its installed!!
add_action("load-{$pageHookId}", array($this, 'getPage'));
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:11,代码来源:packages.accesspoint.php
示例6: 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;
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:36,代码来源:backup.class.php
示例7: delete
/**
* Delete single package.
*
* This method is going to delete the package
* and all the templates and blocks associated to it,
* therefor it'll unlink/break-down the relationship
* between those templates and blocks.
*
* @param Integer Package Id.
* @return CJTPackageModel Return $this.
*/
public function delete($id)
{
// Initialize.
$modelTemplates = CJTModel::getInstance('templates-manager');
$dbd = cssJSToolbox::getInstance()->getDBDriver();
$assoObjectsQueryTmp = 'SELECT objectId
FROM #__cjtoolbox_package_objects
WHERE packageId = %d AND objectType = "%s" AND relType = "%s";';
// Delete the package.
CJTxTable::getInstance('package')->set('id', $id)->delete();
// Delete blocks.
$blockIds = array_keys($dbd->select(sprintf($assoObjectsQueryTmp, $id, 'block', 'add')));
if (!empty($blockIds)) {
// Delete blocks!
CJTModel::getInstance('blocks')->delete($blockIds)->save();
}
// Delete templates.
$modelTemplates->inputs['ids'] = array_keys($dbd->select(sprintf($assoObjectsQueryTmp, $id, 'template', 'add')));
// Templates muct be in trash state before deleted!
$modelTemplates->inputs['state'] = 'trash';
// Move to Trash + Delete only if there is at least one Id!
empty($modelTemplates->inputs['ids']) or $modelTemplates->changeState() and $modelTemplates->delete();
// Delete package objects map.
CJTxTable::getInstance('package-objects')->set('packageId', $id)->delete(array('packageId'));
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:36,代码来源:package.php
示例8: 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);
}
}
}
}
开发者ID:Timfreaky,项目名称:ThinkTax,代码行数:38,代码来源:auto-upgrade.php
示例9: 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();
// 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'];
$license =& $state['license'];
// Set EDD Automatic Updater!
try {
CJTStoreUpdate::autoUpgrade($name, $license['key'], $pluginFile);
} catch (CJTServicesAPICallException $exception) {
die('CJT AUTO-UPGRADE EXCAPTION!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
}
}
}
}
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:35,代码来源:auto-upgrade.php
示例10: display
/**
* put your comment there...
*
* @param mixed $tpl
*/
public function display($tpl = null)
{
$this->component = $this->getModel('setup')->getCJTComponentData();
$this->securityToken = cssJSToolbox::getSecurityToken();
// Display view.
echo $this->getTemplate($tpl);
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:12,代码来源:view.php
示例11: menu
/**
* put your comment there...
*
*/
public function menu()
{
// Blocks Manager page! The only Wordpress menu item we've.
$pageHookId = add_menu_page(cssJSToolbox::getText('CSS & Javascript Toolbox'), cssJSToolbox::getText('CSS & Javascript Toolbox'), 'administrator', CJTPlugin::PLUGIN_REQUEST_ID, array(&$this->controller, '_doAction'), CJTOOLBOX_VIEWS_URL . '/blocks/manager/public/images/menu.png');
// Process request if installed!
add_action("load-{$pageHookId}", array($this, 'getPage'));
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:11,代码来源:manage.accesspoint.php
示例12: prepareItems
/**
* put your comment there...
*
*/
protected function prepareItems()
{
CJTxTable::import('author');
$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
// Query all dates (without time!) or internal authors.
$query = " SELECT DISTINCT(DATE(t.creationDate)) `text`\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM #__cjtoolbox_templates t\n\t\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN #__cjtoolbox_authors a\n\t\t\t\t\t\t\t\t\t\t\t\t\tON t.authorId = a.id\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE (a.attributes & {$internalAuthorsFlag}) = 0\n\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY `text`;";
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:12,代码来源:template-creation-dates.php
示例13: 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;
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:12,代码来源:upgrade.class.php
示例14: menu
/**
* put your comment there...
*
*/
public function menu()
{
// Extensions page.
add_submenu_page(CJTPlugin::PLUGIN_REQUEST_ID, null, cssJSToolbox::getText('Extensions'), 'administrator', null);
// Hack Extensions menu item to point to Plugins page!
$GLOBALS['submenu'][CJTPlugin::PLUGIN_REQUEST_ID][self::MENU_POSITION_INDEX][2] = admin_url('plugins.php?s=' . self::PLUGINS_PAGE_SEARCH_TERM);
// When plugins page loaded!
add_action('load-plugins.php', array($this, 'route'), 10, 0);
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:13,代码来源:extensions.accesspoint.php
示例15: 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;
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:13,代码来源:upgrade.class.php
示例16: __construct
/**
* put your comment there...
*
* @param mixed $formId
* @return CJT_Models_Block_Parameters_Form_Groups
*/
public function __construct($formId)
{
// Initialize.
$this->formId = $formId;
$dbDriver = cssJSToolbox::getInstance()->getDBDriver();
// Query groups.
$groups = $dbDriver->select("SELECT * FROM #__cjtoolbox_form_groups g LEFT JOIN #__cjtoolbox_form_group_xfields xf ON g.id = xf.groupId WHERE g.formId = {$this->formId};", ARRAY_A);
parent::__construct($groups);
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:15,代码来源:groups.php
示例17: getPackageInfo
/**
* put your comment there...
*
*/
public function getPackageInfo()
{
// Initialize.
$driver = cssJSToolbox::getInstance()->getDBDriver();
// Query package info for the current block.
$query = "SELECT p.id, p.author, p.webSite\n\t\t\t\t\t\t\t\t\t\t\tFROM #__cjtoolbox_packages p RIGHT JOIN #__cjtoolbox_package_objects o\n\t\t\t\t\t\t\t\t\t\t\tON p.id = o.packageId AND o.objectType = 'block'\n\t\t\t\t\t\t\t\t\t\t\tWHERE o.objectId = {$this->id};";
// Exec!
$packageInfo = $driver->getRow($query, ARRAY_A);
return $packageInfo;
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:14,代码来源:block.php
示例18: prepareItems
/**
* put your comment there...
*
*/
protected function prepareItems()
{
// Query CJT Authors + Wordpress build-in local users.
$query = ' SELECT o.ID id, o.user_login `text`
FROM #__wordpress_users o
RIGHT JOIN #__cjtoolbox_templates t
ON o.ID = t.ownerId ORDER BY `text`';
// Get all exists authors
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:14,代码来源:template-owners.php
示例19: 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;
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:14,代码来源:developer.php
示例20: prepareItems
/**
* put your comment there...
*
*/
protected function prepareItems()
{
// Import dependencies.
CJTxTable::import('template-revision');
CJTxTable::import('author');
$lastVersionFlag = CJTTemplateRevisionTable::FLAG_LAST_REVISION;
$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
// Query all dates (without time!).
$query = " SELECT DISTINCT(DATE(r.dateCreated)) `text` \n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM #__cjtoolbox_template_revisions r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN #__cjtoolbox_templates t\n\t\t\t\t\t\t\t\t\t\t\t\t\tON r.templateId = t.id\n\t\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN #__cjtoolbox_authors a\n\t\t\t\t\t\t\t\t\t\t\t\t\tON t.authorId = a.id\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE (r.attributes & {$lastVersionFlag}) AND (a.attributes & {$internalAuthorsFlag}) = 0\n\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY `text`";
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
}
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:15,代码来源:template-last-modified-dates.php
注:本文中的cssJSToolbox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论