本文整理汇总了PHP中rex_addon::get方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_addon::get方法的具体用法?PHP rex_addon::get怎么用?PHP rex_addon::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_addon
的用法示例。
在下文中一共展示了rex_addon::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createArchives
private function createArchives()
{
$path = rex_path::base('releases/' . $this->version . '/');
if (file_exists($path)) {
rex_dir::deleteFiles($path);
}
rex_dir::create($path);
$complete = new ZipArchive();
$update = new ZipArchive();
$complete->open($path . 'redaxo_' . $this->version . '.zip', ZipArchive::CREATE);
$update->open($path . 'redaxo_update_' . $this->version . '.zip', ZipArchive::CREATE);
$files = ['assets/.redaxo', 'media/.redaxo', 'redaxo/cache/.htaccess', 'redaxo/cache/.redaxo', 'redaxo/data/.htaccess', 'redaxo/data/.redaxo', 'redaxo/src/.htaccess', 'redaxo/index.php', 'index.php', 'LICENSE.md', 'README.md'];
foreach ($files as $file) {
$complete->addFile(rex_path::base($file), $file);
}
$this->addDir($complete, rex_path::core(), 'redaxo/src/core');
$this->addDir($update, rex_path::core(), 'core');
foreach (self::$addons as $addon) {
$this->addDir($complete, rex_path::addon($addon), 'redaxo/src/addons/' . $addon);
$this->addDir($update, rex_path::addon($addon), 'addons/' . $addon);
}
$this->addDir($complete, rex_path::core('assets'), 'assets');
$addon = rex_addon::get('be_style');
$this->addDir($complete, $addon->getPath('assets'), 'assets/addons/be_style');
$this->addDir($complete, $addon->getPlugin('redaxo')->getPath('assets'), 'assets/addons/be_style/plugins/redaxo');
$files = (require $addon->getPath('vendor_files.php'));
foreach ($files as $source => $destination) {
$complete->addFile($addon->getPath($source), 'assets/addons/be_style/' . $destination);
}
$complete->close();
$update->close();
}
示例2: __construct
public function __construct($exceptions = false)
{
$addon = rex_addon::get('phpmailer');
$this->From = $addon->getConfig('from');
$this->FromName = $addon->getConfig('fromname');
$this->ConfirmReadingTo = $addon->getConfig('confirmto');
$this->Mailer = $addon->getConfig('mailer');
$this->Host = $addon->getConfig('host');
$this->Port = $addon->getConfig('port');
$this->CharSet = $addon->getConfig('charset');
$this->WordWrap = $addon->getConfig('wordwrap');
$this->Encoding = $addon->getConfig('encoding');
if ($addon->getConfig('priority') == 0) {
$this->Priority = null;
} else {
$this->Priority = $addon->getConfig('priority');
}
$this->SMTPDebug = $addon->getConfig('smtp_debug');
$this->SMTPSecure = $addon->getConfig('smtpsecure');
$this->SMTPAuth = $addon->getConfig('smtpauth');
$this->Username = $addon->getConfig('username');
$this->Password = $addon->getConfig('password');
if ($bcc = $addon->getConfig('bcc')) {
$this->AddBCC($bcc);
}
$this->PluginDir = $addon->getPath('lib/phpmailer/');
parent::__construct($exceptions);
}
示例3: doAction
public function doAction()
{
$path = rex_path::addon($this->addonkey);
$temppath = rex_path::addon('.new.' . $this->addonkey);
if (($msg = $this->extractArchiveTo($temppath)) !== true) {
return $msg;
}
if ($this->addon->isAvailable() && ($msg = $this->checkRequirements()) !== true) {
return $msg;
}
// ---- include update.php
if ($this->addon->isInstalled() && file_exists($temppath . rex_package::FILE_UPDATE)) {
try {
$this->addon->includeFile('../.new.' . $this->addonkey . '/' . rex_package::FILE_UPDATE);
} catch (rex_functional_exception $e) {
return $e->getMessage();
} catch (rex_sql_exception $e) {
return 'SQL error: ' . $e->getMessage();
}
if (($msg = $this->addon->getProperty('updatemsg', '')) != '') {
return $msg;
}
if (!$this->addon->getProperty('update', true)) {
return rex_i18n::msg('package_no_reason');
}
}
// ---- backup
$assets = $this->addon->getAssetsPath();
if (rex_addon::get('install')->getConfig('backups')) {
$archivePath = rex_path::addonData('install', $this->addonkey . '/');
rex_dir::create($archivePath);
$archive = $archivePath . strtolower(preg_replace('/[^a-z0-9-_.]/i', '_', $this->addon->getVersion('0'))) . '.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 ($this->addon->getRegisteredPlugins() as $plugin) {
$pluginPath = $temppath . '/plugins/' . $plugin->getName();
if (!is_dir($pluginPath)) {
rex_dir::copy($plugin->getPath(), $pluginPath);
} elseif ($plugin->isInstalled() && is_dir($pluginPath . '/assets')) {
rex_dir::copy($pluginPath . '/assets', $plugin->getAssetsPath());
}
}
// ---- update main addon dir
rex_dir::delete($path);
rename($temppath, $path);
// ---- update assets
$origAssets = $this->addon->getPath('assets');
if ($this->addon->isInstalled() && is_dir($origAssets)) {
rex_dir::copy($origAssets, $assets);
}
$this->addon->setProperty('version', $this->file['version']);
rex_install_packages::updatedPackage($this->addonkey, $this->fileId);
}
示例4: getWidget
public static function getWidget($id, $name, $value, array $args = [])
{
$open_params = '';
if (isset($args['category']) && ($category = (int) $args['category'])) {
$open_params .= '&rex_file_category=' . $category;
}
foreach ($args as $aname => $avalue) {
$open_params .= '&args[' . $aname . ']=' . urlencode($avalue);
}
$wdgtClass = ' rex-js-widget-medialist';
if (isset($args['preview']) && $args['preview']) {
$wdgtClass .= ' rex-js-widget-preview';
if (rex_addon::get('media_manager')->isAvailable()) {
$wdgtClass .= ' rex-js-widget-preview-media-manager';
}
}
$options = '';
$medialistarray = explode(',', $value);
if (is_array($medialistarray)) {
foreach ($medialistarray as $file) {
if ($file != '') {
$options .= '<option value="' . $file . '">' . $file . '</option>';
}
}
}
$disabled = ' disabled';
$open_func = '';
$add_func = '';
$delete_func = '';
$view_func = '';
if (rex::getUser()->getComplexPerm('media')->hasMediaPerm()) {
$disabled = '';
$open_func = 'openREXMedialist(' . $id . ',\'' . $open_params . '\');';
$add_func = 'addREXMedialist(' . $id . ',\'' . $open_params . '\');';
$delete_func = 'deleteREXMedialist(' . $id . ');';
$view_func = 'viewREXMedialist(' . $id . ',\'' . $open_params . '\');';
}
$e = [];
$e['before'] = '<div class="rex-js-widget' . $wdgtClass . '">';
$e['field'] = '<select class="form-control" name="REX_MEDIALIST_SELECT[' . $id . ']" id="REX_MEDIALIST_SELECT_' . $id . '" size="8">' . $options . '</select><input type="hidden" name="' . $name . '" id="REX_MEDIALIST_' . $id . '" value="' . $value . '" />';
$e['moveButtons'] = '
<a href="#" class="btn btn-popup" onclick="moveREXMedialist(' . $id . ',\'top\');return false;" title="' . rex_i18n::msg('var_medialist_move_top') . '"><i class="rex-icon rex-icon-top"></i></a>
<a href="#" class="btn btn-popup" onclick="moveREXMedialist(' . $id . ',\'up\');return false;" title="' . rex_i18n::msg('var_medialist_move_up') . '"><i class="rex-icon rex-icon-up"></i></a>
<a href="#" class="btn btn-popup" onclick="moveREXMedialist(' . $id . ',\'down\');return false;" title="' . rex_i18n::msg('var_medialist_move_down') . '"><i class="rex-icon rex-icon-down"></i></a>
<a href="#" class="btn btn-popup" onclick="moveREXMedialist(' . $id . ',\'bottom\');return false;" title="' . rex_i18n::msg('var_medialist_move_bottom') . '"><i class="rex-icon rex-icon-bottom"></i></a>';
$e['functionButtons'] = '
<a href="#" class="btn btn-popup" onclick="' . $open_func . 'return false;" title="' . rex_i18n::msg('var_media_open') . '"' . $disabled . '><i class="rex-icon rex-icon-open-mediapool"></i></a>
<a href="#" class="btn btn-popup" onclick="' . $add_func . 'return false;" title="' . rex_i18n::msg('var_media_new') . '"' . $disabled . '><i class="rex-icon rex-icon-add-media"></i></a>
<a href="#" class="btn btn-popup" onclick="' . $delete_func . 'return false;" title="' . rex_i18n::msg('var_media_remove') . '"' . $disabled . '><i class="rex-icon rex-icon-delete-media"></i></a>
<a href="#" class="btn btn-popup" onclick="' . $view_func . 'return false;" title="' . rex_i18n::msg('var_media_view') . '"' . $disabled . '><i class="rex-icon rex-icon-view-media"></i></a>';
$e['after'] = '<div class="rex-js-media-preview"></div></div>';
$fragment = new rex_fragment();
$fragment->setVar('elements', [$e], false);
$media = $fragment->parse('core/form/widget_list.php');
return $media;
}
示例5: getParamFields
public function getParamFields()
{
$fields = [['label' => rex_i18n::msg('im_export_filename'), 'name' => 'filename', 'type' => 'text', 'default' => self::DEFAULT_FILENAME, 'notice' => rex_i18n::msg('im_export_filename_notice')], ['name' => 'sendmail', 'type' => 'checkbox', 'options' => [1 => rex_i18n::msg('im_export_send_mail')]]];
if (rex_addon::get('phpmailer')->isAvailable()) {
$fields[] = ['label' => rex_i18n::msg('im_export_mailaddress'), 'name' => 'mailaddress', 'type' => 'text', 'visible_if' => ['sendmail' => 1]];
} else {
$fields[1]['notice'] = rex_i18n::msg('im_export_send_mail_notice');
$fields[1]['attributes'] = ['disabled' => 'disabled'];
}
return $fields;
}
示例6: get
/**
* Returns the package (addon or plugin) by the given package id.
*
* @param string $packageId Package ID
*
* @throws InvalidArgumentException
*
* @return self
*/
public static function get($packageId)
{
if (!is_string($packageId)) {
throw new InvalidArgumentException('Expecting $packageId to be string, but ' . gettype($packageId) . ' given!');
}
$package = explode('/', $packageId);
$addon = rex_addon::get($package[0]);
if (isset($package[1])) {
return $addon->getPlugin($package[1]);
}
return $addon;
}
示例7: __construct
function __construct()
{
$this->addon_name = "rex5_multiupload";
$this->addon = rex_addon::get('rex5_multiupload');
$this->sync_cat = $this->addon->getProperty("sync_cats");
$this->clear_uploadlist_automatically = $this->addon->getProperty("clear_uploadlist_automatically");
$this->clear_file_after_finish = $this->addon->getProperty("clear_file_after_finish");
$this->upload_simultaneously = $this->addon->getProperty("upload_simultaneously");
$this->javascript_debug = $this->addon->getProperty("javascript_debug");
$this->showFootnote = $this->addon->getProperty("show_footnote");
$this->folder = $this->addon->getProperty("folder");
$this->markup = $this->return_markup;
$this->time = uniqid();
}
示例8: getUpdatePackages
public static function getUpdatePackages()
{
if (is_array(self::$updatePackages)) {
return self::$updatePackages;
}
self::$updatePackages = self::getPackages();
foreach (self::$updatePackages as $key => $addon) {
if (rex_addon::exists($key) && isset($addon['files'])) {
self::unsetOlderVersions($key, rex_addon::get($key)->getVersion());
} else {
unset(self::$updatePackages[$key]);
}
}
return self::$updatePackages;
}
示例9: getWidget
public static function getWidget($id, $name, $value, array $args = [])
{
$open_params = '';
if (isset($args['category']) && ($category = (int) $args['category'])) {
$open_params .= '&rex_file_category=' . $category;
}
foreach ($args as $aname => $avalue) {
$open_params .= '&args[' . urlencode($aname) . ']=' . urlencode($avalue);
}
$wdgtClass = ' rex-js-widget-media';
if (isset($args['preview']) && $args['preview']) {
$wdgtClass .= ' rex-js-widget-preview';
if (rex_addon::get('media_manager')->isAvailable()) {
$wdgtClass .= ' rex-js-widget-preview-media-manager';
}
}
$disabled = ' disabled';
$open_func = '';
$add_func = '';
$delete_func = '';
$view_func = '';
if (rex::getUser()->getComplexPerm('media')->hasMediaPerm()) {
$disabled = '';
$open_func = 'openREXMedia(' . $id . ',\'' . $open_params . '\');';
$add_func = 'addREXMedia(' . $id . ',\'' . $open_params . '\');';
$delete_func = 'deleteREXMedia(' . $id . ');';
$view_func = 'viewREXMedia(' . $id . ',\'' . $open_params . '\');';
}
$e = [];
$e['before'] = '<div class="rex-js-widget' . $wdgtClass . '">';
$e['field'] = '<input class="form-control" type="text" name="' . $name . '" value="' . $value . '" id="REX_MEDIA_' . $id . '" readonly />';
$e['functionButtons'] = '
<a href="#" class="btn btn-popup" onclick="' . $open_func . 'return false;" title="' . rex_i18n::msg('var_media_open') . '"' . $disabled . '><i class="rex-icon rex-icon-open-mediapool"></i></a>
<a href="#" class="btn btn-popup" onclick="' . $add_func . 'return false;" title="' . rex_i18n::msg('var_media_new') . '"' . $disabled . '><i class="rex-icon rex-icon-add-media"></i></a>
<a href="#" class="btn btn-popup" onclick="' . $delete_func . 'return false;" title="' . rex_i18n::msg('var_media_remove') . '"' . $disabled . '><i class="rex-icon rex-icon-delete-media"></i></a>
<a href="#" class="btn btn-popup" onclick="' . $view_func . 'return false;" title="' . rex_i18n::msg('var_media_view') . '"' . $disabled . '><i class="rex-icon rex-icon-view-media"></i></a>';
$e['after'] = '<div class="rex-js-media-preview"></div></div>';
$fragment = new rex_fragment();
$fragment->setVar('elements', [$e], false);
$media = $fragment->parse('core/form/widget.php');
return $media;
}
示例10: 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::coreAssets());
// copy skins files/assets
$skinAddon = rex_addon::get($skinAddon);
$skinPlugin = $skinAddon->getPlugin($skinPlugin);
rex_dir::copy($skinAddon->getPath('assets'), $skinAddon->getAssetsPath());
rex_dir::copy($skinPlugin->getPath('assets'), $skinPlugin->getAssetsPath());
if (is_file($skinAddon->getPath('install.php'))) {
$skinAddon->includeFile('install.php');
}
if (is_file($skinPlugin->getPath('install.php'))) {
$skinPlugin->includeFile('install.php');
}
}
示例11: 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));
}
示例12:
<?php
if (rex_addon::get('cronjob')->isAvailable()) {
rex_cronjob_manager::registerType('rex_cronjob_export');
}
示例13:
<br/>
Datei anhängen: </strong>REX_MEDIA[id=1 widget=1]</div>
<div style="clear:both"></div>
</div>
<div class="formgenheadline">E-Mail-Bestätigungstext</div>
<div class="col-md-12 doform"><textarea name="REX_INPUT_VALUE[5]" class="formgenconfig" style="width:100%;height:80px;">REX_VALUE[5]</textarea>
<span class="formgen_sample1"><strong>Platzhalter für Bestätigungstext:</strong> <br />
%Betreff%, %Datum% , %Zeit%, %Absender%, %Mail%, %Vorname%, %Nachname% </span>, <br />
%Besuchermail% (wird durch sender gesetzt)<br/>
</div>
</div>
<br/>
<h2><strong>Bestätigung auf Website</strong></h2>
<?php
$tinycheck = rex_addon::get($weditor)->isAvailable();
if ($tinycheck == 1) {
?>
<textarea id="redactor_REX_SLICE_ID"name="REX_INPUT_VALUE[6]" class="<?php
echo $editstyle;
?>
form-control" style="width:555px; height:250px;">REX_VALUE[6]</textarea>
<?php
} else {
echo ' <div class="formgenerror"> Editor wurde nicht gefunden. <br/> Bitte installieren Sie ein geeignetes ADDON! <br/>z.B: TinyMCE, redactor oder CKEDITOR </div>';
}
?>
示例14: getImageTypes
public static function getImageTypes()
{
return rex_addon::get('mediapool')->getProperty('image_extensions');
}
示例15: function
$titleLink = '<a id="erledigtverbergen" class="erledigtschalter" title="Erledigte Aufgaben verbergen" href="javascript:void(0);"><i class="rex-icon fa-eye-slash"></a>';
} else {
$titleLink = '<a id="erledigtanzeigen" class="erledigtschalter" title="Erledigte Aufgaben anzeigen" href="javascript:void(0);"><i class="rex-icon fa-eye"></a>';
}
$list->setColumnLabel('titel', 'Aufgaben ' . $titleLink);
$list->setColumnLayout('titel', ['<th>###VALUE###</th>', '<td data-title="Aufgaben" class="td_aufgaben">###VALUE###</td>']);
$list->setColumnFormat('titel', 'custom', function ($params) {
$list = $params['list'];
if ($list->getValue('beschreibung') != '') {
$aufgabe = '<div class="collapsetitel" data-toggle="collapse" data-target="#collapse###id###">' . $list->getValue('titel') . '</div>';
} else {
$aufgabe = $list->getValue('titel');
}
if ($list->getValue('beschreibung')) {
$text = htmlspecialchars_decode($list->getValue('beschreibung'));
if (rex_addon::get('textile')->isAvailable()) {
$text = str_replace('<br />', '', $text);
$text = rex_textile::parse($text);
$text = str_replace('###', ' ', $text);
} else {
$text = str_replace(PHP_EOL, '<br/>', $text);
}
$user_name = rex::getUser()->getValue('name') != '' ? rex::getUser()->getValue('name') : rex::getUser()->getValue('login');
$text = str_replace('*****', '<div class="aufgabentrenner">' . date("d.m.y") . ' - ' . htmlspecialchars($user_name) . '</div>', $text);
$beschreibung = '<div id="collapse###id###" class="collapse"><br/>' . $text . '</div>';
} else {
$beschreibung = '';
}
$aufgabe .= $beschreibung;
return $aufgabe;
});