/** * Method to prepare a new Horizontal Plain Menu. * * This method processes items of a menu to prepare and return * the corresponding Horizontal Plain Menu code. * * @access public * @param string $menu_name the name of the menu whose items have to be processed * @return string */ function newHorizontalPlainMenu($menu_name = "") { $horizontal_plain_menu_blck = ""; $t = new Template_PHPLIB(); $t->setFile("tplfile", $this->horizontalPlainMenuTpl); $t->setBlock("tplfile", "template", "template_blck"); $t->setBlock("template", "horizontal_plain_menu_cell", "horizontal_plain_menu_cell_blck"); $t->setVar("horizontal_plain_menu_cell_blck", ""); $t->setBlock("horizontal_plain_menu_cell", "plain_menu_cell", "plain_menu_cell_blck"); $t->setVar("plain_menu_cell_blck", ""); for ($cnt = $this->_firstItem[$menu_name]; $cnt <= $this->_lastItem[$menu_name]; $cnt++) { if ($this->tree[$cnt]["level"] == 1 && $cnt > $this->_firstItem[$menu_name]) { $t->parse("horizontal_plain_menu_cell_blck", "horizontal_plain_menu_cell", true); $t->setVar("plain_menu_cell_blck", ""); } $nbsp = ""; for ($i = 1; $i < $this->tree[$cnt]["level"]; $i++) { $nbsp .= " "; } $t->setVar(array("nbsp" => $nbsp, "href" => $this->tree[$cnt]["parsed_href"], "title" => $this->tree[$cnt]["parsed_title"], "target" => $this->tree[$cnt]["parsed_target"], "text" => $this->tree[$cnt]["parsed_text"])); $t->parse("plain_menu_cell_blck", "plain_menu_cell", true); } $t->parse("horizontal_plain_menu_cell_blck", "horizontal_plain_menu_cell", true); $this->_horizontalPlainMenu[$menu_name] = $t->parse("template_blck", "template"); return $this->_horizontalPlainMenu[$menu_name]; }
/** * Method to prepare a new Horizontal Plain Menu. * * This method processes items of a menu to prepare and return * the corresponding Horizontal Plain Menu code. * * @access public * @param string $menu_name the name of the menu whose items have to be processed * @return string */ function newHorizontalPlainMenu($menu_name = '') { $horizontal_plain_menu_blck = ''; $t = new Template_PHPLIB(); $t->setFile('tplfile', $this->horizontalPlainMenuTpl); $t->setBlock('tplfile', 'template', 'template_blck'); $t->setBlock('template', 'horizontal_plain_menu_cell', 'horizontal_plain_menu_cell_blck'); $t->setVar('horizontal_plain_menu_cell_blck', ''); $t->setBlock('horizontal_plain_menu_cell', 'plain_menu_cell', 'plain_menu_cell_blck'); $t->setVar('plain_menu_cell_blck', ''); for ($cnt = $this->_firstItem[$menu_name]; $cnt <= $this->_lastItem[$menu_name]; $cnt++) { if ($this->tree[$cnt]['text'] == '---') { continue; // separators are significant only for layers-based menus } if ($this->tree[$cnt]['level'] == 1 && $cnt > $this->_firstItem[$menu_name]) { $t->parse('horizontal_plain_menu_cell_blck', 'horizontal_plain_menu_cell', true); $t->setVar('plain_menu_cell_blck', ''); } $nbsp = ''; for ($i = 1; $i < $this->tree[$cnt]['level']; $i++) { $nbsp .= ' '; } $t->setVar(array('nbsp' => $nbsp, 'href' => $this->tree[$cnt]['parsed_href'], 'title' => $this->tree[$cnt]['parsed_title'], 'target' => $this->tree[$cnt]['parsed_target'], 'text' => $this->tree[$cnt]['parsed_text'])); $t->parse('plain_menu_cell_blck', 'plain_menu_cell', true); } $t->parse('horizontal_plain_menu_cell_blck', 'horizontal_plain_menu_cell', true); $this->_horizontalPlainMenu[$menu_name] = $t->parse('template_blck', 'template'); return $this->_horizontalPlainMenu[$menu_name]; }
$IncludeDir = $RootDir . "Include/"; $TemplateDir = "Template/"; $ModuleDir = $RootDir . "Module/"; $ClassDir = $RootDir . "Class/"; if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $separator = ";"; } else { $separator = ":"; } ini_set('include_path', ".{$separator}" . $IncludeDir . "Pear"); include_once $ConfigDir . "Config.php"; include_once $ConfigDir . "Common.php"; include_once $ClassDir . "Actions.class.php"; include_once $ClassDir . "FormObject.php"; include_once "PEAR.php"; include_once "DB.php"; include_once "DB/DataObject.php"; include_once "DB/DataObject/Cast.php"; include_once "HTML/Template/PHPLIB.php"; $UploadDir = $RootDir . $Upload_Dir; $dsn = "{$DB_Type}://{$DB_UserName}:{$DB_PassWord}@{$DB_Host}/{$DB_Name}"; $conn =& DB::connect($dsn); if (DB::isError($conn)) { die("Cannot connect: " . $conn->getMessage() . "\n"); } $opts =& PEAR::getStaticProperty('DB_DataObject', 'options'); $opts = array('database' => $dsn, 'schema_location' => $IncludeDir . 'Schema/', 'class_location' => $IncludeDir . 'DAO/', 'class_prefix' => 'Dao'); $template = new Template_PHPLIB($TemplateDir); $template->setFile(array("Page" => "page.html", "Header" => "header.html", "Foot" => "foot.html")); $template->setBlock("Header", "header"); $template->setVar(array("Title" => $Site_Title, "ImagesDir" => $TemplateDir . "images/", "TemplateDir" => $TemplateDir));
/** * Method to preparare a vertical menu. * * This method processes items of a menu to prepare the corresponding * vertical menu code updating many variables; it returns the code * of the corresponding _firstLevelMenu * * @access public * @param string $menu_name the name of the menu whose items have to be processed * @return string */ function newVerticalMenu($menu_name = '') { if (!isset($this->_firstItem[$menu_name]) || !isset($this->_lastItem[$menu_name])) { $this->error("newVerticalMenu: the first/last item of the menu '{$menu_name}' is not defined; please check if you have parsed its menu data."); return 0; } $this->parseCommon($menu_name); $t = new Template_PHPLIB(); $t->setFile('tplfile', $this->verticalMenuTpl); $t->setBlock('tplfile', 'template', 'template_blck'); $t->setBlock('template', 'vertical_menu_box', 'vertical_menu_box_blck'); $t->setVar('vertical_menu_box_blck', ''); $t->setBlock('vertical_menu_box', 'vertical_menu_cell', 'vertical_menu_cell_blck'); $t->setVar('vertical_menu_cell_blck', ''); $t->setBlock('vertical_menu_cell', 'cell_icon', 'cell_icon_blck'); $t->setVar('cell_icon_blck', ''); $t->setBlock('vertical_menu_cell', 'cell_arrow', 'cell_arrow_blck'); $t->setVar('cell_arrow_blck', ''); $t->setBlock('vertical_menu_box', 'separator', 'separator_blck'); $t->setVar('separator_blck', ''); $t_sub = new Template_PHPLIB(); $t_sub->setFile('tplfile', $this->subMenuTpl); $t_sub->setBlock('tplfile', 'sub_menu_cell', 'sub_menu_cell_blck'); $t_sub->setVar('sub_menu_cell_blck', ''); $t_sub->setBlock('sub_menu_cell', 'cell_icon', 'cell_icon_blck'); $t_sub->setVar('cell_icon_blck', ''); $t_sub->setBlock('sub_menu_cell', 'cell_arrow', 'cell_arrow_blck'); $t_sub->setVar('cell_arrow_blck', ''); $t_sub->setBlock('tplfile', 'separator', 'separator_blck'); $t_sub->setVar('separator_blck', ''); $this->_firstLevelMenu[$menu_name] = ''; $this->moveLayers .= "\tvar " . $menu_name . "TOP = getOffsetTop('" . $menu_name . "');\n"; $this->moveLayers .= "\tvar " . $menu_name . "LEFT = getOffsetLeft('" . $menu_name . "');\n"; $this->moveLayers .= "\tvar " . $menu_name . "WIDTH = getOffsetWidth('" . $menu_name . "');\n"; for ($cnt = $this->_firstItem[$menu_name]; $cnt <= $this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu if ($this->tree[$cnt]['not_a_leaf']) { // geometrical parameters are assigned to the new layer, related to the above mentioned children if ($this->tree[$cnt]['child_of_root_node']) { $this->moveLayers .= "\tsetLeft('" . $this->tree[$cnt]['layer_label'] . "', " . $menu_name . "LEFT + " . $menu_name . "WIDTH - menuRightShift);\n"; } } if ($this->tree[$cnt]['child_of_root_node']) { if ($this->tree[$cnt]['text'] == '---') { $this->_firstLevelMenu[$menu_name] .= $t->parse('separator_blck', 'separator'); continue; } if ($this->tree[$cnt]['not_a_leaf']) { $this->tree[$cnt]['onmouseover'] = ' onmouseover="moveLayerX(' . "'" . $this->tree[$cnt]['layer_label'] . "') ; moveLayerY('" . $this->tree[$cnt]['layer_label'] . "') ; LMPopUp('" . $this->tree[$cnt]['layer_label'] . "'" . ', false);"'; } else { $this->tree[$cnt]['onmouseover'] = ' onmouseover="shutdown();"'; } $t->setVar(array('imgwww' => $this->imgwww, 'transparent' => $this->transparentIcon, 'href' => $this->tree[$cnt]['parsed_href'], 'refid' => 'ref' . $this->tree[$cnt]['layer_label'], 'onmouseover' => $this->tree[$cnt]['onmouseover'], 'title' => $this->tree[$cnt]['parsed_title'], 'target' => $this->tree[$cnt]['parsed_target'], 'text' => $this->tree[$cnt]['text'], 'arrowsrc' => $this->forwardArrowImg['src'], 'arrowwidth' => $this->forwardArrowImg['width'], 'arrowheight' => $this->forwardArrowImg['height'])); if ($this->_hasIcons[$menu_name]) { $t->setVar(array('iconsrc' => $this->tree[$cnt]['iconsrc'], 'iconwidth' => $this->tree[$cnt]['iconwidth'], 'iconheight' => $this->tree[$cnt]['iconheight'], 'iconalt' => $this->tree[$cnt]['iconalt'])); $t->parse('cell_icon_blck', 'cell_icon'); } else { $t->setVar('cell_icon_blck', ''); } if ($this->tree[$cnt]['not_a_leaf']) { $t->parse('cell_arrow_blck', 'cell_arrow'); } else { $t->setVar('cell_arrow_blck', ''); } $this->_firstLevelMenu[$menu_name] .= $t->parse('vertical_menu_cell_blck', 'vertical_menu_cell'); } else { if ($this->tree[$cnt]['text'] == '---') { $this->tree[$this->tree[$cnt]['father_node']]['layer_content'] .= $t_sub->parse('separator_blck', 'separator'); continue; } if ($this->tree[$cnt]['not_a_leaf']) { $this->tree[$cnt]['onmouseover'] = ' onmouseover="moveLayerX(' . "'" . $this->tree[$cnt]['layer_label'] . "') ; moveLayerY('" . $this->tree[$cnt]['layer_label'] . "') ; LMPopUp('" . $this->tree[$cnt]['layer_label'] . "'" . ', false);"'; } else { $this->tree[$cnt]['onmouseover'] = ' onmouseover="LMPopUp(' . "'" . $this->tree[$this->tree[$cnt]['father_node']]['layer_label'] . "'" . ', true);"'; } $t_sub->setVar(array('imgwww' => $this->imgwww, 'transparent' => $this->transparentIcon, 'href' => $this->tree[$cnt]['parsed_href'], 'refid' => 'ref' . $this->tree[$cnt]['layer_label'], 'onmouseover' => $this->tree[$cnt]['onmouseover'], 'title' => $this->tree[$cnt]['parsed_title'], 'target' => $this->tree[$cnt]['parsed_target'], 'text' => $this->tree[$cnt]['text'], 'arrowsrc' => $this->forwardArrowImg['src'], 'arrowwidth' => $this->forwardArrowImg['width'], 'arrowheight' => $this->forwardArrowImg['height'])); if ($this->_hasIcons[$this->tree[$cnt]['father_node']]) { $t_sub->setVar(array('iconsrc' => $this->tree[$cnt]['iconsrc'], 'iconwidth' => $this->tree[$cnt]['iconwidth'], 'iconheight' => $this->tree[$cnt]['iconheight'], 'iconalt' => $this->tree[$cnt]['iconalt'])); $t_sub->parse('cell_icon_blck', 'cell_icon'); } else { $t_sub->setVar('cell_icon_blck', ''); } if ($this->tree[$cnt]['not_a_leaf']) { $t_sub->parse('cell_arrow_blck', 'cell_arrow'); } else { $t_sub->setVar('cell_arrow_blck', ''); } $this->tree[$this->tree[$cnt]['father_node']]['layer_content'] .= $t_sub->parse('sub_menu_cell_blck', 'sub_menu_cell'); } } // end of the "for" cycle scanning all nodes $t->setVar(array('menu_name' => $menu_name, 'vertical_menu_cell_blck' => $this->_firstLevelMenu[$menu_name], 'separator_blck' => '')); $this->_firstLevelMenu[$menu_name] = $t->parse('vertical_menu_box_blck', 'vertical_menu_box'); $t->setVar('abscissaStep', $this->abscissaStep); $t->setVar(array('layer_label' => $menu_name, 'vertical_menu_box_blck' => $this->_firstLevelMenu[$menu_name])); $this->_firstLevelMenu[$menu_name] = $t->parse('template_blck', 'template'); $this->_updateFooter($menu_name); return $this->_firstLevelMenu[$menu_name]; }
/** * Method to preparare a vertical menu. * * This method processes items of a menu to prepare the corresponding * vertical menu code updating many variables; it returns the code * of the corresponding _firstLevelMenu * * @access public * @param string $menu_name the name of the menu whose items have to be processed * @return string */ function newVerticalMenu($menu_name = "") { if (!isset($this->_firstItem[$menu_name]) || !isset($this->_lastItem[$menu_name])) { $this->error("newVerticalMenu: the first/last item of the menu '{$menu_name}' is not defined; please check if you have parsed its menu data."); return 0; } $this->parseCommon($menu_name); $t = new Template_PHPLIB(); $t->setFile("tplfile", $this->verticalMenuTpl); $t->setBlock("tplfile", "template", "template_blck"); $t->setBlock("template", "vertical_menu_box", "vertical_menu_box_blck"); $t->setVar("vertical_menu_box_blck", ""); $t->setBlock("vertical_menu_box", "vertical_menu_cell", "vertical_menu_cell_blck"); $t->setVar("vertical_menu_cell_blck", ""); $t->setBlock("vertical_menu_cell", "cell_icon", "cell_icon_blck"); $t->setVar("cell_icon_blck", ""); $t->setBlock("vertical_menu_cell", "cell_arrow", "cell_arrow_blck"); $t->setVar("cell_arrow_blck", ""); $t_sub = new Template_PHPLIB(); $t_sub->setFile("tplfile", $this->subMenuTpl); $t_sub->setBlock("tplfile", "sub_menu_cell", "sub_menu_cell_blck"); $t_sub->setVar("sub_menu_cell_blck", ""); $t_sub->setBlock("sub_menu_cell", "cell_icon", "cell_icon_blck"); $t_sub->setVar("cell_icon_blck", ""); $t_sub->setBlock("sub_menu_cell", "cell_arrow", "cell_arrow_blck"); $t_sub->setVar("cell_arrow_blck", ""); $this->_firstLevelMenu[$menu_name] = ""; $this->moveLayers .= "\tvar " . $menu_name . "TOP = getOffsetTop('" . $menu_name . "');\n"; $this->moveLayers .= "\tvar " . $menu_name . "LEFT = getOffsetLeft('" . $menu_name . "');\n"; $this->moveLayers .= "\tvar " . $menu_name . "WIDTH = getOffsetWidth('" . $menu_name . "');\n"; for ($cnt = $this->_firstItem[$menu_name]; $cnt <= $this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu if ($this->tree[$cnt]["not_a_leaf"]) { // geometrical parameters are assigned to the new layer, related to the above mentioned children if ($this->tree[$cnt]["child_of_root_node"]) { $this->moveLayers .= "\tsetLeft('" . $this->tree[$cnt]["layer_label"] . "', " . $menu_name . "LEFT + " . $menu_name . "WIDTH - menuRightShift);\n"; } } if ($this->tree[$cnt]["child_of_root_node"]) { if ($this->tree[$cnt]["not_a_leaf"]) { $this->tree[$cnt]["onmouseover"] = " onmouseover=\"moveLayerX('" . $this->tree[$cnt]["layer_label"] . "') ; moveLayerY('" . $this->tree[$cnt]["layer_label"] . "') ; LMPopUp('" . $this->tree[$cnt]["layer_label"] . "', false);\""; } else { $this->tree[$cnt]["onmouseover"] = " onmouseover=\"shutdown();\""; } $t->setVar(array("imgwww" => $this->imgwww, "transparent" => $this->transparentIcon, "href" => $this->tree[$cnt]["parsed_href"], "refid" => "ref" . $this->tree[$cnt]["layer_label"], "onmouseover" => $this->tree[$cnt]["onmouseover"], "title" => $this->tree[$cnt]["parsed_title"], "target" => $this->tree[$cnt]["parsed_target"], "text" => $this->tree[$cnt]["text"], "arrowsrc" => $this->forwardArrowImg["src"], "arrowwidth" => $this->forwardArrowImg["width"], "arrowheight" => $this->forwardArrowImg["height"])); if ($this->_hasIcons[$menu_name]) { $t->setVar(array("iconsrc" => $this->tree[$cnt]["iconsrc"], "iconwidth" => $this->tree[$cnt]["iconwidth"], "iconheight" => $this->tree[$cnt]["iconheight"], "iconalt" => $this->tree[$cnt]["iconalt"])); $t->parse("cell_icon_blck", "cell_icon"); } else { $t->setVar("cell_icon_blck", ""); } if ($this->tree[$cnt]["not_a_leaf"]) { $t->parse("cell_arrow_blck", "cell_arrow"); } else { $t->setVar("cell_arrow_blck", ""); } $this->_firstLevelMenu[$menu_name] .= $t->parse("vertical_menu_cell_blck", "vertical_menu_cell"); } else { if ($this->tree[$cnt]["not_a_leaf"]) { $this->tree[$cnt]["onmouseover"] = " onmouseover=\"moveLayerX('" . $this->tree[$cnt]["layer_label"] . "') ; moveLayerY('" . $this->tree[$cnt]["layer_label"] . "') ; LMPopUp('" . $this->tree[$cnt]["layer_label"] . "', false);\""; } else { $this->tree[$cnt]["onmouseover"] = " onmouseover=\"LMPopUp('" . $this->tree[$this->tree[$cnt]["father_node"]]["layer_label"] . "', true);\""; } $t_sub->setVar(array("imgwww" => $this->imgwww, "transparent" => $this->transparentIcon, "href" => $this->tree[$cnt]["parsed_href"], "refid" => "ref" . $this->tree[$cnt]["layer_label"], "onmouseover" => $this->tree[$cnt]["onmouseover"], "title" => $this->tree[$cnt]["parsed_title"], "target" => $this->tree[$cnt]["parsed_target"], "text" => $this->tree[$cnt]["text"], "arrowsrc" => $this->forwardArrowImg["src"], "arrowwidth" => $this->forwardArrowImg["width"], "arrowheight" => $this->forwardArrowImg["height"])); if ($this->_hasIcons[$this->tree[$cnt]["father_node"]]) { $t_sub->setVar(array("imgwww" => $this->imgwww, "iconsrc" => $this->tree[$cnt]["iconsrc"], "iconwidth" => $this->tree[$cnt]["iconwidth"], "iconheight" => $this->tree[$cnt]["iconheight"], "iconalt" => $this->tree[$cnt]["iconalt"])); $t_sub->parse("cell_icon_blck", "cell_icon"); } else { $t_sub->setVar("cell_icon_blck", ""); } if ($this->tree[$cnt]["not_a_leaf"]) { $t_sub->parse("cell_arrow_blck", "cell_arrow"); } else { $t_sub->setVar("cell_arrow_blck", ""); } $this->tree[$this->tree[$cnt]["father_node"]]["layer_content"] .= $t_sub->parse("sub_menu_cell_blck", "sub_menu_cell"); } } // end of the "for" cycle scanning all nodes $t->setVar(array("menu_name" => $menu_name, "vertical_menu_cell_blck" => $this->_firstLevelMenu[$menu_name])); $this->_firstLevelMenu[$menu_name] = $t->parse("vertical_menu_box_blck", "vertical_menu_box"); $t->setVar("abscissaStep", $this->abscissaStep); $t->setVar(array("layer_label" => $menu_name, "vertical_menu_box_blck" => $this->_firstLevelMenu[$menu_name])); $this->_firstLevelMenu[$menu_name] = $t->parse("template_blck", "template"); $this->_updateFooter($menu_name); return $this->_firstLevelMenu[$menu_name]; }
$WebUploadDir = dirname(getenv("SCRIPT_NAME")) . "/" . $Upload_Dir; $dsn = "{$DB_Type}://{$DB_UserName}:{$DB_PassWord}@{$DB_Host}/{$DB_Name}"; $conn =& DB::connect($dsn); if (DB::isError($conn)) { $subject = "Error:cannot connect database"; $error_msg = "Cannot connect database: " . $conn->getMessage() . "\n"; errorMailToMaster($Tech_Mail, $subject, $error_msg); $logger->log($error_msg); die($error_msg); } $opts =& PEAR::getStaticProperty('DB_DataObject', 'options'); $opts = array('database' => $dsn, 'class_location' => $RootDir . '/dao/', 'class_prefix' => 'Dao', 'extends_location' => '', 'template_location' => $TemplateDir, 'actions_location' => $RootDir, 'modules_location' => $RootDir . '/module/users/', $users_table . '_modules_location' => $RootDir . '/module/users/', $users_table . '_modules_name_location' => 'users', $users_table . '_fields_list' => 'id,user_name,user_pwd,gender,phone,role_id,active', $users_table . '_except_fields' => 'id,add_ip,created_at,update_at', $users_table . '_generator_add_validate_stubs' => 'user_name:empty', $groups_table . '_modules_location' => $RootDir . '/module/users/', $groups_table . '_modules_name_location' => 'users', $groups_table . '_fields_list' => 'group_id,group_type,group_define_name,is_active,owner_user_id,owner_group_id', $groups_table . '_except_fields' => '', $groups_table . '_generator_add_validate_stubs' => 'group_define_name:empty', $rights_table . '_modules_location' => $RootDir . '/module/users/', $rights_table . '_modules_name_location' => 'users', $rights_table . '_fields_list' => 'right_id,right_define_name', $rights_table . '_except_fields' => 'area_id,has_implied', $rights_table . '_generator_add_validate_stubs' => 'right_define_name:empty', $news_category_table . '_modules_location' => $RootDir . '/module/news/', $news_category_table . '_modules_name_location' => 'news', $news_category_table . '_fields_list' => 'id,category_name,active', $news_category_table . '_except_fields' => 'id,add_ip,created_at,update_at,orderid', $news_category_table . '_generator_add_validate_stubs' => 'category_name:empty', $news_table . '_modules_location' => $RootDir . '/module/news/', $news_table . '_modules_name_location' => 'news', $news_table . '_fields_list' => 'id,title,category_id,active', $news_table . '_except_fields' => 'id,add_ip,created_at,update_at', $news_table . '_generator_add_validate_stubs' => 'title:empty', $product_category_table . '_modules_location' => $RootDir . '/module/product/', $product_category_table . '_modules_name_location' => 'product', $product_category_table . '_fields_list' => 'id,category_name,active', $product_category_table . '_except_fields' => 'id,add_ip,created_at,update_at,orderid', $product_category_table . '_generator_add_validate_stubs' => 'category_name:empty', $product_table . '_modules_location' => $RootDir . '/module/product/', $product_table . '_modules_name_location' => 'product', $product_table . '_fields_list' => 'id,category,company_id,name,price,photo,active', $product_table . '_except_fields' => 'id,add_ip,created_at,update_at', $product_table . '_generator_add_validate_stubs' => 'name:empty', $product_price_table . '_modules_location' => $RootDir . '/module/product/', $product_price_table . '_modules_name_location' => 'product', $product_price_table . '_fields_list' => 'id,company_id,product_id,price,created_at', $product_price_table . '_except_fields' => 'id,add_ip,company_id,product_id,created_at,update_at', $product_price_table . '_generator_add_validate_stubs' => 'price:empty', 'require_prefix' => 'dataobjects/', 'class_prefix' => 'Dao', 'extends' => 'DB_DataObject', 'generate_setters' => '1', 'generate_getters' => '1', 'generator_include_regex' => '/^' . $news_category_table . '$/', 'generator_no_ini' => '1'); $controller = new Controller(); $template = new Template_PHPLIB($TemplateDir); $template->setFile(array("LAOUT" => "laout.html", "FOOT" => "foot.html")); $template->setBlock("LAOUT", "laout"); //&& (APF_LOGIN_ACCESS == "Y") if (defined('APF_LOGIN_ACCESS')) { $liveuserConfig = array('session' => array('name' => 'PHPSESSID', 'varname' => 'loginInfo'), 'logout' => array('destroy' => true), 'cookie' => array('name' => 'loginInfo', 'path' => null, 'domain' => null, 'secure' => false, 'lifetime' => 30, 'secret' => 'mysecretkey', 'savedir' => $RootDir . 'cookies'), 'authContainers' => array('DB' => array('type' => 'DB', 'expireTime' => 60 * 60, 'idleTime' => 60 * 60, 'prefix' => 'apf_', 'passwordEncryptionMode' => 'md5', 'storage' => array('prefix' => '', 'dsn' => $dsn, 'tables' => array('users' => array('fields' => array('email' => false, 'lastlogin' => false, 'is_active' => false))), 'alias' => array('users' => $users_table, 'auth_user_id' => 'id', 'handle' => 'user_name', 'passwd' => 'user_pwd', 'lastlogin' => 'update_at', 'is_active' => 'active', 'email' => 'email'), 'fields' => array('lastlogin' => 'timestamp', 'is_active' => 'text', 'email' => 'text')))), 'permContainer' => array('type' => 'Medium', 'storage' => array('DB' => array('dsn' => $dsn, 'prefix' => 'apf_', 'tables' => array('groups' => array('fields' => array('owner_user_id' => false, 'owner_group_id' => false, 'is_active' => false))), 'fields' => array('owner_user_id' => 'integer', 'owner_group_id' => 'integer', 'is_active' => 'boolean'), 'alias' => array('owner_user_id' => 'owner_user_id', 'owner_group_id' => 'owner_group_id', 'is_active' => 'is_active'))))); $LU =& LiveUser::factory($liveuserConfig); if (!$LU->init()) { var_dump($LU->getErrors()); die; } $handle = array_key_exists('handle', $_REQUEST) ? $_REQUEST['handle'] : null; $passwd = array_key_exists('passwd', $_REQUEST) ? $_REQUEST['passwd'] : null; $logout = array_key_exists('logout', $_REQUEST) ? $_REQUEST['logout'] : false; $remember = array_key_exists('remember', $_REQUEST) ? $_REQUEST['remember'] : false; // Var_Dump::display($LU->isLoggedIn()); if ($logout) { $LU->logout(true);
if ($web_base_name == "front_en.php") { $lang = "en"; $template->setFile(array("LAOUT" => "front_laout.html", "HEADER" => "header.html", "MENU" => "menu.html", "FOOT" => "footer_en.html")); } else { $lang = "zh"; $template->setFile(array("LAOUT" => "front_laout.html", "HEADER" => "header.html", "MENU" => "menu.html", "FOOT" => "footer.html")); } $i18n = new I18N_Messages_File($lang, $domain, $dir); include_once $ConfigDir . "common.php"; require_once $ClassDir . "SendEmail.php"; require_once "Cache/Lite.php"; $cache_options = array('cacheDir' => $CacheDir, 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE); $cache = new Cache_Lite($cache_options); $log_conf = array('mode' => 0777, 'timeFormat' => '%X %x'); $logger =& Log::singleton('file', $LogDir . date("Y_m_d") . '.log', '\\t', $log_conf); if (defined('APF_DEBUG') && APF_DEBUG == true) { include_once 'Benchmark/Timer.php'; include_once 'Var_Dump.php'; Var_Dump::displayInit(array('display_mode' => 'HTML4_Table')); $timer =& new Benchmark_Timer(); $timer->start(); } $UploadDir = $RootDir . "web/" . $Upload_Dir; $WebUploadDir = dirname(getenv("SCRIPT_NAME")) . "/" . $Upload_Dir; $dsn = "{$DB_Type}://{$DB_UserName}:{$DB_PassWord}@{$DB_Host}/{$DB_Name}"; $controller = new Controller(); $template->setBlock("FOOT", "foot"); $template->setBlock("LAOUT", "front_laout"); $template->setBlock("MENU", "menu"); include_once $ClassDir . "URLHelper.class.php"; $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir));