예제 #1
0
파일: boot.php 프로젝트: nilsology/slice_ui
if (rex_post('update_slice_status') != 1 && rex_get('function') == '') {
    rex_extension::register('SLICE_SHOW', 'slice_ui::extendBackendSlices');
}
rex_extension::register('SLICE_SHOW', 'slice_ui::isActive');
if (strpos(rex_request('page'), 'content/emptyclipboard') !== false) {
    slice_ui::emptyClipboard();
}
if (!empty($Config['general']['sticky_slice_nav']) && $Config['general']['sticky_slice_nav']) {
    rex_view::addJsFile($this->getAssetsUrl('sticky_header.js'));
}
if (strpos(rex_request('page'), 'content/paste') !== false) {
    slice_ui::addSlice();
}
if (strpos(rex_request('page'), 'content/move') !== false) {
    slice_ui::moveSlice();
}
if (strpos(rex_request('page'), 'content/toggleSlice') !== false || strpos(rex_request('page'), 'content/status') !== false) {
    slice_ui::toggleSlice();
}
if (is_object(rex::getUser()) && (!rex::getUser()->hasPerm('editContentOnly[]') && rex::getUser()->hasPerm('slice_ui[]') || rex::getUser()->isAdmin())) {
    rex_extension::register('STRUCTURE_CONTENT_SLICE_MENU', 'slice_ui::modifySliceEditMenu');
}
if (is_object(rex::getUser()) && (rex_request('page', 'string') === 'content/copy' || rex_request('page', 'string') === 'content/cut')) {
    slice_ui::copySlice();
}
/* Slice-Menü überschreiben */
if (!empty($Config['general']['copy_n_cut']) && $Config['general']['copy_n_cut']) {
    slice_ui::extendSliceButtons();
}
// if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
//   die();
예제 #2
0
<?php

slice_ui::emptyClipboard(1);
$fields = ['active', 'online_from', 'online_to'];
$cols = rex_sql::showColumns(rex::getTablePrefix() . 'article_slice');
foreach ($fields as $fieldname) {
    $found = false;
    foreach ($cols as $field) {
        if ($field['name'] === $fieldname) {
            $found = true;
            break;
        }
    }
    if ($found) {
        $sql = rex_sql::factory();
        $sql->setQuery("ALTER TABLE `" . rex::getTablePrefix() . 'article_slice' . "` DROP " . $fieldname, array());
    }
}
예제 #3
0
파일: boot.php 프로젝트: eaCe/slice_ui
if (rex::isBackend() && is_object(rex::getUser())) {
    rex_perm::register('copy[]');
    rex_perm::register('slice_ui[]', null, rex_perm::OPTIONS);
    rex_perm::register('slice_ui[settings]', null, rex_perm::OPTIONS);
}
if (strpos(rex_request('page'), 'content/emptyclipboard') !== false) {
    slice_ui::emptyClipboard();
}
rex_view::addCssFile($this->getAssetsUrl('slice_ui.css'));
if (strpos(rex_request('page'), 'content/paste') !== false) {
    slice_ui::addSlice();
}
if (strpos(rex_request('page'), 'content/toggleSlice') !== false) {
    slice_ui::toggleSlice();
}
if (is_object(rex::getUser()) && (!rex::getUser()->hasPerm('editContentOnly[]') && rex::getUser()->hasPerm('slice_ui[]') || rex::getUser()->isAdmin())) {
    rex_extension::register('ART_SLICE_MENU', 'slice_ui::modifySliceEditMenu');
}
if (is_object(rex::getUser()) && (rex_request('page', 'string') === 'content/copy' || rex_request('page', 'string') === 'content/cut')) {
    slice_ui::copySlice();
}
rex_extension::register('SLICE_SHOW', 'slice_ui::isActive');
/* Slice-Menü überschreiben */
if (!empty($_SESSION['slice_ui'])) {
    $Content = rex_plugin::get('structure', 'content');
    $ContentPages = $Content->getProperty('pages');
    $ContentPages['content']['subpages']['paste'] = array('title' => 'Einfügen', 'icon' => 'rex-icon rex-icon-paste');
    $ContentPages['content']['subpages']['emptyclipboard'] = array('title' => 'Clipboard löschen', 'icon' => 'rex-icon rex-icon-emptyclipboard');
    $Content->setProperty('pages', $ContentPages);
}