public function __construct($sql)
 {
     parent::__construct($sql);
 }
Beispiel #2
0
 /**
  *@package AppForm
  *@since v0.1
  *@method PrintList()
  *@desc  Returns the records as a table
  * */
 private function PrintList()
 {
     $html = '';
     $db = new db();
     $appListFormId = 'apFrmLst' . $this->IdObject;
     $divPannel = 'pannel-1-' . $this->IdObject;
     $L = new AppList($this->sql_list);
     $L->formId = $appListFormId;
     $L->printFormTag = false;
     $L->reg_x_pag = $this->reg_x_page;
     $L->enable_buttons = true;
     $L->butons_IdObject = $this->IdObject;
     $L->divPannel = $divPannel;
     $L->id_field_name = $this->DbRecord->id_field_name;
     $data['formId'] = $appListFormId;
     $data['divPannel'] = $divPannel;
     $data['url'] = $this->CurrentPage;
     if ($this->templateList != '') {
         $L->useTemplateView($this->templateList, $data);
     }
     // Toolbar
     $toolbar = $this->PrintToolBar();
     $html .= $toolbar;
     $html .= '<div class="clear"></div>';
     $html .= '<form name="' . $appListFormId . '" id="' . $appListFormId . '">';
     $html .= '<input type="hidden" name="op" value="' . encode('view-2') . '">';
     $ajaxSubmit = new ajax_submit();
     //$html .='<textarea style="width:97%;height:400px">';
     $html .= $ajaxSubmit->Render($L->formId, $divPannel, $this->CurrentPage);
     $html .= utf8_encode($L->Render($this->CurrentPage));
     //$html .='</textarea>';
     $html .= '</form>';
     // Returns result
     ob_start();
     eval('?>' . $html . '<?php ');
     echo $ViewResult = ob_get_contents();
     ob_end_clean();
     return $ViewResult;
 }
     $ret = array('html' => $html, 'postId' => $post->get_postId(), 'username' => $user->get_username());
     echo json_encode($ret);
 } else {
     if ($op == "like") {
         // adds a like from the current user to the post
         $postId = $_GET['postId'];
         $post = new Post($postId);
         $ret = array();
         $ret['like'] = $post->like($user->get_username());
         $ret['postId'] = $postId;
         $ret['likecount'] = count($post->get_likes());
         echo json_encode($ret);
     } else {
         if ($op == "get all apps") {
             // get the html for selecting each app
             $applist = new AppList();
             echo json_encode(build_appSelectors($applist->get_applist()));
         } else {
             if ($op == "open app") {
                 // saves the requested app info in the session
                 $app = new App($_GET['appname']);
                 $_SESSION['html'] = file_get_contents($app->get_html_location());
                 $_SESSION['scripts'] = file_get_contents($app->get_htmlscripts_location());
             } else {
                 if ($op == "get app") {
                     // Gets the requested app from the session
                     $json = array();
                     $json['html'] = $_SESSION['html'];
                     $json['scripts'] = $_SESSION['scripts'];
                     echo json_encode($json);
                 } else {