Example #1
0
$head->setCss('./css/psa.css');
$head->setJs('./js/PSA.js');
$head->build();
$body = new Body();
$body->build();
include_once './inc/menubar.php';
$body->line('Executed query : <br />');
$body->line('<p class="qs">' . $sessie->getS('psa-query-results') . '<hr />');
$sessie->unsetS('psa-query-results');
$titles = FALSE;
if (!$res) {
    $body->line('no further feedback');
} else {
    $table = new Table();
    $table->setClas('result');
    $table->setId('listing');
    $table->build();
    $odd = TRUE;
    foreach ($res as $item) {
        if (!$titles) {
            $tr = new Th();
            $names = array_keys(get_object_vars($item));
            foreach ($names as $title) {
                $tr->add($title);
            }
            $tr->build();
            $titles = TRUE;
        }
        $tr = new Tr();
        if ($odd) {
            $tr->setGlobalClass('even');
Example #2
0
 /**
  * Method render
  * @access public
  * @param boolean $ajax_render [default value: false]
  * @return mixed
  * @since 1.1.9
  */
 public function render($ajax_render = false)
 {
     $gallery_table = new Table();
     $gallery_table->setId("PhotoGalleryTable" . rand(0, 999999))->activatePagination();
     $header = new RowTable();
     for ($i = 0; $i < $this->nb_col; $i++) {
         $header->add();
     }
     $gallery_table->addRow($header->setHeaderClass(0));
     $ind = 0;
     $last_ind = -1;
     $gallery_row = null;
     $files = scandir($this->path, 1);
     for ($i = 0; $i < sizeof($files); $i++) {
         $file = $files[$i];
         if ($file != "." && $file != "..") {
             $getExt = explode(".", $file);
             $countExt = count($getExt);
             $fExt = $countExt - 1;
             $myExt = $getExt[$fExt];
             if ((is_dir($this->path . $file) || $this->in_arrayi($myExt, $this->picture_ext)) && $file != $this->thumbnail_folder) {
                 if ($ind != $last_ind && $ind % $this->nb_col == 0) {
                     if ($gallery_row != null) {
                         $gallery_table->addRow($gallery_row);
                     }
                     $gallery_row = new RowTable();
                     $gallery_row->setWidth("25%");
                     $last_ind = $ind;
                 }
                 if (is_dir($this->path . $file)) {
                     if ($this->subfolder) {
                         $folder_pic = new Picture($this->folder_pic, 128, 128, 0, Picture::ALIGN_ABSMIDDLE, $file);
                         $url = $this->getPage()->getCurrentURL();
                         if (($pos = find($url, "gallery_event=")) > 0) {
                             $pos2 = find($url, "&", 0, $pos);
                             if ($pos2 == 0) {
                                 $url = substr($url, 0, $pos - 1);
                             } else {
                                 $url1 = substr($url, 0, $pos - 1);
                                 $url2 = substr($url, $pos2, strlen($url));
                                 $url = $url1 . $url2;
                             }
                         }
                         if (find($url, "?") > 0) {
                             $url = $url . "&";
                         } else {
                             $url = $url . "?";
                         }
                         $url = $url . "gallery_event=" . urlencode(str_replace($this->original_path, "", $this->path . $file));
                         $folder_link = new Link($url, Link::TARGET_NONE, new Object($folder_pic, "<br/>", $file));
                         $gallery_row->add($folder_link);
                         $ind++;
                     }
                 } else {
                     if ($this->in_arrayi($myExt, $this->picture_ext)) {
                         $pic_file = str_replace(str_replace("\\", "/", realpath(SITE_DIRECTORY)) . "/", "", str_replace("\\", "/", realpath($this->path)) . "/" . $file);
                         $pic_file_lower_ext = str_replace("." . $myExt, strtolower("." . $myExt), $pic_file);
                         if ($pic_file_lower_ext != $pic_file) {
                             $path_file_lower_ext = str_replace($pic_file, $pic_file_lower_ext, str_replace("\\", "/", realpath(SITE_DIRECTORY . "/" . $pic_file)));
                             if (!rename(realpath(SITE_DIRECTORY . "/" . $pic_file), $path_file_lower_ext)) {
                                 $pic_file_lower_ext = $pic_file;
                             }
                         }
                         $pic_name = str_replace("." . $myExt, "", $file);
                         $pic_thumbnail = $pic_file_lower_ext;
                         if (trim($this->thumbnail_folder) != "") {
                             if (in_array(strtolower($myExt), array("jpg", "jpeg", "gif", "png"))) {
                                 if (!is_dir(realpath($this->path) . "/" . $this->thumbnail_folder)) {
                                     mkdir(realpath($this->path) . "/" . $this->thumbnail_folder);
                                 }
                                 $pic_thumbnail_path = realpath($this->path . "/" . $this->thumbnail_folder) . "/" . str_replace("." . $myExt, strtolower("." . $myExt), $file);
                                 $pic_thumbnail = str_replace(str_replace("\\", "/", realpath(SITE_DIRECTORY)) . "/", "", str_replace("\\", "/", realpath($this->path . "/" . $this->thumbnail_folder)) . "/" . str_replace("." . $myExt, strtolower("." . $myExt), $file));
                                 if (strtolower($myExt) == "gif") {
                                     // convert to jpg
                                     $pic_thumbnail_path = str_replace(".gif", ".jpg", $pic_thumbnail_path);
                                     $pic_thumbnail = str_replace(".gif", ".jpg", $pic_thumbnail);
                                 }
                                 if (!file_exists($pic_thumbnail_path)) {
                                     if (strtolower($myExt) == "jpg" || strtolower($myExt) == "jpeg") {
                                         jpegReductionFixe($pic_file_lower_ext, $pic_thumbnail_path, 128, 128);
                                     } else {
                                         if (strtolower($myExt) == "png") {
                                             pngReductionFixe($pic_file_lower_ext, $pic_thumbnail_path, 128, 128);
                                         } else {
                                             $tmp_file = realpath($this->path . "/" . $this->thumbnail_folder) . "/temp.jpg";
                                             gif2jpeg($pic_file_lower_ext, $tmp_file);
                                             jpegReductionFixe($tmp_file, $pic_thumbnail_path, 128, 128);
                                             unlink($tmp_file);
                                         }
                                     }
                                 }
                             }
                         }
                         $pic = new Picture($pic_thumbnail, 128, 128, 0, Picture::ALIGN_ABSMIDDLE, $pic_name);
                         $pic->addLightbox("Lightbox" . $gallery_table->getId(), $pic_file_lower_ext, "\$(window).width()-(\$(window).width()*0.2)", "\$(window).height()-(\$(window).height()*0.2)");
                         $gallery_row->add(new Object($pic, "<br/>", $pic_name));
                         $ind++;
                     }
                 }
             }
         }
     }
     if ($gallery_row != null) {
         while ($ind % $this->nb_col != 0) {
             $gallery_row->add();
             $ind++;
         }
         $gallery_table->addRow($gallery_row);
     }
     return $gallery_table->render($ajax_render);
 }
Example #3
0
$coldefault->setName('coldefault');
$coldefault->setSize(25);
$coldefault->setMaxlength(128);
$coldefault->setId('coldefault');
$fieldadd = new Input();
$fieldadd->setType('button');
$fieldadd->setName('fieldadd');
$fieldadd->setValue('add');
$fieldadd->setJs(' onclick="PSA.addField();" ');
$tr = new Tr();
$tr->add($colname->dump());
$tr->add($coltype->dump());
$tr->setClas('center');
$tr->add($colprime->dump());
$tr->setClas('center');
$tr->add($colsize->dump());
$tr->setClas('center');
$tr->add($colnull->dump());
$tr->add($coldefault->dump());
$tr->add($fieldadd->dump());
$tr->build();
unset($table);
$body->line('<hr />');
$table = new Table();
$table->setId('tfields');
unset($table);
$body->line('<div id="ttshow"></div>');
$body->line('</div>');
include_once './inc/footer.php';
unset($body);
unset($html);
Example #4
0
 public function Loaded()
 {
     $users_table = new Table();
     $users_table->setId("users_table")->activateAdvanceTable()->activateSort(1)->setWidth(400);
     $users_table->addRowColumns(__(LOGIN), __(RIGHTS), __(MODIFY), __(DELETE))->setHeaderClass(0);
     $this->old_passwd_row->hide();
     $this->validate_btn->show();
     $this->modify_btn->hide();
     $this->cancel_btn->hide();
     $is_modify_mode = false;
     $array_users = getAllWspUsers();
     for ($i = 0; $i < sizeof($array_users); $i++) {
         $edit_user = new Picture("img/wsp-admin/edit_16.png", 16, 16);
         $edit_user->onClick($this, "refresh")->setAjaxEvent()->disableAjaxWaitMessage();
         if ($edit_user->isClicked() && !$is_modify_mode) {
             $this->old_passwd_row->show();
             $this->validate_btn->hide();
             $this->modify_btn->show();
             $this->cancel_btn->show();
             $this->edt_login->setValue($array_users[$i]['login']);
             $this->edt_old_password->forceEmpty();
             $this->edt_password->forceEmpty();
             $this->edt_confirm_passwd->forceEmpty();
             $is_modify_mode = true;
         }
         if ($array_users[$i]['login'] == $_SESSION['wsp-login']) {
             $del_user = new Object();
         } else {
             $del_user = new Picture("img/wsp-admin/delete_16.png", 16, 16);
             $del_user->setId("user_" . $array_users[$i]['login']);
             $del_user->onClickJs("if (!confirm('" . __(DEL_CONFIRM) . "')) { return false; }");
             $del_user->onClick($this, "removeWspUser", $array_users[$i]['login'])->setAjaxEvent();
             if ($del_user->isClicked()) {
                 continue;
             }
         }
         $users_table->addRowColumns($array_users[$i]['login'], $array_users[$i]['rights'], $edit_user, $del_user)->setColumnAlign(3, RowTable::ALIGN_CENTER)->setColumnAlign(4, RowTable::ALIGN_CENTER);
     }
     $this->users_table_obj->add($users_table);
 }
Example #5
0
 public function createExamples($ind)
 {
     $table_box = new Table();
     $table_box->setWidth(250)->setDefaultAlign(RowTable::ALIGN_LEFT);
     $table_box->addRow();
     $body_obj = new Object();
     $body_obj->setAlign(Object::ALIGN_CENTER);
     //->setId("id_body_obj")->setStyle("padding:5px;background:".$this->background_body->getValue().";");
     $text_obj = new Object(__(TEXT_ON_BODY));
     $body_obj->add($text_obj->setId("id_body_text"), "<br/>");
     $link_obj = new Object(new Link("javascript:void(0);", Link::TARGET_BLANK, __(LINK_ON_BODY)));
     $body_obj->add($link_obj->setId("id_body_link"), "<br/>");
     $body_obj->add($this->text_link_note_obj, "<br/>");
     $table_box->addRow($body_obj);
     $table_box->addRow();
     $table_box->addRow();
     $button_1 = new Button($this);
     $button_1->setWidth(245);
     $table_box->addRow($button_1->setValue("Button [style jquery]"));
     $table_box->addRow();
     $tabs = new Tabs("tab-sample");
     $tabs->addTab("Tab1", "");
     $tabs->addTab("Tab2", "");
     $tabs->addTab("Tab3", "");
     $table_box->addRow($tabs);
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $dialogbox = new DialogBox(__(DIALOGBOX_TITLE), __(DIALOGBOX_CONTENT));
     $dialogbox->setWidth(245)->activateOneInstance()->setPosition("");
     $dialogbox_link = new Object(new Link($dialogbox, Link::TARGET_NONE, __(VIEW_DIALOGBOX)));
     $table_box->addRow($dialogbox_link->setId("id_dialogbox_link"));
     $dialogbox->setPositionX("\$('#" . $dialogbox_link->getId() . "').position().left-f_scrollLeft()");
     $dialogbox->setPositionY("\$('#" . $dialogbox_link->getId() . "').position().top-f_scrollTop()-70");
     $this->addObject(clone $dialogbox);
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $style1_box_text = new Box("text", false, $this->current_style_val, $this->current_style_val, "", "box_text_" . $this->current_style_val, 245);
     if ($this->background_picture_1->getValue() != "") {
         $style1_box_text->forceBoxWithPicture(true, $this->border_table_1->getValue());
     } else {
         $style1_box_text->forceBoxWithPicture(false);
     }
     $table_box->addRow($style1_box_text->setContent("Box Object [<a href=\"javascript:void(0);\">style " . $this->current_style_val . "</a>]"));
     $style1_box = new Box("link", false, $this->current_style_val, $this->current_style_val, "javascript:void(0);", "box_" . $this->current_style_val, 245);
     if ($this->background_picture_1->getValue() != "") {
         $style1_box->forceBoxWithPicture(true, $this->border_table_1->getValue());
     } else {
         $style1_box->forceBoxWithPicture(false);
     }
     $style1_box->setShadow(true);
     $table_box->addRow($style1_box->setContent("Box Object [<a href=\"javascript:void(0);\">style " . $this->current_style_val . "</a>]"));
     $style1_box = new RoundBox($this->current_style_val, "round_box_" . $this->current_style_val, 245);
     $style1_box->setShadow(true);
     if ($this->background_picture_1->getValue() != "") {
         $style1_box->forceBoxWithPicture(true, $this->border_table_1->getValue());
     } else {
         $style1_box->forceBoxWithPicture(false);
     }
     $table_box->addRow($style1_box->setContent("RoundBox Object<br/>[style " . $this->current_style_val . "]"));
     $table_box->addRow();
     if (!defined('DEFINE_STYLE_BORDER_TABLE_' . $this->current_style_val)) {
         define('DEFINE_STYLE_BORDER_TABLE_' . $this->current_style_val, $this->border_table_1->getValue());
     }
     $table = new Table();
     $table->setId("table_sample")->setWidth(245);
     $table->addRowColumns("header1", "header2", "header3")->setHeaderClass($this->current_style_val);
     $table->addRowColumns("cel 1-1", "cel 1-2", "cel 1-3")->setId("table_tr_sample")->setBorderPredefinedStyle($this->current_style_val)->setAlign(RowTable::ALIGN_CENTER);
     $table_box->addRow($table);
     return $table_box;
 }