예제 #1
0
파일: module.php 프로젝트: EGArian/sarkesh
 protected function module_abc($r)
 {
     $db = new cls_database();
     $db->do_query("INSERT INTO rr (user,pass) VALUES ('?','?')", array($r['username']['VALUE'], $r['password']['VALUE']));
     $r['RV']['VALUE'] = cls_page::SHOW_BLOCK('YOHO', 'YOUR MSG WAS RECIVED', 'MODAL', 'type-danger');
     $r['RV']['URL'] = "HTTP://GOOGLE.COM";
     return $r;
 }
예제 #2
0
파일: view.php 프로젝트: MrMiM/sarkesh
 protected function view_table()
 {
     $form = new ctr_form('name');
     $table = new ctr_table();
     $row = new ctr_row();
     $text = new ctr_textbox();
     $button = new ctr_button();
     $row->add($text, 6);
     $row->add($button, 6);
     $db = new cls_database();
     $db->do_query('select * from users');
     $table->add_source($db->get_array());
     $form->add($table);
     return array('tittle', $form->draw());
 }
예제 #3
0
파일: cls_page.php 프로젝트: MrMiM/sarkesh
 public static function set_position($position)
 {
     if (self::$blocks == null) {
         //load all blocks data from database
         $db = new cls_database();
         $query_string = "SELECT b.name AS 'b.name',";
         $query_string .= "b.position AS 'b.position', b.permissions AS 'b.permissions', ";
         $query_string .= "b.pages AS 'b.pages', b.show_header AS 'b.show_header', b.plugin AS 'b.plugin', p.id AS 'p.id', p.name AS 'p.name', b.rank FROM blocks b INNER JOIN plugins p ON b.plugin = p.id ORDER BY b.rank DESC;";
         $db->do_query($query_string);
         self::$blocks = $db->get_array();
         self::$plugin = new cls_plugin();
     }
     //search blocks for position matched
     //if add 'MAIN' to cls_router::show_content that's show like main content that come with url
     //and if add 'BLOCK' tag , sarkesh show that content like block
     //and if Send 'NONE' sarkesh do not show that(just run without view
     foreach (self::$blocks as $block) {
         if ($block['b.position'] == $position) {
             //going to process block
             if ($block['p.name'] == 'core') {
                 //going to show content;
                 $obj_router = new cls_router();
                 $obj_router->show_content();
             } else {
                 //checking that plugin is enabled
                 if (self::$plugin->is_enabled($block['p.name'])) {
                     $plugin = new $block['p.name']();
                     //run action method for show block
                     //all blocks name should be like  'blk_blockname'
                     $content = call_user_func(array($plugin, $block['b.name']), $position);
                     echo self::show_block($content[0], $content[1], 'BLOCK');
                 }
             }
         }
     }
 }