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


PHP rex_url::addonAssets方法代码示例

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


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

示例1: execute

 public function execute()
 {
     if (!rex::getUser()->isAdmin()) {
         throw new rex_api_exception('You do not have the permission!');
     }
     $addonkey = rex_request('addonkey', 'string');
     $upload = rex_request('upload', [['upload_file', 'bool'], ['oldversion', 'string'], ['redaxo', 'array[string]'], ['description', 'string'], ['status', 'int'], ['replace_assets', 'bool'], ['ignore_tests', 'bool']]);
     $file = [];
     $archive = null;
     $file['version'] = $upload['upload_file'] ? rex_addon::get($addonkey)->getVersion() : $upload['oldversion'];
     $file['redaxo_versions'] = $upload['redaxo'];
     $file['description'] = $upload['description'];
     $file['status'] = $upload['status'];
     try {
         if ($upload['upload_file']) {
             $archive = rex_path::addonCache('install', md5($addonkey . time()) . '.zip');
             $exclude = [];
             if ($upload['replace_assets']) {
                 $exclude[] = 'assets';
             }
             if ($upload['ignore_tests']) {
                 $exclude[] = 'tests';
             }
             rex_install_archive::copyDirToArchive(rex_path::addon($addonkey), $archive, null, $exclude);
             if ($upload['replace_assets']) {
                 rex_install_archive::copyDirToArchive(rex_url::addonAssets($addonkey), $archive, $addonkey . '/assets');
             }
             $file['checksum'] = md5_file($archive);
         }
         rex_install_webservice::post(rex_install_packages::getPath('?package=' . $addonkey . '&file_id=' . rex_request('file', 'int', 0)), ['file' => $file], $archive);
     } catch (rex_functional_exception $e) {
         throw new rex_api_exception($e->getMessage());
     }
     if ($archive) {
         rex_file::delete($archive);
     }
     unset($_REQUEST['addonkey']);
     unset($_REQUEST['file']);
     rex_install_packages::deleteCache();
     return new rex_api_result(true, rex_i18n::msg('install_info_addon_uploaded', $addonkey));
 }
开发者ID:staabm,项目名称:redaxo,代码行数:41,代码来源:api_package_upload.php

示例2: rex_metainfo_extensions_handler

/**
 * Bindet ggf extensions ein.
 *
 * @param rex_extension_point $ep
 */
function rex_metainfo_extensions_handler(rex_extension_point $ep)
{
    $page = $ep->getSubject();
    $mainpage = rex_be_controller::getCurrentPagePart(1);
    $mypage = 'metainfo';
    // additional javascripts
    if ($mainpage == 'metainfo' || $page == 'content/metainfo' || $page == 'structure') {
        rex_view::addJsFile(rex_url::addonAssets($mypage, 'metainfo.js'));
    }
    // include extensions
    $curDir = __DIR__ . '/..';
    if ($page == 'structure') {
        require_once $curDir . '/lib/handler/category_handler.php';
    } elseif ($mainpage == 'mediapool') {
        require_once $curDir . '/lib/handler/media_handler.php';
    } elseif ($mainpage == 'content') {
        require_once $curDir . '/extensions/extension_content_sidebar.php';
    } elseif ($page == 'backup') {
        require_once $curDir . '/extensions/extension_cleanup.php';
    }
}
开发者ID:staabm,项目名称:redaxo,代码行数:26,代码来源:function_metainfo.php

示例3: getAssetsUrl

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

示例4: rex_fragment

 $formElements[] = $n;
 $fragment = new rex_fragment();
 $fragment->setVar('elements', $formElements, false);
 $panel .= $fragment->parse('core/form/form.php');
 $formElements = [];
 $n = [];
 $n['reverse'] = true;
 $n['label'] = '<label for="rex-install-packages-upload-status">' . $this->i18n('online') . '</label>';
 $n['field'] = '<input id="rex-install-packages-upload-status" type="checkbox" name="upload[status]" value="1" ' . (!$new && $file['status'] ? 'checked="checked" ' : '') . '/>';
 $formElements[] = $n;
 $n = [];
 $n['reverse'] = true;
 $n['label'] = '<label for="rex-js-install-packages-upload-upload-file">' . $this->i18n('upload_file') . '</label>' . $hiddenField;
 $n['field'] = '<input id="rex-js-install-packages-upload-upload-file" type="checkbox" name="upload[upload_file]" value="1" ' . ($new ? 'checked="checked" ' : '') . $uploadCheckboxDisabled . '/>';
 $formElements[] = $n;
 if (rex_addon::get($addonkey)->isInstalled() && is_dir(rex_url::addonAssets($addonkey))) {
     $n = [];
     $n['reverse'] = true;
     $n['label'] = '<label for="rex-js-install-packages-upload-replace-assets">' . $this->i18n('replace_assets') . '</label>';
     $n['field'] = '<input id="rex-js-install-packages-upload-replace-assets" type="checkbox" name="upload[replace_assets]" value="1" ' . ($new ? '' : 'disabled="disabled" ') . '/>';
     $formElements[] = $n;
 }
 if (is_dir(rex_path::addon($addonkey, 'tests'))) {
     $n = [];
     $n['reverse'] = true;
     $n['label'] = '<label for="rex-js-install-packages-upload-ignore-tests">' . $this->i18n('ignore_tests') . '</label>';
     $n['field'] = '<input id="rex-js-install-packages-upload-ignore-tests" type="checkbox" name="upload[ignore_tests]" value="1" checked="checked"' . ($new ? '' : 'disabled="disabled" ') . '/>';
     $formElements[] = $n;
 }
 $fragment = new rex_fragment();
 $fragment->setVar('elements', $formElements, false);
开发者ID:DECAF,项目名称:redaxo,代码行数:31,代码来源:packages.upload.php


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