本文整理汇总了PHP中OOAddon::getProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP OOAddon::getProperty方法的具体用法?PHP OOAddon::getProperty怎么用?PHP OOAddon::getProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OOAddon
的用法示例。
在下文中一共展示了OOAddon::getProperty方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rex_a256_search_mpool_query
function rex_a256_search_mpool_query($params)
{
global $REX;
if (!$REX['USER']->hasPerm('be_search[mediapool]')) {
return $params['subject'];
}
$media_name = rex_request('a256_media_name', 'string');
if ($media_name == '') {
return $params['subject'];
}
$qry = $params['subject'];
$category_id = $params['category_id'];
$qry = str_replace('f.category_id=' . $category_id, '1=1', $qry);
$where = " (f.filename LIKE '%" . $media_name . "%' OR f.title LIKE '%" . $media_name . "%')";
$searchmode = OOAddon::getProperty('be_search', 'searchmode', 'local');
// global search - all
if ($searchmode == 'global') {
$qry = str_replace('WHERE ', 'WHERE ' . $where . ' AND ', $qry);
return $qry;
// local search - all categories and with no category
} elseif ($category_id == 0) {
$qry = str_replace('WHERE ', 'WHERE ' . $where . ' AND ', $qry);
// local search - categorie and subcategories
} else {
$where .= ' AND f.category_id = c.id ';
$where .= " AND (c.path LIKE '%|" . $params['category_id'] . "|%' OR c.id=" . $params['category_id'] . ') ';
$qry = str_replace('FROM ', 'FROM ' . $REX['TABLE_PREFIX'] . 'file_category c,', $qry);
$qry = str_replace('WHERE ', 'WHERE ' . $where . ' AND ', $qry);
}
return $qry;
}
示例2: rex_a256_search_mpool_query
function rex_a256_search_mpool_query($params)
{
global $REX;
if (!$REX['USER']->hasPerm('be_search[mediapool]')) {
return $params['subject'];
}
$media_name = rex_request('a256_media_name', 'string');
if ($media_name == '') {
return $params['subject'];
}
$qry = $params['subject'];
$category_id = $params['category_id'];
$where = " f.category_id = c.id AND (f.filename LIKE '%" . $media_name . "%' OR f.title LIKE '%" . $media_name . "%')";
switch (OOAddon::getProperty('be_search', 'searchmode', 'local')) {
case 'local':
// Suche auf aktuellen Kontext eingrenzen
if ($category_id != 0) {
$where .= " AND (c.path LIKE '%|" . $params['category_id'] . "|%' OR c.id=" . $params['category_id'] . ") ";
} else {
$qry = str_replace('f.category_id=0', '1=1', $qry);
}
}
$qry = str_replace('FROM ', 'FROM ' . $REX['TABLE_PREFIX'] . 'file_category c,', $qry);
$qry = str_replace('WHERE ', 'WHERE ' . $where . ' AND ', $qry);
return $qry;
}
示例3: getRegisteredPlugins
function getRegisteredPlugins()
{
$plugins = OOAddon::getProperty('community', 'pluginlist', array());
if (is_string($plugins)) {
$plugins = explode(',', $plugins);
}
return $plugins;
}
示例4: doAction
public function doAction()
{
global $I18N, $REX;
// $REX is needed for update.inc.php
$path = rex_path::addon($this->addonkey);
$temppath = rex_path::addon('.new.' . $this->addonkey);
if (($msg = $this->extractArchiveTo($temppath)) !== true) {
return $msg;
}
// ---- include update.php
if (file_exists($temppath . 'update.inc.php')) {
try {
require $temppath . 'update.inc.php';
} catch (rex_install_functional_exception $e) {
return $e->getMessage();
}
if (($msg = OOAddon::getProperty($this->addonkey, 'updatemsg', '')) != '') {
return $msg;
}
if (!OOAddon::getProperty($this->addonkey, 'update', true)) {
return $I18N->msg('package_no_reason');
}
}
// ---- backup
$assets = rex_path::addonAssets($this->addonkey);
if (OOAddon::getProperty('install', 'backups')) {
$archivePath = rex_path::addonData('install', $this->addonkey . '/');
rex_dir::create($archivePath);
$archive = $archivePath . strtolower(preg_replace('/[^a-z0-9-_.]/i', '_', OOAddon::getVersion($this->addonkey))) . '.zip';
rex_install_archive::copyDirToArchive($path, $archive);
if (is_dir($assets)) {
rex_install_archive::copyDirToArchive($assets, $archive, 'assets');
}
}
// ---- copy plugins to new addon dir
foreach (OOPlugin::getRegisteredPlugins($this->addonkey) as $plugin) {
$pluginPath = $temppath . '/plugins/' . $plugin;
if (!is_dir($pluginPath)) {
rex_dir::copy(rex_path::plugin($this->addonkey, $plugin), $pluginPath);
} elseif (OOPlugin::isInstalled($this->addonkey, $plugin) && is_dir($pluginPath . '/files')) {
rex_dir::copy($pluginPath . '/files', rex_path::pluginAssets($this->addonkey, $plugin));
}
}
// ---- update main addon dir
rex_dir::delete($path);
rename($temppath, $path);
// ---- update assets
$origAssets = rex_path::addon($this->addonkey, 'assets');
if (is_dir($origAssets)) {
rex_dir::copy($origAssets, $assets);
}
OOAddon::setProperty($this->addonkey, 'version', $this->file['version']);
rex_install_packages::updatedPackage($this->addonkey, $this->fileId);
}
示例5: setProperty
/**
* set the property for the metainfo.
* added Entrys in metaTables and prefixes
*/
public static function setProperty()
{
global $REX;
$metaTables = OOAddon::getProperty('metainfo', 'metaTables', array());
$metaTables['asd_'] = $REX['TABLE_PREFIX'] . 'asd_news';
OOAddon::setProperty('metainfo', 'metaTables', $metaTables);
$prefixes = OOAddon::getProperty('metainfo', 'prefixes', array());
if (!in_array('asd_', $prefixes)) {
$prefixes[] = 'asd_';
}
OOAddon::setProperty('metainfo', 'prefixes', $prefixes);
}
示例6: setProperty
/**
* set the property for the metainfo.
* added Entrys in metaTables and prefixes
*/
public static function setProperty()
{
global $REX;
$metaTables = OOAddon::getProperty('metainfo', 'metaTables', array());
$metaTables[self::PREFIX] = $REX['TABLE_PREFIX'] . self::TABLE;
OOAddon::setProperty('metainfo', 'metaTables', $metaTables);
$prefixes = OOAddon::getProperty('metainfo', 'prefixes', array());
if (!in_array(self::PREFIX, $prefixes)) {
$prefixes[] = self::PREFIX;
}
OOAddon::setProperty('metainfo', 'prefixes', $prefixes);
}
示例7: rex_a256_search_mpool_query
function rex_a256_search_mpool_query($params)
{
global $REX, $REX_USER;
if (!($REX_USER->isAdmin() || $REX_USER->hasPerm('be_search[medienpool]'))) {
return $params['subject'];
}
$media_name = rex_request('a256_media_name', 'string');
if ($media_name == '') {
return $params['subject'];
}
$category_id = $params['category_id'];
$qry = "SELECT *\n FROM " . $REX['TABLE_PREFIX'] . "file f, " . $REX['TABLE_PREFIX'] . "file_category c\n WHERE f.category_id = c.id AND (filename LIKE '%" . $media_name . "%' OR title LIKE '%" . $media_name . "%')";
switch (OOAddon::getProperty('be_search', 'searchmode', 'local')) {
case 'local':
// Suche auf aktuellen Kontext eingrenzen
if ($category_id != 0) {
$qry .= " AND (c.path LIKE '%|" . $params['category_id'] . "|%' OR c.id=" . $params['category_id'] . ") ";
}
}
$qry .= 'ORDER BY f.updatedate desc';
$qry = rex_register_extension_point('A256_MEDIENPOOL_QUERY', $qry);
return $qry;
}
示例8: rex_generateAddons
/**
* Schreibt Addoneigenschaften in die Datei include/addons.inc.php
*
* @param array Array mit den Namen der Addons aus dem Verzeichnis addons/
*
* @return TRUE bei Erfolg, sonst FALSE
*/
function rex_generateAddons($ADDONS)
{
global $REX;
natsort($ADDONS);
$content = '';
foreach ($ADDONS as $addon) {
if (!OOAddon::isInstalled($addon)) {
OOAddon::setProperty($addon, 'install', 0);
}
if (!OOAddon::isActivated($addon)) {
OOAddon::setProperty($addon, 'status', 0);
}
foreach (array('install', 'status') as $prop) {
$content .= sprintf("\$REX['ADDON']['%s']['%s'] = '%d';\n", $prop, $addon, OOAddon::getProperty($addon, $prop));
}
$content .= "\n";
}
// Da dieser Funktion öfter pro request aufgerufen werden kann,
// hier die caches löschen
clearstatcache();
$file = $REX['INCLUDE_PATH'] . '/addons.inc.php';
if (rex_replace_dynamic_contents($file, $content) === false) {
return 'Datei "' . $file . '" hat keine Schreibrechte';
}
return true;
}
示例9: getPath
private static function getPath($path)
{
global $REX;
$path = strpos($path, '?') === false ? rtrim($path, '/') . '/?' : $path . '&';
$path .= 'rex_version=' . $REX['VERSION'] . '.' . $REX['SUBVERSION'];
if (OOAddon::getProperty('install', 'api_login')) {
$path .= '&api_login=' . urlencode(OOAddon::getProperty('install', 'api_login')) . '&api_key=' . urlencode(OOAddon::getProperty('install', 'api_key'));
}
return $path;
}
示例10: foreach
foreach ($navProperties as $key => $value) {
$mainPluginPage->_set($key, $value);
}
$REX['PAGES'][$addonName . '_' . $pluginName] = $mainPluginPage;
} else {
if ($addonPage) {
$addonPage->addSubPage($pluginPage);
}
}
}
}
}
if ($addonPage) {
$mainAddonPage = new rex_be_main_page('addons', $addonPage);
// "navigation" adds attributes to the addon-root page
foreach (OOAddon::getProperty($addonName, 'navigation', array()) as $key => $value) {
$mainAddonPage->_set($key, $value);
}
$REX['PAGES'][$addonName] = $mainAddonPage;
}
}
}
// Set Startpage
if ($REX['USER']) {
$REX['USER']->pages = $REX['PAGES'];
// --- page herausfinden
$REX['PAGE'] = trim(rex_request('page', 'string'));
// --- page pruefen und benoetigte rechte checken
if (!isset($REX['PAGES'][$REX['PAGE']]) || ($p = $REX['PAGES'][$REX['PAGE']]->getPage()) && !$p->checkPermission($REX['USER'])) {
// --- neue page bestimmen und diese in neuem request dann verarbeiten
$REX['PAGE'] = $REX['LOGIN']->getStartpage();
示例11:
<fieldset>
<legend>' . $I18N->msg('install_settings_myredaxo_account') . '</legend>
<div class="rex-form-wrapper">';
$content .= '
<div class="rex-form-row">
<p class="rex-form-col-a rex-form-text">
<label for="install-settings-api-login">' . $I18N->msg('install_settings_api_login') . '</label>
<input id="install-settings-api-login" class="rex-form-text" type="text" name="settings[api_login]" value="' . OOAddon::getProperty('install', 'api_login') . '" />
</p>
</div>';
$content .= '
<div class="rex-form-row">
<p class="rex-form-col-a rex-form-text">
<label for="install-settings-api-key">' . $I18N->msg('install_settings_api_key') . '</label>
<input id="install-settings-api-key" class="rex-form-text" type="text" name="settings[api_key]" value="' . OOAddon::getProperty('install', 'api_key') . '" />
</p>
</div>';
$content .= ' </div>
</fieldset>';
$content .= '
<fieldset class="rex-form-col-1">
<div class="rex-form-wrapper">
<div class="rex-form-row">
<p class="rex-form-col-a rex-form-submit">
<input class="rex-form-submit" type="submit" name="settings[save]" value="' . $I18N->msg('form_save') . '" />
</p>
</div>
</div>
</fieldset>
示例12: getSupportPage
function getSupportPage($addon, $default = null)
{
return OOAddon::getProperty($addon, 'supportpage', $default);
}
示例13: rex_a256_search_structure
/**
* Backend Search Addon
*
* @author markus[dot]staab[at]redaxo[dot]de Markus Staab
*
* @package redaxo4
* @version $Id: extension_search_structure.inc.php,v 1.19 2008/04/12 09:28:04 kills Exp $
*/
function rex_a256_search_structure($params)
{
global $REX, $REX_USER, $I18N_BE_SEARCH;
if (!($REX_USER->isAdmin() || $REX_USER->hasPerm('be_search[structure]'))) {
return $params['subject'];
}
$message = '';
$search_result = '';
$editUrl = 'index.php?page=content&article_id=%s&mode=edit&clang=%s&a256_article_name=%s';
$structureUrl = 'index.php?page=structure&category_id=%s&clang=%s&a256_article_name=%s';
// ------------ globale Parameter
$page = rex_request('page', 'string');
$mode = rex_request('mode', 'string');
$category_id = rex_request('category_id', 'int');
$article_id = rex_request('article_id', 'int');
$clang = rex_request('clang', 'int');
$ctype = rex_request('ctype', 'int');
// ------------ Parameter
$a256_article_id = rex_request('a256_article_id', 'int');
$a256_clang = rex_request('a256_clang', 'int');
$a256_article_name = rex_request('a256_article_name', 'string');
$a256_article_name_post = rex_post('a256_article_name', 'string');
$mode = rex_request('mode', 'string');
// ------------ Suche via ArtikelId
if ($a256_article_id != 0) {
$OOArt = OOArticle::getArticleById($a256_article_id, $a256_clang);
if (OOArticle::isValid($OOArt)) {
header('Location:' . sprintf($editUrl, $a256_article_id, $a256_clang, urlencode($a256_article_name)));
exit;
}
}
// ------------ Suche via ArtikelName
// hier nur dne post artikel namen abfragen,
// da sonst bei vorherigen headerweiterleitungen
// auch gesucht wuerde
if ($a256_article_name_post != '') {
$qry = '
SELECT id
FROM ' . $REX['TABLE_PREFIX'] . 'article
WHERE
clang = ' . $a256_clang . ' AND
(
name LIKE "%' . $a256_article_name . '%" OR
catname LIKE "%' . $a256_article_name . '%"
)';
switch (OOAddon::getProperty('be_search', 'searchmode', 'local')) {
case 'local':
// Suche auf aktuellen Kontext eingrenzen
if ($category_id != 0) {
$qry .= ' AND path LIKE "%|' . $category_id . '|%"';
}
}
$qry = rex_register_extension_point('A256_STRUCTURE_QUERY', $qry);
$search = new rex_sql();
// $search->debugsql = true;
$search->setQuery($qry);
$foundRows = $search->getRows();
// Suche ergab nur einen Treffer => Direkt auf den Treffer weiterleiten
if ($foundRows == 1) {
$OOArt = OOArticle::getArticleById($search->getValue('id'), $a256_clang);
if ($REX_USER->hasCategoryPerm($OOArt->getCategoryId())) {
header('Location:' . sprintf($editUrl, $search->getValue('id'), $a256_clang, urlencode($a256_article_name)));
exit;
}
} else {
if ($foundRows > 0) {
$search_result .= '<ul class="a256-search-result">';
for ($i = 0; $i < $foundRows; $i++) {
$OOArt = OOArticle::getArticleById($search->getValue('id'), $a256_clang);
$label = $OOArt->getName();
if ($REX_USER->hasCategoryPerm($OOArt->getCategoryId())) {
if ($REX_USER->hasPerm('advancedMode[]')) {
$label .= ' [' . $search->getValue('id') . ']';
}
$s = '';
$first = true;
foreach ($OOArt->getParentTree() as $treeItem) {
$treeLabel = $treeItem->getName();
if ($REX_USER->hasPerm('advancedMode[]')) {
$treeLabel .= ' [' . $treeItem->getId() . ']';
}
$prefix = ': ';
if ($first) {
$prefix = '';
$first = false;
}
$s .= '<li>' . $prefix . '<a href="' . sprintf($structureUrl, $treeItem->getId(), $a256_clang, urlencode($a256_article_name)) . '">' . htmlspecialchars($treeLabel) . ' </a></li>';
}
$prefix = ': ';
if ($first) {
$prefix = '';
$first = false;
//.........这里部分代码省略.........
示例14: a62_meta_table
/**
* Gibt die mit dem Prefix verbundenen Tabellennamen zurück
*/
function a62_meta_table($prefix)
{
$metaTables = OOAddon::getProperty('metainfo', 'metaTables', array());
if (isset($metaTables[$prefix])) {
return $metaTables[$prefix];
}
return false;
}