Exemplo n.º 1
0
 public function lang_load($lang_id)
 {
     include $this->lang_dir . 'enLang.php';
     if ($this->lang_exists($lang_id)) {
         $file = $this->lang_dir . $lang_id . 'Lang.php';
     }
     if (!empty($file) && $lang_id != 'en') {
         include $file;
     }
     glb::set('txt', $txt);
 }
Exemplo n.º 2
0
function div($ret = null)
{
    $win_obj = glb::get('apiWindow');
    if ($ret == null) {
        echo '_' . $win_obj->getID();
    }
    return '_' . $win_obj->getID();
}
Exemplo n.º 3
0
 public function get_explorer_icon_jquery($icon)
 {
     $attr = ".attr('myID','" . $icon['id'] . "')";
     // set id attribute for drag&drop actions
     $middle_click = '';
     $droppable = '';
     $draggable = '';
     $phposFS = glb::get('phposFS');
     $apiWindow = glb::get('apiWindow');
     /*.............................................. */
     // If it's dir:
     if ($phposFS->api_isDir($icon)) {
         $middle_click = ".mousedown(function(event) {\tif(event.which==2) { phpos.windowCreate('" . $icon['name'] . "', 'explorer', 'app_id:explorer@index, parent_id:" . $apiWindow->getID() . "', 'fs:LocalFiles,dir_id:" . $phposFS->addLastSlash($icon['id']) . "'); }\t})";
         // Droppable action for dir
         $droppable = ".droppable({\n\t\t\t\t\tonDragEnter:function(e,source){\n\t\t\t\t\t\t\t\$(source).draggable('options').cursor='auto';\n\t\t\t\t\t\t\t\$(this).addClass('phpos_icon_mouseclick');\t// check class\n\t\t\t\t\t},\n\t\t\t\t\tonDragLeave:function(e,source){\n\t\t\t\t\t\t\t\$(source).draggable('options').cursor='not-allowed';\n\t\t\t\t\t\t\t\$(this).removeClass('phpos_icon_mouseclick');\t\n\t\t\t\t\t},\n\t\t\t\t\tonDrop:function(e,source){\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$(this).addClass('phpos_icon_mouseclick');\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tphpos.windowRefresh('" . $apiWindow->getID() . "','action_MoveFile_ID:'+\$(source).attr('myid')+',action_MoveFile_ToDirID:'+\$(this).attr('myID'));\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t";
     }
     /*.............................................. */
     // Draggable action for all
     $draggable = ".draggable({\n\t\t\t\t\trevert:true,\t\n\t\t\t\t\tproxy: 'clone',\t\t\n\t\t\t\t\tonStartDrag:function(){\t\t\t\t\t\n\t\t\t\t\t\t\t\$(this).draggable('options').cursor = 'not-allowed';\n\t\t\t\t\t\t\t\$(this).draggable('proxy').css('z-index',10);\n\t\t\t\t\t},\n\t\t\t\t\tonStopDrag:function(){\t\t\t\t\t\n\t\t\t\t\t\t\t\$(this).draggable('options').cursor='move';\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t";
     /*.............................................. */
     // Generate jQuery code to assign CSS classes to icon and assign actions
     if (defined('IN_DESKTOP')) {
         // okaddClass('icon_out').addClass('icon_size_desktop');
         $jquery_GenerateIconsActions = "\$('#" . $icon['div'] . "').addClass('icon_out').addClass('icon_size_desktop')" . $middle_click . $droppable . $attr . $draggable . ";\n\t\t\t";
     } else {
         $jquery_GenerateIconsActions = "\$('#" . $icon['div'] . "').addClass('phpos_icon_mouseout').addClass('" . $this->config['icon_size_class'] . "')" . $middle_click . $droppable . $attr . $draggable . ";\n\t\t\t";
     }
     return $jquery_GenerateIconsActions;
 }
Exemplo n.º 4
0
 public function using($helper_name, $helper_params = null)
 {
     // Get globals
     $app_name = glb::get('app_name');
     $app_action = glb::get('app_action');
     $app_param = glb::get('app_param');
     $win_obj = glb::get('apiWindow');
     switch ($helper_name) {
         // ----------
         case 'params':
             // If GET parameters, then parse them and apply to window object
             if (!empty($_GET['app_params'])) {
                 $this->window->setAppParams($_GET['app_params']);
             }
             // If empty params (file included by ajax, from parent main window?)
             if (!$helper_params && !is_array($this->param)) {
                 $this->param = $this->window->getParam('app_params');
             }
             // Parse APP params
             foreach ($this->param as $key => $value) {
                 $param_name = $key;
                 $param_value = $value;
                 // If object have param data in window object
                 if ($this->window->appParam($param_name)) {
                     $this->param[$param_name] = $this->window->appParam($param_name);
                 } else {
                     $this->window->set_appParam($param_name, $param_value);
                 }
             }
             $this->window->updateWindow();
             break;
             // ----------
         // ----------
         case 'menu':
             // Default menu file = action, e.g. "indexMenu.php" (in main app folder)
             $menu_file = $this->app_action;
             // Override menu file if specified in array
             if (is_array($params)) {
                 $menu_file = $params[$this->app_action];
             }
             // If menu exists, load it
             if (file_exists(PHPOS_APPS_DIR . $this->app_id . '/' . $menu_file . 'Menu.php')) {
                 include PHPOS_APPS_DIR . $this->app_id . '/' . $menu_file . 'Menu.php';
                 $this->window->renderMenu($app_menu);
                 $js = $this->window->get_layout_menu_js();
                 $this->jquery_onready($js);
             }
             break;
             // ----------
         // ----------
         case 'toolbar':
             // Default toolbar file = action, e.g. "indexToolbar.php" (in main app folder)
             $toolbar_file = $this->app_action;
             // Override menu file if specified in array
             if (is_array($params)) {
                 $toolbar_file = $params[$this->app_action];
             }
             // If menu exists, load it
             if (file_exists(PHPOS_APPS_DIR . $this->app_id . '/' . $toolbar_file . 'Toolbar.php')) {
                 include PHPOS_APPS_DIR . $this->app_id . '/' . $toolbar_file . 'Toolbar.php';
                 $this->window->render_toolbar($app_toolbar, $this->get_param('section'));
                 $js = $this->window->get_layout_toolbar_js();
                 $this->jquery_onready($js);
             }
             break;
             // ----------
         // ----------
         case 'use_action':
             // Override actual action
             break;
             // ----------
         // ----------
         case 'langs':
             // Load app langs config to global app_langs
             if (is_array($helper_params)) {
                 $win_obj->appParam('_config_langs', $helper_params);
                 glb::set('apiWindow', $win_obj);
                 glb::set('app_langs', $helper_params);
             }
             break;
             // ----------
         // ----------
         case 'use_lang':
             // if param = choosen lang
             if (!empty($helper_params)) {
                 $lang = $helper_params;
             } else {
                 // if empty, get info from window
                 $obj_lang = $win_obj->appParam('_config_lang');
                 if (!empty($obj_lang)) {
                     $lang = $obj_lang;
                 } else {
                     // set from global OS config
                     $lang = cfg::get('lang');
                 }
             }
             // Set app lang
             glb::set("app_lang", $lang);
             // Get app available langs
             $app_langs = glb::get('app_langs');
             // If empty langs try load info from window params
             if (!is_array($app_langs)) {
                 $app_langs = $win_obj->appParam('_config_langs');
             }
             // Get global lang file
             $txt = glb::get('txt');
             // Set app lang file to load
             $lang_file = $app_langs[$lang];
             // Load lang file
             if (file_exists(PHPOS_APPS_DIR . $app_name . '/lang/' . $lang_file . 'Lang.php')) {
                 include PHPOS_APPS_DIR . $app_name . '/lang/' . $lang_file . 'Lang.php';
                 $win_obj->appParam('_config_lang', $lang);
                 $win_obj->updateWindow();
                 glb::set('apiWindow', $win_obj);
                 glb::set('txt', $txt);
                 // add app lang to global lang
             }
             break;
     }
 }
Exemplo n.º 5
0
 static function window($mode, $id = null, $noecho = null)
 {
     if ($id == null) {
         $win = glb::get('apiWindow');
         $id = $win->getID();
     }
     switch ($mode) {
         case 'close':
             $str = "<script>phpos.windowClose(" . $id . ");</script>";
             break;
     }
     if ($noecho == null) {
         echo $str;
     }
     return $str;
 }
Exemplo n.º 6
0
 public function menu($norender = null)
 {
     if (empty($this->region)) {
         $this->region = 'north';
     }
     if (empty($this->split)) {
         $this->split = 'false';
     }
     if (empty($this->fit)) {
         $this->fit = 'true';
     }
     if (empty($this->height)) {
         $this->height = '45';
     }
     $css_height = $this->height;
     $str = '<div id="' . $this->get_id('menu') . '" data-options="' . $this->data_options() . '" class="' . $this->get_classes('') . '" style="' . $this->get_style() . '">';
     $menu_html = $this->my_app->window->get_layout_menu_html();
     $menu = glb::get('window_menu');
     if ($norender != 'norender') {
         $str .= '<div id="api_window_headermenu_container" style="background-color:#eff5fb">' . $menu_html . '</div>';
     } else {
         $html['menu'] = $menu_html;
         glb::set('html', $html);
     }
     $this->reset_params();
     return $str;
 }