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


PHP areas函数代码示例

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


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

示例1: set_state

 function set_state($area, $event, $is_popup, $message)
 {
     $this->is_popup = $is_popup;
     $this->message = $message;
     if ($is_popup) {
         return $this;
     }
     // use legacy areas() for b/c
     $areas = areas();
     $tabs = array('content' => array('label' => gTxt('tab_content'), 'event' => 'article'), 'presentation' => array('label' => gTxt('tab_presentation'), 'event' => 'page'), 'admin' => array('label' => gTxt('tab_admin'), 'event' => 'admin'));
     if (empty($areas['extensions'])) {
         unset($areas['extensions']);
     } else {
         $tabs = $tabs + array('extensions' => array('label' => gTxt('tab_extensions'), 'event' => reset($areas['extensions'])));
     }
     foreach ($areas as $ar => $items) {
         if (has_privs('tab.' . $ar)) {
             $this->menu[$ar] = array('label' => $tabs[$ar]['label'], 'event' => $tabs[$ar]['event'], 'active' => $ar == $area);
             foreach ($items as $a => $b) {
                 if (has_privs($b)) {
                     $this->menu[$ar]['items'][] = array('label' => $a, 'event' => $b, 'active' => $b == $event);
                 }
             }
         }
     }
     return $this;
 }
开发者ID:joebushi,项目名称:textpattern,代码行数:27,代码来源:txplib_theme.php

示例2: navPop

function navPop($inline = '')
{
    $areas = areas();
    $out = array();
    foreach ($areas as $a => $b) {
        if (!has_privs('tab.' . $a)) {
            continue;
        }
        if (count($b) > 0) {
            $out[] = n . t . '<optgroup label="' . gTxt('tab_' . $a) . '">';
            foreach ($b as $c => $d) {
                if (has_privs($d)) {
                    $out[] = n . t . t . '<option value="' . $d . '">' . gTxt($c) . '</option>';
                }
            }
            $out[] = n . t . '</optgroup>';
        }
    }
    if ($out) {
        $style = $inline ? ' style="display: inline;"' : '';
        return '<form method="get" action="index.php" class="navpop"' . $style . '>' . n . '<select name="event" onchange="submit(this.form);">' . n . t . '<option>' . gTxt('go') . '&#8230;</option>' . join('', $out) . n . '</select>' . n . '</form>';
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:23,代码来源:txplib_head.php

示例3: set_state

 /**
  * Sets Textpatterns menu structure, message contents and other application states
  * @param	string	$area	Currently active top level menu
  * @param	string	$event	Currently active second level menu
  * @param	boolean	$is_popup	Just a popup window for tag builder et cetera
  * @param	array	$message	The contents of the notification message pane
  * @return	object	This theme object
  */
 function set_state($area, $event, $is_popup, $message)
 {
     $this->is_popup = $is_popup;
     $this->message = $message;
     if ($is_popup) {
         return $this;
     }
     // use legacy areas() for b/c
     $areas = areas();
     $defaults = array('content' => 'article', 'presentation' => 'page', 'admin' => 'admin');
     if (empty($areas['start'])) {
         unset($areas['start']);
     }
     if (empty($areas['extensions'])) {
         unset($areas['extensions']);
     }
     foreach ($areas as $ar => $items) {
         $l_ = gTxt('tab_' . $ar);
         $e_ = array_key_exists($ar, $defaults) ? $defaults[$ar] : reset($areas[$ar]);
         if (has_privs('tab.' . $ar)) {
             $this->menu[$ar] = array('label' => $l_, 'event' => $e_, 'active' => $ar == $area);
             foreach ($items as $a => $b) {
                 if (has_privs($b)) {
                     $this->menu[$ar]['items'][] = array('label' => $a, 'event' => $b, 'active' => $b == $event);
                 }
             }
         }
     }
     return $this;
 }
开发者ID:psic,项目名称:websites,代码行数:38,代码来源:txplib_theme.php

示例4: default_event

/**
 * Renders a HTML &lt;select&gt; list of available panels to show immediately after login.
 *
 * @param  string $name HTML name of the widget
 * @param  string $val  Initial (or current) selected item
 * @return string HTML
 */
function default_event($name, $val)
{
    $vals = areas();
    $out = array();
    foreach ($vals as $a => $b) {
        if (count($b) > 0) {
            $out[] = n . '<optgroup label="' . gTxt('tab_' . $a) . '">';
            foreach ($b as $c => $d) {
                $out[] = n . '<option value="' . $d . '"' . ($val == $d ? ' selected="selected"' : '') . '>' . $c . '</option>';
            }
            $out[] = n . '</optgroup>';
        }
    }
    return n . '<select id="default_event" name="' . $name . '" class="default-events">' . join('', $out) . n . '</select>';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:22,代码来源:txp_prefs.php

示例5: areas

                 $megaObjeto['Tecnologias'][$ke][$v->claveDistrito][$v->tecnologias[0]->tecnologia]['centros'][$y]['latitud'] = $v->centro->latitud;
                 $megaObjeto['Tecnologias'][$ke][$v->claveDistrito][$v->tecnologias[0]->tecnologia]['centros'][$y]['longitud'] = $v->centro->longitud;
                 $megaObjeto['Tecnologias'][$ke][$v->claveDistrito][$v->tecnologias[0]->tecnologia]['idDistrito'] = $v->idDistrito;
                 $megaObjeto['Tecnologias'][$ke]['PorTipo']['EnArea'][$v->tecnologias[0]->tecnologia] = $v->tecnologias[0]->idTecnologia;
                 $megaObjeto['Tecnologias'][$ke]['PorTipo']['AreaName'] = areas($ke);
                 if (in_array($v->claveDistrito, $polDistritos)) {
                     $megaObjeto['Tecnologias'][$ke]['PorTipo']['Distritos'][$v->claveDistrito][$v->tecnologias[0]->tecnologia] = $v->tecnologias[0]->idTecnologia;
                 }
             }
         }
         $tecsa = file_get_contents($ipServ . 'telmex/infraestructura/tecnolgia/distrito/totales/' . $ke . '');
         $tecsa = json_decode($tecsa);
         $megaObjeto['Graficos']['TecDist'][areas($ke)] = $tecsa->apiResponse;
         $tecsa = file_get_contents($ipServ . 'telmex/infraestructura/tecnolgia/totales/' . $ke . '');
         $tecsa = json_decode($tecsa);
         $megaObjeto['Graficos']['TecTot'][areas($ke)] = $tecsa->apiResponse;
     }
 }
 unset($nmsgs);
 unset($tecsa);
 unset($tecsi);
 unset($pintaAll);
 //Poligonos Distritos
 foreach ($polDistritales as $yis => $vis) {
     $postData = array('distritos' => array('name' => $vis, 'idArea' => $yis, 'color' => '#ff9000'));
     $ch = curl_init($ipServ . 'getDistrito/geoJson');
     curl_setopt_array($ch, array(CURLOPT_POST => TRUE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HTTPHEADER => array('Content-Type: application/json'), CURLOPT_POSTFIELDS => json_encode($postData)));
     $response = curl_exec($ch);
     if ($response === FALSE) {
         die(curl_error($ch));
     }
开发者ID:erickvica,项目名称:OT,代码行数:31,代码来源:db_functions_c.php

示例6: navPop

function navPop()
{
    $areas = areas();
    $o = '<form action="index.php" method="get">
				<select name="event" onchange="submit(this.form)">
				<option>' . ucfirst(gTxt('go')) . '...</option>';
    foreach ($areas as $a => $b) {
        if (count($b) > 0) {
            $o .= '<optgroup label="' . ucfirst(gTxt('tab_' . $a)) . '">';
            foreach ($b as $c => $d) {
                $o .= '<option value="' . $d . '">' . ucfirst($c) . '</option>';
            }
            $o .= '</optgroup>';
        }
    }
    $o .= '</select></form>';
    return $o;
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:18,代码来源:txplib_head.php

示例7: navPop

/**
 * Creates an admin-side main menu as a &lt;select&gt; dropdown.
 *
 * @param  mixed  $inline Is not used.
 * @return string A HTML form
 * @example
 * echo navPop();
 */
function navPop($inline = '')
{
    $areas = areas();
    $out = array();
    foreach ($areas as $a => $b) {
        if (!has_privs('tab.' . $a)) {
            continue;
        }
        if (count($b) > 0) {
            $out[] = n . '<optgroup label="' . gTxt('tab_' . $a) . '">';
            foreach ($b as $c => $d) {
                if (has_privs($d)) {
                    $out[] = n . '<option value="' . txpspecialchars($d) . '">' . strip_tags($c) . '</option>';
                }
            }
            $out[] = n . '</optgroup>';
        }
    }
    if ($out) {
        return n . '<form method="get" action="index.php" class="navpop">' . n . '<select name="event" data-submit-on="change">' . n . '<option>' . gTxt('go') . '&#8230;</option>' . join('', $out) . n . '</select>' . n . '</form>';
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:30,代码来源:txplib_head.php

示例8: navPop

function navPop($inline = '')
{
    $areas = areas();
    $st = $inline ? ' style="display:inline"' : '';
    $o = '<form action="index.php" method="get"' . $st . '>
				<select name="event" onchange="submit(this.form)">
				<option>' . gTxt('go') . '...</option>';
    foreach ($areas as $a => $b) {
        if (count($b) > 0) {
            $o .= '<optgroup label="' . gTxt('tab_' . $a) . '">';
            foreach ($b as $c => $d) {
                $o .= '<option value="' . $d . '">' . $c . '</option>';
            }
            $o .= '</optgroup>';
        }
    }
    $o .= '</select></form>';
    return $o;
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:19,代码来源:txplib_head.php

示例9: foreach

<tr id="nav-primary">
	<td align="center" class="tabs" colspan="2">
		<table cellpadding="0" cellspacing="0" align="center">
		<tr>
			<td id="messagepane" valign="middle"<?php 
if (!empty($msgclass)) {
    echo ' class="' . $msgclass . '"';
}
?>
>&nbsp;<?php 
echo $message;
?>
</td>
<?php 
if ($txp_user) {
    foreach (areas() as $a => $tabs) {
        if ($tabs and has_privs("tab.{$a}")) {
            echo areatab(gTxt('tab_' . $a), $a, array_shift($tabs), $area);
        }
    }
}
?>

			<td class="tabdown"><a href="<?php 
echo hu;
?>
" class="plain" target="_blank"><?php 
echo gTxt('tab_view_site');
?>
</a></td>
		</tr>
开发者ID:bgarrels,项目名称:textpattern,代码行数:31,代码来源:menu.php

示例10: aro_tabsort

function aro_tabsort($area, $event)
{
    if ($area) {
        $areas = areas();
        if (isset($areas[$area])) {
            foreach ($areas[$area] as $a => $b) {
                if (has_privs($b)) {
                    $out[] = aro_tabber($a, $b, $event, 2);
                }
            }
            return $out ? join('', $out) : '';
        }
    }
    return '';
}
开发者ID:netcarver,项目名称:aro_myadmin,代码行数:15,代码来源:aro_myadmin.php

示例11: tabsort

function tabsort($area, $event)
{
    $areas = areas();
    foreach ($areas[$area] as $a => $b) {
        $out[] = tabber($a, $b, $event, 2);
    }
    return join('', $out);
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:8,代码来源:txplib_head.php


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