예제 #1
0
파일: list.php 프로젝트: kostya1017/our
    function execAction($dir)
    {
        // list directory contents
        global $dir_up, $mosConfig_live_site, $_VERSION;
        $allow = ($GLOBALS["permissions"] & 01) == 01;
        $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02;
        $dir_up = dirname($dir);
        if ($dir_up == ".") {
            $dir_up = "";
        }
        if (!get_show_item($dir_up, basename($dir))) {
            ext_Result::sendResult('list', false, $dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
        }
        // Sorting of items
        if ($GLOBALS["direction"] == "ASC") {
            $_srt = "no";
        } else {
            $_srt = "yes";
        }
        show_header();
        extHTML::loadExtJS();
        ?>
		
	<div id="dirtree-panel"></div>
	<div id="locationbar-panel"></div>
	<div id="item-grid"></div>
	<div id="ext_statusbar" class="ext_statusbar"></div>

	<?php 
        // That's the main javascript file to build the Layout & App Logic
        include _EXT_PATH . '/scripts/application.js.php';
    }
예제 #2
0
 /**
  * Writes a yes/no radio list
  * @param string The value of the HTML name attribute
  * @param string Additional HTML attributes for the <select> tag
  * @param mixed The key that is selected
  * @returns string HTML for the radio list
  */
 static function yesnoRadioList($tag_name, $tag_attribs, $selected, $yes = _CMN_YES, $no = _CMN_NO)
 {
     $arr = array(extHTML::makeOption('0', $no), extHTML::makeOption('1', $yes));
     return extHTML::radioList($arr, $tag_name, $tag_attribs, $selected);
 }
예제 #3
0
 static function sendResult($action, $success, $msg, $extra = array())
 {
     // show error-message
     if (ext_isXHR()) {
         $success = (bool) $success;
         if ($success && ext_Result::count_errors() > 0) {
             $success = false;
             foreach (@$_SESSION['ext_error'] as $type) {
                 if (is_array($type)) {
                     foreach ($type as $error) {
                         $msg .= '<br />' . $error;
                     }
                 }
             }
         }
         $result = array('action' => $action, 'message' => str_replace("'", "\\'", $msg), 'error' => str_replace("'", "\\'", $msg), 'success' => $success);
         foreach ($extra as $key => $value) {
             $result[$key] = $value;
         }
         $classname = class_exists('ext_Json') ? 'ext_Json' : 'Services_JSON';
         $json = new $classname();
         $jresult = $json->encode($result);
         if (strtolower(extGetParam($_POST, 'requestType')) == 'xmlhttprequest') {
             header("Content-type: text/html");
         }
         print $jresult;
         ext_exit();
     }
     $messagetxt = '';
     if ($extra != NULL) {
         $msg .= " - " . $extra;
     }
     if ($msg != '') {
         ext_Result::add_error($msg);
     }
     if (ext_Result::count_messages() < 1 && ext_Result::count_errors() < 1) {
         return;
     }
     if (ext_Result::count_messages() > 0) {
         $messagetxt .= '<h3>' . $GLOBALS["error_msg"]["message"] . ':</h3>';
         foreach ($_SESSION['ext_message'] as $msgtype) {
             foreach ($msgtype as $message) {
                 $messagetxt .= $message . '<br/>';
             }
             $messagetxt .= '<br /><hr /><br />';
         }
         ext_Result::empty_messages();
         if (!empty($_REQUEST['extra'])) {
             $messagetxt .= ' - ' . htmlspecialchars(urldecode($_REQUEST['extra']), ENT_QUOTES);
         }
     }
     if (!empty($_SESSION['ext_error'])) {
         $messagetxt .= '<h3>' . $GLOBALS["error_msg"]["error"] . ':</h3>';
         foreach ($_SESSION['ext_error'] as $errortype) {
             foreach ($errortype as $error) {
                 $messagetxt .= $error . '<br/>';
             }
             $messagetxt .= '<br /><hr /><br />';
         }
         ext_Result::empty_errors();
     }
     if (!empty($_REQUEST['extra'])) {
         $messagetxt .= " - " . htmlspecialchars(urldecode($_REQUEST['extra']), ENT_QUOTES);
     }
     extHTML::loadExtJS();
     show_header();
     defined('EXPLORER_NOEXEC') or define('EXPLORER_NOEXEC', 1);
     echo ext_scriptTag('', 'Ext.Msg.alert(\'Status\', \'' . $messagetxt . '\')');
     //}
     $GLOBALS['action'] = 'show_error';
 }