예제 #1
0
$link_id = $my_app->get_param('link_id');
if (!empty($link_id)) {
    $wincfg['back'] = null;
    $shortcut = new phpos_shortcuts();
    $db_shortcut = $shortcut->get_shortcut($link_id);
    $db_params = $shortcut->get_params_from_db($link_id);
    $url = base64_decode($db_params['url']);
    $start_link_title = $db_shortcut['file_title'];
    $button = txt('shortcuts_window_btn_update_url');
    $wincfg['title'] = txt('shortcuts_window_title_update_url');
}
$form->status();
$form->condition('not_null', true, txt('name_empty'));
$form->input('text', 'new_link_name', txt('shortcuts_form_icon_name'), txt('shortcuts_form_icon_name_desc'), $start_link_title);
$form->condition('not_null', true, txt('url_empty'));
$form->input('text', 'new_link_url', txt('shortcuts_url_form_url'), txt('shortcuts_url_form_url_desc'), $url);
$icons = new phpos_icons();
$c = $icons->count_icons();
$items = array('null' => '---');
if ($c != 0) {
    $icons_list = $icons->get_icon_list();
    foreach ($icons_list as $icon_name) {
        $items[$icon_name] = $icon_name;
    }
}
$form->title(txt('shortcuts_icon_for_title'), '', MY_RESOURCES . 'icon.png');
$form->select('new_link_icon', txt('shortcuts_icon_for_name'), txt('shortcuts_icon_for_desc'), $items, $db_shortcut['icon']);
$html .= $form->render();
$form->submit_btn($button);
$next_button = $form->render();
$html .= $form->form_end();
예제 #2
0
 public function get_icon($file)
 {
     global $explorer;
     $shortcut = new phpos_shortcuts();
     if (empty($file['icon'])) {
         if ($this->is_directory($file)) {
             $icon_image = $explorer->config('filetypes_icons_folder_url') . 'folder.png';
         } else {
             $shortcut = new phpos_shortcuts();
             return $shortcut->link_icon($file['extension'], $file['app_id'], null, $file['app_action']);
             if (file_exists($explorer->config('filetypes_icons_folder_dir') . $file['extension'] . '.png')) {
                 $icon_image = $explorer->config('filetypes_icons_folder_url') . $file['extension'] . '.png';
             } else {
                 $icon_image = $explorer->config('filetypes_icons_folder_url') . 'default.png';
             }
         }
     } else {
         $user_icons = new phpos_icons();
         $user_icons_dir = $user_icons->get_icons_dir();
         $user_icons_url = $user_icons->get_icons_url();
         if (file_exists($user_icons_dir . $file['icon'])) {
             $icon_image = $user_icons_url . $file['icon'];
         } else {
             if (file_exists(PHPOS_WEBROOT_DIR . '_phpos/icons/' . $file['icon'])) {
                 $icon_image = PHPOS_WEBROOT_URL . '_phpos/icons/' . $file['icon'];
             } else {
                 $icon_image = PHPOS_WEBROOT_URL . '_phpos/icons/default.png';
             }
         }
     }
     return $icon_image;
     // @returns full url
 }
예제 #3
0
 public function link_icon($plugin = 'app', $app_id = null, $icon = null, $app_action = null)
 {
     $app = new phpos_app();
     $app->set_app_id($app_id);
     $app->load_config();
     if (!empty($icon)) {
         $user_icons = new phpos_icons();
         $user_icons_dir = $user_icons->get_icons_dir();
         $user_icons_url = $user_icons->get_icons_url();
         if (file_exists($user_icons_dir . $icon)) {
             return $user_icons_url . $icon;
         }
     } else {
         if ($app_id == 'mediaframes') {
             return ICONS . 'mediaframes/' . $app_action . '.png';
         }
         return $app->get_icon();
     }
 }