Beispiel #1
0
 protected function view_draw($config)
 {
     //configure raintpl //
     $this->raintpl->configure('tpl_dir', 'core/lib/controls/uploader/');
     //add headers to page//
     browser\page::add_header('<script src="./core/ect/scripts/events/functions.js"></script>');
     browser\page::add_header('<script src="./core/lib/controls/uploader/ctr_uploader.js"></script>');
     browser\page::add_header('<link rel="stylesheet" type="text/css" href="./core/lib/controls/uploader/ctr_uploader.css" />');
     if ($config['SCRIPT_SRC'] != '') {
         browser\page::add_header('<script src="' . $config['SCRIPT_SRC'] . '"></script>');
     }
     if ($config['CSS_FILE'] != '') {
         browser\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);
 }
Beispiel #2
0
 protected function module_login_page()
 {
     //get login panel
     $login_panel = $this->users->login();
     $login_panel[1] = browser\page::show_block($login_panel[0], $login_panel[1], 'BLOCK');
     return $this->module_load($login_panel, true);
 }
Beispiel #3
0
 protected function view_404()
 {
     //first configurate raintpl
     //you should set that place you store your templates files
     //add css page
     browser\page::add_header('<link rel="stylesheet" type="text/css" href="./plugins/system/msg/styles/404.css" />');
     $this->cache = $this->raintpl->cache('404', 60);
     if ($this->cache) {
         //file is exist in cache
         //going to show that on page with browser\page
         //for more information about show_block function in browser\page see browser\page documents
         $page_content = $this->cache;
     } else {
         //file is not exist in cache going to create that
         //add tag for show messages
         //with assign you send value for varible in html file
         //for more information about template\raintpl->assign see template\raintpl documents
         $this->raintpl->assign("msg_404", _('Sorry. Page Not Found!'));
         $this->raintpl->assign("text404", _('404 !'));
         //after set all varibles we going to show that on page with browser\page
         $page_content = $this->raintpl->draw('404', true);
     }
     //return tittle of content you want to show
     return array(_('Not Found!'), $page_content);
 }
Beispiel #4
0
function sys_render($buffer)
{
    // first replace headers
    // like css java scripts and ect
    $buffer = str_replace("</#PAGE_TITTLE#/>", \core\cls\browser\page::get_page_tittle(), $buffer);
    //LOAD HEADERS
    $buffer = str_replace("</#HEADERS#/>", \core\cls\browser\page::load_headers(false), $buffer);
    return $buffer;
}
Beispiel #5
0
 public function view_draw($e, $config)
 {
     if ($config['CSS_FILE'] != '') {
         browser\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);
 }
Beispiel #6
0
 public function view_draw($config, $show)
 {
     //configure raintpl //
     $this->raintpl->configure('tpl_dir', 'core/lib/controls/combobox/tpl/');
     //add headers to page//
     browser\page::add_header('<script src="./core/ect/scripts/events/functions.js"></script>');
     if ($config['SCRIPT_SRC'] != '') {
         browser\page::add_header('<script src="' . $config['SCRIPT_SRC'] . '"></script>');
     }
     if ($config['CSS_FILE'] != '') {
         browser\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;
 }
Beispiel #7
0
 public function view_draw($config, $show)
 {
     //configure raintpl //
     $this->raintpl->configure('tpl_dir', 'core/lib/controls/textbox/tpl/');
     //add headers to page//
     browser\page::add_header('<script src="./core/ect/scripts/events/functions.js"></script>');
     if ($config['SCRIPT_SRC'] != '') {
         browser\page::add_header('<script src="' . $config['SCRIPT_SRC'] . '"></script>');
     }
     if ($config['CSS_FILE'] != '') {
         browser\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;
 }
Beispiel #8
0
 public function view_draw($config)
 {
     //configure raintpl //
     $this->raintpl->configure('tpl_dir', 'core/lib/controls/button/tpl/');
     //add headers to page//
     browser\page::add_header('<script src="./core/ect/scripts/events/functions.js"></script>');
     if ($config['SCRIPT_SRC'] != '') {
         browser\page::add_header('<script src="' . $config['SCRIPT_SRC'] . '"></script>');
     }
     if ($config['CSS_FILE'] != '') {
         browser\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);
 }
Beispiel #9
0
 public function view_draw($config)
 {
     if ($config['CSS_FILE'] != '') {
         browser\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);
 }
Beispiel #10
0
 protected function view_main($menu, $content, $user)
 {
     browser\page::add_header('<link href="./plugins/system/administrator/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", core\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", core\general::create_url(array('plugin', 'users', 'action', 'profile')));
     $this->raintpl->assign("user_settings", _('Settings'));
     $this->raintpl->assign("user_settings_url", core\general::create_url(array('service', '1', 'plugin', 'administrator', 'action', 'main', 'p', 'administrator', 'a', 'settings')));
     $this->raintpl->assign("sarkesh_admin", _('Sarkesh Administrator'));
     $this->raintpl->assign("sarkesh_admin_url", core\general::create_url(array('service', '1', 'plugin', 'administrator', 'action', 'main', 'p', 'administrator', 'a', 'dashboard')));
     //draw and return back menus
     return $this->raintpl->draw('core_content', true);
 }
Beispiel #11
0
 protected function view_draw($config)
 {
     if ($config['CSS_FILE'] != '') {
         browser\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);
     }
 }
Beispiel #12
0
 protected function view_draw($config)
 {
     if ($config['EDITOR']) {
         browser\page::add_header('<script src="./core/lib/controls/textarea/editors/nicedit/nicEdit.js" type="text/javascript"></script>');
     }
     if ($config['CSS_FILE'] != '') {
         browser\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);
 }
Beispiel #13
0
 public function btn_signup_onclick($e)
 {
     //if this action requested by content mode i should reject that
     if ($e == 'content') {
         core\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'] = browser\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);
     }
 }
 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)) {
         $PluginName = '\\core\\plugin\\' . $this->plugin;
         $plugin = new $PluginName();
         //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 plugin\msg();
             $content = call_user_func(array($plugin, 'msg_404'));
             //jump user to 404 page
             $this->jump_page(array('service', '1', 'plugin', 'msg', 'action', 'msg404'));
         }
     } else {
         //plugin is not enabled
         //show 404 page not found page
         $plugin = new plugin\msg();
         $content = call_user_func(array($plugin, 'msg_404'));
         //jump user to 404 page
         $this->jump_page(array('service', '1', 'plugin', 'msg', 'action', 'msg404'));
     }
     browser\page::set_page_tittle($content[0]);
     //show header in up of content or else
     if (sizeof($content) == 3 && $content[2] == false) {
         $output_content = browser\page::show_block('', $content[1], 'MAIN');
     } else {
         $output_content = browser\page::show_block($content[0], $content[1], 'MAIN');
     }
     //show content id show_content was set
     if ($show_content) {
         echo $output_content;
     }
     return $content;
 }
Beispiel #15
0
           <a class="navbar-brand" href="/">Sarkesh</a>
    	</div>
       </div>
    </div>
      
    <div class="container">
      <div class="row row-offcanvas row-offcanvas-left">
        
        <!-- sidebar -->
        <div class="col-xs-6 col-sm-4 sidebar-offcanvas" id="sidebar" role="navigation">
            <?php 
browser\page::set_position('sidebar1');
?>
        </div>
  	
        <!-- main area -->
        <div class="col-xs-12 col-sm-8">
			<div class="row"><div class="col-xs-12" id="sidebar"><?php 
browser\page::set_position('content');
?>
</div></div>
          
          
        </div><!-- /.col-xs-12 main -->
    </div><!--/.row-->
  </div><!--/.container-->
</div><!--/.page-container-->
        
    </body>
</html>
Beispiel #16
0
 protected function module_btn_reset_password_onclick($e)
 {
     $e['RV']['MODAL'] = browser\page::show_block(1, 1, 'MODAL', 'type-warning');
     return $e;
 }
Beispiel #17
0
?>
	  </div>
	  <div class="row">
	  <?php 
browser\page::set_position('sidebar2');
?>
          </div>
        </div>
      </div>
      
      <hr>
      
      <footer>
        <div class="row">
          <div class="col-xs-12">
	    <p><?php 
browser\page::set_position('footer');
?>
</p>
            <p><?php 
echo _('Copyright &copy; Sarkesh LTD 2013');
?>
</p><br />
          </div>
        </div>
      </footer>

    </div><!-- /.container -->
  </body>
</html>