當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。