Ejemplo n.º 1
0
 function __construct($content, $title)
 {
     parent::__construct();
     define(GOOGLE_CODE_TRACKER_NOT_ACTIF, true);
     $this->render = new Table();
     $this->render->setWidth("100%");
     // Header
     if (defined('SITE_META_OPENGRAPH_IMAGE') && SITE_META_OPENGRAPH_IMAGE != "") {
         $logo = new Picture(SITE_META_OPENGRAPH_IMAGE);
     } else {
         $logo = new Picture("img/logo_128x400_" . $_SESSION['lang'] . ".png", 128, 400);
     }
     $logo->setTitle(__(SITE_NAME));
     $logo_link = new Link($this->getPage()->getBaseLanguageURL(), Link::TARGET_NONE, $logo);
     $img_obj = new Object($logo_link);
     $img_obj->add("<br/><br/>");
     $this->render->addRow($img_obj);
     $this->render->addRow();
     // Error message
     $small_img = new Picture("wsp/img/warning_16.png", 16, 16, 0, "absmiddle");
     $title_header = new Object($small_img, $title);
     $error_box = new Box($title_header, true, Box::STYLE_MAIN, Box::STYLE_MAIN, '', 'error_box', 700);
     $error_box->setContent($content);
     $this->render->addRow($error_box);
 }
Ejemplo n.º 2
0
 function __construct($page_object, $array_menu)
 {
     parent::__construct();
     $this->render = new Menu();
     $wsp_admin_url = WSP_ADMIN_URL;
     $menu_items = new MenuItems();
     foreach ($array_menu['MenuItems']['MenuItem'] as $menuitems) {
         eval("\$page_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'] . "\";");
         }
         eval("\$page_link = \"" . $menuitems['Menu_attr']['url'] . "\";");
         if ($menuitems['Menu_attr']['url'] == "\$wsp_admin_url/admin.html") {
             $page_title = "";
         }
         $menu_item = new MenuItem($page_title, $page_link, $page_icon_16);
         if (isset($_GET['menu'])) {
             if ($page_link == $wsp_admin_url . "/admin.html?menu=" . $_GET['menu']) {
                 $menu_item->setCurrent();
             }
         }
         $menu_items->add($menu_item);
         $sub_menu_items = new MenuItems();
         if (!isset($menuitems['MenuItems']['MenuItem'][0])) {
             $sub_menuitems = $menuitems['MenuItems'];
         } else {
             $sub_menuitems = $menuitems['MenuItems']['MenuItem'];
         }
         $nb_sub_menu = 0;
         foreach ($sub_menuitems as $menuitem) {
             eval("\$page_icon_16 = \"" . $menuitem['Menu_attr']['icon_16'] . "\";");
             if (find($menuitem['Menu_attr']['name'], "__(", 0, 0) > 0) {
                 eval("\$page_title = " . $menuitem['Menu_attr']['name'] . ";");
             } else {
                 eval("\$page_title = \"" . $menuitem['Menu_attr']['name'] . "\";");
             }
             eval("\$page_link = \"" . $menuitem['Menu_attr']['url'] . "\";");
             $sub_menu_item = new MenuItem($page_title, $page_link, $page_icon_16);
             if ($page_link == $_GET['p'] . ".html") {
                 $sub_menu_item->setCurrent();
                 $menu_item->setCurrent();
             }
             $sub_menu_items->add($sub_menu_item);
             $nb_sub_menu++;
         }
         if ($nb_sub_menu > 0) {
             $menu_item->setMenuItems($sub_menu_items);
         }
     }
     $this->render->setMenuItems($menu_items);
     $this->render->activateSupersubs();
     list($strAdminLogin, $strAdminPasswd, $strAdminRights) = getWspUserRightsInfo("admin");
     if ($strAdminLogin == "admin" && $strAdminPasswd == sha1("admin")) {
         $modalbox = new DialogBox(__(CHANGE_PASSWD), new Url($page_object->getBaseLanguageURL() . "wsp-admin/change-passwd.call"));
         $modalbox->modal()->setWidth(400);
         $page_object->addObject($modalbox);
     }
 }
Ejemplo n.º 3
0
 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()));
 }