Пример #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>"; }
}
Пример #2
0
            <div><strong>Execution time:</strong>' . number_format($line['time'], 4) . '</div>
            <div onclick="showHide(\'stack-' . $key . '\');" style="cursor:pointer;">More Details</div>';
        echo '<div style="display:none;" id="stack-' . $key . '">';
        echo "<strong>Execution Stack:</strong><pre>" . $line['stack'] . "</pre></div>";
        echo "</div>";
    }
    echo '</div></div>';
}
# =====================================================================
#
# Old-fashioned pre-x4 pre-jquery way to set focus.
# Don't ever use this!  It will be deprecated
# sooner or later.
#
# =====================================================================
$jqdr = vgfGet('jqDocReady', array());
if (count($jqdr) > 0) {
    ?>
    <script type="text/javascript">
    $(document).ready(function() {
<?php 
    echo implode("\n", $jqdr);
    ?>
 
    });
    </script>
    <?php 
}
if (configGet('deprecated', 'Y') == 'Y') {
    $scriptend = ElementImplode('scriptend');
    if ($scriptend != '') {
Пример #3
0
 /**
  *  Generates an x3 HTML page requesting input from the
  *  user.  No parameters, accesses the object's yamlP2 property.
  *
  *  @access private
  */
 private function x3HTML()
 {
     $x6 = vgfGet('x6', false);
     $yamlP2 = $this->yamlP2;
     if (isset($yamlP2['options']['title'])) {
         # This is for classic x2 displays
         $this->PageSubtitle = $yamlP2['options']['title'];
     }
     # There are few tweaks based on x4/x_table2 version
     $x4 = gp('x4Page') == '' ? false : true;
     # Create top-level div, x4 library is looking for this
     # and x2 library will ignore it.
     $top = html('div');
     $top->hp['id'] = 'x4Top';
     $top->autoFormat(true);
     if ($x6) {
         $top->hp['id'] = 'x4Top';
         $top->addClass('fadein');
         $top->hp['x6plugin'] = 'androPage';
         jqDocReady("var plugin = x6.byId('x4Top');");
         jqDocReady("x6plugins.androPage(plugin,'x4Top','*');");
     }
     # Hidden variables so posts will come back here
     if ($x4) {
         x4Data('return', 'menu');
         $h = $top->h('input');
         $h->hp['id'] = 'x4Page';
         $h->hp['type'] = 'hidden';
         $h->hp['value'] = $this->page;
     } else {
         hidden('gp_page', $this->page);
     }
     # List of ids for buttons below
     if ($yamlP2['template'] == '') {
         $ids = array('pdf' => 'printNow', 'onscreen' => 'showOnScreen', 'showSql' => 'showSql', 'csv' => 'csvExport');
     } else {
         $ids = array('smarty' => 'RunReport');
     }
     $x4D = html('div', $top);
     if ($x4) {
         $x4D->addClass('x4Pane');
     }
     $x4D->addClass('x4AndroPage');
     # Triggers all browser-side x4 stuff
     $x4D->hp['id'] = 'x4AndroPage';
     $x4D->ap['defaultOutput'] = a($ids, a($yamlP2['options'], 'default'));
     # Put out the title and the help link
     $tabx = html('table', $x4D);
     $tabx->addClass('tab100');
     $tabxtr = html('tr', $tabx);
     $td = html('td', $tabxtr);
     $td->hp['style'] = "text-align: left; vertical-align: top";
     $h1 = html('h1', $td, $this->PageSubtitle);
     $h1->hp['id'] = 'x4H1Top';
     $td = html('td', $tabxtr);
     $td->hp['style'] = "text-align: right; vertical-align: top;\n        padding-top: 8px; font-size: 120%";
     #if($x4) {
     #$a = html('a-void',$td,"F1:Help");
     #$a->hp['onclick'] = "$('#x4AndroPage')[0].help()";
     #$a->addClass('button');
     #}
     # Make top level container
     $tabtop = html('table', $x4D);
     $tr = html('tr', $tabtop);
     $td1 = html('td', $tr);
     $td1->hp['style'] = 'vertical-align: top';
     $td2 = html('td', $tr);
     $td2->hp['style'] = 'vertical-align: top';
     # Do right-hand side first actually, the on-screen display area
     $div = html('div', $td2);
     $div->hp['id'] = 'divOnScreen';
     # Put out the inputs
     if (!$x6) {
         $table = html('table', $td1);
     } else {
         $form = $td1->form();
         $table = $form->h('table');
         $table->addClass('x6Detail');
         $table->hp['style'] = 'float: left';
     }
     $filters = ArraySafe($this->yamlP2, 'uifilter', array());
     foreach ($filters as $id => $options) {
         if (isset($options['table'])) {
             $dd = ddTable($options['table']);
             $opt2 = $dd['flat'][$options['column']];
             $options = array_merge($opt2, $options);
         } else {
             $options['inputId'] = 'ap_' . $id;
         }
         if (isset($options['value']) && gp('ap_' . $id) == '') {
             $options['value'] = $options['value'];
         } else {
             $options['value'] = gp('ap_' . $id);
         }
         $type_id = a($options, 'cotype_id', 'vchar');
         $tr = html('tr', $table);
         $td = html('td', $tr);
         if ($x6) {
             $td->addClass('x6Caption');
         } else {
             $td->hp['style'] = "text-align: right";
         }
         $td->setHTML($options['description']);
         $td = html('td', $tr);
         if ($x6) {
             $td->addClass('x6Input');
         } else {
             $td->hp['style'] = "text-align: left";
         }
         $input = input($options);
         $input->hp['autocomplete'] = 'off';
         if ($x6) {
             $input->hp['xNoPassup'] = 'Y';
         }
         $td->setHTML($input->bufferedRender());
     }
     $h = $top->h('input');
     $h->hp['type'] = 'hidden';
     $h->hp['id'] = 'gp_post';
     $h->hp['name'] = 'gp_post';
     if (isset($yamlP2['template'])) {
         $h->hp['value'] = 'smarty';
     } else {
         $h->hp['value'] = 'pdf';
     }
     $td1->br();
     // DO 7/31/2008 Only need a button to run the report for Smarty AndroPage
     if ($this->yamlP2['template'] == '') {
         # First button: print
         $inp = html('a-void', $td1, '<u>P</u>rint Now');
         $inp->ap['xLabel'] = 'CtrlP';
         $inp->hp['id'] = $ids['pdf'];
         $inp->addClass('button');
         if ($x6) {
             $inp->hp['onclick'] = "x6events.fireEvent('key_CtrlP')";
         } elseif (gpExists('x4Page')) {
             $inp->hp['onclick'] = "\$a.byId('x4AndroPage').printNow()";
         } else {
             $inp->hp['onclick'] = 'formSubmit();';
         }
         $td1->br(2);
         # Second button: show onscreen
         $inp = html('a-void', $td1, 'Show <u>O</u>nscreen');
         $inp->hp['id'] = $ids['onscreen'];
         $inp->ap['xLabel'] = 'CtrlO';
         $inp->addClass('button');
         if ($x6) {
             $inp->hp['onclick'] = "x6events.fireEvent('key_CtrlO')";
         } elseif (gpExists('x4Page')) {
             $inp->hp['onclick'] = "\$a.byId('x4AndroPage').showOnScreen()";
         } else {
             $inp->hp['onclick'] = "SetAndPost('gp_post','onscreen')";
         }
         # KFD 9/20/08, new option: export to csv
         $td1->br(2);
         $inp = html('a-void', $td1, '<u>E</u>xport as CSV');
         $inp->hp['id'] = $ids['csv'];
         $inp->ap['xLabel'] = 'CtrlE';
         $inp->addClass('button');
         if ($x6) {
             $inp->hp['onclick'] = "x6events.fireEvent('key_CtrlE')";
         } else {
             if (gpExists('x4Page')) {
                 $inp->hp['onclick'] = "\$a.byId('x4AndroPage').csvExport()";
             } else {
                 $inp->hp['onclick'] = "SetAndPost('gp_post','csvexport')";
             }
         }
     } else {
         # First button: Run Report
         $inp = html('a-void', $td1, '<u>R</u>un Report');
         $inp->ap['xLabel'] = 'CtrlR';
         $inp->hp['id'] = $ids['smarty'];
         $inp->addClass('button');
         if (gpExists('x4Page')) {
             $inp->hp['onclick'] = "\$a.byId('x4AndroPage').showOnScreen()";
         } else {
             $inp->hp['onclick'] = 'formSubmit();';
         }
     }
     $td1->br(2);
     if (SessionGet('ADMIN') == true && $x4) {
         $x4D->nbsp(2);
         $inp = html('a-void', $td1, 'Show S<u>Q</u>L');
         $inp->ap['xLabel'] = 'CtrlQ';
         $inp->hp['id'] = $ids['showSql'];
         $inp->hp['name'] = 'showsql';
         // For x2
         $inp->addClass('button');
         if ($x6) {
             $inp->hp['onclick'] = "x6events.fireEvent('key_CtrlQ')";
         } else {
             $inp->hp['onclick'] = "\$a.byId('x4AndroPage').showSql()";
         }
     }
     # Put in the spot where we display the SQL
     $td1->br(2);
     $showSql = html('div', $td1);
     $showSql->hp['id'] = 'divShowSql';
     echo $top->render();
 }
Пример #4
0
 function Login_Process()
 {
     $arg2 = $this->directlogin == true ? 'direct' : '';
     // only process if user hit "post"
     if (gp('gp_posted', '', false) == '') {
         return;
     }
     vgfSet('LoginAttemptOK', false);
     // Error title
     vgfSet('ERROR_TITLE', '*');
     // If the user supplied a loginUID, this is a post and we
     // must process the request.
     $ale = vgaGet('login_errors', array());
     $app = $GLOBALS['AG']['application'];
     $em000 = isset($ale['000']) ? $ale['000'] : "That username/password combination did not work.  Please try again.";
     $em001 = isset($ale['001']) ? $ale['001'] : "That username/password combination did not work.  Please try again.";
     $em002 = isset($ale['002']) ? $ale['002'] : "That username/password combination did not work.  Please try again.";
     $em099 = isset($ale['099']) ? $ale['099'] : "That username/password combination did not work.  Please try again.";
     $terror = "";
     $uid = gp('loginUID');
     $uid = MakeUserID($uid);
     //$uid = str_replace('@','_',$uid);
     //$uid = str_replace('.','_',$uid);
     $pwd = gp("loginPWD", "", false);
     // First check, never allow the database server's superuser
     // account
     //
     if ($uid == "postgres") {
         ErrorAdd($em000);
         if (vgfGet('loglogins', false)) {
             sysLog(LOG_WARNING, "Andromeda:{$app}:Bad login attempt as postgres");
             fwLogEntry('1011', 'Attempt login as postgres', '', $arg2);
         }
         return;
     }
     $app = $GLOBALS['AG']['application'];
     if (substr($uid, 0, strlen($app)) == $app) {
         ErrorAdd($em001);
         if (vgfGet('loglogins', false)) {
             sysLog(LOG_WARNING, "Andromeda:{$app}:Bad login attempt as group role");
             fwLogEntry('1012', 'Attempt login as group role', $uid, $arg2);
         }
         return;
     }
     // Begin with a connection attempt.
     // on fail, otherwise continue
     $tcs = @SQL_CONN($uid, $pwd);
     if ($tcs === false) {
         ErrorAdd($em099);
         if (vgfGet('loglogins', false)) {
             sysLog(LOG_NOTICE, "Andromeda:{$app}:Bad login attempt server rejected");
             fwLogEntry('1013', 'Server rejected username/password', $uid, $arg2);
         }
         return;
     } else {
         SQL_CONNCLOSE($tcs);
     }
     // The rest of this routine uses an admin connection.  If we
     // have an error, we must close the connection before returning!
     //    ...yes, yes, that's bad form, all complaints to /dev/null
     //
     if (vgfGet('loglogins', false)) {
         fwLogEntry('1010', 'Login OK', $uid, $arg2);
     }
     scDBConn_Push();
     // See if they are a root user.  If not, do they have an
     //  active account?
     $root = false;
     $admin = false;
     $group_id_eff = '';
     $results = SQL("\n         Select oid\n           FROM pg_roles   \n          WHERE rolname = CAST('{$uid}' as name)\n            AND rolsuper= true");
     $cr = SQL_NUMROWS($results);
     if ($cr != 0) {
         $root = true;
     } else {
         $results = SQL("Select * from users WHERE LOWER(user_id)='{$uid}'" . "AND (user_disabled<>'Y' or user_disabled IS NULL)");
         $cr = SQL_NUMROWS($results);
         if ($cr == 0) {
             scDBConn_Pop();
             ErrorAdd($em002);
             sysLog(LOG_WARNING, "Andromeda:{$app}:Bad login attempt code 002");
             return;
         } else {
             $userinfo = SQL_Fetch_Array($results);
             $group_id_eff = $userinfo['group_id_eff'];
             SessionSet('user_name', $userinfo['user_name']);
         }
     }
     // Flag if the user is an administrator
     if ($root == true) {
         $admin = true;
     } else {
         $results = SQL("select count(*) as admin from usersxgroups " . "where user_id='{$uid}' and group_id ='{$app}" . "_admin'");
         $row = SQL_FETCH_ARRAY($results);
         $admin = intval($row["admin"]) > 0 ? true : false;
     }
     // Get the users' groups
     $groups = "";
     if ($root) {
         $results = SQL("\n            select group_id \n              from zdd.groups \n             where COALESCE(grouplist,'')=''");
     } else {
         $results = SQL("select group_id from usersxgroups WHERE LOWER(user_id)='{$uid}'");
     }
     while ($row = SQL_FETCH_ARRAY($results)) {
         $agroups[] = "'" . trim($row['group_id']) . "'";
         #$groups.=ListDelim($groups)."'".trim($row["group_id"])."'";
     }
     $groups = array();
     if (!empty($agroups)) {
         $groups = implode(",", $agroups);
     }
     //scDBConn_Pop();
     // We have a successful login.  If somebody else was already
     // logged in, we need to wipe out that person's session.  But
     // don't do this if there was an anonymous login.
     if (LoggedIn()) {
         $uid_previous = SessionGet('UID');
         if ($uid != $uid_previous) {
             //Session_Destroy();
             SessionReset();
             //Index_Hidden_Session_Start(false);
         }
     }
     // We know who they are and that they can connect,
     // see if there is any app-specific confirmation required
     //
     if (function_exists('app_login_process')) {
         //echo "Calling the process now";
         if (!app_login_process($uid, $pwd, $admin, $groups)) {
             return;
         }
     }
     // Protect the session from hijacking, generate a new ID
     Session_regenerate_id();
     // We now have a successful connection, set some
     // flags and lets go
     //
     vgfSet('LoginAttemptOK', true);
     SessionSet("UID", $uid);
     SessionSet("PWD", $pwd);
     SessionSet("ADMIN", $admin);
     SessionSet("ROOT", $root);
     SessionSet("GROUP_ID_EFF", $group_id_eff);
     SessionSet("groups", $groups);
     if (gp('gpz_page') == '') {
         # KFD 9/12/08, extra command to not change page
         if (gp('st2keep') != 1) {
             gpSet('gp_page', '');
         }
     }
     $GLOBALS['session_st'] = 'N';
     // for "N"ormal
     // -------------------------------------------------------------------
     // We are about to make the menu.  Before doing so, see if there
     // are any variables set for the menu layout.  Set defaults and then
     // load from database.
     //
     $this->pmenu = array('MENU_TYPE' => vgaGet('MENU_TYPE', 'div'), 'MENU_CLASS_MODL' => vgaGet('MENU_CLASS_MODL', 'modulename'), 'MENU_CLASS_ITEM' => vgaGet('MENU_CLASS_ITEM', 'menuentry'), 'MENU_TICK' => vgaGET('MENU_TICK', ' - '));
     //$sql = "SELECT * from variables WHERE variable like 'MENU%'";
     //$dbres = SQL($sql);
     //while ($row = SQL_FETCH_ARRAY($dbres)) {
     //   $this->pmenu[trim($row['variable'])]=trim($row['variable_value']);
     //}
     // -------------------------------------------------------------------
     // KFD 10/28/06, Modified to examine "nomenu" instead of permsel
     //   pulls all tables user has nomenu='N'.  The basic idea is
     //   to remove from $AGMENU the stuff they don't see
     //
     // GET AGMENU
     $AGMENU = array();
     // avoid compiler warning, populated next line
     include "ddmodules.php";
     // Pull distinct modules person has any menu options in.
     $sq = "SELECT DISTINCT module\n             FROM zdd.perm_tabs \n            WHERE nomenu='N'\n              AND group_id iN ({$groups})";
     $modules = SQL_AllRows($sq, 'module');
     $AGkeys = array_keys($AGMENU);
     foreach ($AGkeys as $AGkey) {
         if (!isset($modules[$AGkey])) {
             unset($AGMENU[$AGkey]);
         }
     }
     // Now recurse the remaining modules and do the same trick
     // for each one, removing the tables that don't exist
     foreach ($AGMENU as $module => $moduleinfo) {
         $sq = "SELECT DISTINCT table_id\n                FROM zdd.perm_tabs \n               WHERE nomenu='N'\n                 AND module = '{$module}'\n                 AND group_id iN ({$groups})";
         $tables = SQL_AllRows($sq, 'table_id');
         $tkeys = array_keys($moduleinfo['items']);
         foreach ($tkeys as $tkey) {
             if (!isset($tables[$tkey])) {
                 unset($AGMENU[$module]['items'][$tkey]);
             }
         }
     }
     // KFD 12/18/06.  Put all table permissions into session
     $table_perms = SQL_AllRows("Select distinct table_id FROM zdd.perm_tabs\n           WHERE group_id IN ({$groups})\n             AND nomenu='N'", 'table_id');
     SessionSet('TABLEPERMSMENU', array_keys($table_perms));
     $table_perms = SQL_AllRows("Select distinct table_id FROM zdd.perm_tabs\n           WHERE group_id IN ({$groups})\n             AND permsel='Y'", 'table_id');
     SessionSet('TABLEPERMSSEL', array_keys($table_perms));
     $table_perms = SQL_AllRows("Select distinct table_id FROM zdd.perm_tabs\n           WHERE group_id IN ({$groups})\n             AND permins='Y'", 'table_id');
     SessionSet('TABLEPERMSINS', array_keys($table_perms));
     $table_perms = SQL_AllRows("Select distinct table_id FROM zdd.perm_tabs\n           WHERE group_id IN ({$groups})\n             AND permupd='Y'", 'table_id');
     SessionSet('TABLEPERMSUPD', array_keys($table_perms));
     $table_perms = SQL_AllRows("Select distinct table_id FROM zdd.perm_tabs\n           WHERE group_id IN ({$groups})\n             AND permdel='Y'", 'table_id');
     SessionSet('TABLEPERMSDEL', array_keys($table_perms));
     //echo "<div style='background-color:white'>";
     //echo "$uid $groups $group_id_eff";
     //hprint_r(SessionGet('TABLEPERMSMENU'));
     //hprint_r(SessionGet('TABLEPERMSSEL'));
     //echo "</div>";
     // KFD 7/9/07, we always use joomla templates now, don't need
     // options to turn them off
     //if(defined('_ANDROMEDA_JOOMLA')) {
     // In a hybrid situation, put the menu into the session
     SessionSet('AGMENU', $AGMENU);
     //}
     $HTML_Menu = "";
     $WML_Menu = "";
     /*
     foreach ($AGMENU as $key=>$module) {
        //if($key=="datadict") continue;
        //if($key=="sysref")   continue;
        $HTML_Module="";
        $WML_Module="";
        foreach($module["items"] as $itemname=>$item) {
           if (!isset($item["mode"])) { $item["mode"]="normal"; }
           switch ($item["mode"]) {
              case "normal":
                 $ins=false;
                 $extra=array();
                 if($item['menu_parms']<>'') {
                    $aextras=explode('&',$item['menu_parms']);
                    foreach($aextras as $aextra) {
                       list($var,$value)=explode("=",$aextra);
                       $extra[$var]=$value;
                    }
                 }
                 $HTML_Module.=$this->_MenuItem(
                    $item['description'],$itemname,$ins,$extra
                 );
                 $WML_Module.="<div>";
                 $WML_Module.=hLink(
                    '',$item['description'],'?gp_page='.$itemname
                 );
                 $WML_Module.="</div>";
                 break;
              case "ins":
                 //if ($admin || isset($tables_ins[$item["name"]]))  {
                    $HTML_Module.=$this->_MenuItem(
                       $item['description'],$itemname,true
                    );
                 //}
                 break;
                    
                    #$HTML_Module.=
                    #   "\n<font class=\"tablename\">- <a href=\"index.php?gp_page=".$itemname."\">".
                    #   $item["description"]."</a></font><br />";
                    
              }
        }
        
        // the module is defined AFTER its contents so it can be
        // left off if it has no entries
        if ($HTML_Module!="") {
           $HTML_Menu.=$this->_MenuModule($module['description']);
           $HTML_Menu.=$HTML_Module;
        }
        if ($WML_Module!="") {
           $WML_Menu.="<div><b>".$module['description']."</b></div>";
           $WML_Menu.=$WML_Module;
        }
     }
     */
     DynamicSave("menu_" . $uid . ".php", $HTML_Menu);
     DynamicSave("menu_wml_" . $uid . ".php", $WML_Menu);
     // -------------------------------------------------------------------
     // Fetch and cache user preferences
     if (vgaGet('member_profiles')) {
         cacheMember_Profiles();
     }
     // -------------------------------------------------------------------
     // Now find the user's table permissions more precisely table by table
     $sql = "select p.table_id,\n\t\t\t\tmax(case when p.permins='Y' then 1 else 0 end) as permins,\n\t\t\t\tmax(case when p.permupd='Y' then 1 else 0 end) as permupd,\n\t\t\t\tmax(case when p.permdel='Y' then 1 else 0 end) as permdel,\n\t\t\t\tmax(case when p.permsel='Y' then 1 else 0 end) as permsel\n\t\t\t\tfrom zdd.perm_tabs  P\n\t\t\t\tWHERE group_id in ({$groups})\n\t\t\t\tGROUP BY p.table_id";
     //echo $sql;
     $results = SQL($sql);
     $HTML_Perms = "<?php\n\$table_perms = array();\n";
     while ($row = SQL_FETCH_ARRAY($results)) {
         $tn = $row["table_id"];
         $ti = $row["permins"];
         $tu = $row["permupd"];
         $td = $row["permdel"];
         $ts = $row["permsel"];
         $HTML_Perms .= "\$table_perms[\"{$tn}\"]=array(\"ins\"=>{$ti},\"upd\"=>{$tu},\"del\"=>{$td},\"sel\"=>{$ts});\n";
     }
     $HTML_Perms .= "?>\n";
     DynamicSave("perms_" . $uid . ".php", $HTML_Perms);
     /* October 28, 2006, KFD.  Rem'd this all out, column and row security
              made this irrelevant
     		// -------------------------------------------------------------------
     		// Find out if this user has any UID Columns, columns that create
     		// filters on the user's UID
     		$sql = "Select column_id FROM groupuids WHERE group_id IN ($groups)";
     		//echo $sql;
     		$results = SQL($sql);
     		$groupuids = array();
     		while ($row = SQL_FETCH_ARRAY($results)) {
     			//echo "Found this one".$row["column_id"];
     			$groupuids[$row["column_id"]] = $row["column_id"];
     		}
     		SessionSet("groupuids",$groupuids);
           */
     scDBConn_Pop();
     return;
 }
Пример #5
0
if (configGet('paypal_site_url', '') != '') {
    $paypal['site_url'] = configGet('paypal_site_url');
}
$paypal['success_url'] = "?gpt=pp&flag=1";
// after ipn has finished
$paypal['cancel_url'] = "?gpt=pp&flag=0";
// after ipn has finished
# KFD 9/6/08, allow overrides from configuration
if (configGet('paypal_v2', 'N') == 'Y') {
    $paypal['success_url'] = '?gp_page=x_paypalfinal&flag=success';
    $paypal['cancel_url'] = '?gp_page=x_paypalfinal&flag=cancel';
}
# KFD 1/15/09, allow program to dynamically generate a return
#              page that will specify
if (vgfGet('paypal_return_url', false)) {
    $pprurl = vgfGet('paypal_return_url');
    $paypal['success_url'] = $pprurl . '&flag=success';
    $paypal['cancel_url'] = $pprurl . '&flag=cancel';
}
// -----------------------------------------------------------------
// FLIP BETWEEN THESE TWO FOR LIVE/TEST
// -----------------------------------------------------------------
# KFD 9/6/08, allow overrides from configuration
if (configGet('paypal_test_mode', 'N') == 'Y') {
    $paypal['url'] = "https://www.sandbox.paypal.com/cgi-bin/webscr";
} else {
    $paypal['url'] = "https://www.paypal.com/cgi-bin/webscr";
}
# KFD 1/21/09, Another test system, "one dollar mode".  If
#              this flag is set, the trx is switched to
#              one dollar only.  Intended for final run-throughs
Пример #6
0
function ElementOut($type, $dohtml = false)
{
    global $AG;
    // Hardcoded row we want in there
    if ($type == 'script') {
        //$calcRow=vgaGet('calcRow');
        //ElementAdd('script',"\nfunction calcRow() {\n$calcRow\n}");
        $ajaxTM = vgfGet('ajaxTM', 0) == 1 ? '1' : '0';
        ElementAdd('script', "\nvar ajaxTM={$ajaxTM}  /* Controls AJAX table maintenance */");
        //$clearBoxes=implode("\n",ArraySafe($AG,'clearBoxes',array()));
        //ElementAdd('script',"\nfunction clearBoxes() {\n$clearBoxes\n}");
    }
    $array = ArraySafe($AG, $type, array());
    $retval = "";
    $extra = "";
    if ($dohtml) {
        $extra = "<br/>";
    }
    foreach ($array as $msg) {
        $retval .= $msg . $extra . "\n";
    }
    $AG[$type] = array();
    if (!$dohtml) {
        return $retval;
    }
    if (!$retval) {
        return "";
    } else {
        return "<div class=\"{$type}\">{$retval}</div>";
    }
}
Пример #7
0
    function main()
    {
        $this->PageSubtitle = "Imports";
        // Process uploaded files if there are any
        if (!gpExists('gp_xajax')) {
            foreach ($_FILES as $onefile) {
                if (!$onefile['error']) {
                    // Generate a previously unused name, give up after 20 tries
                    $dir = $GLOBALS['AG']['dirs']['root'] . 'tmp/';
                    $count = 0;
                    while (true) {
                        $fn = $onefile['name'] . '.' . rand(1000, 9999);
                        $fs = $dir . $fn;
                        if (!file_exists($fs)) {
                            break;
                        }
                        $count++;
                        if ($count > 20) {
                            $fn = '';
                            break;
                        }
                    }
                    if ($fn == '') {
                        continue;
                    }
                    // skip this file, we couldn't name it
                    // If we got to here, then we have a good name to use, lets copy
                    // the file over.
                    move_uploaded_file($onefile['tmp_name'], $fs);
                    $newfile = array('name' => $onefile['name'], 'uname' => $fs, 'type' => $onefile['type'], 'error' => $onefile['error'], 'size' => $onefile['size']);
                    vgfSet('files', array($newfile));
                    break;
                    // only do one file!
                }
            }
        }
        // Routing
        if (gp('gp_fbproc') == '1') {
            return $this->fbProc();
        }
        if (gpExists('gp_xajax')) {
            return $this->xAjax();
        }
        // Obtain the basic parameters we need on this page, and then assign
        // them to hidden variables so that FORM POSTs will return here.
        $tid = gp('gp_table_id');
        $t = DD_TableRef(gp('gp_table_id'));
        hidden('gp_page', 'x_import');
        hidden('gp_nofile', '');
        hidden('gp_table_id', gp('gp_table_id'));
        //  Process requests.  If they uploaded a file, save the
        //  info to the session.  If they requested file destroy,
        //  throw it away.
        $files = vgfGet('files', array());
        $fi = null;
        if (isset($files[0])) {
            $fi = $files[0];
            SessionSet('importfile', $fi);
        }
        if (gp('gp_nofile') == 1) {
            SessionUnSet('importfile');
            $fi = null;
        }
        // If a file is uploaded we just output the div and then call
        // back for the content
        // On this branch we
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        // BEGIN HTML
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ?>
      <h1>Table Import</h1>
      <p><b>Destination Table:</b><?php 
        echo hLinkPage('', $tid);
        ?>
      </p>
      <p><b>Table Name in Database:</b> <?php 
        echo $tid;
        ?>
.
      </p>
      <p>This is standardized import program that can accept file 
         uploads in the popular "CSV" format.  The first row is expected
         to name columns, and all subsequent rows are expected to 
         contain comma-separated values.
      </p>
      <p>This routine will match known column names and display the 
         columns that will be imported.
      </p>
      <hr />
      <?php 
        if ($fi) {
            ?>
         <div id="xajax"></div>
         <div id="xajaxm"></div>
         
         <script type="text/javascript">
         
         </script>
         <?php 
            elementAdd('scriptend', "andrax('?gp_page=x_import&gp_table_id=" . gp("gp_table_id") . "&gp_xajax=1');");
            return;
        } else {
            ?>
         <h2>File Upload</h2>
         <p>Please upload a file to process.
         <p><?php 
            echo hFileUpload();
            ?>
         <?php 
        }
    }
Пример #8
0
/**
* Utility function to recursively work through a vertically indented
* hierarchial menu
*/
function mosRecurseListMenu($id, $level, &$children, $open, &$indents, $class_sfx, $highlight)
{
    global $Itemid;
    global $HTTP_SERVER_VARS, $mosConfig_live_site;
    if (@$children[$id]) {
        $n = min($level, count($indents) - 1);
        echo $indents[$n][0];
        foreach ($children[$id] as $row) {
            switch ($row->type) {
                case 'separator':
                    // do nothing
                    $row->link = "seperator";
                    break;
                case 'url':
                    if (eregi('index.php\\?', $row->link)) {
                        if (!eregi('Itemid=', $row->link)) {
                            $row->link .= '&Itemid=' . $row->id;
                        }
                    }
                    break;
                default:
                    $row->link .= "&Itemid={$row->id}";
                    break;
            }
            $li = "\n" . $indents[$n][1];
            /* ANDROMEDA CHANGE */
            if (defined('_ANDROMEDA_JOOMLA')) {
                $current_itemid = '';
                if ($row->id == SessionGet('AGMENU_MODULE')) {
                    if (vgfGet('menu_mode') != 'x4') {
                        $li = "<li class='active'>";
                    }
                }
            } else {
                $current_itemid = trim(mosGetParam($_REQUEST, 'Itemid', 0));
                if ($row->link != "seperator" && $current_itemid == $row->id || $row->id == $highlight || sefRelToAbs(substr($_SERVER['PHP_SELF'], 0, -9) . $row->link) == $_SERVER['REQUEST_URI'] || sefRelToAbs(substr($_SERVER['PHP_SELF'], 0, -9) . $row->link) == $HTTP_SERVER_VARS['REQUEST_URI']) {
                    $li = "<li class='active'>";
                }
            }
            echo $li;
            // KFD change 4/9/07, AJAX-ification effort
            //echo hjxCheckFirst($row->name,$row->link);
            //txt = "<a href=\"$mitem->link\">$mitem->name</a>";
            echo mosGetLink($row, $level, $class_sfx);
            mosRecurseListMenu($row->id, $level + 1, $children, $open, $indents, $class_sfx, "");
            echo $indents[$n][2];
        }
        echo "\n" . $indents[$n][3];
    }
}
Пример #9
0
    $gp = 'menu_' . ($gm != '' ? $gm : gp('gp_page'));
    ?>
   <script>
     ob("<?php 
    echo $gp;
    ?>
").className="menuselected";
   </script>
   <?php 
}
// Script goes out at absolute end, after <html> element is closed
if (vgfGet("HTML_focus") != "") {
    ?>
   <script>
   ob('<?php 
    echo vgfGet("HTML_focus");
    ?>
').focus();
   </script>
   <?php 
}
if (Element("scriptend")) {
    echo '<script language="javascript" type="text/javascript">' . "\n";
    echo ElementOut("scriptend") . "\n";
    echo "</script>\n";
}
?>
</body>
</html>

Пример #10
0
 function hBoxes($mode)
 {
     // Obtain a row depending on the mode we are in.  If there
     // wdas an error then reload the first row for this table
     if (is_array(vgfGet('ErrorRow_' . $this->table_id, ''))) {
         $row = vgfGet('ErrorRow_' . $this->table_id);
         $row['skey'] = gp('gpx_skey');
     } else {
         switch ($mode) {
             case 'search':
                 // if a previous search, use that, else fall through
                 // to using current row
                 $row = ConGet('table', $this->table_id, 'search', array());
                 if (count($row) != 0) {
                     break;
                 }
             case 'ins':
                 $row = DrillDownMatches();
                 if (count($row) == 0) {
                     $row = aFromGP('pre_');
                 }
                 // KFD 8/13/07, part of COPY ability
                 if (gp('gp_action') == 'copy') {
                     $row2 = SQL_OneRow("SELECT * FROM " . $this->table_id . " where skey=" . SQLFN(gp('gp_skey')));
                     foreach ($row2 as $column_id => $colvalue) {
                         if (is_numeric($column_id)) {
                             continue;
                         }
                         if (!isset($this->table['flat'][$column_id])) {
                             continue;
                         }
                         $aid = $this->table['flat'][$column_id]['automation_id'];
                         if ($aid == 'SEQUENCE' || $column_id == gp('gp_exclude')) {
                             unset($row2[$column_id]);
                         }
                     }
                     $row = array_merge($row, $row2);
                 }
                 break;
             case 'upd':
                 $skey = gp('gp_skey');
                 hidden('gp_skey', '');
                 if (trim($skey) == '') {
                     $row = array();
                 } else {
                     $skey = " WHERE skey=" . $skey;
                     $sq = "Select * FROM " . $this->view_id . $skey;
                     $row = SQL_OneRow($sq);
                 }
         }
     }
     // Save the row for other routines
     $this->row = $row;
     // Find out what skey we are on, give a next/prev
     // kind of button for stuff like that.
     // Set the next/prev stuff based on rows
     $HTML_PagePrev = $HTML_PageNext = $HTML_ViewingPage = "";
     if ($mode == "upd") {
         $lprev = $lnext = false;
         $skey = $this->row['skey'];
         $sess_skeys = ConGet("table", $this->table_id, "skeys", array());
         if (count($sess_skeys) > 1) {
             $sess_srows = array_flip($sess_skeys);
             $sess_srow = $sess_srows[$row['skey']];
             $lprev = $sess_srow == 0 ? false : true;
             $skeyf = $sess_srow == 0 ? 0 : $sess_skeys[0];
             $skeyp = $sess_srow == 0 ? 0 : $sess_skeys[$sess_srow - 1];
             $skeyn = $sess_srow >= count($sess_srows) - 1 ? 0 : $sess_skeys[$sess_srow + 1];
             $skeyl = $sess_srow >= count($sess_srows) - 1 ? 0 : $sess_skeys[count($sess_srows) - 1];
             $hprev = hLinkImage('first', 'First', 'gp_skey', $skeyf, $lprev) . hLinkImage('previous', 'Previous', 'gp_skey', $skeyp, $lprev);
             $lnext = $sess_srow < count($sess_srows) - 1 ? true : false;
             $hnext = hLinkImage('next', 'Next', 'gp_skey', $skeyn, $lnext) . hLinkImage('last', 'Last', 'gp_skey', $skeyl, $lnext);
             $HTML_ViewingPage = "Page " . ($sess_srow + 1) . " of " . count($sess_srows);
         }
     }
     // Output and save the navbar
     ob_start();
     if ($HTML_ViewingPage != '') {
         $hprev = $this->hTextButton('\\First', 'gp_skey', $skeyf, $lprev) . $this->hTextButton('\\Previous', 'gp_skey', $skeyp, $lprev);
         $hnext = $this->hTextButton('Ne\\xt', 'gp_skey', $skeyn, $lnext) . $this->hTextButton('Las\\t', 'gp_skey', $skeyl, $lnext);
         if (vgfget('buttons_in_commands')) {
             $this->h['NavBar'] = '';
             vgfSet('html_navbar', $hprev . $hnext);
         } else {
             $this->h['NavBar'] = "\n<div class=\"x2menubar\">\n" . $hprev . $HTML_ViewingPage . "&nbsp;&nbsp;&nbsp;" . $hnext . "\n</div><br>";
         }
     }
     // Second output is main content
     // KFD 8/9/07, Project DUPECHECK
     //             If a "dupecheck" projection exists, and they are
     //             doing a new entry, we first ask them to enter
     //             those values
     $dc = ArraySafe($this->table['projections'], 'dupecheck');
     if ($dc != '' && $mode == 'ins' && !gpExists('gp_nodupecheck')) {
         hidden('gp_action', 'dupecheck');
         $this->h['Content'] = $this->hBoxesX3($mode, 'dupecheck');
         $this->h['Content'] .= '<br/><br/>' . '<button  class="btn btn-primary id="object_for_enter" onclick="formSubmit()">(ENTER) Check For Duplicates</button>';
     } else {
         $this->h['Content'] = $this->hBoxesDefault($mode);
     }
 }
Пример #11
0
 $a->hp['href'] = "javascript:x6menuclick('{$menuid}')";
 #$span= $pad->h('span',$menuinfo['description']);
 #$span->hp['onmouseover'] = "x6menumouseover('$menuid')";
 #$span->hp['onclick']     = "x6menuclick('$menuid')";
 $a->hp['onmouseover'] = "x6menumouseover('{$menuid}')";
 #$a->hp['onclick']     = "x6menuclick('$menuid')";
 #$span->addClass('x6menuspan'); // bogus, just for tracking
 $ul = $pad->h('ul');
 $ul->hp['id'] = 'x6menu_' . $menuid;
 $ul->addClass('dropdown');
 $ul->hp['style'] = 'display:none;';
 $count = 0;
 foreach ($menuinfo['items'] as $page => $pageinfo) {
     $count++;
     # Special hardcoded hack for x6 to remove some items
     if (vgfGet('x6')) {
         if ($page == 'apppub') {
             continue;
         }
         if ($page == 'userssimple') {
             continue;
         }
     }
     $pd = $pageinfo['description'];
     $li = $ul->h('li');
     $a = $li->h('a', $pd);
     #$li->hp['onmouseover']="$(this).addClass('selected')";
     #$li->hp['onmouseout'] ="$(this).removeClass('selected')";
     if ($pageinfo['uix2'] == 'Y') {
         #$a->hp['href'] = "?gp_page=$page&x2=1";
         $href = "?gp_page={$page}&amp;x2=1";
Пример #12
0
 function save()
 {
     $table_id = gp('x6page');
     $dd = ddTable($table_id);
     $row0 = aFromGP('x6v_');
     $row1 = aFromgp('x6inp_' . $table_id . '_');
     $row = array_merge($row0, $row1);
     if (arr($row, 'skey', 0) == 0) {
         unset($row['skey']);
     }
     # KFD 12/20/08, prevent ui saves if dd does not allow them
     if (!isset($row['skey'])) {
         $perm = $this->uiPerm(gp('x6page'), 'ins');
         if (!$perm) {
             x6Error("Inserts not allowed from this screen");
             return;
         }
     } else {
         $perm = $this->uiPerm(gp('x6page'), 'upd');
         if (!$perm) {
             x6Error("Updates not allowed from this screen");
             return;
         }
     }
     # Add in values from parent
     if (gp('tableIdPar', false)) {
         $vals2 = $this->fetchParent();
         $row = array_merge($row, $vals2);
     }
     # KFD 12/8/08, More generalized code to allow for
     #              inserts before or after a row.
     #
     # an skeyAfter value means we must find the queuepos
     # column in this table, and save a value of that
     # column equal to +1 of the value in row skeyAfter
     if (gp('queuepos', '') != '') {
         $queuepos = gp('queuepos');
         $skeyBefore = gp('skeyBefore');
         $skeyAfter = gp('skeyAfter');
         $skey = 0;
         if ($skeyBefore != -1) {
             $skey = $skeyBefore;
         }
         if ($skeyAfter != -1) {
             $skey = $skeyAfter;
         }
         if ($skey == 0) {
             $row[$queuepos] = 1;
         } else {
             $qpvalue = SQL_OneValue($queuepos, "Select {$queuepos} from {$dd['viewname']}\n                    where skey = " . sqlfc($skey));
             if ($skey == $skeyAfter) {
                 $qpvalue++;
             } else {
                 $qpvalue--;
             }
             $row[$queuepos] = $qpvalue;
         }
     }
     # KFD 6/28/08, a non-empty date must be valid
     $errors = false;
     foreach ($row as $col => $value) {
         if (!isset($dd['flat'][$col])) {
             unset($row[$col]);
             continue;
         }
         $ermsg = "Invalid date format for " . $dd['flat'][$col]['description'];
         $ermsg2 = "Invalid date value for " . $dd['flat'][$col]['description'];
         if ($dd['flat'][$col]['type_id'] == 'date') {
             if (trim($value) == '') {
                 continue;
             }
             if (strpos($value, '/') === false && strpos($value, '-') === false) {
                 x6Error($ermsg);
                 $errors = true;
                 continue;
             }
             if (strpos($value, '/') !== false) {
                 $parsed = explode('/', $value);
                 if (count($parsed) != 3) {
                     $errors = true;
                     x6Error($ermsg);
                     continue;
                 }
                 if (!checkdate($parsed[0], $parsed[1], $parsed[2])) {
                     x6Error($ermsg2);
                     $errors = true;
                     continue;
                 }
             }
             if (strpos($value, '-') !== false) {
                 $parsed = explode('-', $value);
                 if (count($parsed) != 3) {
                     $errors = true;
                     x6Error($ermsg);
                     continue;
                 }
                 if (!checkdate($parsed[1], $parsed[2], $parsed[0])) {
                     x6Error($ermsg2);
                     $errors = true;
                     continue;
                 }
             }
         }
     }
     if ($errors) {
         return;
     }
     if (!isset($row['skey'])) {
         # KFD 5/26/09 Google Feature #23, hook inserts
         $method = $table_id . "_before_insert";
         if (method_exists($this, $method)) {
             $row = $this->{$method}($row);
         }
         # KFD 6/8/09 Google #30, no action if returns false
         if ($row) {
             $skey = SQLX_Insert($dd, $row);
             if (!errors()) {
                 $row = SQL_OneRow("Select * FROM {$dd['viewname']} WHERE skey = {$skey}");
                 # KFD 5/26/09 Google Feature #23, hook inserts
                 $method = $table_id . "_after_insert";
                 if (method_exists($this, $method)) {
                     $row = $this->{$method}($row);
                 }
                 x6Data('row', $row);
             }
         }
     } else {
         # KFD 5/26/09 Google Feature #23, hook updates
         $method = $table_id . "_before_update";
         if (method_exists($this, $method)) {
             $row = $this->{$method}($row);
         }
         # KFD 6/8/09 Google #30, no action if returns false
         if ($row) {
             SQLX_Update($dd, $row);
             if (!errors()) {
                 $skey = $row['skey'];
                 $row = SQL_OneRow("Select * FROM {$dd['viewname']} WHERE skey = {$skey}");
                 # KFD 5/26/09 Google Feature #23, hook updates
                 $method = $table_id . "_after_update";
                 if (method_exists($this, $method)) {
                     $row = $this->{$method}($row);
                 }
                 x6Data('row', $row);
             }
         }
     }
     if (vgfGet('x6') == true) {
         if ($table_id == 'configinst') {
             configWrite('inst');
         }
         if ($table_id == 'configapp') {
             configWrite('app');
         }
     }
 }
Пример #13
0
 /**
  *  Constructor.  Clears all definitions and
  *  defaults to Landscape, points as unit of measure,
  *  and US Letter as page size.
  *
  *  @param string $ori   Orientation, "P" or "L"
  *  @param string $uom   Unit of measure
  *  @param string $paper See http://www.fpdf.org/manual/FPDF
  *
  *  @access public
  *  @since 0.1
  */
 function androPageReport($ori = 'l', $uom = 'pt', $paper = 'letter')
 {
     // Tab Stops
     $this->cols = array();
     $this->x6 = vgfGet('x6');
     $this->FPDF($ori, $uom, $paper);
 }
Пример #14
0
function index_hidden_template($mode)
{
    # KFD 1/10/08.  If x6 is set, we follow a completely different
    #               path, x6 settings win out.
    $flagx6 = configGet('flag_x6', 'N');
    $x6template = configGet('x6_template', '');
    $x6group = configGet('x6_group', '');
    if ($flagx6 == 'Y') {
        # In x6, we consider the "app_template()" function first,
        # if it returns something it always wins.
        if (function_exists('app_template')) {
            vgfSet('template', app_template());
        } else {
            if ($x6template == '') {
                vgfSet('template', 'x6');
            } else {
                if (!LoggedIn() || inGroup($x6group)) {
                    vgfSet('template', $x6template);
                } else {
                    vgfSet('template', 'x6');
                }
            }
        }
    } else {
        # this is old x2/x4 mode, begin by obtaining a
        # 'candidate' they may have been set
        $candidate = vgfGet('template');
        # KFD 7/23/08. Give application a chance to
        #              play with setting
        if (function_exists('app_template')) {
            vgfSet('template', app_template($candidate));
        }
        # KFD 7/23/08. If no template has been set by vgfSet,
        #              and the candidate is not empty, pick it
        if ($candidate != '' && vgfGet('template') == '') {
            vgfSet('template', $candidate);
        }
        # KFD 7/23/08. Finally, if we still don't have something,
        #              pick according to mode
        if (vgfGet('template') == '') {
            if ($mode == 'x4') {
                vgfSet('template', 'pixel2');
            } else {
                vgfSet('template', 'rt_pixel');
            }
        }
    }
    # KFD 9/2/08.  We still have one customer with a public
    #        interface that is not a Joomla template.  If the
    #        template is "*" then we DO NOT set up Joomla
    #        compatibility.  The application will use its own
    #        file in the application directory that is specified
    #        with vgaSet('html_pub').
    if (vgfGet('template') == '*') {
        return;
    }
    # Tell the JOOMLA files that we are legit
    # Fool them, that is...
    define("_ANDROMEDA_JOOMLA", 1);
    define("_JOOMLA_ANDROMEDA", 1);
    # Activate the template by creating public $J and calling funcs
    global $J, $AG;
    $J['TEMPLATE'] = vgfGet('template');
    JoomlaCompatibility($J['TEMPLATE']);
    $aphp = $AG['dirs']['root'] . '/templates/' . $J['TEMPLATE'] . '/andromeda.php';
    if (file_exists($aphp)) {
        include $aphp;
    }
    # <----- EARLY RETURN
    # The rest of this is totally superseded, and can
    # be removed after we go live with Beta 1
    return;
    /*
     global $AG;
    # KFD 7/3/08.  Have the vgfGet() value override anything else
    #
    if(vgfGet('template')<>'') {
        # Assign the template to spots where the legacy code will find it
        $AG['template'] = vgfGet('template');
    }
    
    // First conditional fix contributed by Don Organ 9/07, $AG['template']
    // was getting lost on passes 2+
    if(ArraySafe($AG,'template')<>'') {
        SessionSet('TEMPLATE',$AG['template']); 
    }
    else {
        if(SessionGet("TEMPLATE")=='') {
           if(!file_exists(fsDirTop().'templates')) {
              // There is no templates directory, so stop looking
              SessionSet('TEMPLATE','*');
           }
           else {
              if(ArraySafe($AG,'template')<>'') {
                 // if the app or instance specified a template at build time,
                 // use that.
                 SessionSet('TEMPLATE',$AG['template']);
              }
              else {
                 // At this point nobody has told us what to do, pick the
                 // first template we can find.
                 
                 // Big change by KFD 3/15/08  If we do not know what
                 // template to use, prefer to pick rt_pixel, our 
                 // default template, unless we find another one.
                 // In that case we assume that template is there for
                 // a reason and we use it.
                 $dir = $AG['dirs']['root'].'templates/';
                 $DIR = opendir($dir);
                 $rt_pixel = false;
                 while (false!==($filename = readdir($DIR))) {
                    if ($filename=='.')  continue;
                    if ($filename=='..') continue;
                    if ($filename=='andro_classic') continue;
                    if ($filename=='x4') continue;
                    // DO 2-1-2008 Added to ignore SVN directory
                    if ($filename=='.svn') continue;
                    if ($filename=='rt_pixel') $rt_pixel = true; 
                    if (is_dir($dir.$filename)) {
                       SessionSet('TEMPLATE',scFileName($filename));
                       break;
                    }
                 }
                 closedir($DIR);
                 // Here is where we pick rt_pixel if we could not
                 // find anything else
                 if($rt_pixel && SessionGet('TEMPLATE','')=='') {
                     SessionSet('TEMPLATE',$rt_pixel);
                 }
              }
           }
        }
    }
    // Now if a template was identified
    if(SessionGet("TEMPLATE")<>'*') {
       // Notify any code that may need to know that we are in a hybrid
       // Andromeda-joomla situation.  This is for both template code and
       // Andromeda code.  We define both variables in case people forget
       // which one we defined.
       define("_ANDROMEDA_JOOMLA",1); 
       define("_JOOMLA_ANDROMEDA",1); 
       
       // Activate the template by creating public $J and calling funcs
       global $J;
       $J['TEMPLATE']=SessionGet('TEMPLATE');
       JoomlaCompatibility($J['TEMPLATE']);
       $aphp=$AG['dirs']['root'].'/templates/'.$J['TEMPLATE'].'/andromeda.php';
       if(file_exists($aphp)) {
          include($aphp);
       }
    }
    */
}
Пример #15
0
<?php

$deprecated = configGet('deprecated', 'Y');
$x6 = vgfGet('x6', false);
# =====================================================================
#
# Output the title
#
# =====================================================================
echo "\n<title>" . vgfGet('pageTitle') . "</title>\n";
# =====================================================================
#
# The jQuery libraries always come first
#
#  NOTICE!  Andromeda has its own mini-fication system,
#           so do not fear all of these individual files!
#
# =====================================================================
# The jQuery library always comes first
jsInclude('clib/jquery-1.8.3.min.js', 'JQuery is distributed under the GPL
          license, written by a team of programmers led by John Resig,
          more info at http://www.jquery.com', 'Y');
$xpath = arr($_COOKIE, 'altjs', 'clib/');
$configJS = trim(configGet('js_css_debug', 'N'));
if ($deprecated == 'Y') {
    $styles = ElementImplode('styles');
    if ($styles != '') {
        ?>
        <style type="text/css">
        <?php 
        echo $styles;
Пример #16
0
if (mosCountModules('right')) {
    ?>
					<td class="right">
					 <div class="sidepad">
					   <?php 
    mosLoadModules('right', -2);
    ?>
					 </div>
					</td>
					<?php 
}
?>
				</tr>
			</table>
            <?php 
if (!(vgfGet('x4') === true && LoggedIn())) {
    ?>
			<div id="bot-footer">
				<?php 
    mosLoadModules('footer', -1);
    ?>
			</div>
            <?php 
}
?>
		</div>
        <?php 
if (!gpExists('x4Page')) {
    ?>
		<div id="bot-rocket">
			<a href="http://www.rockettheme.com"><span class="rocket">&nbsp;</span></a>
Пример #17
0
 function tabIndex($startHere = null)
 {
     if (!is_null($startHere)) {
         $tabIndex = $startHere;
     } else {
         $tabIndex = vgfGet('tabindex', 0);
         if ($tabIndex == 0) {
             $this->hp['x6firstFocus'] = 'Y';
             $tabIndex = 1000;
         }
     }
     $this->hp['tabIndex'] = $tabIndex;
     vgfSet('tabindex', ++$tabIndex);
     if (is_object(vgfGet('lastTab', 0))) {
         $obj = vgfGet('lastTab');
         $obj->hp['xNextTab'] = $this->hp['tabIndex'];
         $this->hp['xPrevTab'] = $obj->hp['tabIndex'];
     }
     vgfSet('lastTab', $this);
 }
Пример #18
0
function tmpModuleMenuRight()
{
    if (!LoggedIn()) {
        return;
    }
    $extra = '';
    if (!vgfGet('x4Welcome', false) && gpExists('x4Page')) {
        $extra = '<li><a href="?index.php">Classic</a>';
    }
    ?>
    <ul>
        <?php 
    echo $extra;
    ?>
        <li><a href='?st2logout=1'>Logout</a></li>
    </ul>
    <?php 
    return false;
}