本文整理汇总了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));
}
示例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';
}
}
示例3: getAssetsUrl
/**
* {@inheritdoc}
*/
public function getAssetsUrl($file = '')
{
return rex_url::addonAssets($this->getName(), $file);
}
示例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);