本文整理汇总了PHP中rex_get函数的典型用法代码示例。如果您正苦于以下问题:PHP rex_get函数的具体用法?PHP rex_get怎么用?PHP rex_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rex_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
if (!rex::getUser()->isAdmin()) {
throw new rex_api_exception('user has no permission for this operation!');
}
$type = rex_get('type', 'string');
switch ($type) {
case 'articles':
$prefix = 'art\\_%';
$defaultFields = [['translate:online_from', 'art_online_from', '1', '', '10', ''], ['translate:online_to', 'art_online_to', '2', '', '10', ''], ['translate:description', 'art_description', '3', '', '2', '']];
break;
case 'media':
$prefix = 'med\\_%';
$defaultFields = [['translate:pool_file_description', 'med_description', '1', '', '2', ''], ['translate:pool_file_copyright', 'med_copyright', '2', '', '1', '']];
break;
default:
throw new rex_api_exception(sprintf('metainfo type "%s" does not have default field.', $type));
}
$existing = rex_sql::factory()->getArray('SELECT name FROM ' . rex::getTable('metainfo_field') . ' WHERE name LIKE ?', [$prefix]);
$existing = array_column($existing, 'name', 'name');
foreach ($defaultFields as $field) {
if (!isset($existing[$field[1]])) {
$return = call_user_func_array('rex_metainfo_add_field', $field);
if (is_string($return)) {
throw new rex_api_exception($return);
}
}
}
return new rex_api_result(true, rex_i18n::msg('minfo_default_fields_created'));
}
示例2: rex_a128_historyHandler
function rex_a128_historyHandler($params)
{
global $page, $subpage, $REX_USER, $REX;
$mypage = $params['mypage'];
require $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/classes/class.rex_historyManager.inc.php';
require $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/classes/class.rex_history.inc.php';
require $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/classes/class.rex_historyItem.inc.php';
$function = rex_request('function', 'string');
$mode = rex_request('mode', 'string');
// Alle Histories registrierens
$articleHistory =& rexHistoryManager::getHistory('articles');
$templateHistory =& rexHistoryManager::getHistory('templates');
$moduleHistory =& rexHistoryManager::getHistory('modules');
$actionHistory =& rexHistoryManager::getHistory('actions');
$sql = new rex_sql();
$sql->debugsql = true;
if ($page == 'module' && $function == 'edit' && ($module_id = rex_get('modul_id', 'int')) != 0) {
$result = $sql->getArray('SELECT name FROM ' . $REX['TABLE_PREFIX'] . 'modultyp WHERE id=' . $module_id);
if (isset($result[0])) {
$link = 'index.php?page=' . $page . '&function=' . $function . '&modul_id=' . $module_id;
$title = $result[0]['name'];
if ($REX_USER->hasPerm('advancedMode[]')) {
$title .= ' [' . $module_id . ']';
}
$moduleHistory->addItem(new rexHistoryItem($title, $link));
}
} elseif ($page == 'module' && $subpage == 'actions' && $function == 'edit' && ($action_id = rex_get('action_id', 'int')) != 0) {
$result = $sql->getArray('SELECT name FROM ' . $REX['TABLE_PREFIX'] . 'action WHERE id=' . $action_id);
if (isset($result[0])) {
$link = 'index.php?page=' . $page . '&subpage=' . $subpage . '&function=' . $function . '&modul_id=' . $action_id;
$title = $result[0]['name'];
if ($REX_USER->hasPerm('advancedMode[]')) {
$title .= ' [' . $action_id . ']';
}
$actionHistory->addItem(new rexHistoryItem($title, $link));
}
} elseif ($page == 'template' && $function == 'edit' && ($template_id = rex_get('template_id', 'int')) != 0) {
$result = $sql->getArray('SELECT name FROM ' . $REX['TABLE_PREFIX'] . 'template WHERE id=' . $template_id);
if (isset($result[0])) {
$link = 'index.php?page=' . $page . '&function=' . $function . '&template_id=' . $template_id;
$title = $result[0]['name'];
if ($REX_USER->hasPerm('advancedMode[]')) {
$title .= ' [' . $template_id . ']';
}
$templateHistory->addItem(new rexHistoryItem($title, $link));
}
} elseif ($page == 'content' && $mode == 'edit' && ($article_id = rex_get('article_id', 'int')) != 0) {
$art = OOArticle::getArticleById($article_id);
if (OOArticle::isValid($art)) {
$link = 'index.php?page=' . $page . '&mode=' . $mode . '&article_id=' . $article_id;
$title = $art->getName();
if ($REX_USER->hasPerm('advancedMode[]')) {
$title .= ' [' . $article_id . ']';
}
$articleHistory->addItem(new rexHistoryItem($title, $link));
}
}
}
示例3: deleteSlices
public static function deleteSlices()
{
$IDs = rex_get('slices');
$sql = rex_sql::factory();
// $sql->setDebug();
$sql->setTable(rex::getTablePrefix() . 'article_slice');
$sql->setWhere("id IN('" . implode("','", $IDs) . "')", array());
$sql->delete();
$_SESSION[__CLASS__]['active'] = 0;
die;
}
示例4: get
function get()
{
global $REX;
if ($this->checkPermission()) {
$callable = array($this, '_get');
$cachekey = $this->funcCache->computeCacheKey($callable, array($REX['USER']->getUserLogin()));
$cacheBackend = $this->funcCache->getCache();
$configForm = '';
if ($this->config) {
$configForm = $this->config ? $this->config->get() : '';
// config changed -> remove cache to reflect changes
if ($this->config->changed()) {
$cacheBackend->remove($cachekey);
}
}
// refresh clicked in actionbar
if (rex_get('refresh', 'string') == $this->getId()) {
$cacheBackend->remove($cachekey);
}
// prueft ob inhalte des callables gecacht vorliegen
$content = $this->funcCache->call($callable, array($REX['USER']->getUserLogin()));
// wenn gecachter inhalt leer ist, vom cache entfernen und nochmals checken
// damit leere komponenten sofort angezeigt werden, wenn neue inhalte verfuegbar sind
if ($content == '') {
$cacheBackend->remove($cachekey);
$content = $this->funcCache->call($callable, array($REX['USER']->getUserLogin()));
}
$cachestamp = $cacheBackend->getLastModified($cachekey);
if (!$cachestamp) {
$cachestamp = time();
}
// falls kein gueltiger cache vorhanden
$cachetime = rex_formatter::format($cachestamp, 'strftime', 'datetime');
$content = strtr($content, array('%%actionbar%%' => $this->getActionBar()));
$content = strtr($content, array('%%cachetime%%' => $cachetime));
$content = strtr($content, array('%%config%%' => $configForm));
// refresh clicked in actionbar
if (rex_get('ajax-get', 'string') == $this->getId()) {
// clear output-buffer
while (@ob_end_clean()) {
}
rex_send_resource($content);
exit;
}
return $content;
}
return '';
}
示例5: image_manager_init
function image_manager_init()
{
global $REX;
//--- handle image request
$rex_img_file = rex_get('rex_img_file', 'string');
$rex_img_type = rex_get('rex_img_type', 'string');
$rex_img_init = false;
if ($rex_img_file != '' && $rex_img_type != '') {
$rex_img_init = true;
}
$imagepath = $REX['HTDOCS_PATH'] . $REX['MEDIA_DIR'] . '/' . $rex_img_file;
$cachepath = $REX['GENERATED_PATH'] . '/files/';
// REGISTER EXTENSION POINT
$subject = array('rex_img_type' => $rex_img_type, 'rex_img_file' => $rex_img_file, 'rex_img_init' => $rex_img_init, 'imagepath' => $imagepath, 'cachepath' => $cachepath);
$subject = rex_register_extension_point('IMAGE_MANAGER_INIT', $subject);
if (isset($subject['rex_img_file'])) {
$rex_img_file = $subject['rex_img_file'];
}
if (isset($subject['rex_img_type'])) {
$rex_img_type = $subject['rex_img_type'];
}
if (isset($subject['imagepath'])) {
$imagepath = $subject['imagepath'];
}
if (isset($subject['cachepath'])) {
$cachepath = $subject['cachepath'];
}
if ($subject['rex_img_init']) {
$image = new rex_image($imagepath);
$image_cacher = new rex_image_cacher($cachepath);
$image_manager = new rex_image_manager($image_cacher);
$image = $image_manager->applyEffects($image, $rex_img_type);
$image_manager->sendImage($image, $rex_img_type);
exit;
}
}
示例6: ob_end_clean
$where .= "AND (width > " . $max_pixel . " OR height > " . $max_pixel . ")";
$FILESQL->setWhere($where . ' ORDER BY pixel asc');
// rex_sql has no special method for adding sort-order
$FILESQL->select('*, (width * height) AS pixel');
$files = $FILESQL->getArray();
if (rex_get('scale') == 'scale') {
ob_end_clean();
$initial = rex_get('initial');
$progress = $initial - count($files);
if ($progress) {
$td_width = round($progress / $initial * 100);
} else {
$td_width = 0;
}
$td2_width = 100 - $td_width;
if (rex_post('btn_update', 'string') != '' || rex_get('update_continue')) {
ob_start();
echo '<span style="font-family: sans-serif; font-size: 12px;">' . $I18N->msg('dcf_precomp_caption_progress') . '</span><br />';
echo '<table cellpadding=0 cellspacing=0 border=0 style="height: 32px; width: 100%"><tr><td style="width: ' . $td_width . '%; background: #3c9ed0; color: #fff; font-size: 12px; font-weight: bold; font-family: sans-serif; text-align: left"> ' . $progress . '</td><td style="width:' . $td2_width . '%; text-align: right; font-size: 12px; font-weight: bold; font-family: sans-serif"> </td></tr></table>';
if (!count($files)) {
echo '<br /><span style="font-family: sans-serif; font-size: 12px; font-weight: bold">' . $I18N->msg('dcf_precomp_caption_finished') . '</span>';
} else {
echo '<br /><span style="font-family: sans-serif; font-size: 12px;">' . $I18N->msg('dcf_precomp_no_reload') . '</span>';
}
$i = 0;
foreach ($files as $file) {
if ($file['width'] > $file['height']) {
$ratio = $REX['ADDON']['upload_precompressor']['settings']['max_pixel'] / $file['width'];
} else {
$ratio = $REX['ADDON']['upload_precompressor']['settings']['max_pixel'] / $file['height'];
}
示例7: rex_register_extension
$REX['ADDON']['image_resize']['max_resizekb'] = 300;
$REX['ADDON']['image_resize']['max_resizepixel'] = 500;
$REX['ADDON']['image_resize']['jpg_quality'] = 75;
// --- /DYN
include_once $REX['INCLUDE_PATH'] . '/addons/image_resize/classes/class.thumbnail.inc.php';
if ($REX['GG']) {
require_once $REX['INCLUDE_PATH'] . '/addons/image_resize/extensions/extension_wysiwyg.inc.php';
rex_register_extension('OUTPUT_FILTER', 'rex_resize_wysiwyg_output');
} else {
// Bei Update Cache loeschen
if (!function_exists('rex_image_ep_mediaupdated')) {
rex_register_extension('MEDIA_UPDATED', 'rex_image_ep_mediaupdated');
function rex_image_ep_mediaupdated($params)
{
rex_thumbnail::deleteCache($params["filename"]);
}
}
}
// Resize Script
$rex_resize = rex_get('rex_resize', 'string');
if ($rex_resize != '') {
rex_thumbnail::createFromUrl($rex_resize);
}
if ($REX['REDAXO']) {
if (rex_get('css', 'string') == 'addons/' . $mypage) {
$cssfile = $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/css/image_resize.css';
rex_send_file($cssfile, 'text/css');
exit;
}
rex_register_extension('PAGE_HEADER', create_function('$params', 'return $params[\'subject\'] .\' <link rel="stylesheet" type="text/css" href="index.php?css=addons/' . $mypage . '" />\'."\\n";'));
}
示例8: rex_send_file
$REX['ADDON']['rxid'][$mypage] = '256';
$REX['ADDON']['page'][$mypage] = $mypage;
//$REX['ADDON']['name'][$mypage] = 'Backend Search';
//$REX['ADDON']['perm'][$mypage] = 'be_search[]';
$REX['ADDON']['version'][$mypage] = '1.0';
$REX['ADDON']['author'][$mypage] = 'Markus Staab';
$REX['ADDON']['supportpage'][$mypage] = 'forum.redaxo.de';
$REX['EXTPERM'][] = 'be_search[medienpool]';
$REX['EXTPERM'][] = 'be_search[structure]';
if ($REX['REDAXO']) {
if (rex_get('css', 'string') == 'addons/' . $mypage) {
$cssfile = $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/css/be_search.css';
rex_send_file($cssfile, 'text/css');
exit;
}
if (rex_get('css', 'string') == 'addons/' . $mypage . '/ie7') {
$cssfile = $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/css/be_search_ie_lte_7.css';
rex_send_file($cssfile, 'text/css');
exit;
}
rex_register_extension('PAGE_HEADER', create_function('$params', 'return $params[\'subject\'] .\' <link rel="stylesheet" type="text/css" href="index.php?css=addons/' . $mypage . '" />
<!--[if lte IE 7]><link rel="stylesheet" href="index.php?css=addons/' . $mypage . '/ie7" type="text/css" media="all" /><![endif]-->' . "\n" . '\';'));
$I18N_BE_SEARCH = new i18n($REX['LANG'], $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/lang');
// Include Extensions
if (!isset($page) || $page == '' || $page == 'structure') {
require_once $REX['INCLUDE_PATH'] . '/addons/be_search/extensions/extension_search_structure.inc.php';
rex_register_extension('PAGE_STRUCTURE_HEADER', 'rex_a256_search_structure');
} elseif ($page == 'content') {
require_once $REX['INCLUDE_PATH'] . '/addons/be_search/extensions/extension_search_structure.inc.php';
rex_register_extension('PAGE_CONTENT_HEADER', 'rex_a256_search_structure');
} elseif ($page == 'medienpool') {
示例9: rex_create_lang
$REX['LANG'] = 'de_de';
}
$I18N = rex_create_lang($REX['LANG']);
$REX['PAGES']['setup'] = rex_be_navigation::getSetupPage();
$REX['PAGE'] = "setup";
} else {
// ----------------- CREATE LANG OBJ
$I18N = rex_create_lang($REX['LANG']);
// ---- prepare login
$REX['LOGIN'] = new rex_backend_login($REX['TABLE_PREFIX'] . 'user');
$rex_user_login = rex_post('rex_user_login', 'string');
$rex_user_psw = rex_post('rex_user_psw', 'string');
if ($REX['PSWFUNC'] != '') {
$REX['LOGIN']->setPasswordFunction($REX['PSWFUNC']);
}
if (rex_get('rex_logout', 'boolean')) {
$REX['LOGIN']->setLogout(true);
}
$REX['LOGIN']->setLogin($rex_user_login, $rex_user_psw);
$loginCheck = $REX['LOGIN']->checkLogin();
$rex_user_loginmessage = "";
if ($loginCheck !== true) {
// login failed
$rex_user_loginmessage = $REX['LOGIN']->message;
// Fehlermeldung von der Datenbank
if (is_string($loginCheck)) {
$rex_user_loginmessage = $loginCheck;
}
$REX['PAGES']['login'] = rex_be_navigation::getLoginPage();
$REX['PAGE'] = 'login';
$REX['USER'] = null;
示例10: checkPermissions
public static function checkPermissions($ep)
{
$AddonPerm = rex_config::get('slice_ui');
$article = rex_sql::factory();
// $article->setDebug();
$articleTable = rex::getTablePrefix() . 'article';
$article->setTable($articleTable);
// $article->setDebug();
$article->setQuery('
SELECT article.*, template.attributes as template_attributes
FROM ' . rex::getTablePrefix() . 'article as article
LEFT JOIN ' . rex::getTablePrefix() . 'template as template ON template.id=article.template_id
WHERE article.id = ? AND clang_id = ?', array($ep['article_id'], $ep['clang']));
$ctype = 1;
if ($c = rex_request('ctype')) {
$ctype = $c;
}
$template_attributes = json_decode($article->getValue('template_attributes'), 1);
if ($template_attributes === null) {
$template_attributes = array();
}
$AddonPerm['ctypes'] = $AddonPerm['ctypes'][$article->getValue('template_id')];
if (!rex_template::hasModule($template_attributes, $ep['ctype'], $ep['module_id'])) {
return false;
} elseif (!(rex::getUser()->isAdmin() || rex::getUser()->hasPerm('module[' . $ep['module_id'] . ']') || rex::getUser()->hasPerm('module[0]'))) {
return false;
}
if (strpos(rex_get('page', 'string'), 'content/paste') === false) {
if (!empty($AddonPerm['modules']) && !in_array('all', $AddonPerm['modules']) && !in_array($ep['module_id'], $AddonPerm['modules']) || !empty($AddonPerm['ctypes']) && !in_array('all', $AddonPerm['ctypes']) && !in_array($ep['ctype'], $AddonPerm['ctypes'])) {
return false;
}
}
return true;
}
示例11: i18n
* @version $Id: config.inc.php,v 1.1 2008/03/26 13:34:13 kills Exp $
*/
$mypage = 'metainfo';
if ($REX['REDAXO']) {
$I18N_META_INFOS = new i18n($REX['LANG'], $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/lang');
}
$REX['ADDON']['rxid'][$mypage] = '62';
$REX['ADDON']['page'][$mypage] = $mypage;
$REX['ADDON']['name'][$mypage] = 'Meta Infos';
$REX['ADDON']['perm'][$mypage] = 'metainfo[]';
$REX['ADDON']['version'][$mypage] = "1.0";
$REX['ADDON']['author'][$mypage] = "Markus Staab, Jan Kristinus";
$REX['ADDON']['supportpage'][$mypage] = 'forum.redaxo.de';
$REX['PERM'][] = 'metainfo[]';
if ($REX['REDAXO']) {
if (rex_get('js', 'string') == 'addons/metainfo') {
$jsfile = $REX['INCLUDE_PATH'] . '/addons/metainfo/js/metainfo.js';
rex_send_file($jsfile, 'text/javascript');
exit;
}
// Include Extensions
if (isset($page)) {
if ($page == 'metainfo') {
rex_register_extension('PAGE_HEADER', create_function('$params', 'return $params[\'subject\'] .\' <script src="index.php?js=addons/metainfo" type="text/javascript"></script>\'."\\n";'));
}
require_once $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/extensions/extension_common.inc.php';
if ($page == 'content' && isset($mode) && $mode == 'meta') {
require_once $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/extensions/extension_art_metainfo.inc.php';
} elseif ($page == 'structure') {
require_once $REX['INCLUDE_PATH'] . '/addons/' . $mypage . '/extensions/extension_cat_metainfo.inc.php';
} elseif ($page == 'medienpool') {
示例12: resolve
/**
* RESOLVE()
*
* resolve url to ARTICLE_ID & CLANG,
* resolve rewritten params back to GET/REQUEST
*/
function resolve()
{
global $REX, $SEO42_URLS, $SEO42_IDS;
if (!file_exists(SEO42_PATHLIST)) {
seo42_generate_pathlist(array());
}
require_once SEO42_PATHLIST;
if (!$REX['REDAXO']) {
$article_id = -1;
$clang = $REX['CUR_CLANG'];
$start_id = $REX['START_ARTICLE_ID'];
$notfound_id = $REX['NOTFOUND_ARTICLE_ID'];
$install_subdir = seo42::getServerSubDir();
// 42
$homelang = $REX['ADDON']['seo42']['settings']['homelang'];
// TRY IMMEDIATE MATCH OF REQUEST_URI AGAINST PATHLIST..
if (self::resolve_from_pathlist(ltrim($_SERVER['REQUEST_URI'], '/'))) {
return;
}
// allow_article_id ?
if ($REX['ADDON']['seo42']['settings']['allow_article_id'] && rex_get('article_id', 'int') > 0) {
return self::setArticleId(rex_request('article_id', 'int'), rex_request('clang', 'int', $clang));
}
// IF NON_REWRITTEN URLS ALLOWED -> USE ARTICLE_ID FROM REQUEST
if ($REX['ADDON']['seo42']['settings']['auto_redirects'] != SEO42_AUTO_REDIRECT_NONE && rex_get('article_id', 'int') > 0) {
if ($REX['ADDON']['seo42']['settings']['auto_redirects'] == SEO42_AUTO_REDIRECT_ARTICLE_ID) {
$artId = rex_request('article_id', 'int');
$clangId = rex_request('clang', 'int', $clang);
$article = OOArticle::getArticleById($artId, $clangId);
if (OOArticle::isValid($article)) {
$redirect = array('id' => $artId, 'clang' => $clangId, 'status' => 301);
return self::redirect($redirect);
/*todo: include params*/
}
}
}
// GET PATH RELATIVE TO INTALL_SUBDIR ---------------> 42
$path = ltrim($_SERVER['REQUEST_URI'], '/');
if (seo42::isSubDirInstall()) {
$path = substr($path, strlen($install_subdir));
$path = ltrim($path, '/');
}
// TRIM STANDARD PARAMS
if (($pos = strpos($path, '?')) !== false) {
$path = substr($path, 0, $pos);
}
// TRIM ANCHORS
if (($pos = strpos($path, '#')) !== false) {
$path = substr($path, 0, $pos);
}
// RETRY RESOLVE VIA PATHLIST
if (self::resolve_from_pathlist($path)) {
return;
}
// smart redirects option
if ($REX['ADDON']['seo42']['settings']['smart_redirects']) {
$trimmedReuqestUri = trim($_SERVER['REQUEST_URI'], '/');
$trimmedReuqestUri = str_replace('.html', '', $trimmedReuqestUri);
$requestUriWithCorrectUrlEnding = $trimmedReuqestUri . $REX['ADDON']['seo42']['settings']['url_ending'];
if (isset($SEO42_URLS[$requestUriWithCorrectUrlEnding])) {
$redirect = array('id' => $SEO42_URLS[$requestUriWithCorrectUrlEnding]['id'], 'clang' => $SEO42_URLS[$requestUriWithCorrectUrlEnding]['clang'], 'status' => 301);
return self::redirect($redirect);
}
}
// auto redirects
if ($REX['ADDON']['seo42']['settings']['auto_redirects'] == SEO42_AUTO_REDIRECT_URL_REWRITE || $REX['ADDON']['seo42']['settings']['auto_redirects'] == SEO42_AUTO_REDIRECT_URL_REWRITE_R3) {
// smart redirects for old fashioned standard redaxo rewrite methods
if ($REX['ADDON']['seo42']['settings']['auto_redirects'] == SEO42_AUTO_REDIRECT_URL_REWRITE_R3) {
preg_match('/\\/(.*(\\.))?((?P<clang>[0-9]+)(.*)\\-(?P<id>[0-9]+))((\\-|\\.).*)/', $_SERVER['REQUEST_URI'], $url_params);
} else {
preg_match('/\\/(.*(\\.))?((?P<id>[0-9]+)\\-(?P<clang>[0-9]+))((\\-|\\.).*)/', $_SERVER['REQUEST_URI'], $url_params);
}
if ($url_params !== false && isset($url_params['id']) && isset($url_params['clang'])) {
$article = OOArticle::getArticleById($url_params['id'], $url_params['clang']);
if (OOArticle::isValid($article)) {
$redirect = array('id' => $url_params['id'], 'clang' => $url_params['clang'], 'status' => 301);
return self::redirect($redirect);
}
}
}
// check for possible lang slug to load up correct language for 404 article
$firstSlashPos = strpos($path, '/');
if ($firstSlashPos !== false) {
$possibleLangSlug = substr($path, 0, $firstSlashPos);
$langSlugs = array();
foreach ($REX['CLANG'] as $clangId => $clangName) {
$langSlugs[$clangId] = seo42::getLangUrlSlug($clangId);
}
$clangId = array_search($possibleLangSlug, $langSlugs);
if ($clangId !== false) {
$clang = $clangId;
$REX['CUR_CLANG'] = $clang;
}
}
//.........这里部分代码省略.........
示例13: elseif
$class = '';
$status = ' ';
if ($package->isActivated()) {
$status = $getLink($package, 'deactivate', 'rex-icon-package-is-activated');
$class .= ' rex-package-is-activated';
} elseif ($package->isInstalled()) {
$status = $getLink($package, 'activate', 'rex-icon-package-not-activated');
$class .= ' rex-package-is-installed';
} else {
$class .= ' rex-package-not-installed';
}
$name = '<span class="rex-' . $type . '-name">' . htmlspecialchars($package->getName()) . '</span>';
$class .= $package->isSystemPackage() ? ' rex-system-' . $type : '';
// --------------------------------------------- API MESSAGES
$message = '';
if ($package->getPackageId() == rex_get('package', 'string') && rex_api_function::hasMessage()) {
$message = '
<tr class="rex-package-message">
<td colspan="8">
' . rex_api_function::getMessage() . '
</td>
</tr>';
$class = ' mark';
}
$version = trim($package->getVersion()) != '' ? ' <span class="rex-' . $type . '-version">' . trim($package->getVersion()) . '</span>' : '';
return $message . '
<tr class="rex-package-is-' . $type . $class . '">
<td class="rex-table-icon"><i class="rex-icon rex-icon-package-' . $type . '"></i></td>
<td data-title="' . rex_i18n::msg('package_hname') . '">' . $name . '</td>
<td data-title="' . rex_i18n::msg('package_hversion') . '">' . $version . '</td>
<td class="rex-table-slim" data-title="' . rex_i18n::msg('package_hhelp') . '"><a href="' . rex_url::currentBackendPage(['subpage' => 'help', 'package' => $packageId]) . '" title="' . rex_i18n::msg('package_help') . ' ' . htmlspecialchars($package->getName()) . '"><i class="rex-icon rex-icon-help"></i> <span class="sr-only">' . rex_i18n::msg('package_help') . ' ' . htmlspecialchars($package->getName()) . '</span></a></td>
示例14:
$Subject['class'][] = 'copy';
}
return $Subject;
});
if (rex::isBackend() && is_object(rex::getUser())) {
rex_perm::register('copy[]');
rex_perm::register('slice_ui[]', null, rex_perm::OPTIONS);
rex_perm::register('slice_ui[settings]', null, rex_perm::OPTIONS);
}
if (rex::isBackend()) {
rex_view::addCssFile($this->getAssetsUrl('slice_ui.css'));
rex_view::addCssFile($this->getAssetsUrl('jquery-ui.datepicker.css'));
rex_view::addJsFile($this->getAssetsUrl('slice_ui.js'));
rex_view::addJsFile($this->getAssetsUrl('jquery-ui.datepicker.js'));
}
if (rex_post('update_slice_status') != 1 && rex_get('function') == '') {
rex_extension::register('SLICE_SHOW', 'slice_ui::extendBackendSlices');
}
rex_extension::register('SLICE_SHOW', 'slice_ui::isActive');
if (strpos(rex_request('page'), 'content/emptyclipboard') !== false) {
slice_ui::emptyClipboard();
}
if (!empty($Config['general']['sticky_slice_nav']) && $Config['general']['sticky_slice_nav']) {
rex_view::addJsFile($this->getAssetsUrl('sticky_header.js'));
}
if (strpos(rex_request('page'), 'content/paste') !== false) {
slice_ui::addSlice();
}
if (strpos(rex_request('page'), 'content/move') !== false) {
slice_ui::moveSlice();
}
示例15: dirname
<?php
/**
* Guestbook Addon
* @author staab[at]public-4u[dot]de Markus Staab
* @author <a href="http://www.public-4u.de">www.public-4u.de</a>
* @author redaxo[at]koalashome[dot]de Sven (Koala) Eichler
* @package redaxo4
* @version $Id: entries.inc.php,v 1.10 2010/10/12 19:38:46 koala_s Exp $
*/
//------------------------------> Parameter
$Basedir = dirname(__FILE__);
$entry_id = rex_request('entry_id', 'integer');
$mode = rex_get('mode', 'string');
$func = rex_request('func', 'string');
$entry_id = !empty($entry_id) ? (int) $entry_id : 0;
$mode = !empty($mode) ? (string) $mode : '';
//DBO($func);
//if (rex_get('func','string') == 'status')
if ($func == 'status') {
$status = $mode == 'online_it' ? 1 : 0;
$qry = 'UPDATE ' . TBL_GBOOK . ' SET status="' . $status . '" WHERE id=' . $entry_id;
$sql = new rex_sql();
//$sql->debugsql = true;
$sql->setQuery($qry);
$func = '';
}
//------------------------------> Eintragsliste
//if (rex_get('func','string','') == '')
if ($func == '') {
require_once $Basedir . '/../../addon_framework/classes/list/class.rex_list.inc.php';