当前位置: 首页>>代码示例>>PHP>>正文


PHP rex_view::addJsFile方法代码示例

本文整理汇总了PHP中rex_view::addJsFile方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_view::addJsFile方法的具体用法?PHP rex_view::addJsFile怎么用?PHP rex_view::addJsFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rex_view的用法示例。


在下文中一共展示了rex_view::addJsFile方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: function

 }, 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 = [];
     foreach (['57', '60', '72', '76', '114', '120', '144', '152'] as $size) {
         $size = $size . 'x' . $size;
         $icons[] = '<link rel="apple-touch-icon-precomposed" sizes="' . $size . '" href="' . $this->getAssetsUrl('images/apple-touch-icon-' . $size . '.png') . '" />';
     }
     foreach (['16', '32', '96', '128', '196'] as $size) {
         $size = $size . 'x' . $size;
         $icons[] = '<link rel="icon" type="image/png" href="' . $this->getAssetsUrl('images/favicon-' . $size . '.png') . '" sizes="' . $size . '" />';
     }
     $icons[] = '<meta name="msapplication-TileColor" content="#FFFFFF" />';
     $icons[] = '<meta name="msapplication-TileImage" content="' . $this->getAssetsUrl('images/mstile-144x144.png') . '" />';
     foreach (['70', '150', '310'] as $size) {
         $size = $size . 'x' . $size;
         $icons[] = '<meta name="msapplication-square' . $size . 'logo" content="' . $this->getAssetsUrl('images/mstile-' . $size . '.png') . '" />';
开发者ID:DECAF,项目名称:redaxo,代码行数:31,代码来源:boot.php

示例3: strtolower

         case 'ART_SLICES_COPY':
             $type = 'slices_copy';
             break;
         case 'SLICE_MOVE':
             $type = 'slice_' . $ep->getParam('direction');
             break;
         default:
             $type = strtolower($ep->getName());
     }
     $article_id = $ep->getParam('article_id');
     $clang_id = $ep->getParam('clang_id');
     $slice_revision = $ep->getParam('slice_revision');
     rex_article_slice_history::makeSnapshot($article_id, $clang_id, $type, $slice_revision);
 });
 rex_view::addCssFile($this->getAssetsUrl('history.css'));
 rex_view::addJsFile($this->getAssetsUrl('history.js'));
 $info = '';
 switch (rex_request('rex_history_function', 'string')) {
     case 'snap':
         $article_id = rex_request('history_article_id', 'int');
         $clang_id = rex_request('history_clang_id', 'int');
         $revision = rex_request('history_revision', 'int', 0);
         $history_date = rex_request('history_date', 'string');
         rex_article_slice_history::restoreSnapshot($history_date, $article_id, $clang_id, $revision);
         $info = $version['history_snapshot_history_reactivate_snapshot'];
     case 'layer':
         // article_id und clang_id und revision noch nötig
         $article_id = rex_request('history_article_id', 'int');
         $clang_id = rex_request('history_clang_id', 'int');
         $revision = rex_request('history_revision', 'int', 0);
         $versions = rex_article_slice_history::getSnapshots($article_id, $clang_id, $revision);
开发者ID:redaxo,项目名称:redaxo,代码行数:31,代码来源:boot.php

示例4:

<?php

/**
 * REDAXO customizer.
 *
 * Codemirror by : http://codemirror.net/
 * Marijn Haverbeke <marijnh@gmail.com>
 */
if (rex::isBackend() && rex::getUser()) {
    $config = $this->getConfig();
    rex_view::addCssFile($this->getAssetsUrl('css/styles.css'));
    if ($config['codemirror']) {
        rex_view::addCssFile($this->getAssetsUrl('vendor/codemirror/codemirror.css'));
        rex_view::addCssFile($this->getAssetsUrl('vendor/codemirror/theme/' . $config['codemirror_theme'] . '.css'));
        if ($config['codemirror_theme'] != '') {
            rex_view::setJsProperty('customizer_codemirror_defaulttheme', $config['codemirror_theme']);
        }
        rex_view::addJsFile($this->getAssetsUrl('vendor/codemirror/codemirror-compressed.js'));
    }
    if ($config['labelcolor'] != '') {
        rex_view::setJsProperty('customizer_labelcolor', $config['labelcolor']);
    }
    if ($config['showlink']) {
        rex_view::setJsProperty('customizer_showlink', '<h1 class="be-style-customizer-title"><a href="' . rex::getServer() . '" target="_blank">' . rex::getServerName() . '</a><i class="fa fa-external-link"></i></h1>');
    }
    rex_view::addJsFile($this->getAssetsUrl('js/main.js'));
}
开发者ID:staabm,项目名称:redaxo,代码行数:27,代码来源:boot.php

示例5: rex_unset_session

        } else {
            rex_unset_session('safemode');
        }
    }
}
rex_be_controller::setPages($pages);
// ----- Prepare Core Pages
if (rex::getUser()) {
    rex_be_controller::appendLoggedInPages();
    rex_be_controller::setCurrentPage(trim(rex_request('page', 'string')));
}
rex_view::addJsFile(rex_url::coreAssets('jquery.min.js'));
rex_view::addJsFile(rex_url::coreAssets('jquery-ui.custom.min.js'));
rex_view::addJsFile(rex_url::coreAssets('jquery-pjax.min.js'));
rex_view::addJsFile(rex_url::coreAssets('standard.js'));
rex_view::addJsFile(rex_url::coreAssets('sha1.js'));
rex_view::setJsProperty('backend', true);
rex_view::setJsProperty('accesskeys', rex::getProperty('use_accesskeys'));
// ----- INCLUDE ADDONS
include_once rex_path::core('packages.php');
// ----- Prepare AddOn Pages
if (rex::getUser()) {
    rex_be_controller::appendPackagePages();
}
$pages = rex_extension::registerPoint(new rex_extension_point('PAGES_PREPARED', rex_be_controller::getPages()));
rex_be_controller::setPages($pages);
// Set Startpage
if ($user = rex::getUser()) {
    // --- page pruefen und benoetigte rechte checken
    rex_be_controller::checkPagePermissions($user);
}
开发者ID:VIEWSION,项目名称:redaxo,代码行数:31,代码来源:backend.php

示例6: function

<?php

rex_extension::register('BE_STYLE_LESS_FILES', function (rex_extension_point $ep) {
    $subject = $ep->getSubject();
    array_unshift($subject, rex_plugin::get('slice_ui', 'slice_json_block')->getPath('less/styles.less|sourceMap|compress'));
    return $subject;
}, rex_extension::EARLY);
if (!rex_plugin::exists('be_style', 'lessphp')) {
    rex_view::addCssFile($this->getPath() . 'less/styles.min.css');
}
rex_view::addJsFile($this->getAssetsUrl('slice_skin.js'));
开发者ID:nilsology,项目名称:slice_ui,代码行数:11,代码来源:boot.php

示例7: foreach

 * @author <a href="http://www.redaxo.org">www.redaxo.org</a>
 *
 * @package redaxo5
 */
$mypage = 'be_style';
/* Addon Parameter */
if (rex::isBackend()) {
    require_once rex_path::addon($mypage, 'extensions/function_extensions.php');
    rex_extension::register('PACKAGES_INCLUDED', 'rex_be_add_page');
    $files = [$this->getPath('vendor/bootstrap/assets/javascripts/bootstrap.js') => $this->getAssetsPath('javascripts/bootstrap.js'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.eot') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.eot'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.svg') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.svg'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.ttf'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.woff') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.woff'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.eot') => $this->getAssetsPath('fonts/fontawesome-webfont.eot'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.svg') => $this->getAssetsPath('fonts/fontawesome-webfont.svg'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.ttf') => $this->getAssetsPath('fonts/fontawesome-webfont.ttf'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.woff') => $this->getAssetsPath('fonts/fontawesome-webfont.woff'), $this->getPath('vendor/font-awesome/fonts/FontAwesome.otf') => $this->getAssetsPath('fonts/FontAwesome.otf')];
    foreach ($files as $source => $destination) {
        if (!file_exists($destination)) {
            rex_file::copy($source, $destination);
        }
    }
    rex_extension::register('PACKAGES_INCLUDED', function () {
        if (rex::getUser() && $this->getProperty('compile')) {
            $compiler = new rex_scss_compiler();
            $scss_files = rex_extension::registerPoint(new rex_extension_point('BE_STYLE_SCSS_FILES', [$this->getPath('scss/master.scss')]));
            $compiler->setScssFile($scss_files);
            //$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/bootstrap.js'));
}
开发者ID:skerbis,项目名称:redaxo,代码行数:31,代码来源:boot.php

示例8:

}
if (rex::isBackend()) {
    rex_view::addCssFile($this->getAssetsUrl('slice_ui.css'));
    rex_view::addCssFile($this->getAssetsUrl('jquery-ui.datepicker.css'));
    rex_view::addJsFile($this->getAssetsUrl('slice_ui.js'));
    rex_view::addJsFile($this->getAssetsUrl('jquery-ui.datepicker.js'));
}
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();
开发者ID:nilsology,项目名称:slice_ui,代码行数:31,代码来源:boot.php

示例9: markdown

<?php

/**
 * This file is part of the Url package.
 *
 * @author (c) Thomas Blum <thomas@addoff.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
/**
 * Convert some text to Markdown...
 */
function markdown($text)
{
    return (new ParsedownExtra())->text($text);
}
if (rex::isBackend()) {
    rex_view::addCssFile($this->getAssetsUrl('dao.css'));
    rex_view::addJsFile($this->getAssetsUrl('vendor/redips/redips-table.js'));
    if (rex_be_controller::getCurrentPage() == 'dao_var/readme') {
        rex_view::addJsFile($this->getAssetsUrl('prism.js'));
    }
}
开发者ID:tbaddade,项目名称:redaxo_dao_var,代码行数:24,代码来源:boot.php

示例10:

<?php

/**
 * Mediapool Addon.
 *
 * @author jan[dot]kristinus[at]redaxo[dot]de Jan Kristinus
 *
 * @package redaxo5
 *
 * @var rex_addon $this
 */
$mypage = 'mediapool';
rex_complex_perm::register('media', 'rex_media_perm');
if (rex::isBackend() && rex::getUser()) {
    require_once __DIR__ . '/functions/function_rex_mediapool.php';
    rex_view::addJsFile($this->getAssetsUrl('mediapool.js'));
    rex_view::setJsProperty('imageExtensions', $this->getProperty('image_extensions'));
}
开发者ID:staabm,项目名称:redaxo,代码行数:18,代码来源:boot.php

示例11: foreach

<?php

/**
 * yform
 * @author jan.kristinus[at]redaxo[dot]org Jan Kristinus
 * @author <a href="http://www.yakamara.de">www.yakamara.de</a>
 *
 * @var rex_plugin $this
 */
rex_yform::addTemplatePath(rex_path::plugin('yform', 'manager', 'ytemplates'));
if (rex::isBackend() && rex::getUser()) {
    rex_view::addJsFile($this->getAssetsUrl('manager.js'));
    $tables = rex_yform_manager_table::getAll();
    $pages = [];
    foreach ($tables as $table) {
        $table_perm = 'yform[table:' . $table['table_name'] . ']';
        if ($table['status'] == 1 && $table['hidden'] != 1) {
            $be_page = new rex_be_page_main('yform_tables', $table['table_name'], $table['name']);
            $be_page->setHref('index.php?page=yform/manager/data_edit&table_name=' . $table['table_name']);
            $be_page->setIcon('rex-icon rex-icon-module');
            $be_page->setRequiredPermissions([$table_perm]);
            if (rex_request('page', 'string') == 'yform/manager/data_edit' && rex_request('table_name', 'string') == $table['table_name']) {
                $be_page->setIsActive();
                $main_page = $this->getAddon()->getProperty('page');
                $main_page['isActive'] = false;
                $this->getAddon()->setProperty('page', $main_page);
            }
            $pages[] = $be_page;
            // TODO rechte noch verfügbar machen
        }
    }
开发者ID:VIEWSION,项目名称:redaxo_yform,代码行数:31,代码来源:boot.php

示例12: rex_request

rex_perm::register('copyContent[]', null, rex_perm::OPTIONS);
rex_perm::register('publishArticle[]', null, rex_perm::OPTIONS);
rex_perm::register('publishCategory[]', null, rex_perm::OPTIONS);
rex_perm::register('article2startarticle[]', null, rex_perm::OPTIONS);
rex_perm::register('article2category[]', null, rex_perm::OPTIONS);
rex_complex_perm::register('structure', 'rex_structure_perm');
require_once __DIR__ . '/functions/function_rex_url.php';
if (rex_request('article_id', 'int') == 0) {
    rex::setProperty('article_id', rex::getProperty('start_article_id'));
} else {
    $article_id = rex_request('article_id', 'int');
    $article_id = rex_article::get($article_id) ? $article_id : rex::getProperty('notfound_article_id');
    rex::setProperty('article_id', $article_id);
}
if (rex::isBackend() && rex::getUser()) {
    rex_view::addJsFile($this->getAssetsUrl('linkmap.js'));
    rex_extension::register('PAGE_SIDEBAR', function () {
        $category_id = rex_request('category_id', 'int');
        $article_id = rex_request('article_id', 'int');
        $clang = rex_request('clang', 'int');
        $ctype = rex_request('ctype', 'int');
        $category_id = rex_category::get($category_id) ? $category_id : 0;
        $article_id = rex_article::get($article_id) ? $article_id : 0;
        $clang = rex_clang::exists($clang) ? $clang : rex_clang::getStartId();
        // TODO - CHECK PERM
        $context = new rex_context(['page' => 'structure', 'category_id' => $category_id, 'article_id' => $article_id, 'clang' => $clang, 'ctype' => $ctype]);
        // check if a new category was folded
        $category_id = rex_request('toggle_category_id', 'int', -1);
        $category_id = rex_category::get($category_id) ? $category_id : -1;
        $tree = '';
        $tree .= '<div id="rex-sitemap">';
开发者ID:skerbis,项目名称:redaxo,代码行数:31,代码来源:boot.php

示例13:

<?php

if (rex::isBackend()) {
    rex_view::addCssFile($this->getAssetsUrl('slice_footer.css'));
    rex_view::addJsFile($this->getAssetsUrl('slice_footer.js'));
}
rex_extension::register('ADD_AFTER_SLICE', 'slice_footer::editAll');
// slice_footer::extendSliceButtons();
if (strpos(rex_request('page'), 'content/editall') !== false) {
    slice_footer::showForm();
}
if (strpos(rex_request('page'), 'content/delete') !== false) {
    slice_footer::deleteSlices();
}
rex_extension::register('STRUCTURE_CONTENT_BEFORE_SLICES', 'slice_footer::addFooterForm');
rex_extension::register('STRUCTURE_CONTENT_AFTER_SLICES', 'slice_footer::addFooterForm');
开发者ID:nilsology,项目名称:slice_ui,代码行数:16,代码来源:boot.php

示例14: function

 *
 * @author jan.kristinus[at]redaxo[dot]de Jan Kristinus
 * @author <a href="http://www.yakamara.de">www.yakamara.de</a>
 * @author markus[dot]staab[at]redaxo[dot]de Markus Staab
 * @author <a href="http://www.redaxo.org">www.redaxo.org</a>
 *
 * @package redaxo5
 */
$mypage = 'be_style';
/* Addon Parameter */
if (rex::isBackend()) {
    require_once rex_path::addon($mypage, 'extensions/function_extensions.php');
    rex_extension::register('PACKAGES_INCLUDED', 'rex_be_add_page');
    rex_extension::register('PACKAGES_INCLUDED', function () {
        if (rex::getUser() && $this->getProperty('compile')) {
            $compiler = new rex_scss_compiler();
            $scss_files = rex_extension::registerPoint(new rex_extension_point('BE_STYLE_SCSS_FILES', [$this->getPath('scss/master.scss')]));
            $compiler->setScssFile($scss_files);
            //$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::addCssFile($this->getAssetsUrl('css/perfect-scrollbar.min.css'));
    rex_view::addJsFile($this->getAssetsUrl('javascripts/bootstrap.js'));
    rex_view::addJsFile($this->getAssetsUrl('javascripts/perfect-scrollbar.jquery.min.js'));
}
开发者ID:alsahh,项目名称:redaxo,代码行数:31,代码来源:boot.php


注:本文中的rex_view::addJsFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。