Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 /**
  * Returns if the package exists.
  *
  * @param string $packageId Package ID
  *
  * @return bool
  */
 public static function exists($packageId)
 {
     $package = explode('/', $packageId);
     if (isset($package[1])) {
         return rex_plugin::exists($package[0], $package[1]);
     }
     return rex_addon::exists($package[0]);
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
 public static function getMyPackages()
 {
     if (is_array(self::$myPackages)) {
         return self::$myPackages;
     }
     self::$myPackages = self::getPackages('?only_my=1');
     foreach (self::$myPackages as $key => $addon) {
         if (!rex_addon::exists($key)) {
             unset(self::$myPackages[$key]);
         }
     }
     return self::$myPackages;
 }
Exemplo n.º 7
0
 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();
 }
Exemplo n.º 8
0
 public static function getWidget($id, $name, $value, array $args = [])
 {
     $open_params = '';
     if (isset($args['category']) && ($category = (int) $args['category'])) {
         $open_params .= '&amp;rex_file_category=' . $category;
     }
     foreach ($args as $aname => $avalue) {
         $open_params .= '&amp;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;
 }
Exemplo n.º 9
0
 /**
  * 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');
     }
 }
Exemplo n.º 10
0
 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));
 }
Exemplo n.º 11
0
<?php

if (rex_addon::get('cronjob')->isAvailable()) {
    rex_cronjob_manager::registerType('rex_cronjob_export');
}
Exemplo n.º 12
0
        <br/>
Datei anh&#228;ngen: </strong>REX_MEDIA[id=1 widget=1]</div>
    <div style="clear:both"></div>
  </div>
  <div class="formgenheadline">E-Mail-Best&#228;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>';
}
?>
   
   
Exemplo n.º 13
0
 public static function getImageTypes()
 {
     return rex_addon::get('mediapool')->getProperty('image_extensions');
 }
Exemplo n.º 14
0
 /**
  * Initializes all packages.
  */
 public static function initialize($dbExists = true)
 {
     if ($dbExists) {
         $config = rex::getConfig('package-config', []);
     } else {
         $config = [];
         foreach (rex::getProperty('setup_addons') as $addon) {
             $config[$addon]['install'] = false;
         }
     }
     $addons = self::$addons;
     self::$addons = [];
     foreach ($config as $addonName => $addonConfig) {
         $addon = isset($addons[$addonName]) ? $addons[$addonName] : new self($addonName);
         $addon->setProperty('install', isset($addonConfig['install']) ? $addonConfig['install'] : false);
         $addon->setProperty('status', isset($addonConfig['status']) ? $addonConfig['status'] : false);
         self::$addons[$addonName] = $addon;
         if (!$dbExists && is_array($plugins = $addon->getProperty('system_plugins'))) {
             foreach ($plugins as $plugin) {
                 $config[$addonName]['plugins'][$plugin]['install'] = false;
             }
         }
         if (isset($config[$addonName]['plugins']) && is_array($config[$addonName]['plugins'])) {
             $plugins = $addon->plugins;
             $addon->plugins = [];
             foreach ($config[$addonName]['plugins'] as $pluginName => $pluginConfig) {
                 $plugin = isset($plugins[$pluginName]) ? $plugins[$pluginName] : new rex_plugin($pluginName, $addon);
                 $plugin->setProperty('install', isset($pluginConfig['install']) ? $pluginConfig['install'] : false);
                 $plugin->setProperty('status', isset($pluginConfig['status']) ? $pluginConfig['status'] : false);
                 $addon->plugins[$pluginName] = $plugin;
             }
         }
     }
 }
Exemplo n.º 15
0
 /**
  * @override
  * @see redaxo/include/classes/rex_addon#setProperty($addon, $property, $value)
  */
 static function setProperty($addon, $plugin, $property, $value = null)
 {
     return parent::setProperty(array($addon, $plugin), $property, $value);
 }
Exemplo n.º 16
0
     $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('###', '&#x20;', $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;
 });
Exemplo n.º 17
0
 /**
  * Synchronizes the packages with the file system.
  */
 public static function synchronizeWithFileSystem()
 {
     $config = rex::getConfig('package-config');
     $addons = self::readPackageFolder(rex_path::src('addons'));
     $registeredAddons = array_keys(rex_addon::getRegisteredAddons());
     foreach (array_diff($registeredAddons, $addons) as $addonName) {
         $manager = rex_addon_manager::factory(rex_addon::get($addonName));
         $manager->_delete(true);
         unset($config[$addonName]);
     }
     foreach ($addons as $addonName) {
         if (!rex_addon::exists($addonName)) {
             $config[$addonName]['install'] = false;
             $config[$addonName]['status'] = false;
             $registeredPlugins = [];
         } else {
             $addon = rex_addon::get($addonName);
             $config[$addonName]['install'] = $addon->isInstalled();
             $config[$addonName]['status'] = $addon->isAvailable();
             $registeredPlugins = array_keys($addon->getRegisteredPlugins());
         }
         $plugins = self::readPackageFolder(rex_path::addon($addonName, 'plugins'));
         foreach (array_diff($registeredPlugins, $plugins) as $pluginName) {
             $manager = rex_plugin_manager::factory(rex_plugin::get($addonName, $pluginName));
             $manager->_delete(true);
             unset($config[$addonName]['plugins'][$pluginName]);
         }
         foreach ($plugins as $pluginName) {
             $plugin = rex_plugin::get($addonName, $pluginName);
             $config[$addonName]['plugins'][$pluginName]['install'] = $plugin->isInstalled();
             $config[$addonName]['plugins'][$pluginName]['status'] = $plugin->getProperty('status');
         }
         if (isset($config[$addonName]['plugins']) && is_array($config[$addonName]['plugins'])) {
             ksort($config[$addonName]['plugins']);
         }
     }
     ksort($config);
     rex::setConfig('package-config', $config);
     rex_addon::initialize();
 }
Exemplo n.º 18
0
 /**
  * Fuegt dem Formular ein Feld hinzu mit dem die Struktur-Verwaltung angebunden werden kann.
  * Damit koennen mehrere Elemente aus der Struktur eingefuegt werden.
  *
  * @param string $name
  * @param mixed  $value
  * @param array  $attributes
  *
  * @throws rex_exception
  *
  * @return rex_form_widget_linklist_element
  */
 public function addLinklistField($name, $value = null, array $attributes = [])
 {
     if (!rex_addon::get('structure')->isAvailable()) {
         throw new rex_exception(__METHOD__ . '() needs "structure" addon!');
     }
     $attributes['internal::fieldClass'] = 'rex_form_widget_linklist_element';
     $field = $this->addField('', $name, $value, $attributes, true);
     return $field;
 }
Exemplo n.º 19
0
     if ($list->getValue('description') != '') {
         $aufgabe = '<div class="collapsetitle" data-toggle="collapse" data-target="#collapse###id###">' . $list->getValue('title') . '</div>';
     } else {
         $aufgabe = $list->getValue('title');
     }
     if ($list->getValue('description')) {
         $text = $list->getValue('description');
         if (rex_addon::get('textile')->isAvailable()) {
             $text = str_replace('<br />', '', $text);
             $text = rex_textile::parse($text);
             $text = str_replace('###', '&#x20;', $text);
         }
         if (rex_addon::get('rex_markitup')->isAvailable()) {
             $text = rex_markitup::parseOutput('textile', $text);
         }
         if (!rex_addon::get('rex_markitup')->isAvailable() and !rex_addon::get('textile')->isAvailable()) {
             $text = str_replace(PHP_EOL, '<br/>', $text);
         }
         $user_name = rex::getUser()->getValue('login');
         $beschreibung = '<div id="collapse###id###" class="collapse"><br/>' . $text . '</div>';
     } else {
         $beschreibung = '';
     }
     $aufgabe .= $beschreibung;
     return $aufgabe;
 });
 // --------------------
 //
 //  UpdateDate
 //
 // --------------------
Exemplo n.º 20
0
             <td colspan="2">
             ' . $checkbox . '
             </td>
             <td colspan="4">
             ' . $field . '
             </td>
         </tr>
         </tfoot>
     ';
 }
 $where = 'f.category_id=' . $rex_file_category;
 $addTable = '';
 if ($media_name != '') {
     $media_name = str_replace(['_', '%'], ['\\_', '\\%'], $media_name);
     $where = "(f.filename LIKE '%" . $media_name . "%' OR f.title LIKE '%" . $media_name . "%')";
     if (rex_addon::get('mediapool')->getConfig('searchmode', 'local') != 'global' && $rex_file_category != 0) {
         $addTable = rex::getTablePrefix() . 'media_category c, ';
         $where .= ' AND f.category_id = c.id ';
         $where .= " AND (c.path LIKE '%|" . $rex_file_category . "|%' OR c.id=" . $rex_file_category . ') ';
     }
 }
 if (isset($args['types'])) {
     $types = [];
     foreach (explode(',', $args['types']) as $type) {
         $types[] = 'LOWER(RIGHT(f.filename, LOCATE(".", REVERSE(f.filename))-1))="' . strtolower(htmlspecialchars($type)) . '"';
     }
     $where .= ' AND (' . implode(' OR ', $types) . ')';
 }
 $qry = 'SELECT * FROM ' . $addTable . rex::getTablePrefix() . 'media f WHERE ' . $where . ' ORDER BY f.updatedate desc, f.id desc';
 // ----- EXTENSION POINT
 $qry = rex_extension::registerPoint(new rex_extension_point('MEDIA_LIST_QUERY', $qry, ['category_id' => $rex_file_category]));
Exemplo n.º 21
0
 /**
  * @param string      $temppath
  * @param string      $version
  * @param rex_addon[] $addons
  *
  * @throws rex_functional_exception
  */
 private function checkRequirements($temppath, $version, array $addons)
 {
     // ---- update "version", "requires" and "conflicts" properties
     $coreVersion = rex::getVersion();
     rex::setProperty('version', $version);
     $versions = new SplObjectStorage();
     $requirements = new SplObjectStorage();
     $conflicts = new SplObjectStorage();
     foreach ($addons as $addonkey => $config) {
         $addon = rex_addon::get($addonkey);
         $addonPath = $temppath . 'addons/' . $addonkey . '/';
         if (isset($config['requires'])) {
             $requirements[$addon] = $addon->getProperty('requires');
             $addon->setProperty('requires', $config['requires']);
         }
         if (isset($config['conflicts'])) {
             $conflicts[$addon] = $addon->getProperty('conflicts');
             $addon->setProperty('conflicts', $config['conflicts']);
         }
         $versions[$addon] = $addon->getVersion();
         $addon->setProperty('version', $config['version']);
         foreach ($addon->getAvailablePlugins() as $plugin) {
             if (is_dir($addonPath . 'plugins/' . $plugin->getName())) {
                 $config = rex_file::getConfig($addonPath . 'plugins/' . $plugin->getName() . '/' . rex_package::FILE_PACKAGE);
                 if (isset($config['requires'])) {
                     $requirements[$plugin] = $plugin->getProperty('requires');
                     $plugin->setProperty('requires', $config['requires']);
                 }
                 if (isset($config['conflicts'])) {
                     $conflicts[$plugin] = $plugin->getProperty('conflicts');
                     $plugin->setProperty('conflicts', $config['conflicts']);
                 }
                 if (isset($config['version'])) {
                     $versions[$plugin] = $plugin->getProperty('version');
                     $plugin->setProperty('requires', $config['version']);
                 }
             }
         }
     }
     // ---- check requirements
     $messages = [];
     foreach (rex_package::getAvailablePackages() as $package) {
         $manager = rex_package_manager::factory($package);
         if (!$manager->checkRequirements()) {
             $messages[] = $package->getPackageId() . ': ' . $manager->getMessage();
         } elseif (!$manager->checkConflicts()) {
             $messages[] = $package->getPackageId() . ': ' . $manager->getMessage();
         }
     }
     // ---- reset "version", "requires" and "conflicts" properties
     rex::setProperty('version', $coreVersion);
     foreach ($versions as $package) {
         $package->setProperty('version', $versions[$package]);
     }
     foreach ($requirements as $package) {
         $package->setProperty('requires', $requirements[$package]);
     }
     foreach ($conflicts as $package) {
         $package->setProperty('conflicts', $conflicts[$package]);
     }
     if (!empty($messages)) {
         throw new rex_functional_exception(implode('<br />', $messages));
     }
 }
Exemplo n.º 22
0
/**
 * return global mediatype blacklist from master.inc.
 *
 * @return array blacklisted mediatype extensions
 */
function rex_mediapool_getMediaTypeBlacklist()
{
    return rex_addon::get('mediapool')->getProperty('blocked_extensions');
}
Exemplo n.º 23
0
/**
 * Gibt die mit dem Prefix verbundenen Tabellennamen zurück.
 */
function rex_metainfo_meta_table($prefix)
{
    $metaTables = rex_addon::get('metainfo')->getProperty('metaTables', []);
    if (isset($metaTables[$prefix])) {
        return $metaTables[$prefix];
    }
    return false;
}
Exemplo n.º 24
0
 /**
  * Return the site wide notfound article id.
  *
  * @return int
  */
 public static function getNotfoundArticleId()
 {
     return rex_addon::get('structure')->getProperty('notfound_article_id', 1);
 }
Exemplo n.º 25
0
 protected function checkPreConditions()
 {
     if (rex_addon::exists($this->addonkey)) {
         throw new rex_api_exception(sprintf('AddOn "%s" already exist!', $this->addonkey));
     }
 }
Exemplo n.º 26
0
<?php

/**
 * Packages loading.
 *
 * @package redaxo5
 */
rex_addon::initialize(!rex::isSetup());
if (rex::isSetup() || rex::isSafeMode()) {
    $packageOrder = array_keys(rex_package::getSetupPackages());
} else {
    $packageOrder = rex::getConfig('package-order', []);
}
// in the first run, we register all folders for class- and fragment-loading,
// so it is transparent in which order the addons are included afterwards.
foreach ($packageOrder as $packageId) {
    $package = rex_package::get($packageId);
    $folder = $package->getPath();
    // add addon path for i18n
    if (is_readable($folder . 'lang')) {
        rex_i18n::addDirectory($folder . 'lang');
    }
    // add package path for fragment loading
    if (is_readable($folder . 'fragments')) {
        rex_fragment::addDirectory($folder . 'fragments' . DIRECTORY_SEPARATOR);
    }
    // add addon path for class-loading
    if (is_readable($folder . 'lib')) {
        rex_autoload::addDirectory($folder . 'lib');
    }
    if (is_readable($folder . 'vendor')) {
Exemplo n.º 27
0
<?php

if (!rex::isBackend()) {
    rex_extension::register('OUTPUT_FILTER', function (rex_extension_point $ep) {
        // Bereite Ausnahmen vor: Templates und Artikel
        // Dort werden E-Mailadressen nicht verschlüsselt
        $whitelistTemplates = rex_addon::get('emailobfuscator')->getConfig('templates', []);
        $whitelistArticles = rex_addon::get('emailobfuscator')->getConfig('articles', '');
        if ($whitelistArticles != '') {
            $whitelistArticles = explode(',', $whitelistArticles);
        } else {
            $whitelistArticles = [];
        }
        if (!is_null(rex_article::getCurrent()) && !in_array(rex_article::getCurrent()->getTemplateId(), $whitelistTemplates) && !in_array(rex_article::getCurrentId(), $whitelistArticles)) {
            $subject = $ep->getSubject();
            // Ersetze mailto-Links (zuerst!)
            // Anmerkung: Attributwerte (hier: href) benötigen nicht zwingend Anführungsstriche drumrum,
            // deshalb prüfen wir zusätzlich noch auf '>' am Ende .
            $subject = preg_replace_callback('/mailto:(.*?)(?=[\'|"|\\>])/', 'emailobfuscator::encodeEmailLinks', $subject);
            // Ersetze E-Mailadressen
            $subject = preg_replace_callback('/([\\w\\-\\+\\.]+)@([\\w\\-\\.]+\\.[\\w]{2,})/', 'emailobfuscator::encodeEmail', $subject);
            // Injiziere CSS vors schließende </head> im Seitenkopf
            if ($this->getConfig('autoload_css')) {
                $cssFile = '<link rel="stylesheet" href="' . $this->getAssetsUrl('emailobfuscator.css?v=' . $this->getVersion()) . '">';
                $subject = str_replace('</head>', $cssFile . '</head>', $subject);
            }
            // Injiziere JavaScript vors schließende </body> der Seite
            if ($this->getConfig('autoload_js')) {
                $jsFile = '<script src="' . $this->getAssetsUrl('emailobfuscator.js?v=' . $this->getVersion()) . '"></script>';
                $subject = str_replace('</body>', $jsFile . '</body>', $subject);
            }
Exemplo n.º 28
0
/**
 * Menupunkt nur einbinden, falls ein Plugin sich angemeldet hat
 * via BE_STYLE_PAGE_CONTENT inhalt auszugeben.
 *
 * @package redaxo\be-style
 */
function rex_be_add_page()
{
    if (rex_extension::isRegistered('BE_STYLE_PAGE_CONTENT')) {
        rex_addon::get('be_style')->setProperty('name', 'Backend Style');
    }
}
Exemplo n.º 29
0
<?php

/**
 * rex5_multiupload Addon.
 * @author Friends Of REDAXO
 * @package redaxo
 * @var rex_addon $this
 */
$addon = rex_addon::get('rex5_multiupload');
$addon->getProperty("php_debug");
if ($addon->getProperty("php_debug")) {
    ini_set('error_reporting', E_ALL);
    ini_set('display_errors', 1);
}
require_once rex_path::addon("rex5_multiupload", "fragments/action.upload.php");
Exemplo n.º 30
0
 * @author thomas[dot]blum[at]redaxo[dot]org Thomas Blum
 *
 * @package redaxo5
 *
 * @var rex_plugin $this
 */
$mypage = 'redaxo';
if (rex::isBackend()) {
    rex_extension::register('BE_STYLE_SCSS_FILES', function (rex_extension_point $ep) use($mypage) {
        $subject = $ep->getSubject();
        $file = rex_plugin::get('be_style', $mypage)->getPath('scss/default.scss');
        array_unshift($subject, $file);
        return $subject;
    }, rex_extension::EARLY);
    if (rex::getUser() && $this->getProperty('compile')) {
        rex_addon::get('be_style')->setProperty('compile', true);
        rex_extension::register('PACKAGES_INCLUDED', function () {
            $compiler = new rex_scss_compiler();
            $compiler->setRootDir($this->getPath('scss/'));
            $compiler->setScssFile($this->getPath('scss/master.scss'));
            // Compile in backend assets dir
            $compiler->setCssFile($this->getPath('assets/css/styles.css'));
            $compiler->compile();
            // Compiled file to copy in frontend assets dir
            rex_file::copy($this->getPath('assets/css/styles.css'), $this->getAssetsPath('css/styles.css'));
        });
    }
    rex_view::addCssFile($this->getAssetsUrl('css/styles.css'));
    rex_view::addJsFile($this->getAssetsUrl('javascripts/redaxo.js'));
    rex_extension::register('PAGE_HEADER', function (rex_extension_point $ep) {
        $icons = [];