Exemplo n.º 1
0
 public function GetItemDetail($name, $mode)
 {
     $list = null;
     switch ($mode) {
         case "Base":
             $list = JwtUtil::getFiles($this->rootPath . "Scripts/Base");
             break;
         case "Layouts":
             $list = JwtUtil::getFiles($this->rootPath . "Scripts/Layouts/" . $name);
             break;
         case "Widgets":
             $list = JwtUtil::getFiles($this->rootPath . "Scripts/Components/" . $name);
             break;
         case "Components":
             $list = JwtUtil::getFiles($this->rootPath . "Scripts/Directives/" . $name);
             break;
         case "Modules":
             $list = JwtUtil::getFiles($this->rootPath . "Scripts/Modules/" . $name);
             break;
     }
     $res = array('js' => array(), 'css' => array(), 'html' => array());
     foreach ($list as $value) {
         if (JwtUtil::endsWith($value, ".js")) {
             $res['js'][] = $value;
         } else {
             if (JwtUtil::endsWith($value, ".css")) {
                 $res['css'][] = $value;
             } else {
                 if (JwtUtil::endsWith($value, ".html")) {
                     $res['html'][] = $value;
                 }
             }
         }
     }
     return $res;
 }