Ejemplo n.º 1
0
function tmpModuleLeft()
{
    // April 4, 2007, KFD.  Allow a breakout here
    if (function_exists('appModuleLeft')) {
        $continue = appModuleLeft();
        return $continue;
    }
    //echo "<br/>";
    if (!LoggedIn()) {
        return;
    }
    // Only display menu if
    if (OptionGet('MENULEFT', 'Y') == 'Y') {
        $module = SessionGet("AGMENU_MODULE");
        $AGMENU = SessionGet("AGMENU");
        $kount = 0;
        if (isset($AGMENU[$module])) {
            $desc = $AGMENU[$module]['description'];
            echo "<ul class=\"nav nav-list\">";
            echo "<li class=\"nav-header\">{$desc}</li>";
            foreach ($AGMENU[$module]['items'] as $key => $info) {
                $hExtra = ' tabindex="' . hpTabIndexNext(100) . '"';
                // We may make the first item the focused item if nothing else
                // has been picked yet.  This code runs when rendering is going on
                // and the class-specific biz code has all run already, so it will
                // not override any business-specific focus setting
                if (vgfGet('HTML_focus') == '') {
                    $hExtra .= ' ID="FIRSTSPLITMENU" NAME="FIRSTSPLITMENU" ';
                    vgfSet('HTML_focus', 'FIRSTSPLITMENU');
                }
                $kount++;
                $d = '?gp_page=' . $key;
                $h = hLink("mainlevel", $info['description'], $d, $hExtra);
                echo "\n<li>{$h}</li>";
                // Possibly two more links
                if (ArraySafe($info, 'linknew') == 'Y') {
                    $hx = ' tabindex="' . hpTabIndexNext(100) . '" style="margin-left:30px"';
                    $h = hLink("mainlevel", 'New', $d . '&gp_mode=ins', $hx);
                    echo "\n<li>{$h}</td></li>";
                }
                if (ArraySafe($info, 'linksearch') == 'Y') {
                    $hx = ' tabindex="' . hpTabIndexNext(100) . '" style="margin-left:30px"';
                    $h = hLink("mainlevel", 'Search', $d . '&gp_mode=search', $hx);
                    echo "\n<li>{$h}</li>";
                }
            }
            echo "</ul>";
        }
    }
    if (isset($continue)) {
        return $continue;
    }
    //while ($kount++ < 30) { echo "<br>"; }
}
Ejemplo n.º 2
0
    function CheckRemoteUID($node)
    {
        // If the node we were last on is not the current one, wipe
        // out any memory of previous UID and PWD
        if (SessionGet('remoteNODE') != $node) {
            SessionSet('remoteUID', '');
            SessionSet('remotePWD', '');
            SessionSet('remoteNODE', $node);
        }
        // Already a user?  Fine, go back.
        if (SessionGet('remoteUID') != '') {
            return true;
        }
        // If they posted a uid/pw, assume it is ok and go back
        // and tell them to continue.  Notice we don't check or anything,
        // to do that we'd have to have a function on the remote server
        // that told us if a login was ok, and we kind of don't really
        // want that, it could be abused.
        if (gp('remoteUID') != '') {
            SessionSet('remoteUID', gp('remoteUID'));
            SessionSet('remotePWD', gp('remotePWD'));
            return true;
        }
        ?>
      <p>
      The authoritative node for this application is <b><?php 
        echo $node;
        ?>
</b>.
      Please provide your user id and password for that node.
      </p>
      <table>
      <tr><td style="text-align: right">Remote user id
          <td style="text-align: left"><input name="remoteUID" id="remoteUID" 
                                        tabindex="<?php 
        echo hpTabIndexNext(100);
        ?>
">
      <tr><td style="text-align: right">Remote password
          <td style="text-align: left"><input name="remotePWD" type="password"
                     tabindex="<?php 
        echo hpTabIndexNext(100);
        ?>
">
      </table>
      <br/>
      <input type="submit" value="Save" tabindex="<?php 
        echo hpTabIndexNext(100);
        ?>
">
      
      <?php 
        vgfSet('HTML_focus', 'remoteUID');
        // Since we don't have a remote uid/pwd anymore, return false
        // so they don't display the rest of the page
        return false;
    }
Ejemplo n.º 3
0
    function hDisplayOnscreen($filters = array(), &$parent_row)
    {
        $parent_pks = $filters;
        // capture for later reference
        //hprint_r($filters);
        // Pull the rows so we know how many we have
        if (count($filters) != 0) {
            //$filters=ConSet('table',$this->table_id,'search',$filters);
            processPost_TableSearchResultsClear($this->table_id);
        }
        $rows = rowsFromUserSearch($this->table, $this->projections['_uisearch'], $filters, true);
        $early_return = $this->hDisplayOnscreenOverride($rows, $filters, $parent_row);
        if ($early_return != '') {
            return $early_return;
        }
        // Pull the nav bar.  Do this after pulling rows so we
        // know how many rows there are, what page we're on, etc.
        $hNavBar = $this->hBrowse_NavBar();
        // Generate the table header
        $cols1 = asliceValsFromKeys($this->table['flat'], 'description', $this->projections['_uisearch']);
        $cols2 = array('Edit');
        if (DDUserPerm($this->table_id, 'del')) {
            $cols2[] = 'Delete';
        }
        $cols = array_merge($cols1, $cols2);
        if (count($rows) == 0) {
            $hContent = "<tr><td colspan=99 class=\"dlite\">" . "<b>There are no records to display</b>" . "</td></tr>\n";
        } else {
            // Convert last column to hyperlink to that page/row
            foreach ($rows as $index => $row) {
                $slipin1 = hLinkPostFromArray('', 'Edit', array('gp_dd_page' => $this->table_id, 'gp_skey' => $row['skey'], 'gp_mode' => 'upd'));
                //$slipin1=array('_edit'=>$slipin);
                $slipin2 = '';
                if (DDUserPerm($this->table_id, 'del')) {
                    $slipin2 = hLinkPostFromArray('', 'Delete', array('gp_delskey_' . $this->table_id => $row['skey'], 'gp_mode' => 'upd', 'gp_skey' => gp('gp_skey')));
                }
                //$slipin=array('_del'=>$slipin);
                // Get the formatted value
                foreach ($row as $colname => $colvalue) {
                    $value = hFormat($this->table['flat'][$colname]['type_id'], $colvalue);
                    $rows[$index][$colname] = $value;
                }
                if (isset($row['skey'])) {
                    unset($rows[$index]['skey']);
                }
                $rows[$index][] = $slipin1;
                $rows[$index][] = $slipin2;
                //$rows[$index]=array_merge($rows[$index],$slipin);
            }
            $hContent = hTBodyFromRows('', $rows);
        }
        // Add an empty row for inserting
        $empty_row = '';
        $table_id = $this->table['table_id'];
        /*
        foreach($cols1 as $column=>$description){
           $value = '';
           $name_id = 'gp_onscreen_'.$table_id.'_'.$column.'';
           $iname   = 'name="'.$name_id.'" '.'id="'.$name_id.'"';
           $value   = '<input type="text" '.$iname.'></input>';
           $empty_row  .= hTD('',$value,'');
        }
        */
        $empty_row = '';
        $parent_skey = $parent_row['skey'];
        $pkcols = explode(',', $this->table['pks']);
        // KFD 1/11/07, unconditionally copied in all values supplied
        // from parent.
        foreach ($pkcols as $pkcol) {
            if (!isset($parent_row[$pkcol])) {
                continue;
            }
            $prefilled[$pkcol] = $parent_row[$pkcol];
        }
        $prefilled = $parent_pks;
        //hprint_r($prefilled);
        $opts = array('drilldownmatches' => $prefilled, 'name_prefix' => 'gp_onscreen_' . $table_id . '_', 'hpsize' => 12);
        // KFD 5/29/07, refactoring code to use new widget generation
        //   routines, no more ahInputsComprehensive.
        //$inputs = ahInputsComprehensive($this->table,'ins',$prefilled,'_uisearch',$opts);
        //foreach($inputs as $column=>$details){
        //   $empty_row  .= hTD('',$details['html'],'');
        //}
        $acols = aColsModeProj($this->table, 'ins', '_uisearch');
        $ahcols = aHColsfromACols($acols, $prefilled);
        $name_prefix = 'gp_onscreen_' . $table_id . '_';
        $xh = hDetailFromAHCols($ahcols, $name_prefix, 500, 'tds');
        $xh = jsValues($ahcols, $name_prefix, $prefilled, $xh);
        $empty_row .= $xh;
        // END OF CHANGES 5/29/07 code refactoring
        //hprint_r(htmlentities($empty_row));
        // Add a save link
        hidden('gp_child_onscreen', '');
        $name_id = 'onscreen_save';
        $iname = 'name="' . $name_id . '" ' . 'id="' . $name_id . '"';
        $value = '<a tabindex="' . hpTabIndexNext(500) . '" href="' . "javascript:SetAction('gp_skey',{$parent_skey},'gp_child_onscreen','{$table_id}')" . '">Save</a>';
        $empty_row .= hTD('', $value, '');
        // Add a <tr></tr>
        $empty_row = '<tr>' . $empty_row . '</tr>';
        // Attatch the empty row
        $hContent .= $empty_row;
        $hNew = hLinkPostFromArray('', $this->table['description'], array('gp_dd_page' => $this->table_id));
        //$hDsc="<span class=\"x2menubar_text\">"
        //   .$this->table['description']
        //   .'</span>';
        ob_start();
        ?>
      <br>
      <br>
      <div class="x2menubar" style="text-align: left">
        <?php 
        echo $hNew;
        ?>
      </div>
      <div class="andro_space2"></div>
		<fieldset>
			<?php 
        echo hTRFromArray('dhead', $cols);
        ?>
			<?php 
        echo $hContent;
        ?>
			<tr>
				<td colspan=99 class='dhead'>&nbsp;
				</td>
			</tr>
		</fieldset>
      <?php 
        return ob_get_clean();
    }
Ejemplo n.º 4
0
/**
* @deprecated
*/
function AHColNames(&$ahcols, $colname, $name, $tabindex)
{
    $cname = $name . $colname;
    $ahcol = $ahcols[$colname];
    $ahcols[$colname]['cname'] = $cname;
    if ($ahcol['writable'] == false) {
        $tabindex = 10000;
    }
    // Replace out the HTML
    $html = $ahcol['html'];
    $html = str_replace('--NAME--', $cname, $html);
    $html = str_replace('--ID--', $cname, $html);
    $html = str_replace('--TABINDEX--', hpTabIndexNext($tabindex), $html);
    $html = str_replace('--NAME-PREFIX--', $name, $html);
    $ahcols[$colname]['htmlnamed'] = $html;
    // Replace out the stuff to the right
    $hrgt = $ahcol['html_right'];
    $hrgt = str_replace('--NAME--', $cname, $hrgt);
    $hrgt = str_replace('--TABINDEX--', hpTabIndexNext($tabindex), $hrgt);
    $ahcols[$colname]['hrgtnamed'] = $hrgt;
}
Ejemplo n.º 5
0
/**
* Utility function for writing a menu link
*/
function mosGetLink($mitem, $level, $class_sfx = '')
{
    global $Itemid, $mosConfig_live_site;
    $txt = '';
    $mitem->link = str_replace('&', '&amp;', $mitem->link);
    /* ANDROMEDA CHANGE */
    // Define first menu item with a specific name, so we can give it focus
    global $AndroFirstMenu;
    if (is_null($AndroFirstMenu)) {
        $AndroID = 'name="FIRSTMENU" id="FIRSTMENU"';
        $AndroFirstMenu = 1;
    } else {
        $AndroID = '';
    }
    /* ANDROMEDA CHANGE */
    // Put tab indexes on the top level.  NOTE the call
    $AndroTABIndex = "tabindex=\"{$level}\"";
    if ($level == 0) {
        $AndroTABIndex = 'tabindex="' . hpTabIndexNext(200) . '"';
    } else {
        $AndroTABIndex = 'tabindex="9999"';
    }
    /* ANDROMEDA CHANGE */
    if (!defined('_ANDROMEDA_JOOMLA')) {
        if (strcasecmp(substr($mitem->link, 0, 4), "http")) {
            $mitem->link = sefRelToAbs($mitem->link);
        }
    }
    switch ($mitem->browserNav) {
        // cases are slightly different
        case 1:
            // open in a new window
            if ($mitem->cnt > 0) {
                if ($level == 0) {
                    $txt = "<a class=\"topdaddy\" target=\"_window\"  href=\"{$mitem->link}\">{$mitem->name}</a>";
                } else {
                    $txt = "<a class=\"daddy\" target=\"_window\"  href=\"{$mitem->link}\">{$mitem->name}</a>";
                }
            } else {
                $txt = "<a href=\"{$mitem->link}\" target=\"_window\" >{$mitem->name}</a>\n";
            }
            break;
        case 2:
            // open in a popup window
            // KFD 7/6/07, get rid of warning
            $menuclass = '';
            if ($mitem->cnt > 0) {
                if ($level == 0) {
                    $txt = "<a href=\"#\" class=\"topdaddy\" onClick=\"javascript: window.open('{$mitem->link}', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550');\" class=\"{$menuclass}\">{$mitem->name}</a>\n";
                } else {
                    $txt = "<a href=\"#\" class=\"daddy\" onClick=\"javascript: window.open('{$mitem->link}', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550');\" class=\"{$menuclass}\">{$mitem->name}</a>\n";
                }
            } else {
                $txt = "<a href=\"#\" onClick=\"javascript: window.open('{$mitem->link}', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550');\" class=\"{$menuclass}\">{$mitem->name}</a>\n";
            }
            break;
        case 3:
            // don't link it
            if ($mitem->cnt > 0) {
                if ($level == 0) {
                    $txt = "<a class=\"topdaddy\">{$mitem->name}</a>";
                } else {
                    $txt = "<a class=\"daddy\">{$mitem->name}</a>";
                }
            } else {
                $txt = "<a>{$mitem->name}</a>\n";
            }
            break;
        default:
            // formerly case 2
            // open in parent window
            if (isset($mitem->cnt) && $mitem->cnt > 0) {
                if ($level == 0) {
                    $txt = "<a {$AndroTABIndex} {$AndroID} class=\"topdaddy\" href=\"{$mitem->link}\">{$mitem->name}</a>";
                } else {
                    $txt = "<a {$AndroTABIndex} {$AndroID} class=\"daddy\" href=\"{$mitem->link}\"> {$mitem->name}</a>";
                }
            } else {
                $txt = "<a {$AndroTABIndex} {$AndroID}  href=\"{$mitem->link}\">{$mitem->name}</a>";
            }
            break;
    }
    return $txt;
}