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


PHP nggGallery::get_theme_css_file方法代码示例

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


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

示例1: load_styles

 function load_styles()
 {
     // check first the theme folder for a nggallery.css
     if (nggGallery::get_theme_css_file()) {
         wp_enqueue_style('NextGEN', nggGallery::get_theme_css_file(), false, '1.0.0', 'screen');
     } else {
         if ($this->options['activateCSS']) {
             wp_enqueue_style('NextGEN', NGGALLERY_URLPATH . 'css/' . $this->options['CSSfile'], false, '1.0.0', 'screen');
         }
     }
     //	activate Thickbox
     if ($this->options['thumbEffect'] == 'thickbox') {
         wp_enqueue_style('thickbox');
     }
     // activate modified Shutter reloaded if not use the Shutter plugin
     if ($this->options['thumbEffect'] == 'shutter' && !function_exists('srel_makeshutter')) {
         wp_enqueue_style('shutter', NGGALLERY_URLPATH . 'shutter/shutter-reloaded.css', false, '1.3.0', 'screen');
     }
 }
开发者ID:ahsaeldin,项目名称:projects,代码行数:19,代码来源:nggallery.php

示例2: controller

    /**
     * Render the page content.
     *
     * @since 1.9.22
     *
     */
    function controller()
    {
        global $ngg;
        //the directions containing the css files
        if (file_exists(NGG_CONTENT_DIR . "/ngg_styles")) {
            $dir = array(NGGALLERY_ABSPATH . "css", NGG_CONTENT_DIR . "/ngg_styles");
        } else {
            $dir = array(NGGALLERY_ABSPATH . "css");
        }
        //support for legacy location (in theme folder)
        if ($theme_css_exists = file_exists(get_stylesheet_directory() . "/nggallery.css")) {
            $act_cssfile = get_stylesheet_directory() . "/nggallery.css";
        }
        //if someone uses the filter, don't display this page.
        if (!$theme_css_exists && ($set_css_file = nggGallery::get_theme_css_file())) {
            nggGallery::show_error(__('Your CSS file is set by a theme or another plugin.', 'nggallery') . "<br><br>" . __('This CSS file will be applied:', 'nggallery') . "<br>" . $set_css_file);
            return;
        }
        //load all files
        if (!isset($act_cssfile)) {
            $csslist = NGG_Style::ngg_get_cssfiles($dir);
            $act_cssfile = $ngg->options['CSSfile'];
        }
        //get the data from the file
        $act_css_data = NGG_Style::ngg_get_cssfiles_data($act_cssfile);
        $act_css_name = $act_css_data['Name'];
        $act_css_description = $act_css_data['Description'];
        $act_css_author = $act_css_data['Author'];
        $act_css_version = $act_css_data['Version'];
        $act_css_folder = $act_css_data['Folder'];
        // get the content of the file
        $error = !is_file($act_cssfile);
        if (!$error && filesize($act_cssfile) > 0) {
            $f = fopen($act_cssfile, 'r');
            $content = fread($f, filesize($act_cssfile));
            $content = htmlspecialchars($content);
        }
        ?>
		<div class="wrap">
			<div class="bordertitle">
				<?php 
        screen_icon('nextgen-gallery');
        ?>
				<h2><?php 
        _e('Style Editor', 'nggallery');
        ?>
</h2>
				<div class="fileedit-sub">
				<?php 
        if (!$theme_css_exists) {
            //no need if there is a theme css
            ?>
					<div class="alignright">
						<form id="themeselector" name="cssfiles" method="post">
							<?php 
            wp_nonce_field('ngg_style');
            ?>
							<strong><?php 
            _e('Activate and use style sheet:', 'nggallery');
            ?>
</strong>
							<input type="checkbox" name="activateCSS" value="1" <?php 
            checked('1', $ngg->options['activateCSS']);
            ?>
 />							
							<select name="css" id="theme" style="margin: 0pt; padding: 0pt;">
								<?php 
            self::output_css_files_dropdown($csslist, $act_cssfile);
            ?>
							</select>
							<input class="button" type="submit" name="activate" value="<?php 
            _e('Activate', 'nggallery');
            ?>
 &raquo;" class="button" />
						</form>
					</div>
				<?php 
        }
        ?>
				<?php 
        if (!is_multisite() || is_super_admin()) {
            ?>
					<div class="alignleft">
						<?php 
            $title = '<h3>';
            if (is_writeable($act_cssfile)) {
                $title .= sprintf(__('Editing %s', 'nggallery'), $act_css_name);
            } else {
                $title .= sprintf(__('Browsing %s', 'nggallery'), $act_css_name);
            }
            if ($theme_css_exists) {
                $title .= ' ' . __('(from the theme folder)', 'nggallery');
            }
            $title .= '</h3>';
//.........这里部分代码省略.........
开发者ID:valerol,项目名称:korpus,代码行数:101,代码来源:style.php

示例3: load_styles

 /**
  * Load styles based on options defined
  * 20150106: added style for Qunit
  */
 function load_styles()
 {
     //Notice stylesheet selection has this priority:
     //1-sytlesheet loaded from filter ngg_load_stylesheet
     //2-nggalery.css on folder's current theme
     //3-active stylesheet defined on styles.
     if ($css_file = nggGallery::get_theme_css_file()) {
         wp_enqueue_style('NextGEN', $css_file, false, '1.0.0', 'screen');
         //load the framework
         wp_enqueue_style('NextCellent-Framework', NGGALLERY_URLPATH . 'css/framework-min.css', false, '1.0.1', 'screen');
     } elseif ($this->options['activateCSS']) {
         //convert the path to an URL
         $replace = content_url();
         $path = str_replace(NGG_CONTENT_DIR, $replace, $this->options['CSSfile']);
         wp_enqueue_style('NextGEN', $path, false, '1.0.0', 'screen');
         //load the framework
         wp_enqueue_style('NextCellent-Framework', NGGALLERY_URLPATH . 'css/framework-min.css', false, '1.0.1', 'screen');
     }
     //	activate Thickbox
     if ($this->options['thumbEffect'] == 'thickbox') {
         wp_enqueue_style('thickbox');
     }
     // activate modified Shutter reloaded if not use the Shutter plugin
     if ($this->options['thumbEffect'] == 'shutter' && !function_exists('srel_makeshutter')) {
         wp_enqueue_style('shutter', NGGALLERY_URLPATH . 'shutter/shutter-reloaded.css', false, '1.3.4', 'screen');
     }
     // add qunit style if activated. I put 1.0.0 as formula, but it would mean nothing.
     $nxc = isset($_GET['nextcellent']) ? $_GET['nextcellent'] : "";
     if ($nxc) {
         wp_enqueue_style("qunit", NGGALLERY_URLPATH . "css/qunit-1.16.0.css", false, '1.0.0', 'screen');
     }
 }
开发者ID:valerol,项目名称:korpus,代码行数:36,代码来源:nggallery.php

示例4: nggallery_wpmu_setup

function nggallery_wpmu_setup()
{
    //to be sure
    if (!is_super_admin()) {
        die('You are not allowed to call this page.');
    }
    $messagetext = '';
    // get the options
    $ngg_options = get_site_option('ngg_options');
    if (isset($_POST['updateoption'])) {
        check_admin_referer('ngg_wpmu_settings');
        // get the hidden option fields, taken from WP core
        if ($_POST['page_options']) {
            $options = explode(',', stripslashes($_POST['page_options']));
        }
        if ($options) {
            foreach ($options as $option) {
                $option = trim($option);
                $value = false;
                if (isset($_POST[$option])) {
                    $value = trim($_POST[$option]);
                    if ($value === "true") {
                        $value = true;
                    }
                    if (is_numeric($value)) {
                        $value = (int) $value;
                    }
                }
                //		$value = sanitize_option($option, $value); // This does stripslashes on those that need it
                $ngg_options[$option] = $value;
            }
        }
        // the path should always end with a slash
        $ngg_options['gallerypath'] = trailingslashit($ngg_options['gallerypath']);
        update_site_option('ngg_options', $ngg_options);
        var_dump($ngg_options);
        $messagetext = __('Update successfully', 'nggallery');
    }
    global $ngg;
    //the directions containing the css files
    if (file_exists(NGG_CONTENT_DIR . "/ngg_styles")) {
        $dir = array(NGGALLERY_ABSPATH . "css", NGG_CONTENT_DIR . "/ngg_styles");
    } else {
        $dir = array(NGGALLERY_ABSPATH . "css");
    }
    //support for legacy location (in theme folder)
    if ($theme_css_exists = file_exists(get_stylesheet_directory() . "/nggallery.css")) {
        $act_cssfile = get_stylesheet_directory() . "/nggallery.css";
    }
    //if someone uses the filter, don't display this page.
    if (!$theme_css_exists && ($set_css_file = nggGallery::get_theme_css_file())) {
        nggGallery::show_error(__('Your CSS file is set by a theme or another plugin.', 'nggallery') . "<br><br>" . __('This CSS file will be applied:', 'nggallery') . "<br>" . $set_css_file);
        return;
    }
    //load all files
    if (!isset($act_cssfile)) {
        $csslist = NGG_Style::ngg_get_cssfiles($dir);
        $act_cssfile = $ngg->options['CSSfile'];
    }
    // message windows
    if (!empty($messagetext)) {
        echo '<!-- Last Action --><div id="message" class="updated fade"><p>' . $messagetext . '</p></div>';
    }
    ?>

	<div class="wrap">
		<h2><?php 
    _e('Network Options', 'nggallery');
    ?>
</h2>
		<form name="generaloptions" method="post">
			<?php 
    wp_nonce_field('ngg_wpmu_settings');
    ?>
			<input type="hidden" name="page_options" value="silentUpgrade,gallerypath,wpmuQuotaCheck,wpmuZipUpload,wpmuImportFolder,wpmuStyle,wpmuRoles,wpmuCSSfile" />
			<table class="form-table">
				<tr>
					<th><label for="gallerypath"><?php 
    _e('Gallery path', 'nggallery');
    ?>
</label></th>
					<td>
						<input type="text" size="50" name="gallerypath" id="gallerypath" value="<?php 
    echo $ngg_options['gallerypath'];
    ?>
">
						<p class="description">
							<?php 
    _e('This is the default path for all blogs. With the placeholder %BLOG_ID% you can organize the folder structure better.', 'nggallery');
    ?>
							<?php 
    echo sprintf(__('The default setting should be %s.', 'nggallery'), '<code>wp-content/blogs.dir/%BLOG_ID%/files/</code>');
    ?>
						</p>
					</td>
				</tr>
				<tr>
					<th><?php 
    _e('Silent database upgrade', 'nggallery');
    ?>
//.........这里部分代码省略.........
开发者ID:valerol,项目名称:korpus,代码行数:101,代码来源:wpmu.php


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