Documentation is available at navigation.php
- <?php
- /* NAP code, called by the "nap" interface class */
- class midgard_admin_sitewizard_navigation {
- var $_object;
- var $_l10n;
- var $_l10n_midcom;
- function midgard_admin_sitewizard_navigation() {
- $this->_object = null;
- $i18n =& $GLOBALS["midcom"]->get_service("i18n");
- $this->_l10n = $i18n->get_l10n("midgard.admin.sitewizard");
- $this->_l10n_midcom = $i18n->get_l10n("midcom");
- }
- function is_internal() {
- // return true if the current topic should not be displayed by NAP
- return false;
- }
- function get_leaves() {
- $topic = &$this->_object;
- $leaves = array ();
- $hosts = mgd_list_hosts();
- if ($hosts) {
- while ($hosts->fetch ()) {
- if ($GLOBALS["midgard"]->sitegroup != 0 && $hosts->sitegroup != $GLOBALS["midgard"]->sitegroup) {
- // If we're in SG, display only hosts in same SG(s)
- $visible = false;
- } elseif ($hosts->id == $GLOBALS["midgard"]->host) {
- // Hide the host we're in
- $visible = false;
- } elseif (substr($hosts->prefix,0,12) == "/attachment/") {
- // Hide Aegir attachment hosts
- $visible = false;
- } elseif (substr($hosts->prefix,0,6) == "/aegir") {
- // Hide Aegir hosts
- $visible = false;
- } elseif (substr($hosts->prefix,0,13) == "/spider-admin") {
- // Hide SpiderAdmin hosts
- $visible = false;
- } elseif (substr($hosts->prefix,0,7) == "/asgard") {
- // Hide Asgard hosts
- $visible = false;
- } else {
- $visible = true;
- }
- $leaves[$hosts->id] = array (
- MIDCOM_NAV_SITE => Array (
- MIDCOM_NAV_URL => $hosts->sitegroup."/".$hosts->id.".html",
- MIDCOM_NAV_NAME => $hosts->hostname
- ),
- MIDCOM_NAV_ADMIN => Array (
- MIDCOM_NAV_URL => "",
- MIDCOM_NAV_NAME => $hosts->hostname
- ),
- MIDCOM_NAV_GUID => $hosts->guid(),
- MIDCOM_NAV_TOOLBAR => array(),
- MIDCOM_NAV_VISIBLE => $visible,
- MIDCOM_META_CREATOR => null,
- MIDCOM_META_EDITOR => null,
- MIDCOM_META_CREATED => null,
- MIDCOM_META_EDITED => null
- );
- }
- }
- return $leaves;
- }
- function get_node() {
- // information about the current node (topic)
- $topic = &$this->_object;
- $toolbar[0] = Array(
- MIDCOM_TOOLBAR_URL => 'create.html',
- MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('create'),
- MIDCOM_TOOLBAR_HELPTEXT => null,
- MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_new.png',
- MIDCOM_TOOLBAR_ENABLED => true
- );
- $toolbar[100] = Array(
- MIDCOM_TOOLBAR_URL => '',
- MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'),
- MIDCOM_TOOLBAR_HELPTEXT => $this->_l10n_midcom->get('component configuration helptext'),
- MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_folder-properties.png',
- MIDCOM_TOOLBAR_ENABLED => true
- );
- return array (
- MIDCOM_NAV_URL => "",
- MIDCOM_NAV_NAME => $topic->extra,
- MIDCOM_NAV_VISIBLE => true,
- MIDCOM_NAV_TOOLBAR => $toolbar,
- MIDCOM_META_CREATOR => $topic->creator,
- MIDCOM_META_EDITOR => $topic->revisor,
- MIDCOM_META_CREATED => $topic->created,
- MIDCOM_META_EDITED => $topic->revised
- );
- }
- function set_object($object) {
- debug_add ("Component: setting NAP Element to " . $object->name ." [" . $object->id . "]");
- $this->_object = $object;
- return true;
- }
- function get_current_leaf() {
- return $GLOBALS["midgard_admin_sitewizard_nap_activeid"];
- }
- }
- ?>
Documentation generated on Mon, 21 Nov 2005 18:20:23 +0100 by phpDocumentor 1.3.0RC3