示例#1
0
 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;
 }
示例#2
0
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>';
    }
}
示例#3
0
 /**
  * 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;
 }
示例#4
0
/**
 * 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>';
}
示例#5
0
                 $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));
     }
示例#6
0
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;
}
示例#7
0
/**
 * 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>';
    }
}
示例#8
0
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;
}
示例#9
0
<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>
示例#10
0
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 '';
}
示例#11
0
function tabsort($area, $event)
{
    $areas = areas();
    foreach ($areas[$area] as $a => $b) {
        $out[] = tabber($a, $b, $event, 2);
    }
    return join('', $out);
}