本文整理汇总了PHP中addCSS函数的典型用法代码示例。如果您正苦于以下问题:PHP addCSS函数的具体用法?PHP addCSS怎么用?PHP addCSS使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addCSS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
function add($file)
{
global $scripts, $base;
$f = "{$base}/{$file}.vo..out.js";
if (file_exists($f)) {
$scripts[] = "<script src='{$f}'></script>";
}
addCSS($file);
}
示例2: addTips
function addTips()
{
global $added_tips;
if ($added_tips == false) {
$added_tips = true;
$t = TipsJS();
addScript($t);
$tcss = TipsCSS();
addCSS($tcss);
}
}
示例3: allCSS
function allCSS()
{
$toret = "";
$conf = new Config();
if ($dh = opendir($conf->cssfolder)) {
while (($file = readdir($dh)) !== false) {
if (is_file($conf->cssfolder . '/' . $file) && $file != '.' && $file != '..') {
echo $toret .= addCSS($file);
}
}
closedir($dh);
}
return $toret;
}
示例4: renderInterfacesStats
function renderInterfacesStats($object_id)
{
global $nextorder;
global $port_use_age;
addCSS("/* Live Interfaces */\n\t\t.text_green { color: #00cc00; }\n\t\t.text_yellow { color: #ff9900; }\n\t\t.text_red { color: #ff0000; }", TRUE);
startPortlet('Interfaces statistics');
//get data: show version
try {
$uptime = queryDevice($object_id, 'getuptime');
} catch (RackTablesError $e) {
}
echo "<table width='100%'><tr>";
if (permitted(NULL, NULL, 'get_link_status')) {
//get data: show interfaces
try {
$interfaces = queryDevice($object_id, 'getinterfaces');
} catch (RackTablesError $e) {
}
if (!empty($interfaces)) {
$last_reboot = time_convert($uptime);
echo "<td";
echo $last_reboot < $port_use_age ? " class='text_red'>" : $last_reboot > 262080 ? " class='text_green'>" : ">";
echo $uptime . "</tr>";
echo "<table width='80%' class='widetable' cellspacing=0 cellpadding='5px' align='center'><tr><th>Port<th>Link status<th>Last input<th>Last clear<th>Input packets<th>Output packets<th>Description</tr>";
$order = 'even';
foreach ($interfaces as $pn => $int) {
echo "<tr class='row_{$order}'>";
$order = $nextorder[$order];
echo '<td>' . $pn . '<td';
echo $int['status'] == "connected" ? " class='text_green'>" : ">";
echo $int['status'] . '<td';
echo time_convert($int['last']) > $port_use_age ? " class='text_yellow'>" : ">";
echo $int['last'] . '<td';
echo time_convert($int['clear']) > 0 ? time_convert($int['clear']) < $port_use_age ? " class='text_red'>" : ">" : ">";
echo $int['clear'];
echo '<td>' . $int['in_pkts'];
echo '<td>' . $int['out_pkts'];
echo '<td>' . $int['desc'];
echo '</tr>';
}
echo "</table></td>";
}
}
echo "</td></tr></table>";
finishPortlet();
}
示例5: switchportInfoJS
function switchportInfoJS($object_id)
{
$available_ops = array('link' => array('op' => 'get_link_status', 'gw' => 'getportstatus'), 'conf' => array('op' => 'get_port_conf', 'gw' => 'get8021q'), 'mac' => array('op' => 'get_mac_list', 'gw' => 'getmaclist'), 'portmac' => array('op' => 'get_port_mac_list', 'gw' => 'getportmaclist'));
$breed = detectDeviceBreed($object_id);
$allowed_ops = array();
foreach ($available_ops as $prefix => $data) {
if (permitted('object', 'liveports', $data['op']) and validBreedFunction($breed, $data['gw'])) {
$allowed_ops[] = $prefix;
}
}
addJS('js/jquery.thumbhover.js');
addCSS('css/jquery.contextmenu.css');
addJS('js/jquery.contextmenu.js');
addJS("enabled_elements = " . json_encode($allowed_ops), TRUE);
addJS('js/portinfo.js');
}
示例6: renderCustomReport
//.........这里部分代码省略.........
$sTemp .= $port['name'] . ': ' . $port['remote_object_name'];
if (trim($port['cableid']) != '') {
$sTemp .= ' Cable ID: ' . $port['cableid'];
}
$sTemp .= ' ';
}
$sTemp = trim($sTemp);
array_push($aCSVRow, $sTemp);
}
if (isset($_POST['Containers'])) {
$sTemp = '';
foreach (getObjectContainerList($Result['id']) as $key => $aDetails) {
$sTemp .= trim($aDetails['container_name']) . ' ';
}
$sTemp = trim($sTemp);
array_push($aCSVRow, $sTemp);
}
if (isset($_POST['Childs'])) {
$sTemp = '';
foreach (getObjectChildObjectList($Result['id']) as $key => $aDetails) {
$sTemp .= trim($aDetails['object_name']) . ' ';
}
$sTemp = trim($sTemp);
array_push($aCSVRow, $sTemp);
}
fputcsv($outstream, $aCSVRow, $csvDelimiter);
}
fclose($outstream);
exit(0);
# Exit normally after send CSV to browser
}
echo '<h2>Custom report</h2><ul>';
// Load stylesheet and jquery scripts
addCSS('css/extensions/style.css');
addJS('js/extensions/saveFormValues.js');
addJS('js/extensions/jquery-latest.js');
addJS('js/extensions/jquery.tablesorter.js');
addJS('js/extensions/picnet.table.filter.min.js');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
echo '<a href="#" class="show_hide">Show/hide search form</a><br/><br/>';
}
echo '<div class="searchForm">';
echo '<form method="post" name="searchForm">';
echo '<table class="searchTable">
<tr>
<th>Object Type</th>
<th>Common Values</th>
<th>Attributes</th>
<th>Tags</th>
<th>Misc</th>
</tr>
<tr>';
echo '<td valign="top">
<table class="searchTable">';
$i = 0;
foreach ($phys_typelist as $objectTypeID => $sName) {
if ($i % 2) {
echo '<tr class="odd">';
} else {
echo '<tr>';
}
echo ' <td>
<input type="checkbox" name="objectIDs[]" value="' . $objectTypeID . '"';
if (isset($_POST['objectIDs']) && in_array($objectTypeID, $_POST['objectIDs'])) {
echo ' checked="checked"';
}
示例7: renderSearchNewIP4Range
function renderSearchNewIP4Range()
{
global $pTable;
// prepare $cellfilter
$cellfilter = getCellFilter();
if ($cellfilter['is_empty'] || !isset($_REQUEST['cfp'])) {
if (defined('SPARE_SEARCH_PREDICATE') && isset($pTable[SPARE_SEARCH_PREDICATE])) {
$_REQUEST['cfp'] = array(SPARE_SEARCH_PREDICATE);
$cellfilter = getCellFilter();
}
}
$mask = NULL;
if (!empty($_REQUEST['pref_len'])) {
$mask = intval($_REQUEST['pref_len']);
}
$nets = array();
foreach (filterCellList(listCells('ipv4net'), $cellfilter['expression']) as $net) {
if (!isset($mask)) {
$nets[] = $net;
} elseif ($net['mask'] <= $mask) {
$is_aggregate = FALSE;
foreach ($net['atags'] as $atag) {
if ($atag['tag'] == '$aggregate') {
$is_aggregate = TRUE;
} elseif (preg_match('/^\\$spare_(\\d+)$/', $atag['tag'], $m) && $mask >= $m[1]) {
$nets[] = $net;
continue 2;
}
}
if (!$is_aggregate) {
$nets[] = $net;
}
}
}
$filter = getOutputOf('renderCellFilterPortlet', $cellfilter, 'ipv4net', $nets);
echo '<table width="100%"><tr valign=top>';
echo '<td>';
startPortlet("Results (" . count($nets) . ")");
echo '<ul class="spare-nets">';
foreach ($nets as $net) {
echo '<li>';
renderNetCellForAlloc($net, $mask);
echo '</li>';
}
echo '</ul>';
finishPortlet();
echo '</td>';
echo '<td width="33%">';
echo preg_replace_callback('/(<form[^<>]*>)/', 'generatePrefixLengthInput', $filter);
echo '</td>';
echo '</tr></table>';
addCSS(<<<END
ul.spare-nets {
\tlist-style: none;
\tpadding: 0px;
}
ul.spare-nets li {
\tmargin: 5px 0px;
}
END
, TRUE);
}
示例8: snmplive_tabhandler
function snmplive_tabhandler($object_id)
{
addCSS(<<<ENDCSS
.ifoperstatus-default { background-color:#ddd; }
.ifoperstatus-1, .ifoperstatus-up { background-color:#00ff00; }
.ifoperstatus-2, .ifoperstatus-down { background-color:#ff0000; }
.ifoperstatus-3, .ifoperstatus-testing { background-color:#ffff66; }
.ifoperstatus-4, .ifoperstatus-unknown { background-color:#ffffff; }
.ifoperstatus-5, .ifoperstatus-dormant { background-color:#90bcf5; }
.ifoperstatus-6, .ifoperstatus-notPresent { }
.ifoperstatus-7, .ifoperstatus-lowerLayerDown { }
.port-groups { border-spacing:1px;display:table; }
.port-group { display:table-cell;border:3px solid #000;background-color:#c0c0c0; }
.port-column { display:table-cell;position:relative; }
.port { position:relative;width:42px;height:100px;border:2px solid #000;overflow:hidden; }
.port-pos-1 { margin-bottom:1px; }
.port-pos-2 { }
.port-pos-0 { margin-top:1px; }
.port-header { position:absolute }
.port-header-pos-1 { top:0px; }
.port-header-pos-0 { bottom:0px; }
.port-status { position:absolute;min-width:42px;text-align:center;font-size:10pt; }
.port-status-pos-1 { top:35px; }
.port-status-pos-0 { bottom:35px; }
.port-info { position:absolute;width:90%;background-color:#ddd;overflow:hidden; }
.port-info-pos-1 { top: 80px; }
.port-info-pos-0 { bottom: 80px;}
.port-name { font-size:10pt;margin:0px auto;width:40px;text-align:center; }
.port-number { font-size:8pt;color:#eee; }
.port-detail { position:fixed;z-index:1000;top:0px;right:0px;border:3px solid #000;background-color:#fff }
.port-detail-links { background-color:#ccc }
.hidden { visibility:hidden; }
.info-footer { }
ENDCSS
, TRUE);
echo "<div id=\"info\"></div>";
if (isset($_GET['debug'])) {
$debug = $_GET['debug'];
} else {
$debug = 0;
}
$object = spotEntity('object', $object_id);
amplifyCell($object);
if (isset($_GET['modules'])) {
$modules = $_GET['modules'];
} else {
$modules = false;
}
if ($modules) {
unset($_GET['modules']);
} else {
$_GET['modules'] = 1;
}
echo "<a href=" . makeHref($_GET) . ">" . ($modules ? "Hide" : "Show") . " Modules</a>";
pl_layout_default($object, 0, false, $modules);
addJS(<<<ENDJS
function togglevisibility(elem, hide)
{
if(hide)
elem.css('visibility', 'hidden');
else
elem.css('visibility', 'visible');
//a.show();
//a.hide();
}
function setdetail(elem, hide)
{
var a = \$( "#port" + elem.id + "-detail");
togglevisibility(a, hide);
}
function setports( data, textStatus, jqHXR ) {
if(data.debug)
\$( "#info" ).html(\$( "#info" ).html() + "DEBUG: " + data.name + ": " + data.debug);
for(var index in data.ports)
{
setport(data, data.ports[index]);
}
}
function setportstatus( obj, port , id , detail)
{
tagidsuffix = "";
if(detail)
tagidsuffix = tagidsuffix + "-detail";
//.........这里部分代码省略.........
示例9: array
// used by getExplicitTagsOnly()
$tagRelCache = array();
$taglist = getTagList();
$tagtree = treeFromList($taglist);
$auto_tags = array();
if (!isCLIMode() && isset($_SERVER['REMOTE_ADDR'])) {
$auto_tags[] = array('tag' => '$client_' . $_SERVER['REMOTE_ADDR']);
}
// Initial chain for the current user.
$user_given_tags = array();
// list of regexps used in findAutoTagWarnings to check RackCode.
// add your regexps here to suppress 'Martian autotag' warnings
$user_defined_atags = array();
// This also can be modified in local.php.
$pageheaders = array(100 => "<link rel='ICON' type='image/x-icon' href='?module=chrome&uri=pix/favicon.ico' />");
addCSS('css/pi.css');
if (!isset($script_mode) or $script_mode !== TRUE) {
// A successful call to authenticate() always generates autotags and somethimes
// even given/implicit tags. It also sets remote_username and remote_displayname.
authenticate();
// Authentication passed.
// Note that we don't perform autorization here, so each 1st level page
// has to do it in its way, e.g. by calling authorize() after fixContext().
} elseif (!isset($remote_username)) {
// Some functions require remote_username to be set to something to act correctly,
// even though they don't use the value itself.
$admin_account = spotEntity('user', 1);
if (isCLIMode() && FALSE !== ($env_user = getenv('USER'))) {
// use USER env var if we are in CLI mode
$remote_username = $env_user;
} else {
示例10: handlePopupPortLink
function handlePopupPortLink()
{
assertPermission('depot', 'default');
assertUIntArg('port');
assertUIntArg('remote_port');
assertStringArg('cable', TRUE);
$port_info = getPortInfo($_REQUEST['port']);
$remote_port_info = getPortInfo($_REQUEST['remote_port']);
$POIFC = getPortOIFCompat();
if (isset($_REQUEST['port_type']) and isset($_REQUEST['remote_port_type'])) {
$type_local = $_REQUEST['port_type'];
$type_remote = $_REQUEST['remote_port_type'];
} else {
$type_local = $port_info['oif_id'];
$type_remote = $remote_port_info['oif_id'];
}
$matches = FALSE;
$js_table = '';
foreach ($POIFC as $pair) {
if ($pair['type1'] == $type_local && $pair['type2'] == $type_remote) {
$matches = TRUE;
break;
} else {
$js_table .= "POIFC['{$pair['type1']}-{$pair['type2']}'] = 1;\n";
}
}
if ($matches) {
if ($port_info['oif_id'] != $type_local) {
commitUpdatePortOIF($port_info['id'], $type_local);
}
if ($remote_port_info['oif_id'] != $type_remote) {
commitUpdatePortOIF($remote_port_info['id'], $type_remote);
}
linkPorts($port_info['id'], $remote_port_info['id'], $_REQUEST['cable']);
// patch cable?
if (array_key_exists('heap_id', $_REQUEST)) {
// Leave the compatibility constraints check up to the foreign keys.
if (0 != ($heap_id = genericAssertion('heap_id', 'uint0'))) {
$heaps = getPatchCableHeapSummary();
if (commitModifyPatchCableAmount($heap_id, -1)) {
showSuccess('consumed a patch cable from ' . formatPatchCableHeapAsPlainText($heaps[$heap_id]));
} else {
showError('failed to consume a patch cable');
}
}
}
showOneLiner(8, array(formatPortLink($port_info['object_id'], NULL, $port_info['id'], $port_info['name']), formatPort($remote_port_info)));
addJS(<<<END
window.opener.location.reload(true);
window.close();
END
, TRUE);
backupLogMessages();
} else {
// JS code to display port compatibility hint
addJS(<<<END
POIFC = {};
{$js_table}
\$(document).ready(function () {
\t\$('select.porttype').change(onPortTypeChange);\t
\tonPortTypeChange();
});
function onPortTypeChange() {
\tvar key = \$('*[name=port_type]')[0].value + '-' + \$('*[name=remote_port_type]')[0].value;
\tif (POIFC[key] == 1)
\t{
\t\t\$('#hint-not-compat').hide();
\t\t\$('#hint-compat').show();
\t}
\telse
\t{
\t\t\$('#hint-compat').hide();
\t\t\$('#hint-not-compat').show();
\t}
}
END
, TRUE);
addCSS(<<<END
.compat-hint {
\tdisplay: none;
\tfont-size: 125%;
}
.compat-hint#hint-compat {
\tcolor: green;
}
.compat-hint#hint-not-compat {
\tcolor: #804040;
}
END
, TRUE);
// render port type editor form
echo '<form method=GET>';
echo '<input type=hidden name="module" value="popup">';
echo '<input type=hidden name="helper" value="portlist">';
echo '<input type=hidden name="port" value="' . $port_info['id'] . '">';
echo '<input type=hidden name="remote_port" value="' . $remote_port_info['id'] . '">';
echo '<input type=hidden name="cable" value="' . htmlspecialchars($_REQUEST['cable'], ENT_QUOTES) . '">';
echo '<p>The ports you have selected are not compatible. Please select a compatible transceiver pair.';
echo '<p>';
echo formatPort($port_info) . ' ';
//.........这里部分代码省略.........
示例11: initCSS
/** -----------------------------
* load CSS libaray
----------------------------*/
function initCSS()
{
addCSS('css/reset.css');
addCSS('css/common.css');
}
示例12: defined
* */
defined('_JEXEC') or die;
// Always load JBSM API if it exists.
$api = JPATH_ADMINISTRATOR . '/components/com_churchdirectory/api.php';
if (file_exists($api))
{
require_once $api;
}
// Include the Birthday/Anniversary functions only once
require_once dirname(__FILE__) . '/helper.php';
/* Set some global property */
addCSS();
/* Get the RenderHelper Class for the Module to us */
$render = new ChurchDirectoryRenderHelper;
/* Return members that have Birthdays of this month. */
$birthdays = $render->getBirthdays($params);
/* Return members that have Anniversary of this month. */
$anniversary = $render->getAnniversary($params);
// Get Groups for checking permissions
$user = JFactory::getUser();
$groups = $user->getAuthorisedViewLevels();
// Check permissions for Birthdays by running through the records and removing those the user doesn't have permission to see
示例13: addCSS
<?php
addCSS('tesing.css');
示例14: renderRackCodeEditor
function renderRackCodeEditor()
{
addJS('js/codemirror/codemirror.js');
addJS('js/codemirror/rackcode.js');
addCSS('js/codemirror/codemirror.css');
addJS(<<<ENDJAVASCRIPT
function verify()
{
\t\$.ajax({
\t\ttype: "POST",
\t\turl: "index.php",
\t\tdata: {'module': 'ajax', 'ac': 'verifyCode', 'code': \$("#RCTA").text()},
\t\tsuccess: function (data)
\t\t{
\t\t\tarr = data.split("\\n");
\t\t\tif (arr[0] == "ACK")
\t\t\t{
\t\t\t\t\$("#SaveChanges")[0].disabled = "";
\t\t\t\t\$("#ShowMessage")[0].innerHTML = "Code verification OK, don't forget to save the code";
\t\t\t\t\$("#ShowMessage")[0].className = "msg_success";
\t\t\t}
\t\t\telse
\t\t\t{
\t\t\t\t\$("#SaveChanges")[0].disabled = "disabled";
\t\t\t\t\$("#ShowMessage")[0].innerHTML = arr[1];
\t\t\t\t\$("#ShowMessage")[0].className = "msg_warning";
\t\t\t}
\t\t}
\t});
}
\$(document).ready(function() {
\t\$("#SaveChanges")[0].disabled = "disabled";
\t\$("#ShowMessage")[0].innerHTML = "";
\t\$("#ShowMessage")[0].className = "";
\tvar rackCodeMirror = CodeMirror.fromTextArea(document.getElementById("RCTA"),{
\t\tmode:'rackcode',
\t\tlineNumbers:true });
\trackCodeMirror.on("change",function(cm,cmChangeObject){
\t\t\$("#RCTA").text(cm.getValue());
});
});
ENDJAVASCRIPT
, TRUE);
$text = loadScript('RackCode');
printOpFormIntro('saveRackCode');
echo '<table style="width:100%;border:1px;" border=0 align=center>';
echo "<tr><td><textarea rows=40 cols=100 name=rackcode id=RCTA class='codepress rackcode'>";
echo $text . "</textarea></td></tr>\n";
echo "<tr><td align=center>";
echo '<div id="ShowMessage"></div>';
echo "<input type='button' value='Verify' onclick='verify();'>";
echo "<input type='submit' value='Save' disabled='disabled' id='SaveChanges' onclick='\$(RCTA).toggleEditor();'>";
// printImageHREF ('SAVE', 'Save changes', TRUE);
echo "</td></tr>";
echo '</table>';
echo "</form>";
}
示例15: urldecode
}]
}]';
} else {
if ($modify_json != 'false') {
$style = urldecode(base64_decode($map_json));
}
}
// style
////////////////////////////////////////////////////////////////
//
// HTML Output
//
////////////////////////////////////////////////////////////////
$output .= '<div id="' . $id . '" class="mk-advanced-gmaps ' . $map_height_class . '"
data-options=\'' . $options . '\'
data-places=\'' . $places . '\'
data-style=\'' . $style . '\'
data-icon=\'' . $pin_icon . '\'
></div>';
$output .= '<script src="http' . (is_ssl() ? 's' : '') . '://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>';
echo $output;
////////////////////////////////////////////////////////////////
//
// Custom CSS Output
//
////////////////////////////////////////////////////////////////
if ($map_height == 'custom') {
addCSS('
#' . $id . ' { height: ' . $height . 'px; }
');
}