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


PHP rex_path::plugin方法代码示例

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


在下文中一共展示了rex_path::plugin方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: init

 /**
  * very basic setup steps, so everything is in place for our browser-based setup wizard.
  *
  * @param string $skinAddon
  * @param string $skinPlugin
  */
 public static function init($skinAddon = 'be_style', $skinPlugin = 'redaxo')
 {
     // initial purge all generated files
     rex_delete_cache();
     // delete backend session
     rex_backend_login::deleteSession();
     // copy alle media files of the current rex-version into redaxo_media
     rex_dir::copy(rex_path::core('assets'), rex_path::assets());
     // copy skins files/assets
     rex_dir::copy(rex_path::addon($skinAddon, 'assets'), rex_path::addonAssets($skinAddon));
     rex_dir::copy(rex_path::plugin($skinAddon, $skinPlugin, 'assets'), rex_path::pluginAssets($skinAddon, $skinPlugin));
 }
开发者ID:skerbis,项目名称:redaxo,代码行数:18,代码来源:setup.php

示例3: getDataPage


//.........这里部分代码省略.........
         // -------------- Opener
         foreach ($rex_yform_manager_opener as $k => $v) {
             $link_vars .= '&rex_yform_manager_opener[' . $k . ']=' . urlencode($v);
         }
         // -------------- Searchfields / Searchtext
         $link_vars .= '&' . http_build_query($searchObject->getSearchVars());
         // -------------- FILTER UND SETS PR†FEN
         $em_url_filter = '';
         if (count($rex_yform_filter) > 0) {
             foreach ($rex_yform_filter as $k => $v) {
                 if (!in_array($k, $field_names)) {
                     unset($rex_yform_filter[$k]);
                 }
             }
             $em_url_filter .= '&' . http_build_query(compact('rex_yform_filter'));
         }
         $em_url_set = '';
         if (count($rex_yform_set) > 0) {
             foreach ($rex_yform_set as $k => $v) {
                 if (!in_array($k, $field_names)) {
                     unset($rex_yform_set[$k]);
                 }
             }
             $em_url_filter .= '&' . http_build_query(compact('rex_yform_set'));
         }
         $em_url = $em_url_filter . $em_url_set;
         $em_rex_list = '';
         $em_rex_list .= '&list=' . urlencode(rex_request('list', 'string'));
         $em_rex_list .= '&sort=' . urlencode(rex_request('sort', 'string'));
         $em_rex_list .= '&sorttype=' . urlencode(rex_request('sorttype', 'string'));
         $em_rex_list .= '&start=' . urlencode(rex_request('start', 'string'));
         // ---------- Popup - no menue, header ...
         if ($popup) {
             echo '<link rel="stylesheet" type="text/css" href="' . rex_plugin::get('yform', 'manager')->getAssetsUrl('popup.css') . '" />';
         }
         // -------------- Import
         if (!$popup && $func == 'import' && $this->hasDataPageFunction('import')) {
             include rex_path::plugin('yform', 'manager', 'pages/data_import.php');
             echo rex_view::info('<a href="index.php?' . $link_vars . $em_url . $em_rex_list . '"><b>&laquo; ' . rex_i18n::msg('yform_back_to_overview') . '</b></a>');
         }
         // -------------- delete entry
         if ($func == 'delete' && $data_id != '' && $this->hasDataPageFunction('delete')) {
             $delete = true;
             if (rex_extension::registerPoint(new rex_extension_point('YFORM_DATA_DELETE', $delete, array('id' => $data_id, 'value' => $data, 'table' => $this->table)))) {
                 $query = 'delete from ' . $this->table->getTablename() . ' where id=' . $data_id;
                 $delsql = rex_sql::factory();
                 $delsql->debugsql = self::$debug;
                 $delsql->setQuery($query);
                 echo rex_view::success(rex_i18n::msg('yform_datadeleted'));
                 $func = '';
                 $this->table->removeRelationTableRelicts();
                 rex_extension::registerPoint(new rex_extension_point('YFORM_DATA_DELETED', '', array('id' => $data_id, 'value' => $data, 'table' => $this->table)));
             }
         }
         // -------------- delete dataset
         if ($func == 'dataset_delete' && $this->hasDataPageFunction('truncate_table')) {
             $delete = true;
             $query = 'delete from `' . $this->table->getTablename() . '` ' . $this->getDataListQueryWhere($rex_yform_filter, $searchObject);
             if (rex_extension::registerPoint(new rex_extension_point('YFORM_DATA_DATASET_DELETE', $delete, array('table' => $this->table, 'query' => &$query)))) {
                 $delsql = rex_sql::factory();
                 $delsql->debugsql = self::$debug;
                 $delsql->setQuery($query);
                 echo rex_view::success(rex_i18n::msg('yform_dataset_deleted'));
                 $func = '';
                 $this->table->removeRelationTableRelicts();
                 rex_extension::registerPoint(new rex_extension_point('YFORM_DATA_DATASET_DELETED', '', array('table' => $this->table)));
开发者ID:VIEWSION,项目名称:redaxo_yform,代码行数:67,代码来源:manager.php

示例4:

<?php

include rex_path::plugin('yform', 'manager', 'install.inc.php');
$REX['ADDON']['update']['yform'] = true;
开发者ID:xong,项目名称:redaxo_yform,代码行数:4,代码来源:_update.inc.php

示例5: rex_request

    $func = rex_request('func');
    if ($page == rex_asd_news_config::getName()) {
        require_once rex_path::addon(rex_asd_news_config::getName(), 'classes/rex_asd_news_ajaxHandler.php');
        rex_register_extension('PAGE_HEADER', 'asd_news_setjQueryTags');
        // Ajax Publish
        if ($func == 'publish') {
            $id = rex_post('id', 'int');
            $clang = rex_post('clang', 'int');
            try {
                $time = new DateTime(rex_post('time'));
            } catch (Exception $e) {
                $time = new DateTime();
            }
            echo rex_asd_news_ajaxHandler::publishNews($id, $clang, $time);
            exit;
        }
    }
    // add / remove News if lang added or removed
    rex_register_extension('CLANG_ADDED', 'asd_news_addClang');
    rex_register_extension('CLANG_DELETED', 'asd_news_deleteClang');
    // check if image in use
    rex_register_extension('OOMEDIA_IS_IN_USE', 'rex_asd_news_utils::isImageInUse');
    // autoload Plugins
    $plugins = OOPlugin::getAvailablePlugins(rex_asd_news_config::getName());
    foreach ($plugins as $name) {
        if (file_exists(rex_path::plugin(rex_asd_news_config::getName(), $name, 'pages' . DIRECTORY_SEPARATOR . $name))) {
            $I18N->appendFile(rex_path::plugin(rex_asd_news_config::getName(), $name, 'lang' . DIRECTORY_SEPARATOR));
            array_push($REX['ADDON'][rex_asd_news_config::getName()]['SUBPAGES'], array($name, $I18N->msg(rex_asd_news_config::getName() . '_' . $name)));
        }
    }
}
开发者ID:Sysix,项目名称:asd_news,代码行数:31,代码来源:config.inc.php

示例6: rex_title

require rex_path::src('layout' . DIRECTORY_SEPARATOR . 'top.php');
rex_title($I18N->msg('asd_news'), $REX['ADDON']['pages'][rex_asd_news_config::getName()]);
$page = rex_request('page', 'string');
$subpage = rex_request('subpage', 'string');
$func = rex_request('func', 'string');
if (!$subpage) {
    $subpage = 'news';
}
$BaseDir = rex_asd_news_config::getBaseUrl();
$baseDirFunc = rex_asd_news_config::getBaseUrl($func);
if (!rex_asd_news_config::getConfig('article')) {
    echo rex_warning($I18N->msg('asd_news_no_article_selected'));
}
switch ($subpage) {
    case 'news':
    case 'rubric':
    case 'faq':
        $path = rex_path::addon(rex_asd_news_config::getName(), 'pages' . DIRECTORY_SEPARATOR . $subpage . '.php');
        break;
    case 'settings':
    case 'metainfo':
        if ($REX['USER']->hasPerm(rex_asd_news_config::getName() . '[' . $subpage . ']') || $REX['USER']->isAdmin()) {
            $path = rex_path::addon(rex_asd_news_config::getName(), 'pages' . DIRECTORY_SEPARATOR . $subpage . '.php');
        }
        break;
    default:
        $path = rex_path::plugin(rex_asd_news_config::getName(), $subpage, 'pages' . DIRECTORY_SEPARATOR . $subpage . '.php');
        break;
}
require $path;
require rex_path::src('layout' . DIRECTORY_SEPARATOR . 'bottom.php');
开发者ID:Sysix,项目名称:asd_news,代码行数:31,代码来源:index.inc.php

示例7: htmlspecialchars

<?php

$curDir = rex_path::plugin('be_style', 'customizer');
$error = [];
$config = [];
$info = '';
$success = '';
if (rex_post('btn_save', 'string') != '') {
    // set config
    $tempConfig = [];
    $newConfig = [];
    $newConfig = rex_post('settings', 'array');
    $tempConfig['codemirror'] = 0;
    if (isset($newConfig['codemirror']) && $newConfig['codemirror'] == 1) {
        $tempConfig['codemirror'] = 1;
    }
    $tempConfig['codemirror_theme'] = htmlspecialchars($newConfig['codemirror_theme']);
    $labelcolor = $newConfig['labelcolor'];
    if ($labelcolor == '') {
        $tempConfig['labelcolor'] = '';
    } elseif (preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $labelcolor)) {
        $tempConfig['labelcolor'] = htmlspecialchars($labelcolor);
    } else {
        $error[] = rex_i18n::msg('customizer_labelcolor_error');
    }
    $tempConfig['showlink'] = 0;
    if (isset($newConfig['showlink']) && $newConfig['showlink'] == 1) {
        $tempConfig['showlink'] = 1;
    }
    // save config
    if (empty($error) && rex_plugin::get('be_style', 'customizer')->setConfig($tempConfig)) {
开发者ID:staabm,项目名称:redaxo,代码行数:31,代码来源:system.customizer.php

示例8: foreach

<?php

/**
 * yform
 * @author jan.kristinus[at]redaxo[dot]org Jan Kristinus
 * @author <a href="http://www.yakamara.de">www.yakamara.de</a>
 *
 * @var rex_plugin $this
 */
rex_yform::addTemplatePath(rex_path::plugin('yform', 'manager', 'ytemplates'));
if (rex::isBackend() && rex::getUser()) {
    rex_view::addJsFile($this->getAssetsUrl('manager.js'));
    $tables = rex_yform_manager_table::getAll();
    $pages = [];
    foreach ($tables as $table) {
        $table_perm = 'yform[table:' . $table['table_name'] . ']';
        if ($table['status'] == 1 && $table['hidden'] != 1) {
            $be_page = new rex_be_page_main('yform_tables', $table['table_name'], $table['name']);
            $be_page->setHref('index.php?page=yform/manager/data_edit&table_name=' . $table['table_name']);
            $be_page->setIcon('rex-icon rex-icon-module');
            $be_page->setRequiredPermissions([$table_perm]);
            if (rex_request('page', 'string') == 'yform/manager/data_edit' && rex_request('table_name', 'string') == $table['table_name']) {
                $be_page->setIsActive();
                $main_page = $this->getAddon()->getProperty('page');
                $main_page['isActive'] = false;
                $this->getAddon()->setProperty('page', $main_page);
            }
            $pages[] = $be_page;
            // TODO rechte noch verfügbar machen
        }
    }
开发者ID:VIEWSION,项目名称:redaxo_yform,代码行数:31,代码来源:boot.php

示例9: getPath

 /**
  * {@inheritdoc}
  */
 public function getPath($file = '')
 {
     return rex_path::plugin($this->getAddon()->getName(), $this->getName(), $file);
 }
开发者ID:staabm,项目名称:redaxo,代码行数:7,代码来源:plugin.php

示例10: foreach

<?php

$content = rex_file::getOutput(rex_path::plugin('be_style', 'redaxo', 'assets/css/styles.css'));
preg_match_all('@\\.rex-icon-(\\w+):before@im', $content, $matches, PREG_SET_ORDER);
$icons_used = '';
if (count($matches) > 0) {
    $list = [];
    foreach ($matches as $match) {
        $list[$match[1]] = '<li><i class="rex-icon rex-icon-' . $match[1] . '"></i> rex-icon-' . $match[1] . '</li>';
    }
    ksort($list);
    $icons_used = '<ul class="rex-list-inline">' . implode('', $list) . '</ul>';
}
preg_match_all('@\\.fa-(\\w+):before@im', $content, $matches, PREG_SET_ORDER);
$icons_complete = '';
if (count($matches) > 0) {
    $list = [];
    foreach ($matches as $match) {
        $list[$match[1]] = '<li><i class="fa fa-' . $match[1] . '"></i> fa-' . $match[1] . '</li>';
    }
    ksort($list);
    $icons_complete = '<ul class="rex-list-inline">' . implode('', $list) . '</ul>';
}
$fragment = new rex_fragment();
$fragment->setVar('content', '<h3>REDAXO Icons</h3>' . $icons_used, false);
echo $fragment->parse('core/page/section.php');
$fragment = new rex_fragment();
$fragment->setVar('content', '<h3>Font-Awesome Icons</h3>' . $icons_complete, false);
echo $fragment->parse('core/page/section.php');
开发者ID:staabm,项目名称:redaxo,代码行数:29,代码来源:help.php


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