protected function module_login_page() { //get login panel $login_panel = $this->users->login(); $login_panel[1] = cls_page::show_block($login_panel[0], $login_panel[1], 'BLOCK'); return $this->module_load($login_panel, true); }
protected function view_draw($config) { //configure raintpl // $this->raintpl->configure('tpl_dir', 'core/lib/controls/uploader/'); //add headers to page// cls_page::add_header('<script src="./core/ect/scripts/events/functions.js"></script>'); cls_page::add_header('<script src="./core/lib/controls/uploader/ctr_uploader.js"></script>'); cls_page::add_header('<link rel="stylesheet" type="text/css" href="./core/lib/controls/uploader/ctr_uploader.css" />'); if ($config['SCRIPT_SRC'] != '') { cls_page::add_header('<script src="' . $config['SCRIPT_SRC'] . '"></script>'); } if ($config['CSS_FILE'] != '') { cls_page::add_header('<link rel="stylesheet" type="text/css" href="' . $config['CSS_FILE']) . '" />'; } $this->raintpl->assign("size", $config['SIZE']); $this->raintpl->assign("class", $config['CLASS']); $this->raintpl->assign("form", $config['FORM']); $this->raintpl->assign("name", $config['NAME']); $this->raintpl->assign("label", $config['LABEL']); $this->raintpl->assign("help", $config['HELP']); $this->raintpl->assign("type", $config['TYPE']); $this->raintpl->assign("txt_file_address", _('File name')); $this->raintpl->assign("txt_upload", _('Upload')); $this->raintpl->assign("txt_select", _('Select')); $this->raintpl->assign("txt_max_size", _('Max Size')); $this->raintpl->assign("txt_max_size_unit", $config['FILE_UNIT']); $this->raintpl->assign("max_size", $config['MAX_FILE_SIZE']); $this->raintpl->assign("max_size_unit", $config['MAX_FILE_SIZE_UNIT']); $this->raintpl->assign("txt_file_types", _('Valid types')); $this->raintpl->assign("file_types", $config['FILE_TYPES']); $this->raintpl->assign("preview", $config['PREVIEW']); //return control return $this->raintpl->draw('ctr_uploader', true); }
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; }
function sys_render($buffer) { // first replace headers // like css java scripts and ect $buffer = str_replace("</#PAGE_TITTLE#/>", cls_page::get_page_tittle(), $buffer); //LOAD HEADERS $buffer = str_replace("</#HEADERS#/>", cls_page::load_headers(false), $buffer); return $buffer; }
public function view_draw($e, $config) { if ($config['CSS_FILE'] != '') { cls_page::add_header(''); } $this->raintpl->assign("e", $e); $this->raintpl->assign("style", $config['STYLE']); $this->raintpl->assign("class", $config['CLASS']); return $this->raintpl->draw("ctr_row", true); }
protected function module_change_language($e) { if ($this->obj_localize->set_language($e['lang']['SELECTED'])) { //change successfull return 1 $e['RV']['URL'] = 'R'; } else { $e['RV']['VALUE'] = cls_page::show_block(false, _('message'), _('changing language has some problem! Please try again later.'), 'MODAL', 'type-warning'); } return $e; }
public function view_draw($config, $show) { //configure raintpl // $this->raintpl->configure('tpl_dir', 'core/lib/controls/combobox/tpl/'); //add headers to page// cls_page::add_header('<script src="./core/ect/scripts/events/functions.js"></script>'); if ($config['SCRIPT_SRC'] != '') { cls_page::add_header('<script src="' . $config['SCRIPT_SRC'] . '"></script>'); } if ($config['CSS_FILE'] != '') { cls_page::add_header('<link rel="stylesheet" type="text/css" href="' . $config['CSS_FILE']) . '" />'; } //Assign variables $this->raintpl->assign("id", $config['NAME']); $this->raintpl->assign("form", $config['FORM']); $this->raintpl->assign("value", $config['VALUE']); $this->raintpl->assign("label", $config['LABEL']); $elements = []; if ($config['COLUMN_LABELS'] == '') { //WANT TO SHOW SIMPLE ARRAY $indexes = array_keys($config['SOURCE']); foreach ($config['SOURCE'] as $keys => $source) { $elements[$keys]['label'] = $source; $elements[$keys]['value'] = $source; } } else { //want to bind control to table foreach ($config['TABLE'] as $keys => $source) { $elements[$keys]['label'] = $source[$config['COLUMN_LABELS']]; $elements[$keys]['value'] = $source[$config['COLUMN_VALUES']]; } } $this->raintpl->assign("source", $elements); $this->raintpl->assign("size", $config['SIZE']); $this->raintpl->assign("help", $config['HELP']); $this->raintpl->assign("bs_control", $config['BS_CONTROL']); $this->raintpl->assign("inline", $config['INLINE']); $this->raintpl->assign("styles", $config['STYLE']); $this->raintpl->assign("class", $config['CLASS']); $this->raintpl->assign("j_onchange", $config['J_ONCHANGE']); $this->raintpl->assign("p_onchange_f", $config['P_ONCHANGE_FUNCTION']); $this->raintpl->assign("p_onchange_p", $config['P_ONCHANGE_PLUGIN']); $this->raintpl->assign("j_after_onchange", $config['J_AFTER_ONCHANGE']); if ($config['DISABLE']) { $this->raintpl->assign("disabled", 'disabled'); } else { $this->raintpl->assign("disabled", 'enabled'); } //return control $ctr = $this->raintpl->draw('ctr_combobox', true); if ($show) { echo $ctr; } return $ctr; }
public function view_draw($config, $show) { //configure raintpl // $this->raintpl->configure('tpl_dir', 'core/lib/controls/textbox/tpl/'); //add headers to page// cls_page::add_header('<script src="./core/ect/scripts/events/functions.js"></script>'); if ($config['SCRIPT_SRC'] != '') { cls_page::add_header('<script src="' . $config['SCRIPT_SRC'] . '"></script>'); } if ($config['CSS_FILE'] != '') { cls_page::add_header('<link rel="stylesheet" type="text/css" href="' . $config['CSS_FILE']) . '" />'; } //Assign variables $this->raintpl->assign("id", $config['NAME']); $this->raintpl->assign("form", $config['FORM']); $this->raintpl->assign("password", $config['PASSWORD']); $this->raintpl->assign("value", $config['VALUE']); $this->raintpl->assign("label", $config['LABEL']); $this->raintpl->assign("help", $config['HELP']); $this->raintpl->assign("size", $config['SIZE']); $this->raintpl->assign("bs_size", $config['BS_SIZE']); $this->raintpl->assign("type", $config['TYPE']); $this->raintpl->assign("bs_control", $config['BS_CONTROL']); $this->raintpl->assign("inline", $config['INLINE']); $this->raintpl->assign("placeholder", $config['PLACE_HOLDER']); $this->raintpl->assign("styles", $config['STYLE']); $this->raintpl->assign("class", $config['CLASS']); $this->raintpl->assign("addon", $config['ADDON']); $this->raintpl->assign("j_onclick", $config['J_ONCLICK']); $this->raintpl->assign("p_onclick_f", $config['P_ONCLICK_FUNCTION']); $this->raintpl->assign("p_onclick_p", $config['P_ONCLICK_PLUGIN']); $this->raintpl->assign("j_after_onclick", $config['J_AFTER_ONCLICK']); $this->raintpl->assign("j_onfocus", $config['J_ONFOCUS']); $this->raintpl->assign("p_onfocus_f", $config['P_ONFOCUS_FUNCTION']); $this->raintpl->assign("p_onfocus_p", $config['P_ONFOCUS_PLUGIN']); $this->raintpl->assign("j_after_onfocus", $config['J_AFTER_ONFOCUS']); $this->raintpl->assign("j_onblur", $config['J_ONBLUR']); $this->raintpl->assign("p_onblur_f", $config['P_ONBLUR_FUNCTION']); $this->raintpl->assign("p_onblur_p", $config['P_ONBLUR_PLUGIN']); $this->raintpl->assign("j_after_onblur", $config['J_AFTER_ONBLUR']); if ($config['DISABLE']) { $this->raintpl->assign("disabled", 'disabled'); } else { $this->raintpl->assign("disabled", 'enabled'); } //return control $ctr = $this->raintpl->draw('ctr_textbox', true); if ($show) { echo $ctr; } return $ctr; }
public function view_draw($config) { //configure raintpl // $this->raintpl->configure('tpl_dir', 'core/lib/controls/button/tpl/'); //add headers to page// cls_page::add_header('<script src="./core/ect/scripts/events/functions.js"></script>'); if ($config['SCRIPT_SRC'] != '') { cls_page::add_header('<script src="' . $config['SCRIPT_SRC'] . '"></script>'); } if ($config['CSS_FILE'] != '') { cls_page::add_header('<link rel="stylesheet" type="text/css" href="' . $config['CSS_FILE']) . '" />'; } //Assign variables $this->raintpl->assign("id", $config['NAME']); $this->raintpl->assign("href", $config['HREF']); //if href config is enabled we are sorry for do onclick events if ($config['HREF'] != '') { $config['J_ONCLICK'] = '0'; $config['P_ONCLICK_FUNCTION'] = '0'; $config['P_ONCLICK_PLUGIN'] = '0'; $config['J_AFTER_ONCLICK'] = '0'; } $this->raintpl->assign("form", $config['FORM']); $this->raintpl->assign("value", $config['VALUE']); $this->raintpl->assign("bs_control", $config['BS_CONTROL']); $this->raintpl->assign("size", $config['SIZE']); $this->raintpl->assign("label", $config['LABEL']); $this->raintpl->assign("type", 'btn btn-' . $config['TYPE']); $this->raintpl->assign("styles", $config['STYLE']); $this->raintpl->assign("class", $config['CLASS']); $this->raintpl->assign("j_onclick", $config['J_ONCLICK']); $this->raintpl->assign("p_onclick_f", $config['P_ONCLICK_FUNCTION']); $this->raintpl->assign("p_onclick_p", $config['P_ONCLICK_PLUGIN']); $this->raintpl->assign("j_after_onclick", $config['J_AFTER_ONCLICK']); $this->raintpl->assign("j_onfocus", $config['J_ONFOCUS']); $this->raintpl->assign("p_onfocus_f", $config['P_ONFOCUS_FUNCTION']); $this->raintpl->assign("p_onfocus_p", $config['P_ONFOCUS_PLUGIN']); $this->raintpl->assign("j_after_onfocus", $config['J_AFTER_ONFOCUS']); $this->raintpl->assign("j_onblur", $config['J_ONBLUR']); $this->raintpl->assign("p_onblur_f", $config['P_ONBLUR_FUNCTION']); $this->raintpl->assign("p_onblur_p", $config['P_ONBLUR_PLUGIN']); $this->raintpl->assign("j_after_onblur", $config['J_AFTER_ONBLUR']); if ($config['DISABLE']) { $this->raintpl->assign("disabled", 'disabled'); } else { $this->raintpl->assign("disabled", 'enabled'); } //return control return $this->raintpl->draw('ctr_button', true); }
public function view_draw($config) { if ($config['CSS_FILE'] != '') { cls_page::add_header('<link rel="stylesheet" type="text/css" href="' . $config['CSS_FILE']) . '" />'; } $this->raintpl->assign("name", $config['NAME']); $this->raintpl->assign("label", $config['LABEL']); $this->raintpl->assign("id", $config['NAME']); $this->raintpl->assign("style", $config['STYLE']); $this->raintpl->assign("class", $config['CLASS']); $this->raintpl->assign("disabled", $config['DISABLED']); $this->raintpl->assign("form", $config['FORM']); $this->raintpl->assign("value", $config['VALUE']); $this->raintpl->assign("checked", $config['CHECKED']); return $this->raintpl->draw("ctr_radioitem", true); }
protected function view_main($menu, $content, $user) { cls_page::add_header('<link href="./plugins/system/core/style/core_content.css" rel="stylesheet">'); //Assign variables $this->raintpl->assign("menu", $menu); $this->raintpl->assign("content", $content); $this->raintpl->assign("user_logout", _('Log Out')); $this->raintpl->assign("user_logout_url", cls_general::create_url(array('plugin', 'users', 'action', 'btn_logout_onclick'))); $this->raintpl->assign("user_name", $user['username']); $this->raintpl->assign("user_profile", _('Profile')); $this->raintpl->assign("user_profile_url", cls_general::create_url(array('plugin', 'users', 'action', 'profile'))); $this->raintpl->assign("user_settings", _('Settings')); $this->raintpl->assign("user_settings_url", cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'settings'))); $this->raintpl->assign("sarkesh_admin", _('Sarkesh Administrator')); $this->raintpl->assign("sarkesh_admin_url", cls_general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'dashboard'))); //draw and return back menus return $this->raintpl->draw('core_content', true); }
protected function view_draw($config) { if ($config['CSS_FILE'] != '') { cls_page::add_header($config['CSS_FILE']); } $this->raintpl->assign('headers', $config['HEADERS']); $this->raintpl->assign('rows', $config['ROWS']); $this->raintpl->assign('headers_width', $config['HEADERS_WIDTH']); $this->raintpl->assign('size', $config['SIZE']); $this->raintpl->assign('bs_control', $config['BS_CONTROL']); $this->raintpl->assign('border', $config['BORDER']); $this->raintpl->assign('hover', $config['HOVER']); $this->raintpl->assign('striped', $config['STRIPED']); $this->raintpl->assign('class', $config['CLASS']); if ($config['TYPE'] == 'NORMAL') { return $this->raintpl->draw("ctr_table_normal", true); } else { return $this->raintpl->draw("ctr_table_source", true); } }
protected function view_draw($config) { if ($config['EDITOR']) { cls_page::add_header('<script src="./core/lib/controls/textarea/editors/nicedit/nicEdit.js" type="text/javascript"></script>'); } if ($config['CSS_FILE'] != '') { cls_page::add_header('<link rel="stylesheet" type="text/css" href="' . $config['CSS_FILE']) . '" />'; } $this->raintpl->assign("name", $config['NAME']); $this->raintpl->assign("label", $config['LABEL']); $this->raintpl->assign("help", $config['HELP']); $this->raintpl->assign("id", $config['NAME']); $this->raintpl->assign("rows", $config['ROWS']); $this->raintpl->assign("size", $config['SIZE']); $this->raintpl->assign("style", $config['STYLE']); $this->raintpl->assign("value", $config['VALUE']); $this->raintpl->assign("editor", $config['EDITOR']); $this->raintpl->assign("form", $config['FORM']); $this->raintpl->assign("class", $config['CLASS']); return $this->raintpl->draw("ctr_textarea", true); }
public function show_content($show_content = true) { //this function run from page class. // this function load plugin and run controller //checking for that plugin is enabled if ($this->obj_plugin->is_enabled($this->plugin)) { $plugin = new $this->plugin(); //run action directly if (method_exists($plugin, $this->action)) { $content = call_user_func(array($plugin, $this->action), 'content'); } else { if (method_exists($plugin, 'default')) { $content = call_user_func(array($plugin, 'default'), 'content'); } //show 404 page not found page $plugin = new msg(); $content = call_user_func(array($plugin, 'msg_404')); } } else { //plugin is not enabled //show 404 page not found page $plugin = new msg(); $content = call_user_func(array($plugin, 'msg_404')); } cls_page::set_page_tittle($content[0]); //show header in up of content or else if (sizeof($content) == 3 && $content[2] == false) { $output_content = cls_page::show_block('', $content[1], 'MAIN'); } else { $output_content = cls_page::show_block($content[0], $content[1], 'MAIN'); } //show content id show_content was set if ($show_content) { echo $output_content; } return $content; }
public function btn_signup_onclick($e) { //if this action requested by content mode i should reject that if ($e == 'content') { cls_router::jump_page(SiteDomain); } //check input if ($e['txt_username']['VALUE'] == '' || $e['txt_email']['VALUE'] == '' || $e['txt_password']['VALUE'] == '' || $e['txt_repassword']['VALUE'] == '') { //invalid field $e['RV']['MODAL'] = cls_page::show_block(_('Message'), _('Please fill out all the field that are marked with an asterisk (*).'), 'MODAL', 'type-warning'); return $e; } else { return $this->module_btn_signup_onclick($e); } }
protected function module_btn_reset_password_onclick($e) { $e['RV']['MODAL'] = cls_page::show_block(1, 1, 'MODAL', 'type-warning'); return $e; }
public function btn_onclick($e) { $a = $e['textbox']['VALUE']; $e['RV']['MODAL'] = cls_page::show_block('title', $a, 'MODAL', 'type-danger'); return $e; }
?> </div> <div class="row"> <?php cls_page::set_position('sidebar2'); ?> </div> </div> </div> <hr> <footer> <div class="row"> <div class="col-xs-12"> <p><?php cls_page::set_position('footer'); ?> </p> <p><?php echo _('Copyright © Sarkesh LTD 2013'); ?> </p><br /> </div> </div> </footer> </div><!-- /.container --> </body> </html>
<!DOCTYPE html> <head> </#HEADERS#/> <title></#PAGE_TITTLE#/></title> </head> <body> <div class="container"> <div class="row"> <div class="content col-md-12"><?php cls_page::set_position('content'); ?> </div> </div> <div class="row"> <div class="footer col-xs-12">Sarkesh 2014 Under GNU GPL V3</div> </div> </div> </body> </html>
/** * @param $selectSql "select id,name,code FROM city where id>10" * @param string $url "getCity-{page}.php?id=10" * @param int $pageNo 当前页 * @param int $pageSize 每页记录数 * @return PageUtil 分页对象 */ public function queryWithPage($selectSql, $url = '', $pageNo = 1, $pageSize = 20) { $sql = trim($selectSql); $start = (intval($pageNo) - 1) * intval($pageSize); $start = $start > 0 ? $start : 0; $sql = $sql . " limit {$start},{$pageSize}"; $dataList = $this->getAll($sql); $newStr = substr($sql, stripos($sql, "FROM")); $orderLength = stripos($newStr, "ORDER "); if ($orderLength) { $countSql = "SELECT count(1) " . substr($newStr, 0, $orderLength); } else { $countSql = "SELECT count(1) " . $newStr; } $totalCount = $this->getColumn($countSql); $pageUtil = new cls_page($url, $totalCount, $pageNo, $pageSize); $pageUtil->setList($dataList); return $pageUtil; }
public function upload_error() { return cls_page::show_block(_('System message !'), _('Upload file is not successful! refresh page and try again.'), 'MODAL', 'type-warning'); }
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'); } } } } }