Example #1
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(HOME_PAGE_TITLE);
     // Welcome message
     $small_img = new Picture("img/logo_16x16.png", 16, 16, 0, Picture::ALIGN_ABSMIDDLE);
     $title_header = new Object($small_img, __(WELCOME));
     $welcome_box = new Box($title_header, true, Box::STYLE_SECOND, Box::STYLE_SECOND, "", "welcome_box", 600);
     $welcome_obj = new Object(__(WELCOME_MSG));
     list($strAdminLogin, $strAdminPasswd, $strAdminRights) = getWspUserRightsInfo("admin");
     $quickstart_obj = new Object(new Picture("img/quickstart_128.png", 64, 64), "<br/>", __(QUICKSTART));
     $quickstart_link = new Link("http://www.website-php.com/" . $this->getLanguage() . "/quick-start.html", Link::TARGET_BLANK, $quickstart_obj);
     $quickstart_box = new RoundBox(3, "quickstart_box", 120, 120);
     $quickstart_box->setValign(RoundBox::VALIGN_CENTER);
     $quickstart_box->setContent($quickstart_link);
     $tutorial_obj = new Object(new Picture("img/tutorials_128.png", 64, 64), "<br/>", __(TUTORIALS));
     $tutorial_link = new Link("http://www.website-php.com/" . $this->getLanguage() . "/tutorials.html", Link::TARGET_BLANK, $tutorial_obj);
     $tutorial_box = new RoundBox(3, "tutorial_box", 120, 120);
     $tutorial_box->setValign(RoundBox::VALIGN_CENTER);
     $tutorial_box->setContent($tutorial_link);
     $connect_obj = new Object(new Picture("img/wsp-admin/admin_128.png", 64, 64), "<br/>", __(CONNECT));
     $connect_link = new Link("wsp-admin/connect.html", Link::TARGET_BLANK, $connect_obj);
     $connect_box = new RoundBox(3, "connect_box", 120, 120);
     $connect_box->setValign(RoundBox::VALIGN_CENTER);
     $connect_box->setContent($connect_link);
     $icon_table = new Table();
     $icon_table->setDefaultAlign(RowTable::ALIGN_CENTER)->setDefaultValign(RowTable::VALIGN_TOP);
     $icon_row = $icon_table->addRowColumns($quickstart_box, "&nbsp;", $tutorial_box, "&nbsp;", $connect_box);
     $icon_row->setColumnWidth(5, 120);
     if ($strAdminLogin == "admin" && $strAdminPasswd == sha1("admin")) {
         $finalize = new Font(__(FINALIZE_INSTALL));
         $finalize->setFontColor("red");
         $finalize->setFontWeight(Font::FONT_WEIGHT_BOLD);
         $welcome_obj->add("<br/>", $finalize, "<br/>", __(CONNECT_DEFAULT_PASSWD), "<br/>");
     }
     $welcome_obj->add("<br/>", $icon_table);
     $welcome_box->setContent($welcome_obj);
     // Footer
     $this->render = new Template($welcome_box);
 }
 function __construct($page_object, $content, $right_side_content = null)
 {
     parent::__construct();
     $page_object->includeJsAndCssFromObjectToPage("LiveValidation");
     $this->render = new Table();
     $this->render->setWidth("100%");
     $this->render->setDefaultAlign(RowTable::ALIGN_CENTER);
     $table = new Table();
     $table->setWidth("800");
     $table->setDefaultAlign(RowTable::ALIGN_LEFT);
     // search parent link and current page icon, name
     $pathway = "";
     $page_icon_16 = "";
     $wsp_admin_url = WSP_ADMIN_URL;
     $array_menu = xml2array(file_get_contents(dirname(__FILE__) . "/../menu.xml"));
     foreach ($array_menu['MenuItems']['MenuItem'] as $menuitems) {
         if (find($menuitems['Menu_attr']['name'], "__(", 0, 0) > 0) {
             eval("\$page_title = " . $menuitems['Menu_attr']['name'] . ";");
         } else {
             eval("\$page_title = \"" . $menuitems['Menu_attr']['name'] . "\";");
         }
         eval("\$page_link = \"" . $menuitems['Menu_attr']['url'] . "\";");
         if (!isset($menuitems['MenuItems']['MenuItem'][0])) {
             $sub_menuitems = $menuitems['MenuItems'];
         } else {
             $sub_menuitems = $menuitems['MenuItems']['MenuItem'];
         }
         foreach ($sub_menuitems as $menuitem) {
             eval("\$sub_page_link = \"" . $menuitem['Menu_attr']['url'] . "\";");
             if ($sub_page_link == $_GET['p'] . ".html") {
                 eval("\$page_icon_16 = \"" . $menuitem['Menu_attr']['icon_16'] . "\";");
                 if (find($menuitem['Menu_attr']['name'], "__(", 0, 0) > 0) {
                     eval("\$sub_page_title = " . $menuitem['Menu_attr']['name'] . ";");
                 } else {
                     eval("\$sub_page_title = \"" . $menuitem['Menu_attr']['name'] . "\";");
                 }
                 $pathway = new Object(new Link($page_link, Link::TARGET_NONE, $page_title), " > ", $sub_page_title);
                 break;
             }
         }
         if ($pathway != "") {
             break;
         }
     }
     // Header
     $logo_pic = new Picture("img/wsp-admin/logo_60x160_" . $_SESSION['lang'] . ".png", 60, 160, 0);
     $table->addRowColumns(new AdminMenu($page_object, $array_menu), new Link("http://www.website-php.com", Link::TARGET_BLANK, $logo_pic))->setColumnAlign(2, RowTable::ALIGN_RIGHT);
     // check WSP version
     $alert_version_obj = getAlertVersiobObject($page_object);
     if ($alert_version_obj != null) {
         $table->addRowColumns($alert_version_obj)->setColspan(2);
     }
     // Main
     $small_img = new Picture($page_icon_16, 16, 16, 0, Picture::ALIGN_ABSMIDDLE);
     $title_header = new Object($small_img);
     $title_header->add(new Object(new Link("wsp-admin/admin.html", Link::TARGET_NONE, __(ADMIN)), " > ", $pathway));
     $box_width = 800;
     if ($right_side_content != null) {
         $box_width = 700;
     }
     $configure_box = new Box($title_header, true, Box::STYLE_SECOND, Box::STYLE_SECOND, "", "configure_database_box", $box_width);
     $configure_box->setContent($content);
     if ($right_side_content != null) {
         $table->addRowColumns($configure_box, "&nbsp;", $right_side_content)->setColumnColspan(1, 2)->setColumnWidth(1, $box_width)->setColumnWidth(2, 10);
     } else {
         $table->addRow($configure_box)->setColspan(2);
     }
     $this->render->addRow($table);
     $this->render->addRow(__(CURRENT_WSP_VERSION, getCurrentWspVersion()));
 }
 function __construct($page_object, $menu_url)
 {
     parent::__construct();
     $wsp_admin_url = WSP_ADMIN_URL;
     $array_menu = xml2array(file_get_contents(dirname(__FILE__) . "/../menu.xml"));
     foreach ($array_menu['MenuItems']['MenuItem'] as $menuitems) {
         if ($menuitems['Menu_attr']['url'] == "\$wsp_admin_url/" . $menu_url) {
             eval("\$icon_16 = \"" . $menuitems['Menu_attr']['icon_16'] . "\";");
             if (find($menuitems['Menu_attr']['name'], "__(", 0, 0) > 0) {
                 eval("\$page_title = " . $menuitems['Menu_attr']['name'] . ";");
             } else {
                 eval("\$page_title = \"" . $menuitems['Menu_attr']['name'] . "\";");
             }
             if ($menuitems['Menu_attr']['url'] == "\$wsp_admin_url/admin.html") {
                 $menuitems = $array_menu;
             }
             if (!isset($menuitems['MenuItems']['MenuItem'][0])) {
                 $sub_menuitems = $menuitems['MenuItems'];
             } else {
                 $sub_menuitems = $menuitems['MenuItems']['MenuItem'];
             }
             foreach ($sub_menuitems as $menuitem) {
                 if ($menuitem['Menu_attr']['url'] != "\$wsp_admin_url/admin.html") {
                     eval("\$sub_page_icon_64 = \"" . $menuitem['Menu_attr']['icon_64'] . "\";");
                     if (find($menuitem['Menu_attr']['name'], "__(", 0, 0) > 0) {
                         eval("\$sub_page_title = " . $menuitem['Menu_attr']['name'] . ";");
                     } else {
                         eval("\$sub_page_title = \"" . $menuitem['Menu_attr']['name'] . "\";");
                     }
                     eval("\$sub_page_link = \"" . $menuitem['Menu_attr']['url'] . "\";");
                     $this->addLink($sub_page_icon_64, $sub_page_title, $sub_page_link);
                 }
             }
             break;
         }
     }
     if ($page_title == "" && $icon_16 == "") {
         throw new NewException("Administration page doesn't exists", 0, getDebugBacktrace(1));
     }
     $this->render = new Table();
     $this->render->setWidth("100%");
     $this->render->setDefaultAlign(RowTable::ALIGN_CENTER);
     $table = new Table();
     $table->setWidth("800");
     $table->setDefaultAlign(RowTable::ALIGN_LEFT);
     // Header
     $logo_pic = new Picture("img/wsp-admin/logo_60x160_" . $_SESSION['lang'] . ".png", 60, 160, 0);
     $table->addRowColumns(new AdminMenu($page_object, $array_menu), new Link("http://www.website-php.com", Link::TARGET_BLANK, $logo_pic))->setColumnAlign(2, RowTable::ALIGN_RIGHT);
     // check WSP version
     $alert_version_obj = getAlertVersiobObject($page_object);
     if ($alert_version_obj != null) {
         $table->addRowColumns($alert_version_obj)->setColspan(2);
     }
     // Main
     $small_img = new Picture($icon_16, 16, 16, 0, Picture::ALIGN_ABSMIDDLE);
     $title_header = new Object($small_img);
     if ($page_title == __(ADMIN)) {
         $title_header->add($page_title);
     } else {
         $title_header->add(new Object(new Link(WSP_ADMIN_URL . "/admin.html", Link::TARGET_NONE, __(ADMIN)), " > ", $page_title));
     }
     $admin_box = new Box($title_header, true, Box::STYLE_SECOND, Box::STYLE_SECOND, "", "admin_box", 800);
     $admin_obj = new Object("<br/>");
     $admin_obj->add(createTableFirstPagePic64($this->array_link_obj), "<br/><br/>");
     $admin_box->setContent($admin_obj);
     $table->addRow($admin_box)->setColspan(2);
     $this->render->addRow($table);
     $this->render->addRow(__(CURRENT_WSP_VERSION, getCurrentWspVersion()));
 }