예제 #1
0
 /**
  * Method to get a list of all the files to edit in a template.
  *
  * @return	array	A nested array of relevant files.
  *
  */
 public function getFiles()
 {
     // Initialise variables.
     $result = array();
     jimport('joomla.filesystem.folder');
     $path = JPath::clean(JPATH_ROOT . '/media/com_jem/');
     // Check if the template path exists.
     if (is_dir($path)) {
         // Handle the CSS files.
         $files = JFolder::files($path . '/css', '\\.css$', false, false);
         foreach ($files as $file) {
             $result['css'][] = $this->getFile($path . '/css/', $file);
         }
     } else {
         $this->setError(JText::_('COM_JEM_CSSMANAGER_ERROR_CSS_FOLDER_NOT_FOUND'));
         return false;
     }
     # define array with custom css files
     $settings = JemHelper::retrieveCss();
     $custom = array();
     $custom[] = $settings->get('css_backend_customfile');
     $custom[] = $settings->get('css_calendar_customfile');
     $custom[] = $settings->get('css_colorpicker_customfile');
     $custom[] = $settings->get('css_geostyle_customfile');
     $custom[] = $settings->get('css_googlemap_customfile');
     $custom[] = $settings->get('css_jem_customfile');
     $custom[] = $settings->get('css_print_customfile');
     foreach ($custom as $cfile) {
         if ($cfile) {
             $rf = $this->getCustomFile(JPATH_SITE . '/', $cfile);
             if ($rf->exists && $rf->ext) {
                 $result['custom'][] = $rf;
             }
         }
     }
     return $result;
 }