Example #1
0
 /**
  * View usend and unused extension templates
  * @return $html
  **/
 function viewExtHTMLFiles()
 {
     global $option;
     $rel_path = DS . 'templates' . DS . $this->template_name . DS . 'html';
     $ext_files = JYAML::getExtHTMLFiles($rel_path);
     $html = '<p>' . JText::_('YAML EXTENSION TEMPLATES DESC') . '</p>';
     $bar =& new JToolBar('My ToolBar');
     $button =& $bar->loadButtonType('Custom');
     $popup =& $bar->loadButtonType('Popup');
     $html .= '<ul class="exthtml-file-tree filetree tree-disabled">' . "\n";
     $html .= '<li><span class="folder">&nbsp;/html/</span>' . "\n";
     $html .= '<ul>' . "\n";
     $html .= JYAML::extFileTree($ext_files['com']['used']) . "\n";
     $html .= JYAML::extFileTree($ext_files['mod']['used']) . "\n";
     $files = JFolder::files(JPATH_SITE . $rel_path, 'php$');
     if ($files) {
         foreach ($files as $file) {
             $filepath = $this->template_name . DS . 'html' . DS . $file;
             $edit_url = JURI::base() . 'index3.php?option=' . $option . '&amp;controller=syntaxEditor&amp;task=edit&amp;eSyntax=html&amp;file=' . $filepath;
             $link = "<a class=\"modal\" href=\"{$edit_url}\" rel=\"{handler: 'iframe', size: {x: 640, y: 480}}\">";
             $link .= "{$file}";
             $link .= "</a>";
             $deleteLink = $filepath;
             $html .= '<li><span class="file">' . $button->fetchButton('Custom', $link, 'editfile') . '</span></li>' . "\n";
         }
     }
     $html .= '</ul>' . "\n";
     $html .= '</li>' . "\n";
     $html .= JYAML::extFileTree($ext_files['com']['unused'], 1) . "\n";
     $html .= JYAML::extFileTree($ext_files['mod']['unused'], 2) . "\n";
     $html .= '</ul>' . "\n";
     return $html;
 }