本文整理汇总了PHP中synccache类的典型用法代码示例。如果您正苦于以下问题:PHP synccache类的具体用法?PHP synccache怎么用?PHP synccache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了synccache类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$files = glob($this->dir . '*.php');
foreach ($files as $file) {
$filename = basename($file, '.php');
$content = file_get_contents($file);
// Can't use REPLACE as the name column isn't indexed
#$res = $modx->db->query("REPLACE INTO $table SET {$component[$type]['col_content']} = '". mysql_real_escape_string($content, $modx->db->conn) ."' WHERE {$component[$type]['col_name']} = '". $filename ."'");
$id = $this->modx->db->getValue("SELECT id FROM {$this->table} WHERE {$this->component[$this->type]['col_name']} = '" . $filename . "'");
if ($id) {
$res = $this->modx->db->query("UPDATE {$this->table} SET {$this->component[$this->type]['col_content']} = '" . $this->modx->db->escape($content, $this->modx->db->conn) . "' WHERE {$this->component[$this->type]['col_name']} = '" . $filename . "'");
$updated_items[] = $filename;
} else {
$res = $this->modx->db->query("INSERT INTO {$this->table} SET {$this->component[$this->type]['col_content']} = '" . $this->modx->db->escape($content, $this->modx->db->conn) . "', {$this->component[$this->type]['col_name']} = '" . $filename . "'");
$new_items[] = $filename;
}
$fs_items[] = $filename;
}
// Handle items which may now be in the DB/filesystem but are no longer present in the filesystem/db
// (i.e. remove deleted resources)
$this->fs_items = $fs_items;
$this->new_items = $new_items;
$this->updated_items = $updated_items;
// Clear cache if sync'ing back to DB - as chunks etc are cached there
include_once $this->modx->config['base_path'] . "manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath($this->modx->config['base_path'] . "assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
// first empty the cache
}
开发者ID:hansek,项目名称:modx-component-sync,代码行数:31,代码来源:ComponentLoad.php
示例2: clearCache
public final function clearCache($fire_events = null)
{
$this->modx->clearCache();
include_once $this->modx->getManagerPath() . '/processors/cache_sync.class.processor.php';
$sync = new synccache();
$sync->setCachepath($this->modx->getCachePath());
$sync->setReport(false);
$sync->emptyCache();
$this->invokeEvent('OnSiteRefresh', array(), $fire_events);
}
开发者ID:radist,项目名称:DocFaker,代码行数:10,代码来源:MODx.php
示例3: saveconfig
function saveconfig()
{
global $shop_lang, $modx;
$user = $modx->userLoggedIn();
$act = $_GET['act'];
if ($user['usertype'] == "manager") {
if (!empty($act) && $act == "saveconfig") {
foreach ($_GET as $key => $value) {
if ($key != "a" && $key != "id" && $key != "act" && $key != "act2" && $key != "act3") {
//echo $value;
setConf("", $key, $value, 1);
}
}
include_once $modx->config['base_path'] . "manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath($modx->config['base_path'] . "assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
// first empty the cache
regenConf();
return "<span class='ok'>" . $shop_lang['saveok'] . "</span>";
}
}
}
开发者ID:vvp24,项目名称:tsvshop,代码行数:24,代码来源:functions.inc.php
示例4: regenConf
function regenConf()
{
global $modx;
$query = "SELECT * FROM " . $modx->getFullTableName('shop_conf') . " WHERE exported=1 ORDER BY module, name";
if (!($result = $modx->db->query($query))) {
exit('Query failed: ' . mysql_error());
}
$f = fopen($modx->config['base_path'] . 'assets/snippets/tsvshop/include/config.inc.php', 'w') or die('Can not open config.inc.php for writing!');
$js = fopen($modx->config['base_path'] . 'assets/snippets/tsvshop/js/config.js', 'w') or die('Can not open config.inc.php for writing!');
fwrite($f, "<?php // This file is automatically generated. Do not edit.\n\n");
fwrite($js, "// This file is automatically generated. Do not edit.\n\n");
while ($row = mysql_fetch_row($result)) {
//$mod = strtoupper($row[0]);
//$nam = strtoupper($row[1]);
$mod = $row[0];
$nam = $row[1];
$val = $row[2];
// write numerics directly
if (is_numeric($val)) {
//fwrite($f, "define('$mod"."_$nam', $val);\n");
if (!empty($mod)) {
//fwrite($f, "define('$mod"."_$nam', $val);\n");
if (!empty($val)) {
fwrite($f, "\$tsvshop['" . $mod . "_" . $nam . "']=" . $val . ";\n");
} else {
fwrite($f, "\$tsvshop['" . $mod . "_" . $nam . "']='';\n");
}
//if ($val=="0,00") {$val="'0,00'";}
//fwrite($js, $mod."_".$nam."=".$val.";\n");
} else {
if (!empty($val)) {
fwrite($f, "\$tsvshop['" . $nam . "']=" . $val . ";\n");
if ($val == "0,00") {
$val = "'0,00'";
}
fwrite($js, $nam . "=" . $val . ";\n");
} else {
fwrite($f, "\$tsvshop['" . $nam . "']='';\n");
if ($val == "0,00") {
$val = "'0,00'";
}
fwrite($js, $nam . "='';\n");
}
}
} else {
// escape the single quotes
$val = str_replace('\'', '\\\'', $val);
// end-of-php will break the conf.php; replace it:
$val = str_replace('?' . '>', "?'.'>", $val);
//fwrite($f,"define('$mod"."_$nam', '$val');\n");
if (!empty($mod)) {
//fwrite($f, "define('$mod"."_$nam', $val);\n");
if (!empty($val)) {
fwrite($f, "\$tsvshop['" . $mod . "_" . $nam . "']='" . $val . "';\n");
} else {
fwrite($f, "\$tsvshop['" . $mod . "_" . $nam . "']='';\n");
}
//if ($val=="0,00") {$val="'0,00'";}
//fwrite($js, $mod."_".$nam."=".$val.";\n");
} else {
if (!empty($val)) {
fwrite($f, "\$tsvshop['" . $nam . "']='" . $val . "';\n");
if ($val == "0,00") {
$val = "0,00";
}
fwrite($js, $nam . "='" . $val . "';\n");
} else {
fwrite($f, "\$tsvshop['" . $nam . "']='';\n");
if ($val == "0,00") {
$val = "'0,00'";
}
fwrite($js, $nam . "='';\n");
}
}
}
}
fwrite($f, '?' . '>');
fclose($f);
fclose($js);
/* Clear Cache of MODx*/
include_once $modx->config['base_path'] . "manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath($modx->config['base_path'] . "assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
// first empty the cache
// invoke OnSiteRefresh event
$modx->invokeEvent("OnSiteRefresh");
}
开发者ID:vvp24,项目名称:tsvshop,代码行数:89,代码来源:core.inc.php
示例5: explode
if ($listName == 'listSubmitted') {
continue;
}
$orderArray = explode(';', rtrim($listValue, ';'));
foreach ($orderArray as $key => $item) {
if (strlen($item) == 0) {
continue;
}
$tmplvar = ltrim($item, 'item_');
$sql = 'UPDATE ' . $tbl_site_tmplvar_templates . ' SET rank=' . $key . ' WHERE tmplvarid=' . $tmplvar . ' AND templateid=' . $_REQUEST['id'];
$modx->db->query($sql);
}
}
// empty cache
include_once $basePath . 'manager/processors/cache_sync.class.processor.php';
$sync = new synccache();
$sync->setCachepath($basePath . '/assets/cache/');
$sync->setReport(false);
$sync->emptyCache();
// first empty the cache
}
$sql = 'SELECT tv.name AS `name`, tv.id AS `id`, tr.templateid, tr.rank, tm.templatename ' . 'FROM ' . $tbl_site_tmplvar_templates . ' AS tr ' . 'INNER JOIN ' . $tbl_site_tmplvars . ' AS tv ON tv.id = tr.tmplvarid ' . 'INNER JOIN ' . $tbl_site_templates . ' AS tm ON tr.templateid = tm.id ' . 'WHERE tr.templateid=' . (int) $_REQUEST['id'] . ' ORDER BY tr.rank ASC';
$rs = $modx->db->query($sql);
$limit = $modx->db->getRecordCount($rs);
if ($limit > 1) {
for ($i = 0; $i < $limit; $i++) {
$row = $modx->db->getRow($rs);
if ($i == 0) {
$evtLists .= '<strong>' . $row['templatename'] . '</strong><br /><ul id="sortlist" class="sortableList">';
}
$evtLists .= '<li id="item_' . $row['id'] . '" class="sort">' . $row['name'] . '</li>';
开发者ID:rthrash,项目名称:evolution,代码行数:31,代码来源:mutate_template_tv_rank.dynamic.php
示例6: clearCache
function clearCache()
{
// Clear cache
include_once $this->modx->config['base_path'] . "manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath($this->modx->config['base_path'] . "assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
}
开发者ID:noahlearner,项目名称:evolution,代码行数:9,代码来源:qm.inc.php
示例7: clearCache
public final function clearCache($fire_events = null, $custom = false)
{
$IDs = array();
if ($custom === false) {
$this->modx->clearCache();
include_once MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php';
$sync = new synccache();
$path = $this->getCachePath(true);
$sync->setCachepath($path);
$sync->setReport(false);
$sync->emptyCache();
} else {
if (is_scalar($custom)) {
$custom = array($custom);
}
$files = array();
switch ($this->modx->config['cache_type']) {
case 2:
$cacheFile = "_*.pageCache.php";
break;
default:
$cacheFile = ".pageCache.php";
}
if (is_array($custom)) {
foreach ($custom as $id) {
$tmp = glob(MODX_BASE_PATH . "assets/cache/docid_" . $id . $cacheFile);
foreach ($tmp as $file) {
if (is_readable($file)) {
unlink($file);
}
$IDs[] = $id;
}
}
}
clearstatcache();
}
$this->invokeEvent('OnSiteRefresh', array('IDs' => $IDs), $fire_events);
}
开发者ID:dukeRD,项目名称:DocLister,代码行数:38,代码来源:MODx.php
示例8: syncsite
public function syncsite()
{
$do_sync = isset($_POST['syncsite']) ? $_POST['syncsite'] : 0;
if ($do_sync == 1) {
// empty cache
include_once MODX_BASE_PATH.'manager/processors/cache_sync.class.processor.php';
$sync = new synccache();
$sync->setCachepath(MODX_BASE_PATH.'assets/cache/');
$sync->setReport(false);
$sync->emptyCache();
}
}
开发者ID:netProphET,项目名称:Middleman,代码行数:12,代码来源:Save.php
示例9: getSettings
function getSettings()
{
if (!is_array($this->config) || empty($this->config)) {
if ($included = file_exists(MODX_BASE_PATH . 'assets/cache/siteCache.idx.php')) {
$included = (include_once MODX_BASE_PATH . 'assets/cache/siteCache.idx.php');
}
if (!$included || !is_array($this->config) || empty($this->config)) {
include_once MODX_BASE_PATH . "/manager/processors/cache_sync.class.processor.php";
$cache = new synccache();
$cache->setCachepath(MODX_BASE_PATH . "/assets/cache/");
$cache->setReport(false);
$rebuilt = $cache->buildCache($this);
$included = false;
if ($rebuilt && ($included = file_exists(MODX_BASE_PATH . 'assets/cache/siteCache.idx.php'))) {
$included = (include MODX_BASE_PATH . 'assets/cache/siteCache.idx.php');
}
if (!$included) {
$result = $this->db->query('SELECT setting_name, setting_value FROM ' . $this->getFullTableName('system_settings'));
while ($row = $this->db->getRow($result, 'both')) {
$this->config[$row[0]] = $row[1];
}
}
}
// added for backwards compatibility - garry FS#104
$this->config['etomite_charset'] =& $this->config['modx_charset'];
// store base_url and base_path inside config array
$this->config['base_url'] = MODX_BASE_URL;
$this->config['base_path'] = MODX_BASE_PATH;
$this->config['site_url'] = MODX_SITE_URL;
// load user setting if user is logged in
$usrSettings = array();
if ($id = $this->getLoginUserID()) {
$usrType = $this->getLoginUserType();
if (isset($usrType) && $usrType == 'manager') {
$usrType = 'mgr';
}
if ($usrType == 'mgr' && $this->isBackend()) {
// invoke the OnBeforeManagerPageInit event, only if in backend
$this->invokeEvent("OnBeforeManagerPageInit");
}
if (isset($_SESSION[$usrType . 'UsrConfigSet'])) {
$usrSettings =& $_SESSION[$usrType . 'UsrConfigSet'];
} else {
if ($usrType == 'web') {
$query = $this->getFullTableName('web_user_settings') . ' WHERE webuser=\'' . $id . '\'';
} else {
$query = $this->getFullTableName('user_settings') . ' WHERE user=\'' . $id . '\'';
}
$result = $this->db->query('SELECT setting_name, setting_value FROM ' . $query);
while ($row = $this->db->getRow($result, 'both')) {
$usrSettings[$row[0]] = $row[1];
}
if (isset($usrType)) {
$_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings;
}
// store user settings in session
}
}
if ($this->isFrontend() && ($mgrid = $this->getLoginUserID('mgr'))) {
$musrSettings = array();
if (isset($_SESSION['mgrUsrConfigSet'])) {
$musrSettings =& $_SESSION['mgrUsrConfigSet'];
} else {
$query = $this->getFullTableName('user_settings') . ' WHERE user=\'' . $mgrid . '\'';
if ($result = $this->db->query('SELECT setting_name, setting_value FROM ' . $query)) {
while ($row = $this->db->getRow($result, 'both')) {
$usrSettings[$row[0]] = $row[1];
}
$_SESSION['mgrUsrConfigSet'] = $musrSettings;
// store user settings in session
}
}
if (!empty($musrSettings)) {
$usrSettings = array_merge($musrSettings, $usrSettings);
}
}
$this->config = array_merge($this->config, $usrSettings);
}
}
开发者ID:noahlearner,项目名称:evolution,代码行数:79,代码来源:document.parser.class.inc.php
示例10: Run
function Run()
{
// Include MODx manager language file
global $_lang;
// Get manager language
$manager_language = $this->modx->config['manager_language'];
// Include_once the language file
if (!isset($manager_language) || !file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) {
$manager_language = "english";
// if not set, get the english language file.
}
// Include default language
include_once MODX_MANAGER_PATH . "includes/lang/english.inc.php";
// Include user language
if ($manager_language != "english" && file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) {
include_once MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php";
}
// Get event
$e = $this->modx->Event;
// Run plugin based on event
switch ($e->name) {
// Save document
case 'OnDocFormSave':
// Saving process for Qm only
if (intval($_REQUEST['quickmanager']) == 1) {
$id = $e->params['id'];
$key = $id;
// Normal saving document procedure stops to redirect => Before redirecting secure documents and clear cache
// Secure web documents - flag as private (code from: manager/processors/save_content.processor.php)
include $this->modx->config['base_path'] . "manager/includes/secure_web_documents.inc.php";
secureWebDocument($key);
// Secure manager documents - flag as private (code from: manager/processors/save_content.processor.php)
include $this->modx->config['base_path'] . "manager/includes/secure_mgr_documents.inc.php";
secureMgrDocument($key);
// Clear cache
include_once $this->modx->config['base_path'] . "manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath($this->modx->config['base_path'] . "assets/cache/");
$sync->setReport(true);
$sync->emptyCache();
// Redirect to clearer page which refreshes parent window and closes modal box frame
$this->modx->sendRedirect($this->modx->config['base_url'] . 'assets/plugins/qm/close.php?id=' . $id, 0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently');
}
break;
// Display page in front-end
// Display page in front-end
case 'OnWebPagePrerender':
// If logged in manager but not in manager preview show control buttons
if (isset($_SESSION['mgrValidated']) && $_REQUEST['z'] != 'manprev') {
$output =& $this->modx->documentOutput;
// If logout break here
if (isset($_REQUEST['logout'])) {
$this->Logout();
break;
}
$userID = $_SESSION['mgrInternalKey'];
$docID = $this->modx->documentIdentifier;
$doc = $this->modx->getDocument($docID);
// Edit button
$editButton = '
<li>
<a class="qmButton qmEdit colorbox" href="' . $this->modx->config['site_url'] . 'manager/index.php?a=27&id=' . $docID . '&quickmanager=1"><span> ' . $_lang['edit_resource'] . '</span></a>
</li>
';
// Check if user has manager access to current document
$access = $this->checkAccess();
// Does user have permissions to edit document
if ($access) {
$controls .= $editButton;
}
if ($this->addbutton == 'true' && $access) {
// Add button
$addButton = '
<li>
<a class="qmButton colorbox" href="' . $this->modx->config['site_url'] . 'manager/index.php?a=4&pid=' . $docID . '&quickmanager=1">' . $_lang['create_resource_here'] . '</a>
</li>
';
// Does user have permissions to add document
if ($this->modx->hasPermission('new_document')) {
$controls .= $addButton;
}
}
// Custom add buttons if not empty and enough permissions
if ($this->custombutton != '') {
$buttons = explode("||", $this->custombutton);
// Buttons are divided by "#"
// Parse buttons
foreach ($buttons as $key => $field) {
$field = substr($field, 1, -1);
// Trim "'" from beginning and from end
$buttonParams = explode("','", $field);
// Button params are divided by "','"
$buttonTitle = $buttonParams[0];
$buttonAction = $buttonParams[1];
// Contains URL if this is not add button
$buttonParentId = $buttonParams[2];
// Is empty is this is not add button
$buttonTplId = $buttonParams[3];
// Button visible for all
if ($buttonParams[4] == '') {
//.........这里部分代码省略.........
开发者ID:rthrash,项目名称:evolution,代码行数:101,代码来源:qm.inc.php
示例11: emptyCache
function emptyCache()
{
global $modx;
// empty cache
include_once $modx->config['base_path'] . 'manager/processors/cache_sync.class.processor.php';
$sync = new synccache();
$sync->setCachepath($modx->config['base_path'] . 'assets/cache/');
$sync->setReport(false);
$sync->emptyCache();
// first empty the cache
}
开发者ID:Bruno17,项目名称:bloX-Xedit,代码行数:11,代码来源:xedit.class.php
示例12: clearCache
function clearCache()
{
include_once "processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath("../assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
}
开发者ID:Jako,项目名称:ModX-Evo-dbEdit,代码行数:8,代码来源:index.php
示例13: clearCache
function clearCache($params = array())
{
if ($this->isBackend() && !$this->hasPermission('empty_cache')) {
return;
}
if (opendir(MODX_BASE_PATH . 'assets/cache') !== false) {
$showReport = $params['showReport'] ? $params['showReport'] : false;
$target = $params['target'] ? $params['target'] : 'pagecache,sitecache';
include_once MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php';
$sync = new synccache();
$sync->setCachepath(MODX_BASE_PATH . 'assets/cache/');
$sync->setReport($showReport);
$sync->setTarget($target);
$sync->emptyCache();
// first empty the cache
return true;
} else {
return false;
}
}
开发者ID:Fiberalph,项目名称:evolution-jp,代码行数:20,代码来源:document.parser.class.inc.php
示例14: explode
}
$langs = explode(",", $_POST['lang_list']);
foreach ($langs as $lng) {
if (!in_array($lng, $columns)) {
$needed[] = $lng;
}
}
foreach ($needed as $lng) {
if (!empty($lng)) {
$modx->db->query("ALTER TABLE `modx_a_lang` ADD `" . $lng . "` text NOT NULL COMMENT '" . $lng . "'\t");
}
}
}
// empty cache
include_once MODX_BASE_PATH . "manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath(MODX_BASE_PATH . "assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
// first empty the cache
die(header("Location: " . $url . "&get=settings"));
}
$tpl = "/tpl/module_settings.tpl";
break;
case "about":
break;
}
if (isset($tpl)) {
ob_start();
include ROOT . $tpl;
$res['content'] = ob_get_contents();
开发者ID:AlexJS7,项目名称:church.local,代码行数:31,代码来源:module.php
示例15: clearCache
/**
* Clear the cache of MODX.
*
* @return boolean
*/
function clearCache($type = '', $report = false)
{
if ($type == 'full') {
include_once MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php';
$sync = new synccache();
$sync->setCachepath(MODX_BASE_PATH . 'assets/cache/');
$sync->setReport($report);
$sync->emptyCache();
} else {
$files = glob(MODX_BASE_PATH . 'assets/cache/*');
$deletedfiles = array();
while ($file = array_shift($files)) {
$name = basename($file);
if (preg_match('/\\.pageCache/', $name) && !in_array($name, $deletedfiles)) {
$deletedfiles[] = $name;
unlink($file);
clearstatcache();
}
}
}
}
开发者ID:AlexJS7,项目名称:church.local,代码行数:26,代码来源:document.parser.class.inc.php
示例16: Run
function Run()
{
// Include MODx manager language file
global $_lang;
include_once $this->modx->config['base_path'] . 'manager/includes/lang/' . $this->modx->config['manager_language'] . '.inc.php';
// Get event
$e = $this->modx->Event;
// Run plugin based on event
switch ($e->name) {
// Save document
case 'OnDocFormSave':
// Saving process for Qm only, confirm HTTP_REFERER
if (!empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'quickmanager=true') !== false) {
$id = $e->params['id'];
$key = $id;
// Normal saving document procedure stops to redirect => Before redirecting secure documents and clear cache
// Secure web documents - flag as private (code from: manager/processors/save_content.processor.php)
include $this->modx->config['base_path'] . "manager/includes/secure_web_documents.inc.php";
secureWebDocument($key);
// Secure manager documents - flag as private (code from: manager/processors/save_content.processor.php)
include $this->modx->config['base_path'] . "manager/includes/secure_mgr_documents.inc.php";
secureMgrDocument($key);
// Clear cache
include_once $this->modx->config['base_path'] . "manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath($this->modx->config['base_path'] . "assets/cache/");
$sync->setReport(true);
$sync->emptyCache();
// Redirect to clearer page which refreshes parent window and closes ColorBox frame
$this->modx->sendRedirect($this->modx->config['base_url'] . 'assets/plugins/qm/close.php?id=' . $id . '&baseurl=' . $this->modx->config['base_url'], 0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently');
}
break;
// Display page in front-end
// Display page in front-end
case 'OnWebPagePrerender':
// If logged in manager but not in manager preview show control buttons
if (isset($_SESSION['mgrValidated']) && $_REQUEST['z'] != 'manprev') {
$output =& $this->modx->documentOutput;
// If logout break here
if (isset($_REQUEST['logout'])) {
$this->Logout();
break;
}
$userID = $_SESSION['mgrInternalKey'];
$docID = $this->modx->documentIdentifier;
$doc = $this->modx->getDocument($docID);
// Edit button
$editButton = '
<li>
<a class="qmButton qmEdit colorbox" title="' . $doc['pagetitle'] . ' » ' . $_lang['edit_document'] . '" href="' . $this->modx->config['site_url'] . 'manager/index.php?a=27&id=' . $docID . '&quickmanager=true">' . $_lang['edit_document'] . '</a>
</li>';
// Does user have permissions to edit document
if ($this->modx->hasPermission('edit_document')) {
$controls .= $editButton;
}
if ($this->addbutton == 'true') {
// Add button
$addButton = '
<li>
<a class="qmButton qmAdd colorbox" title="' . $doc['pagetitle'] . ' » ' . $_lang['create_document_here'] . '" href="' . $this->modx->config['site_url'] . 'manager/index.php?a=4&pid=' . $docID . '&quickmanager=true">' . $_lang['create_document_here'] . '</a>
</li>';
// Does user have permissions to add document
if ($this->modx->hasPermission('new_document')) {
$controls .= $addButton;
}
}
// Not implemented yet
//$delButton = '<a class="button delete" title="'.$doc['pagetitle'].'» '.$_lang['delete_document'].'" href="#" onclick="if(confirm(\'`'.$doc['pagetitle'].'`\n\n'.$_lang['confirm_delete_document'].'\')==true) document.location.href=\''.$this->modx->config['site_url'].'manager/index.php?a=4&id='.$docID.'\';return false;">'.$_lang['delete_document'].'</a>';
//if($this->modx->hasPermission('delete_document')) $controls.=$delButton;
// Logout button
$logout = $this->modx->config['site_url'] . 'manager/index.php?a=8';
$logoutButton = '
<li>
<a class="qmButton qmLogout" title="' . $_lang['logout'] . '" href="' . $logout . '" ><!--img src="' . MODX_BASE_URL . 'assets/plugins/qm/res/exit.png" alt="Edit" /-->' . $_lang['logout'] . '</a>
</li>';
$controls .= $logoutButton;
$editor = '
<div id="qmEditor" class="actionButtons">
<ul>' . $controls . '
</ul>
</div>';
$css = '<link rel="stylesheet" type="text/css" href="assets/plugins/qm/res/style.css" />';
// Insert jQuery and ColorBox in head if needed
if ($this->loadfrontendjq == 'true') {
$head .= '<script src="' . $this->modx->config['site_url'] . $this->jqpath . '" type="text/javascript"></script>';
}
if ($this->loadtb == 'true') {
$head .= '
<script type="text/javascript" src="' . $this->modx->config['site_url'] . 'assets/js/jquery.colorbox-min.js"></script>
<link type="text/css" media="screen" rel="stylesheet" href="' . $this->modx->config['site_url'] . 'assets/js/colorbox.css" />
<!--[if IE]>
<link type="text/css" media="screen" rel="stylesheet" href="' . $this->modx->config['site_url'] . 'assets/js/colorbox-ie.css" title="example" />
<![endif]-->
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function($){
$("a.colorbox").colorbox({width:"' . $this->tbwidth . '", height:"' . $this->tbheight . '", iframe:true});
});
function cb_remove(){
//.........这里部分代码省略.........
开发者ID:jgrau,项目名称:MODx-CMS,代码行数:101,代码来源:qm.inc.php
示例17: define
}
// call back function
if ($callBackFnc != "") {
$callBackFnc($sqlParser);
}
// Setup the MODx API -- needed for the cache processor
define('MODX_API_MODE', true);
define('MODX_BASE_PATH', $base_path);
$database_type = 'mysql';
// initiate a new document parser
include_once '../manager/includes/document.parser.class.inc.php';
$modx = new DocumentParser();
$modx->db->connect();
// always empty cache after install
include_once "../manager/processors/cache_sync.class.processor.php";
$sync = new synccache();
$sync->setCachepath("../assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
// first empty the cache
// try to chmod the cache go-rwx (for suexeced php)
$chmodSuccess = @chmod('../assets/cache/siteCache.idx.php', 0600);
$chmodSuccess = @chmod('../assets/cache/sitePublishing.idx.php', 0600);
// remove any locks on the manager functions so initial manager login is not blocked
mysql_query("TRUNCATE TABLE `" . $table_prefix . "active_users`");
// close db connection
$sqlParser->close();
// andrazk 20070416 - release manager access
if (file_exists('../assets/cache/installProc.inc.php')) {
@chmod('../assets/cache/installProc.inc.php', 0755);
unlink('../assets/cache/installProc.inc.php');
开发者ID:jgrau,项目名称:MODx-CMS,代码行数:31,代码来源:instprocessor.php
示例18: clearVars
/**
* Удаляем все неиспользуемые параметры товаров снятых с производства
* @
*/
function clearVars()
{
// Удалим все TV параметры не спользуемые в шаблоне для товаров снятых с производства
if ($this->config['clear_tvs'] && $this->config['product_prodution_tpl_id'] && $this->config['prodution_catalog_id']) {
$tv_p_res = $this->query("SELECT tmplvarid FROM " . $this->modx->getFullTableName('site_tmplvar_templates') . " WHERE templateid = " . $this->config['product_tpl_id']);
while ($tv = mysql_fetch_array($tv_p_res)) {
$tv_product[] = $tv[0];
}
$tv_p_p_res = $this->query("SELECT tmplvarid FROM " . $this->modx->getFullTableName('site_tmplvar_templates') . " WHERE templateid = " . $this->config['product_prodution_tpl_id']);
while ($tv = mysql_fetch_array($tv_p_p_res)) {
$tv_product_prodution[] = $tv[0];
}
$this->query("DELETE FROM " . $this->config['tbl_catalog_tv'] . " \n\t\t\t\t\tWHERE contentid IN (" . implode(',', $this->modx->getChildIds($this->config['prodution_catalog_id'])) . ") \n\t\t\t\t\tAND tmplvarid IN (" . implode(",", array_diff($tv_product, $tv_product_prodution)) . ")");
}
// Полная очистка кэша
$this->modx->clearCache();
include_once MODX_BASE_PATH . 'manager/processors/cache_sync.class.processor.php';
$sync = new synccache();
$sync->setCachepath(MODX_BASE_PATH . "assets/cache/");
$sync->setReport(false);
$sync->emptyCache();
}
开发者ID:pozitr0n,项目名称:1c_exchange,代码行数:26,代码来源:class.exchange_1c.catalog_import.php
注:本文中的synccache类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论