//-- Add a slash $local_api_copy .= '/'; } if (strpos($local_api_copy, '//')) { $local_api_copy = substr($local_api_copy, strpos($local_api_copy, '//') + 2); } $formats[] = array('api local', $local_api_copy . '[package]/[class].html#[method]', 'apilocal', 'local'); } else { echo '<span style="float: right; background-color: #ffc;">'; echo jgettext('No local API copy specified. you may do this in configuration.'); echo '</span>'; } $cList = getJoomlaClasses(); $packages = getJoomlaPackages(); ecrLoadMedia('php_file_tree'); $fileTree = new EcrFileTree('', '', " onclick=\"changeFrame('[folder]', '[file]');\""); $fileTree->setDir($pathHelp); $fileTree->showExtension = false; ?> <script type="text/javascript"> var fId = '<?php echo $out_format; ?> '; var ECR_DEBUG = <?php echo ECR_DEBUG ? 'true' : 'false'; ?> ; </script> <table width="100%">
//-- No direct access defined('_JEXEC') || die('=;)'); /* * Context menu */ //-- Add css ecrStylesheet('contextmenu'); //-- Add javascript ecrScript('contextmenu', 'templates'); JHTML::_('behavior.modal', 'a.ecr_modal'); //-- Allowed extensions //-- TODO set somewhere else... $allowed_exts = array('php', 'css', 'xml', 'js', 'ini', 'txt', 'html', 'sql'); $allowed_pics = array('png', 'gif', 'jpg', 'ico'); ecrLoadMedia('php_file_tree'); $fileTree = new EcrFileTree(); $js = ''; $js .= " onmousedown=\"setAction(event, '[folder]', '[file]', '[id]');\""; $js .= " onclick=\"ecr_loadFile('templates', '[folder]', '[file]', '[id]');\""; $fileTree->setJs('file', $js); $fileTree->setJs('folder', " onmousedown=\"setAction(event, '[folder]', '[file]');\""); ?> <table width="100%"> <tr valign="top"> <td width="20%"> <div class="ecr_floatbox"> <span style="float: right;" class="img icon16-info hasTip" title="<?php echo jgettext('File tree') . '::' . jgettext('Left click files to edit.') . '<br />' . jgettext('Right click files and folders for options.'); ?>
/** * @param EcrProjectBase $project * * @return string */ function drawFileTree(EcrProjectBase $project) { ecrLoadMedia('php_file_tree'); $ret = ''; $javascript = ''; $javascript .= " onclick=\"reflectFile('[folder]', '[file]', '[id]');\""; $jsFolder = ''; $fileTree = new EcrFileTree('', '', $javascript, $jsFolder); foreach ($project->copies as $dir) { if (is_dir($dir)) { $d = str_replace(JPATH_ROOT, '', $dir); $dspl = str_replace(DS, ' ' . DS . ' ', $d); $ret .= '<div class="file_tree_path"><strong>JROOT</strong>' . BR . $dspl . '</div>'; $fileTree->setDir($dir); $ret .= $fileTree->startTree(); $ret .= $fileTree->drawTree(); $ret .= $fileTree->endTree(); } else { if (JFile::exists($dir)) { $show = true; foreach ($project->copies as $test) { if (strpos($dir, $test)) { $show = false; } } if ($show) { //--This shows a single file not included in anterior directory list ;) - hi plugins... $fileName = JFile::getName(JPath::clean($dir)); $dirName = substr($dir, 0, strlen($dir) - strlen($fileName)); $oldDir = isset($oldDir) ? $oldDir : ''; if ($dirName != $oldDir) { $d = str_replace(JPATH_ROOT, '', $dir); $dspl = str_replace(DS, ' ' . DS . ' ', $d); $ret .= '<div class="file_tree_path"><strong>JROOT</strong>' . BR . $dspl . '</div>'; } $oldDir = $dirName; if (false == isset($fileTree)) { $fileTree = new EcrFileTree($dir, "javascript:", $javascript); } else { $fileTree->setDir($dir); } $ret .= $fileTree->startTree(); $ret .= $fileTree->getLink($dirName, $fileName); $ret .= $fileTree->endTree(); $ret .= '<br />'; } } } } return $ret; }
/** * Get extended Information for an extension temlate. * * AJAX called. ! * * @return void */ public function ajGetExtensionTemplateInfo() { $input = JFactory::getApplication()->input; $jsFile = ''; $fileTree = new EcrFileTree('', '', $jsFile, ''); $extType = $input->get('extType'); $folder = $input->get('folder'); $response = array(); $response['status'] = 0; $response['text'] = ''; if (!$extType || !$folder) { $response['text'] = 'Invalid options'; echo json_encode($response); return; } $dir = ECRPATH_EXTENSIONTEMPLATES . DS . $extType . DS . $folder; $folders = JFolder::folders($dir, '.', false, true, array('.svn')); foreach ($folders as $folder) { $fileTree->setDir($folder); $response['text'] .= $fileTree->drawFullTree(); } //foreach $response['status'] = 1; echo json_encode($response); }
/** * Displays the content of the test directory. * * @return void */ public function draw_test_dir() { $ecr_project = JFactory::getApplication()->input->get('ecr_project'); $this->testsBase = 'administrator' . DS . 'components' . DS . $ecr_project . DS . 'tests'; $timeStamp = date('Ymd_his'); $jsFile = ''; $jsFile .= " onclick=\"doPHPUnit('[link]', '[file]', '{$timeStamp}', '[id]');\""; $jsFolder = ''; $fileTree = new EcrFileTree(JPATH_ROOT . DS . $this->testsBase, '', $jsFile, $jsFolder); $arguments = array(); $response = array(); //-- Joomla! bootstrap $arguments[] = '--bootstrap ' . JPATH_ROOT . DS . 'bootstrap.php'; // @codingStandardsIgnoreStart - use of superglobals $results = print_r($_REQUEST, true); // @codingStandardsIgnoreEnd $response['text'] = $fileTree->drawFullTree(); $response['console'] = htmlentities($results); $response['status'] = 1; echo json_encode($response); jexit(); }
/** * * @param $project * @return unknown_type */ function drawFileTree($project) { $ret = ''; $javascript = ''; $javascript .= " onclick=\"create_skeleton('[link]', '[file]', '[id]');\""; $jsFolder = ''; // #$jsFolder .= " onmousedown=\"setPath('[link]/[file]');\""; $fileTree = new EcrFileTree('', '', $javascript, $jsFolder); foreach ($project->copies as $dir) { if (is_dir($dir)) { $dspl = str_replace(JPATH_ROOT . DS, '', $dir); $dspl = str_replace(DS, ' ' . DS . ' ', $dspl); $ret .= '<div class="file_tree_path"><strong>JROOT</strong>' . BR . $dspl . '</div>'; $fileTree->setDir($dir); $ret .= $fileTree->startTree(); $ret .= $fileTree->drawTree(); $ret .= $fileTree->endTree(); } else { if (JFile::exists($dir)) { $show = true; foreach ($project->copies as $test) { if (strpos($dir, $test)) { $show = false; } } //foreach if (!$show) { continue; } //-- This shows a single file not included in anterior directory list ;) - hi plugins... $fileName = JFile::getName(JPath::clean($dir)); $dirName = substr($dir, 0, strlen($dir) - strlen($fileName)); $oldDir = isset($oldDir) ? $oldDir : ''; if ($dirName != $oldDir) { $dspl = str_replace(JPATH_ROOT . DS, '', $dirName); $ret .= '<div class="file_tree_path"><strong>JROOT</strong>' . BR . $dspl . '</div>'; } $oldDir = $dirName; if (!isset($fileTree)) { $fileTree = new EcrFileTree($dir, "javascript:", $javascript); } else { $fileTree->setDir($dir); } $ret .= $fileTree->startTree(); $ret .= $fileTree->getLink($dirName, $fileName); $ret .= $fileTree->endTree(); $ret .= '<br />'; } } } //foreach return $ret; }
/** * @package EasyCreator * @subpackage Views * @author Nikolai Plath (elkuku) * @author Created on 07-Mar-2008 * @license GNU/GPL, see JROOT/LICENSE.php */ if (!count($this->logFiles)) { EcrHtml::message(jgettext('No logfiles found'), 'notice'); return; } //-- Add css ecrLoadMedia('php_file_tree'); //-- Add javascript ecrScript('log'); $fileTree = new EcrFileTree(ECRPATH_LOGS, '', " onclick=\"EcrLog.loadLog('[file]', '[id]');\"", '', array('log'), true); ?> <h1 style="display: inline;"><span class="img32c icon32-menus"></span><?php echo jgettext('Logfiles'); ?> </h1> <span class="img icon16-server"> <?php echo ECRPATH_LOGS; ?> </span> <div class="ecr_floatbox" style="width: 230px;"> <div class="btn block" onclick="submitbutton('clearLogfiles');">