当前位置: 首页>>代码示例>>PHP>>正文


PHP OOAddon::setProperty方法代码示例

本文整理汇总了PHP中OOAddon::setProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP OOAddon::setProperty方法的具体用法?PHP OOAddon::setProperty怎么用?PHP OOAddon::setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OOAddon的用法示例。


在下文中一共展示了OOAddon::setProperty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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);
 }
开发者ID:eaCe,项目名称:redaxo4,代码行数:54,代码来源:api_package_update.php

示例2: 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);
 }
开发者ID:Sysix,项目名称:asd_news,代码行数:16,代码来源:rex_asd_metainfo_install.php

示例3: 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);
 }
开发者ID:olien,项目名称:global_settings,代码行数:16,代码来源:global_settings_metainfo.php

示例4: setProperty

 function setProperty($plugin, $property, $value)
 {
     global $REX;
     // Plugin in Liste aufnehmen
     $plugins = OOPlugin::getRegisteredPlugins();
     if (!in_array($plugin, $plugins)) {
         $plugins[$plugin] = $plugin;
         OOAddon::setProperty('community', 'pluginlist', $plugins);
     }
     if (!isset($REX['ADDON']['plugins']['community'][$plugin])) {
         $REX['ADDON']['plugins']['community'][$plugin] = array();
     }
     // Property fuer das Plugin setzen
     $REX['ADDON']['plugins']['community'][$plugin][$property] = $value;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:15,代码来源:class.ooplugin.inc.php

示例5: 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;
}
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:33,代码来源:function_rex_generate.inc.php

示例6: rex_post

<?php

/** @var i18n $I18N */
$content = '';
$settings = rex_post('settings', array(array('backups', 'bool', false), array('api_login', 'string'), array('api_key', 'string')), null);
if (is_array($settings)) {
    $settingsContent = "<?php\n\n";
    foreach ($settings as $key => $value) {
        $settingsContent .= "\$REX['ADDON'][" . var_export($key, true) . "]['install'] = " . var_export($value, true) . ";\n";
        OOAddon::setProperty('install', $key, $value);
    }
    if (rex_file::put(rex_path::addonData('install', 'settings.inc.php'), $settingsContent)) {
        echo rex_info($I18N->msg('install_settings_saved'));
    } else {
        echo rex_warning($I18N->msg('install_settings_not_saved'));
    }
    rex_install_webservice::deleteCache();
}
$content .= '
    <div class="rex-addon-output">
        <h2 class="rex-hl2">' . $I18N->msg('install_subpage_settings') . '</h2>

        <div class="rex-form">
            <form action="index.php?page=install&subpage=settings" method="post">
                <fieldset class="rex-form-col-1">
                    <legend>' . $I18N->msg('install_settings_general') . '</legend>

                    <div class="rex-form-wrapper">';
$content .= '
                        <div class="rex-form-row">
                            <p class="rex-form-col-a rex-form-checkbox rex-form-label-right">
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:31,代码来源:settings.php


注:本文中的OOAddon::setProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。