• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP generate_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: product_conversion

 function product_conversion($products = array(), $isFullName = false)
 {
     $converted = array();
     foreach ($products as $product) {
         if ($product['description']) {
             $product['description'] = preg_replace(array("/\r\n|\r|\n/"), array("<br/>"), $product['description']);
         }
         if ($product['specs']) {
             $product['specs'] = preg_replace(array("/\r\n|\r|\n/"), array("<br/>"), $product['specs']);
         }
         if ($product['images']) {
             $product['images'] = explode(",", $product['images']);
             list($file, $ext) = explode(".", $product['images'][0]);
             $filename = FCPATH . 'public/frontend/products/' . $file . '-thumbnail.' . $ext;
             if (file_exists($filename)) {
                 $product['thumbnail'] = $file . '-thumbnail.' . $ext;
             }
         }
         if (!isset($product['url']) || !$product['url']) {
             $product['url'] = generate_url($product['name']) . '-' . $product['id'];
         }
         if (!$isFullName && strlen($product['name']) > 35) {
             $product['name'] = substr($product['name'], 0, 33) . '...';
         }
         $converted[] = $product;
     }
     return $converted;
 }
开发者ID:nelsieborja,项目名称:qdosworld,代码行数:28,代码来源:utility_helper.php


示例2: find_child

function find_child($components, $parent, $level)
{
    global $vars;
    foreach ($components as $id => $array) {
        if ($array['qos-type'] == 3) {
            continue;
        }
        if ($array['parent'] == $components[$parent]['sp-obj'] && $array['sp-id'] == $components[$parent]['sp-id']) {
            echo "<ul>";
            echo "<li>";
            if ($array['qos-type'] == 1) {
                // Its a policy, we need to make it a link.
                $linkvars = array_merge($vars, array('policy' => $id));
                unset($linkvars['class']);
                echo '<a href="' . generate_url($linkvars) . '">' . $array['label'] . '</a>';
            } elseif ($array['qos-type'] == 2) {
                // Its a class, we need to make it a link.
                echo '<a href="' . generate_url($vars, array('policy' => $parent, 'class' => $id)) . '">' . $array['label'] . '</a>';
            } else {
                // Unknown, no link
                echo $array['label'];
            }
            if (isset($array['match'])) {
                echo ' (' . $array['match'] . ')';
            }
            find_child($components, $id, $level + 1);
            echo "</li>";
            echo "</ul>";
        }
    }
}
开发者ID:pblasquez,项目名称:librenms,代码行数:31,代码来源:cbqos.inc.php


示例3: redirect

 public function redirect($controller = null, $action = "default", $params = null)
 {
     if ($controller == null) {
         $controller = $this->getControllerName();
     }
     $redirecturl = generate_url($controller, $action, $params);
     header("Location: {$redirecturl}");
     $this->dontRender();
 }
开发者ID:paulodacosta,项目名称:LearnFlash,代码行数:9,代码来源:BaseController.php


示例4: print_graph_row

function print_graph_row($graph_array)
{
    global $config;
    if ($_SESSION['widescreen']) {
        if ($_SESSION['big_graphs']) {
            if (!$graph_array['height']) {
                $graph_array['height'] = "110";
            }
            if (!$graph_array['width']) {
                $graph_array['width'] = "353";
            }
            $periods = array('sixhour', 'week', 'month', 'year');
        } else {
            if (!$graph_array['height']) {
                $graph_array['height'] = "110";
            }
            if (!$graph_array['width']) {
                $graph_array['width'] = "215";
            }
            $periods = array('sixhour', 'day', 'week', 'month', 'year', 'twoyear');
        }
    } else {
        if ($_SESSION['big_graphs']) {
            if (!$graph_array['height']) {
                $graph_array['height'] = "100";
            }
            if (!$graph_array['width']) {
                $graph_array['width'] = "323";
            }
            $periods = array('day', 'week', 'month');
        } else {
            if (!$graph_array['height']) {
                $graph_array['height'] = "100";
            }
            if (!$graph_array['width']) {
                $graph_array['width'] = "228";
            }
            $periods = array('day', 'week', 'month', 'year');
        }
    }
    if ($graph_array['shrink']) {
        $graph_array['width'] = $graph_array['width'] - $graph_array['shrink'];
    }
    $graph_array['to'] = $config['time']['now'];
    foreach ($periods as $period) {
        $graph_array['from'] = $config['time'][$period];
        $graph_array_zoom = $graph_array;
        $graph_array_zoom['height'] = "175";
        $graph_array_zoom['width'] = "600";
        $link_array = $graph_array;
        $link_array['page'] = "graphs";
        unset($link_array['height'], $link_array['width']);
        $link = generate_url($link_array);
        echo overlib_link($link, generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
    }
}
开发者ID:skive,项目名称:observium,代码行数:56,代码来源:rows.inc.php


示例5: debug_url

function debug_url()
{
    $DEBUG_OUTPUT = DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'url.txt';
    $fh = fopen($DEBUG_OUTPUT, 'a');
    $v = var_export($_GET, TRUE);
    fwrite($fh, str_replace(NEWLINE, BLANK, $v) . NEWLINE);
    fwrite($fh, generate_url() . NEWLINE);
    fclose($fh);
    return 0;
}
开发者ID:ronaldbradford,项目名称:code,代码行数:10,代码来源:url.php


示例6: generate_page_url

function generate_page_url($page, $subpage = false, $suffix = false, $return = false)
{
    $append = $subpage !== false ? '&amp;subpage=' . $subpage : '';
    $append .= $suffix !== false ? $suffix : '';
    $url = generate_url('adm/index.php?page=' . $page . $append);
    if ($return) {
        return $url;
    }
    echo $url;
}
开发者ID:pwltt,项目名称:MES-PWLTT-ENVI,代码行数:10,代码来源:functions-admin.php


示例7: logout

 public function logout($redirect = '')
 {
     global $config, $db;
     // Kill session
     $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' WHERE session_id = ' . $db->quote($this->sid);
     $db->query($sql);
     if (empty($redirect)) {
         $redirect = generate_url('', '');
     }
     redirect($redirect);
 }
开发者ID:pwltt,项目名称:MES-PWLTT-ENVI,代码行数:11,代码来源:class-user.php


示例8: smarty_url_tag

function smarty_url_tag($params, $smarty)
{
    global $controller;
    $ctrl = empty($params["controller"]) ? $controller : $params["controller"];
    $act = empty($params["action"]) ? "default" : $params["action"];
    $pars = array();
    foreach ($params as $key => $value) {
        if ($key != "controller" && $key != "action") {
            $pars[$key] = $value;
        }
    }
    return generate_url($ctrl, $act, $pars);
}
开发者ID:paulodacosta,项目名称:LearnFlash,代码行数:13,代码来源:index.php


示例9: replaceReferenceWithLink

 private function replaceReferenceWithLink($ref)
 {
     $delim = strpos($ref, "|");
     $title = $delim !== false ? substr($ref, 0, $delim) : $ref;
     $text = $delim !== false ? substr($ref, $delim + 1) : $title;
     $cm = new \Manager\CardsManager();
     $card = $cm->findByTitle($title);
     if ($card == null) {
         return '<a class="createlink" href="' . generate_url("cards", "add", array("title" => $title)) . "\">{$text}</a>";
     } else {
         return '<a href="' . generate_url("cards", "show", array("cardId" => $card->getId())) . "\">{$text}</a>";
     }
 }
开发者ID:paulodacosta,项目名称:LearnFlash,代码行数:13,代码来源:BaseCards.php


示例10: atualizar_url_filhos

 /**
  * Executado apos atualizar uma página
  */
 function atualizar_url_filhos($parent_id, $parent_url)
 {
     $filhos = $this->db->select('id, titulo, url')->from($this->table_name)->where('parent_id', $parent_id)->get()->result_array();
     if (!is_array($filhos) || count($filhos) == 0) {
         foreach ($filhos as $pagina) {
             if (strpos($pagina['url'], $parent_url) !== 0) {
                 $alias = generate_url($pagina['titulo']);
                 $separator = $parent_url != '' ? '/' : '';
                 $new_url = $parent_url . $separator . $alias;
                 $this->db->update($this->table_name, array('url' => $new_url), array('id' => $pagina['id']));
                 $this->atualizar_url_filhos($pagina['id'], $new_url);
             }
         }
     }
 }
开发者ID:NaszvadiG,项目名称:DivaSul,代码行数:18,代码来源:paginas_model.php


示例11: humanize_port

 * @author     Adam Armstrong <[email protected]>
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
$port['device_id'] = $device['device_id'];
$port['hostname'] = $device['hostname'];
// Process port properties and generate printable values
humanize_port($port);
if (!isset($ports_has_ext['ports_adsl']) || in_array($port['port_id'], $ports_has_ext['ports_adsl'])) {
    $port_adsl = dbFetchRow("SELECT * FROM `ports_adsl` WHERE `port_id` = ?", array($port['port_id']));
}
if ($port['ifInErrors_delta'] > 0 || $port['ifOutErrors_delta'] > 0) {
    $port['tags'] .= generate_port_link($port, '<span class="label label-important">Errors</span>', 'port_errors');
}
if ($port['deleted'] == '1') {
    $port['tags'] .= '<a href="' . generate_url(array('page' => 'deleted-ports')) . '"><span class="label label-important">Deleted</span></a>';
}
if (isset($ports_has_ext['ports_cbqos'])) {
    if (in_array($port['port_id'], $ports_has_ext['ports_cbqos'])) {
        $port['tags'] .= '<a href="' . generate_port_url($port, array('view' => 'cbqos')) . '"><span class="label label-info">CBQoS</span></a>';
    }
} else {
    if (dbFetchCell("SELECT COUNT(*) FROM `ports_cbqos` WHERE `port_id` = ?", array($port['port_id']))) {
        $port['tags'] .= '<a href="' . generate_port_url($port, array('view' => 'cbqos')) . '"><span class="label label-info">CBQoS</span></a>';
    }
}
if (isset($ports_has_ext['mac_accounting'])) {
    if (in_array($port['port_id'], $ports_has_ext['mac_accounting'])) {
        $port['tags'] .= '<a href="' . generate_port_url($port, array('view' => 'macaccounting')) . '"><span class="label label-info">MAC</span></a>';
    }
} else {
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:print-interface.inc.php


示例12: nicecase

if (is_file($app_filename)) {
    // Include app code to output data
    include $app_filename;
    // If an $app_sections array has been returned, build a menu
    if (isset($app_sections) && is_array($app_sections)) {
        $navbar['brand'] = nicecase($vars['app']);
        $navbar['class'] = "navbar-narrow";
        foreach ($app_sections as $app_section => $text) {
            // Set the chosen app to be this one if it's not already set.
            if (!$vars['app_section']) {
                $vars['app_section'] = $app_section;
            }
            if ($vars['app_section'] == $app_section) {
                $navbar['options'][$app_section]['class'] = "active";
            }
            $navbar['options'][$app_section]['url'] = generate_url($vars, array('app_section' => $app_section));
            $navbar['options'][$app_section]['text'] = $text;
        }
        print_navbar($navbar);
        unset($navbar);
    } else {
        // It appears this app doesn't have multiple sections. We set app_section to default here.
        $vars['app_section'] = 'default';
    }
    // If a matching app_section array exists within app_graphs, print the graphs.
    if (isset($app_graphs[$vars['app_section']]) && is_array($app_graphs[$vars['app_section']])) {
        echo generate_box_open();
        echo '<table class="table table-striped table-hover  table-condensed">';
        foreach ($app_graphs[$vars['app_section']] as $key => $text) {
            $graph_type = $key;
            $graph_array['to'] = $config['time']['now'];
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:apps.inc.php


示例13: print_status

/**
 * Display status alerts.
 *
 * Display pages with alerts about device troubles.
 * Examples:
 * print_status(array('devices' => TRUE)) - display for devices down
 *
 * Another statuses:
 * devices, uptime, ports, errors, services, bgp
 *
 * @param array $status
 * @return none
 *
 */
function print_status($status)
{
    global $config;
    $max_interval = filter_var($status['max']['interval'], FILTER_VALIDATE_INT, array('options' => array('default' => 24, 'min_range' => 1)));
    $max_count = filter_var($status['max']['count'], FILTER_VALIDATE_INT, array('options' => array('default' => 200, 'min_range' => 1)));
    $string = '<table class="table table-bordered table-striped table-hover table-condensed">' . PHP_EOL;
    $string .= '  <thead>' . PHP_EOL;
    $string .= '  <tr>' . PHP_EOL;
    $string .= '    <th>Device</th>' . PHP_EOL;
    $string .= '    <th>Type</th>' . PHP_EOL;
    $string .= '    <th>Status</th>' . PHP_EOL;
    $string .= '    <th>Entity</th>' . PHP_EOL;
    $string .= '    <th>Location</th>' . PHP_EOL;
    $string .= '    <th>Time Since / Information</th>' . PHP_EOL;
    $string .= '  </tr>' . PHP_EOL;
    $string .= '  </thead>' . PHP_EOL;
    $string .= '  <tbody>' . PHP_EOL;
    $query_device_permitted = generate_query_permitted(array('device'), array('device_table' => 'D'));
    $query_port_permitted = generate_query_permitted(array('port'), array('port_table' => 'I'));
    // Show Device Status
    if ($status['devices']) {
        $query = 'SELECT * FROM `devices` AS D';
        $query .= ' WHERE D.`status` = 0' . $query_device_permitted;
        $query .= ' ORDER BY D.`hostname` ASC';
        $entries = dbFetchRows($query);
        foreach ($entries as $device) {
            $string .= '  <tr>' . PHP_EOL;
            $string .= '    <td class="entity">' . generate_device_link($device, short_hostname($device['hostname'])) . '</td>' . PHP_EOL;
            $string .= '    <td><span class="badge badge-inverse">Device</span></td>' . PHP_EOL;
            $string .= '    <td><span class="label label-important">Device Down</span></td>' . PHP_EOL;
            $string .= '    <td>-</td>' . PHP_EOL;
            $string .= '    <td style="white-space: nowrap">' . htmlspecialchars(truncate($device['location'], 30)) . '</td>' . PHP_EOL;
            $string .= '    <td style="white-space: nowrap">' . deviceUptime($device, 'short') . '</td>' . PHP_EOL;
            $string .= '  </tr>' . PHP_EOL;
        }
    }
    // Uptime
    if ($status['uptime']) {
        if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $config['uptime_warning'] > 0) {
            $query = 'SELECT * FROM `devices` AS D';
            $query .= ' WHERE D.`status` = 1 AND D.`uptime` > 0 AND D.`uptime` < ' . $config['uptime_warning'];
            $query .= $query_device_permitted;
            $query .= 'ORDER BY D.`hostname` ASC';
            $entries = dbFetchRows($query);
            foreach ($entries as $device) {
                $string .= '  <tr>' . PHP_EOL;
                $string .= '    <td class="entity">' . generate_device_link($device, short_hostname($device['hostname'])) . '</td>' . PHP_EOL;
                $string .= '    <td><span class="badge badge-inverse">Device</span></td>' . PHP_EOL;
                $string .= '    <td><span class="label label-success">Device Rebooted</span></td>' . PHP_EOL;
                $string .= '    <td>-</td>' . PHP_EOL;
                $string .= '    <td style="white-space: nowrap">' . htmlspecialchars(truncate($device['location'], 30)) . '</td>' . PHP_EOL;
                $string .= '    <td style="white-space: nowrap">Uptime ' . formatUptime($device['uptime'], 'short') . '</td>' . PHP_EOL;
                $string .= '  </tr>' . PHP_EOL;
            }
        }
    }
    // Ports Down
    if ($status['ports'] || $status['links']) {
        // warning about deprecated option: $config['warn']['ifdown']
        if (isset($config['warn']['ifdown']) && !$config['warn']['ifdown']) {
            print_warning("<strong>Config option obsolete</strong>\n                    Please note that config option <strong>\$config['warn']['ifdown']</strong> is now obsolete.\n                    Use options: <strong>\$config['frontpage']['device_status']['ports']</strong> and <strong>\$config['frontpage']['device_status']['errors']</strong>\n                    To remove this message, delete <strong>\$config['warn']['ifdown']</strong> from configuration file.");
        }
        $query = 'SELECT * FROM `ports` AS I ';
        if ($status['links'] && !$status['ports']) {
            $query .= 'INNER JOIN `links` AS L ON I.`port_id` = L.`local_port_id` ';
        }
        $query .= 'LEFT JOIN `devices` AS D ON I.`device_id` = D.`device_id` ';
        $query .= "WHERE I.`ifOperStatus` = 'down' AND I.`ifAdminStatus` = 'up' ";
        if ($status['links'] && !$status['ports']) {
            $query .= ' AND L.`active` = 1 ';
        }
        $query .= $query_port_permitted;
        $query .= ' AND I.`ifLastChange` >= DATE_SUB(NOW(), INTERVAL ' . $max_interval . ' HOUR) ';
        $query .= 'ORDER BY I.`ifLastChange` DESC, D.`hostname` ASC, I.`ifDescr` * 1 ASC ';
        $entries = dbFetchRows($query);
        $i = 1;
        foreach ($entries as $port) {
            if ($i > $max_count) {
                $string .= '  <tr><td></td><td><span class="badge badge-info">Port</span></td>';
                $string .= '<td><span class="label label-important">Port Down</span></td>';
                $string .= '<td colspan=3>Too many ports down. See <strong><a href="' . generate_url(array('page' => 'ports'), array('state' => 'down')) . '">All DOWN ports</a></strong>.</td></tr>' . PHP_EOL;
                break;
            }
            humanize_port($port);
            $string .= '  <tr>' . PHP_EOL;
            $string .= '    <td class="entity">' . generate_device_link($port, short_hostname($port['hostname'])) . '</td>' . PHP_EOL;
//.........这里部分代码省略.........
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:101,代码来源:status.inc.php


示例14: dbFetchCell

        </li><!-- End 4 columns container -->

<?php 
}
$packages = dbFetchCell("SELECT COUNT(pkg_id) from `packages`");
if ($packages) {
    ?>

        <li class="dropdown">
          <a href="<?php 
    echo generate_url(array('page' => 'packages'));
    ?>
" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><img src="images/16/box.png" border="0" align="absmiddle" /> Packages<b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="<?php 
    echo generate_url(array('page' => 'packages'));
    ?>
"><img src="images/16/box.png" border="0" align="absmiddle" /> All Packages</a></li>
          </ul>
        </li>
<?php 
}
# if ($packages)
?>

        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"> Plugins<b class="caret"></b></a>
          <ul class="dropdown-menu">
<?php 
Plugins::call('menu');
?>
开发者ID:CumulusNetworks,项目名称:cldemo-archive,代码行数:31,代码来源:print-menubar.php


示例15: array

     $width_div = 438;
 } else {
     $width_div = 393;
 }
 $graph_array = array();
 $graph_array['height'] = 100;
 $graph_array['width'] = 210;
 $graph_array['to'] = $config['time']['now'];
 $graph_array['id'] = $port['port_id'];
 $graph_array['type'] = $graph_type;
 $graph_array['from'] = $config['time']['day'];
 $graph_array['legend'] = 'no';
 $link_array = $graph_array;
 $link_array['page'] = 'graphs';
 unset($link_array['height'], $link_array['width'], $link_array['legend']);
 $link = generate_url($link_array);
 $overlib_content = generate_overlib_content($graph_array, $port['hostname'] . ' - ' . $port['label']);
 $graph_array['title'] = 'yes';
 $graph_array['width'] = $width;
 $graph_array['height'] = 119;
 $graph = generate_lazy_graph_tag($graph_array);
 echo "<div style='display: block; padding: 1px; margin: 2px; min-width: " . $width_div . 'px; max-width:' . $width_div . "px; min-height:180px; max-height:180px; text-align: center; float: left; background-color: #f5f5f5;'>";
 echo overlib_link($link, $graph, $overlib_content);
 echo '</div>';
 // echo("<div style='display: block; padding: 1px; margin: 2px; min-width: 393px; max-width:393px; min-height:180px; max-height:180px; text-align: center; float: left; background-color: #f5f5f5;'>
 // <a href='".generate_port_url($port)."/' onmouseover=\"return overlib('\
 // <div style=\'font-size: 16px; padding:5px; font-weight: bold; color: #e5e5e5;\'>".$device['hostname']." - ".$port['ifDescr']."</div>\
 // <img src=\'graph.php?type=$graph_type&amp;id=".$port['port_id']."&amp;from=".$config['time']['day']."&amp;to=".$config['time']['now']."&amp;width=450&amp;height=150&amp;title=yes\'>\
 // ', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\"  >".
 // "<img src='graph.php?type=$graph_type&amp;id=".$port['port_id']."&amp;from=".$config['time']['day']."&amp;to=".$config['time']['now']."&amp;width=315&amp;height=110&amp;legend=no&amp;title=yes'>
 // </a>
开发者ID:samyscoub,项目名称:librenms,代码行数:31,代码来源:graph.inc.php


示例16: array

 * @author     Adam Armstrong <[email protected]>
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
$link_array = array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'latency');
$navbar['brand'] = "Latency";
$navbar['class'] = "navbar-narrow";
foreach (array('incoming', 'outgoing') as $view) {
    if (!strlen($vars['view'])) {
        $vars['view'] = $view;
    }
    if (count($smokeping_files[$view][$device['hostname']])) {
        if ($vars['view'] == $view) {
            $navbar['options'][$view]['class'] = "active";
        }
        $navbar['options'][$view]['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'latency', 'view' => $view));
        $navbar['options'][$view]['text'] = ucwords($view);
    }
}
print_navbar($navbar);
echo '<table class="table table-striped">';
if ($vars['view'] == "incoming") {
    if (count($smokeping_files['incoming'][$device['hostname']])) {
        $graph_array['type'] = "device_smokeping_in_all_avg";
        $graph_array['device'] = $device['device_id'];
        echo '<tr><td>';
        echo '<h3>Average</h3>';
        print_graph_row($graph_array);
        echo '</td></tr>';
        $graph_array['type'] = "device_smokeping_in_all";
        $graph_array['legend'] = 'no';
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:latency.inc.php


示例17: array

<?php 
    $sorts = array('device' => 'Device', 'port' => 'Port', 'speed' => 'Speed', 'traffic' => 'Traffic', 'traffic_in' => 'Traffic In', 'traffic_out' => 'Traffic Out', 'packets' => 'Packets', 'packets_in' => 'Packets In', 'packets_out' => 'Packets Out', 'errors' => 'Errors', 'media' => 'Media', 'descr' => 'Description');
    foreach ($sorts as $sort => $sort_text) {
        echo '<option value="' . $sort . '" ';
        if ($vars['sort'] == $sort) {
            echo "selected";
        }
        echo '>' . $sort_text . '</option>';
    }
    ?>

        </select>
      </div>
      <button type="submit" class="btn btn-default btn-sm">Search</button>
      <a class="btn btn-default btn-sm" href="<?php 
    echo generate_url(array('page' => 'ports', 'section' => $vars['section'], 'bare' => $vars['bare']));
    ?>
" title="Reset critera to default." >Reset</a>
      </td>
    </form>
  </tr>
</table>

<?php 
}
print_optionbar_end();
$param = array();
if (!isset($vars['ignore'])) {
    $vars['ignore'] = "0";
}
if (!isset($vars['disabled'])) {
开发者ID:sfromm,项目名称:librenms,代码行数:31,代码来源:ports.inc.php


示例18: generate_url

                         $map .= "\"" . $sif['port_id'] . "\" [label=\"" . $sif['label'] . "\", fontsize=12, fillcolor=lightblue, URL=\"" . generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'port', 'port' => $local_port_id)) . "\"]\n";
                         if (!$ifdone[$src][$sif['port_id']]) {
                             $map .= "\"{$src}\" -> \"" . $sif['port_id'] . "\" [weight=500000, arrowsize=0, len=0];\n";
                             $ifdone[$src][$sif['port_id']] = 1;
                         }
                         if ($dst_host) {
                             $map .= "\"{$dst}\" [URL=\"" . generate_url(array('page' => 'device', 'device' => $dst_host, 'tab' => 'ports', 'view' => 'map')) . "\", fontsize=20, shape=box3d]\n";
                         } else {
                             $map .= "\"{$dst}\" [ fontsize=20 shape=box3d]\n";
                         }
                         if ($dst_host == $device['device_id'] || !is_numeric($device['device_id'])) {
                             $map .= "\"" . $dif['port_id'] . "\" [label=\"" . $dif['label'] . "\", fontsize=12, fillcolor=lightblue, URL=\"" . generate_url(array('page' => 'device', 'device' => $dst_host, 'tab' => 'port', 'port' => $remote_port_id)) . "\"]\n";
                         } else {
                             $map .= "\"" . $dif['port_id'] . "\" [label=\"" . $dif['label'] . " \", fontsize=12, fillcolor=lightgray";
                             if ($dst_host) {
                                 $map .= ", URL=\"" . generate_url(array('page' => 'device', 'device' => $dst_host, 'tab' => 'port', 'port' => $remote_port_id)) . "\"";
                             }
                             $map .= "]\n";
                         }
                         if (!$ifdone[$dst][$dif['port_id']]) {
                             $map .= "\"" . $dif['port_id'] . "\" -> \"{$dst}\" [weight=500000, arrowsize=0, len=0];\n";
                             $ifdone[$dst][$dif['port_id']] = 1;
                         }
                         $map .= "\"" . $sif['port_id'] . "\" -> \"" . $dif['port_id'] . "\" [weight=1, arrowhead=normal, arrowtail=normal, len=2, {$info}] \n";
                     }
                 }
             }
             $done = 0;
         }
     }
 }
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:31,代码来源:map.php


示例19: foreach

$type_text['loadbalancer_vservers'] = "Serverfarms";
// Citrix Netscaler
$type_text['netscaler_vsvr'] = "VServers";
$type_text['netscaler_services'] = "Services";
$page_title[] = "Load Balancer";
$navbar['brand'] = "Load Balancer";
$navbar['class'] = "navbar-narrow";
foreach ($loadbalancer_tabs as $type) {
    if (!$vars['type']) {
        $vars['type'] = $type;
    }
    if ($vars['type'] == $type) {
        $navbar['options'][$type]['class'] = "active";
    }
    $navbar['options'][$type]['text'] = $type_text[$type] . " (" . $device_loadbalancer_count[$type] . ")";
    $navbar['options'][$type]['url'] = generate_url($link_array, array('type' => $type));
}
print_navbar($navbar);
unset($navbar);
if (is_file("pages/device/loadbalancer/" . $vars['type'] . ".inc.php")) {
    include "pages/device/loadbalancer/" . $vars['type'] . ".inc.php";
} else {
    foreach ($loadbalancer_tabs as $type) {
        if ($type != "overview") {
            if (is_file("pages/device/loadbalancer/overview/{$type}.inc.php")) {
                $g_i++;
                if (!is_integer($g_i / 2)) {
                    $row_colour = $list_colour_a;
                } else {
                    $row_colour = $list_colour_b;
                }
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:31,代码来源:loadbalancer.inc.php


示例20: foreach

 <button type="button" class="close" data-dismiss="alert">×</button>
 <div class="pull-left" style="padding:0 5px 0 0"><i class="oicon-information"></i></div>
 <h4>添加分组</h4>';
 foreach (array('entity_type', 'group_name', 'group_descr', 'assoc_device_conditions', 'assoc_entity_conditions') as $var) {
     if (!isset($vars[$var]) || strlen($vars[$var]) == '0') {
         echo "Missing required data.</div>";
         break 2;
     }
 }
 $group_array = array();
 $group_array['entity_type'] = $vars['entity_type'];
 $group_array['group_name'] = $vars['group_name'];
 $group_array['group_descr'] = $vars['group_descr'];
 $group_id = dbInsert('groups', $group_array);
 if (is_numeric($group_id)) {
     echo '<p>分组已创建为ID <a href="' . generate_url(array('page' => 'group', 'group_id' => $group_id)) . '">' . $group_id . '</a></p>';
     $assoc_array = array();
     $assoc_array['group_id'] = $group_id;
     $assoc_array['entity_type'] = $vars['entity_type'];
     $dev_conds = array();
     foreach (explode("\n", $vars['assoc_device_conditions']) as $cond) {
         list($this['attrib'], $this['condition'], $this['value']) = explode(" ", trim($cond), 3);
         $dev_conds[] = $this;
     }
     $assoc_array['device_attribs'] = json_encode($dev_conds);
     if ($vars['assoc_device_conditions'] == "*") {
         $vars['assoc_device_conditions'] = json_encode(array());
     }
     $ent_conds = array();
     foreach (explode("\n", $vars['assoc_entity_conditions']) as $cond) {
         list($this['attrib'], $this['condition'], $this['value']) = explode(" ", trim($cond), 3);
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:31,代码来源:group_add.inc.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP generate_user_password函数代码示例发布时间:2022-05-15
下一篇:
PHP generate_token函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap