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


PHP includeCss函数代码示例

本文整理汇总了PHP中includeCss函数的典型用法代码示例。如果您正苦于以下问题:PHP includeCss函数的具体用法?PHP includeCss怎么用?PHP includeCss使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: mm_widget_template

/**
 * mm_widget_template
 * @version 1.0 (2013-01-01)
 *
 * A template for creating new widgets
 *
 * @uses ManagerManager plugin 0.4.
 *
 * @link http://
 *
 * @copyright 2013
 */
function mm_widget_template($fields, $other_param = 'defaultValue', $roles = '', $templates = '')
{
    global $modx, $mm_fields, $mm_current_page;
    $e =& $modx->event;
    if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) {
        // Your output should be stored in a string, which is outputted at the end
        // It will be inserted as a Javascript block (with jQuery), which is executed on document ready
        // We always put a JS comment, which makes debugging much easier
        $output = "//  -------------- mm_widget_template :: Begin ------------- \n";
        // if we've been supplied with a string, convert it into an array
        $fields = makeArray($fields);
        // You might want to check whether the current page's template uses the TVs that have been
        // supplied, to save processing page which don't contain them
        $count = tplUseTvs($mm_current_page['template'], $fields);
        if ($count == false) {
            return;
        }
        // We have functions to include JS or CSS external files you might need
        // The standard ModX API methods don't work here
        $output .= includeJs('assets/plugins/managermanager/widgets/template/javascript.js');
        $output .= includeCss('assets/plugins/managermanager/widgets/template/styles.css');
        // Do something for each of the fields supplied
        foreach ($fields as $targetTv) {
            // If it's a TV, we may need to map the field name, to what it's ID is.
            // This can be obtained from the mm_fields array
            $tv_id = $mm_fields[$targetTv]['fieldname'];
        }
        //JS comment for end of widget
        $output .= "//  -------------- mm_widget_template :: End ------------- \n";
        // Send the output to the browser
        $e->output($output . "\n");
    }
}
开发者ID:Fiberalph,项目名称:evolution-jp,代码行数:45,代码来源:!template.php

示例2: mm_widget_colors

/**
 * mm_widget_colors
 * @version 1.1 (2012-11-13)
 *
 * Adds a color selection widget to the specified TVs.
 *
 * @uses ManagerManager plugin 0.4.
 *
 * @link http://code.divandesign.biz/modx/mm_widget_colors/1.1
 *
 * @copyright 2012
 */
function mm_widget_colors($fields, $default = '#ffffff', $roles = '', $templates = '')
{
    global $modx, $mm_fields, $mm_current_page;
    $e =& $modx->event;
    if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) {
        $output = '';
        // if we've been supplied with a string, convert it into an array
        $fields = makeArray($fields);
        // Which template is this page using?
        if (isset($content['template'])) {
            $page_template = $content['template'];
        } else {
            // If no content is set, it's likely we're adding a new page at top level.
            // So use the site default template. This may need some work as it might interfere with a default template set by MM?
            $page_template = $modx->config['default_template'];
        }
        // Does this page's template use any of these TVs? If not, quit.
        $tv_count = tplUseTvs($mm_current_page['template'], $fields);
        if ($tv_count === false) {
            return;
        }
        // Insert some JS
        $output .= includeJs($modx->config['base_url'] . 'assets/plugins/managermanager/widgets/colors/farbtastic.js');
        // Insert some CSS
        $output .= includeCss($modx->config['base_url'] . 'assets/plugins/managermanager/widgets/colors/farbtastic.css');
        // Go through each of the fields supplied
        foreach ($fields as $tv) {
            $tv_id = $mm_fields[$tv]['fieldname'];
            $output .= '
				// ----------- Color widget for  ' . $tv_id . '  --------------
				$j("#' . $tv_id . '").css("background-image","none");
				$j("#' . $tv_id . '").after(\'<div id="colorpicker' . $tv_id . '"></div>\');
				if ($j("#' . $tv_id . '").val() == ""){
					$j("#' . $tv_id . '").val("' . $default . '");
				}
				$j("#colorpicker' . $tv_id . '").farbtastic("#' . $tv_id . '");
				$j("#colorpicker' . $tv_id . '").mouseup(function(){
					// mark the document as dirty, or the value wont be saved
					$j("#' . $tv_id . '").trigger("change");
				});
				';
        }
        $e->output($output . "\n");
    }
}
开发者ID:Fiberalph,项目名称:evolution-jp,代码行数:57,代码来源:colors.php

示例3: mm_widget_template

function mm_widget_template($fields, $other_param = 'defaultValue', $roles = '', $templates = '')
{
    global $modx, $content, $mm_fields;
    $e =& $modx->Event;
    if (useThisRule($roles, $templates)) {
        // Your output should be stored in a string, which is outputted at the end
        // It will be inserted as a Javascript block (with jQuery), which is executed on document ready
        $output = '';
        // if we've been supplied with a string, convert it into an array
        $fields = makeArray($fields);
        // You might want to check whether the current page's template uses the TVs that have been
        // supplied, to save processing page which don't contain them
        // Which template is this page using?
        if (isset($content['template'])) {
            $page_template = $content['template'];
        } else {
            // If no content is set, it's likely we're adding a new page at top level.
            // So use the site default template. This may need some work as it might interfere with a default template set by MM?
            $page_template = $modx->config['default_template'];
        }
        $count = tplUseTvs($content['template'], $fields);
        if ($count == false) {
            return;
        }
        // We always put a JS comment, which makes debugging much easier
        $output .= "//  -------------- Widget name ------------- \n";
        // We have functions to include JS or CSS external files you might need
        // The standard ModX API methods don't work here
        $output .= includeJs('/assets/plugins/managermanager/widgets/template/javascript.js');
        $output .= includeCss('/assets/plugins/managermanager/widgets/template/styles.css');
        // Do something for each of the fields supplied
        foreach ($fields as $targetTv) {
            // If it's a TV, we may need to map the field name, to what it's ID is.
            // This can be obtained from the mm_fields array
            $tv_id = $mm_fields[$targetTv]['fieldname'];
        }
    }
    // end if
    $e->output($output . "\n");
    // Send the output to the browser
}
开发者ID:myindexlike,项目名称:MODX.plugins,代码行数:41,代码来源:!template.php

示例4: mm_widget_accessdenied

/**
 * mm_widget_accessdenied
 * @version 1.1 (2012-11-13)
 *
 * Close access for some documents by ids.
 * Icon by designmagus.com
 * Originally written by Metaller
 *
 * @uses ManagerManager plugin 0.4.
 *
 * @link http://code.divandesign.biz/modx/mm_widget_accessdenied/1.1
 *
 * @copyright 2012
 */
function mm_widget_accessdenied($ids = '', $message = '', $roles = '')
{
    global $modx, $content;
    $e =& $modx->event;
    if (empty($message)) {
        $message = '<span>Access denied</span>Access to current document closed for security reasons.';
    }
    if ($e->name == 'OnDocFormRender' && useThisRule($roles)) {
        $docid = (int) $_GET[id];
        $ids = makeArray($ids);
        $output = "//  -------------- accessdenied widget include ------------- \n";
        if (in_array($docid, $ids)) {
            $output .= includeCss($modx->config['base_url'] . 'assets/plugins/managermanager/widgets/accessdenied/accessdenied.css');
            $output .= '
			$j("input, div, form[name=mutate]").remove(); // Remove all content from the page
			$j("body").prepend(\'<div id="aback"><div id="amessage">' . $message . '</div></div>\');
			$j("#aback").css({height: $j("body").height()} );';
        }
        $e->output($output . "\n");
    }
}
开发者ID:Fiberalph,项目名称:evolution-jp,代码行数:35,代码来源:accessdenied.php

示例5: isLoggedin

isLoggedin();
$authorise = isAuthorize();
$filterValue = "";
if (isset($_GET['Submit'])) {
    if (isset($_GET['cboFilter'])) {
        $filterValue = $_GET['cboFilter'];
    }
} else {
    $filterValue = "";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <?php 
includeCss();
includeJs();
?>
    <title>
      List Postoffice
    </title>
  </head>
  <body>
    <?php 
showHeader();
showLeftColLayout();
showLeftCol($authorise);
showMdlColLayout();
showMdlCol($authorise, $filterValue);
showFooter();
?>
开发者ID:anishsheela,项目名称:Zyxware-Health-Monitoring-System,代码行数:31,代码来源:listpostoffice.php

示例6: mm_widget_tags

function mm_widget_tags($fields, $delimiter = ',', $source = '', $display_count = false, $roles = '', $templates = '')
{
    global $modx, $content, $mm_fields;
    $e =& $modx->Event;
    if (useThisRule($roles, $templates)) {
        $output = '';
        // if we've been supplied with a string, convert it into an array
        $fields = makeArray($fields);
        // And likewise for the data source (if supplied)
        $source = empty($source) ? $fields : makeArray($source);
        // Which template is this page using?
        if (isset($content['template'])) {
            $page_template = $content['template'];
        } else {
            // If no content is set, it's likely we're adding a new page at top level.
            // So use the site default template. This may need some work as it might interfere with a default template set by MM?
            $page_template = $modx->config['default_template'];
        }
        // Does this page's template use any of these TVs? If not, quit.
        $field_tvs = tplUseTvs($page_template, $fields);
        if ($field_tvs == false) {
            return;
        }
        $source_tvs = tplUseTvs($page_template, $source);
        if ($source_tvs == false) {
            return;
        }
        // Insert some JS  and a style sheet into the head
        $output .= "//  -------------- Tag widget include ------------- \n";
        $output .= includeJs($modx->config['base_url'] . 'assets/plugins/managermanager/widgets/tags/tags.js');
        $output .= includeCss($modx->config['base_url'] . 'assets/plugins/managermanager/widgets/tags/tags.css');
        // Go through each of the fields supplied
        foreach ($fields as $targetTv) {
            $tv_id = $mm_fields[$targetTv]['fieldname'];
            // Make an SQL friendly list of fields to look at:
            //$escaped_sources = array();
            //foreach ($source as $s) {
            //$s=substr($s,2,1);
            //	$escaped_sources[] = "'".$s."'";
            //}
            $sql_sources = implode(',', $source_tvs[0]);
            // Get the list of current values for this TV
            $sql = "SELECT `value` FROM " . $modx->getFullTableName('site_tmplvar_contentvalues') . " WHERE tmplvarid IN (" . $sql_sources . ")";
            $result = $modx->dbQuery($sql);
            $all_docs = $modx->db->makeArray($result);
            $foundTags = array();
            foreach ($all_docs as $theDoc) {
                $theTags = explode($delimiter, $theDoc['value']);
                foreach ($theTags as $t) {
                    $foundTags[trim($t)]++;
                }
            }
            // Sort the TV values (case insensitively)
            uksort($foundTags, 'strcasecmp');
            $lis = '';
            foreach ($foundTags as $t => $c) {
                $lis .= '<li title="Used ' . $c . ' times">' . jsSafe($t) . ($display_count ? ' (' . $c . ')' : '') . '</li>';
            }
            $html_list = '<ul class="mmTagList" id="' . $tv_id . '_tagList">' . $lis . '</ul>';
            // Insert the list of tags after the field
            $output .= '
				//  -------------- Tag widget for ' . $targetTv . ' (' . $tv_id . ') --------------
				$j("#' . $tv_id . '").after(\'' . $html_list . '\');
				';
            // Initiate the tagCompleter class for this field
            $output .= 'var ' . $tv_id . '_tags = new TagCompleter("' . $tv_id . '", "' . $tv_id . '_tagList", "' . $delimiter . '"); ';
        }
    }
    $e->output($output . "\n");
}
开发者ID:myindexlike,项目名称:MODX.plugins,代码行数:70,代码来源:tags.php

示例7: mm_ddMaxLength

/**
 * mm_ddMaxLength
 * @version 1.0.1 (2012-01-13)
 *
 * Позволяет ограничить количество вводимых символов в TV.
 *
 * @copyright 2012, DivanDesign
 * http://www.DivanDesign.ru
 */
function mm_ddMaxLength($tvs = '', $roles = '', $templates = '', $length = 150)
{
    global $modx, $content;
    $e =& $modx->Event;
    if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) {
        $output = '';
        $site = $modx->config['site_url'];
        // Which template is this page using?
        if (isset($content['template'])) {
            $page_template = $content['template'];
        } else {
            // If no content is set, it's likely we're adding a new page at top level.
            // So use the site default template. This may need some work as it might interfere with a default template set by MM?
            $page_template = $modx->config['default_template'];
        }
        // 		$tvsMas = array();
        // Does this page's template use any image or file or text TVs?
        $tvs = tplUseTvs($page_template, $tvs, 'text,textarea');
        // 		$tvsTemp = tplUseTvs($page_template, $tvs, 'text');
        // 		if ($tvsTemp){
        // 			foreach($tvsTemp as $v){
        // 				$v['type'] = 'text';
        // 				array_push($tvsMas,$v);
        // 			}
        // 		}
        // 		if (count($tvsMas) == 0){
        // 			return;
        // 		}
        if ($tvs == false) {
            return;
        }
        $output .= "// ---------------- mm_ddMaxLength :: Begin ------------- \n";
        //General functions
        $output .= includeJs($site . 'assets/plugins/managermanager/widgets/ddmaxlength/jquery.ddmaxlength-1.0.min.js');
        $output .= includeCss($site . 'assets/plugins/managermanager/widgets/ddmaxlength/ddmaxlength.css');
        foreach ($tvs as $tv) {
            $output .= '
$j("#tv' . $tv['id'] . '").addClass("ddMaxLengthField").each(function(){
	$j(this).parent().append("<div class=\\"ddMaxLengthCount\\"><span></span></div>");
}).ddMaxLength({
	max: ' . $length . ',
	containerSelector: "div.ddMaxLengthCount span",
	warningClass: "maxLenghtWarning"
});
			';
        }
        $output .= '
$j("#mutate").submit(function(){
	var ddErrors = new Array();
	$j("div.ddMaxLengthCount span").each(function(){
		var $this = $j(this), field = $this.parents(".ddMaxLengthCount:first").parent().find(".ddMaxLengthField");
		if (parseInt($this.text()) < 0){
			field.addClass("maxLenghtErrorField").focus(function(){
				field.removeClass("maxLenghtErrorField");
			});
			ddErrors.push(field.parents("tr").find("td:first-child .warning").text());
		}
	});

	if(ddErrors.length > 0){
		alert("Некорректно заполнены поля: " + ddErrors.join(","));
		
		return false;
	} else {
		return true;
	}
});
		';
        $output .= "\n// ---------------- mm_ddMaxLength :: End -------------";
        $e->output($output . "\n");
    }
}
开发者ID:Fiberalph,项目名称:evolution-jp,代码行数:81,代码来源:ddmaxlength.php

示例8: mm_ddMultipleFields

/** 
 * mm_ddMultipleFields
 * @version 4.3.4 (2012-12-20)
 * 
 * Позволяет добавлять произвольное количество полей (TV) к одному документу (записывается в одно через разделители).
 *
 * @param tvs {comma separated string} - Имена TV, для которых необходимо применить виджет.
 * @param roles {comma separated string} - Роли, для которых необходимо применить виждет, пустое значение — все роли. По умолчанию: ''.
 * @param templates {comma separated string} - Id шаблонов, для которых необходимо применить виджет, пустое значение — все шаблоны. По умолчанию: ''.
 * @param coloumns {comma separated string} - Типы колонок (field — колонка типа поля, text — текстовая колонка, id — скрытое поле с уникальным идентификатором, select — список с выбором значений (см. coloumnsData)). По умолчанию: 'field'.
 * @param coloumnsTitle {comma separated string} - Названия колонок. По умолчанию: ''.
 * @param colWidth {comma separated string} - Ширины колонок (может быть задана одна ширина). По умолчанию: 180;
 * @param splY {string} - Разделитель между строками. По умолчанию: '||'.
 * @param splX {string} - Разделитель между колонками. По умолчанию: '::'.
 * @param imgW {integer} - Максимальная ширина превьюшки. По умолчанию: 300.
 * @param imgH {integer} - Максимальная высота превьюшки. По умолчанию: 100.
 * @param minRow {integer} - Минимальное количество строк. По умолчанию: 0.
 * @param maxRow {integer} - Максимальное количество строк. По умолчанию: 0 (без лимита).
 * @param coloumnsData {separated string} - Список возможных значений для полей в формате json, через ||. По умолчанию: ''.
 * 
 * @link http://code.divandesign.biz/modx/mm_ddmultiplefields/4.3.4
 * 
 * @copyright 2012, DivanDesign
 * http://www.DivanDesign.ru
 */
function mm_ddMultipleFields($tvs = '', $roles = '', $templates = '', $coloumns = 'field', $coloumnsTitle = '', $colWidth = '180', $splY = '||', $splX = '::', $imgW = 300, $imgH = 100, $minRow = 0, $maxRow = 0, $coloumnsData = '')
{
    global $modx, $content, $_lang;
    $e =& $modx->Event;
    if ($e->name == 'OnDocFormRender' && useThisRule($roles, $templates)) {
        $output = '';
        $site = $modx->config['site_url'];
        $widgetDir = $site . 'assets/plugins/managermanager/widgets/ddmultiplefields/';
        if ($coloumnsData) {
            $coloumnsDataTemp = explode('||', $coloumnsData);
            $coloumnsData = array();
            foreach ($coloumnsDataTemp as $value) {
                //Евалим знение и записываем результат или исходное значени
                $eval = @eval($value);
                $coloumnsData[] = $eval ? addslashes(json_encode($eval)) : $value;
            }
            //Сливаем в строку, что бы передать на клиент
            $coloumnsData = implode('||', $coloumnsData);
        }
        //Стиль превью изображения
        $stylePrewiew = "max-width:{$imgW}px; max-height:{$imgH}px; margin: 4px 0; cursor: pointer;";
        // Which template is this page using?
        if (isset($content['template'])) {
            $page_template = $content['template'];
        } else {
            // If no content is set, it's likely we're adding a new page at top level.
            // So use the site default template. This may need some work as it might interfere with a default template set by MM?
            $page_template = $modx->config['default_template'];
        }
        $tvsMas = array();
        // Does this page's template use any image or file or text TVs?
        $tvsTemp = tplUseTvs($page_template, $tvs, 'image');
        if ($tvsTemp) {
            foreach ($tvsTemp as $v) {
                $v['type'] = 'image';
                array_push($tvsMas, $v);
            }
        }
        $tvsTemp = tplUseTvs($page_template, $tvs, 'file');
        if ($tvsTemp) {
            foreach ($tvsTemp as $v) {
                $v['type'] = 'file';
                array_push($tvsMas, $v);
            }
        }
        $tvsTemp = tplUseTvs($page_template, $tvs, 'text');
        if ($tvsTemp) {
            foreach ($tvsTemp as $v) {
                $v['type'] = 'text';
                array_push($tvsMas, $v);
            }
        }
        if (count($tvsMas) == 0) {
            return;
        }
        $output .= "// ---------------- mm_ddMultipleFields :: Begin ------------- \n";
        //General functions
        $output .= '
//Если ui-sortable ещё не подключён, подключим
if (!$j.ui || !$j.ui.sortable){' . includeJs($widgetDir . 'jquery-ui.custom.min.js') . '}

//Проверяем на всякий случай (если вдруг вызывается пару раз)
if (!ddMultiple){

' . includeCss($widgetDir . 'ddmultiplefields.css') . '
var ddMultiple = {
	//Обновляет мульти-поле, берёт значение из оригинального поля
	updateField: function(id){
		//Если есть текущее поле
		if (ddMultiple[id].currentField){
			//Задаём значение текущему полю (берём у оригинального поля), запускаем событие изменения
			ddMultiple[id].currentField.val($j.trim($j("#"+id).val())).trigger("change.ddEvents");
			//Забываем текущее поле (ибо уже обработали)
			ddMultiple[id].currentField = false;
		}
//.........这里部分代码省略.........
开发者ID:Fiberalph,项目名称:evolution-jp,代码行数:101,代码来源:ddmultiplefields.php


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