/** * Context menu */ public static function display() { $input = JFactory::getApplication()->input; //--Add css and javascript ecrLoadMedia('contextmenu'); $ajaxLink = 'index.php?option=com_easycreator'; $ajaxLink .= '&controller=ajax&tmpl=component'; $ajaxLink .= '&old_task=' . $input->get('task'); $ajaxLink .= '&old_controller=' . $input->get('controller'); $ajaxLink .= '&ecr_project=' . $input->get('ecr_project'); ?> <script type="text/javascript"> SimpleContextMenu.setup({'preventDefault' : true, 'preventForms' : false}); SimpleContextMenu.attach('pft-file', 'CM1'); SimpleContextMenu.attach('pft-directory', 'CM2'); </script> <!-- Context menu files --> <?php $menuEntries = array(array(jgettext('New folder'), 'new_folder', 'add'), array(jgettext('New file'), 'new_file', 'add'), array(jgettext('Rename'), 'rename_file', 'rename'), array(jgettext('Delete'), 'delete_file', 'delete')); ?> <ul id="CM1" class="SimpleContextMenu"> <li class="title"><?php echo jgettext('File'); ?> </li> <?php foreach ($menuEntries as $menuEntry) { self::addEntry($ajaxLink, $menuEntry[0], $menuEntry[1], $menuEntry[2]); } //foreach ?> </ul> <!-- Context menu folders --> <?php $menuEntries = array(array(jgettext('New folder'), 'new_folder', 'add'), array(jgettext('New file'), 'new_file', 'add'), array(jgettext('Rename'), 'rename_folder', 'rename'), array(jgettext('Delete'), 'delete_folder', 'delete')); ?> <ul id="CM2" class="SimpleContextMenu"> <li class="title"><?php echo jgettext('Folder'); ?> </li> <?php foreach ($menuEntries as $menuEntry) { self::addEntry($ajaxLink, $menuEntry[0], $menuEntry[1], $menuEntry[2]); } //foreach ?> </ul> <input type="hidden" name="act_folder" id="act_folder"/> <input type="hidden" name="act_file" id="act_file"/> <?php }
/** * Standard display method. * * @param null|string $tpl The name of the template file to parse; * * @return mixed|void */ public function display($tpl = null) { ecrLoadMedia('ziper'); $task = JFactory::getApplication()->input->get('task'); try { $this->project = EcrProjectHelper::getProject(); $this->preset = $this->project->presets['default']; } catch (Exception $e) { EcrHtml::message($e); EcrHtml::formEnd(); return; } if (in_array($task, get_class_methods($this))) { $this->{$task}(); } //-- Draw the submenu echo $this->displayBar(); parent::display($tpl); EcrHtml::formEnd(); }
/** * Standard display method. * * @param null|string $tpl The name of the template file to parse; * * @return mixed|void */ public function display($tpl = null) { $input = JFactory::getApplication()->input; $task = $input->get('task'); $this->builder = new EcrProjectBuilder(); ecrLoadMedia('wizard'); $params = JComponentHelper::getParams('com_easycreator'); $this->templateList = EcrProjectTemplateHelper::getTemplateList(); $tplType = $input->get('tpl_type'); $tplFolder = $input->get('tpl_name'); $desc = isset($this->templateList[$tplType][$tplFolder]) ? $this->templateList[$tplType][$tplFolder]->description : ''; $project = EcrProjectHelper::newProject('empty'); $project->type = $input->get('tpl_type'); $project->tplName = $input->get('tpl_name'); $project->version = $input->getString('version', '1.0'); $project->description = $input->getString('description', $desc); $project->listPostfix = $input->get('list_postfix', 'List'); $project->JCompat = $input->getString('jcompat'); //-- Sanitize project name $project->name = $input->get('com_name'); $disallows = array('_'); $project->name = str_replace($disallows, '', $project->name); //-- Credits $s = $input->getString('author'); $project->author = $s ? $s : $params->get('cred_author'); $s = $input->getString('authorEmail'); $project->authorEmail = $s ? $s : $params->get('cred_author_email'); $s = $input->getString('authorUrl'); $project->authorUrl = $s ? $s : $params->get('cred_author_url'); $s = $input->getString('license'); $project->license = $s ? $s : $params->get('cred_license'); $s = $input->getString('copyright'); $project->copyright = $s ? $s : $params->get('cred_copyright'); $this->project = $project; if ($task && method_exists($this, $task)) { $this->{$task}(); } parent::display($tpl); EcrHtml::formEnd(); }
*/ //-- 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.');
<?php defined('_JEXEC') || die('=;)'); /** * @package EasyCreator * @subpackage Views * @author Nikolai Plath (elkuku) * @author Created on 11-Sep-2008 * @license GNU/GPL, see JROOT/LICENSE.php */ //-- Add CSS ecrLoadMedia('translator'); ecrStylesheet('icon'); ecrScript('php2js'); $input = JFactory::getApplication()->input; $useGoogle = JComponentHelper::getParams('com_easycreator')->get('use_google_trans_api'); $fieldID = $input->getInt('field_id'); $adIds = $input->getString('ad_ids'); $baseLink = 'index.php?option=com_easycreator&tmpl=component&controller=ajax&format=raw'; $baseLink .= '&ecr_project=' . $input->get('ecr_project'); $baseLink .= '&scope=' . $this->scope; $baseLink .= '&trans_lang=' . $this->trans_lang; $baseLink .= '&trans_key=' . $this->trans_key; $ret_type = $input->get('ret_type', 'ini'); $langTag = substr($this->trans_lang, 0, 2); if ($this->trans_lang != 'en-GB' && !$this->trans_default) { //-- No default translation available - this is an error ! EcrHtml::message(array(jgettext('Unable to translate without default translation'), sprintf(jgettext('Please translate %s first'), 'en-GB')), 'error'); return; } $translation = '';
/** * @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; }
<?php defined('_JEXEC') || die('=;)'); /** * @package EasyCreator * @subpackage Views * @author Nikolai Plath * @author Created on 12-Oct-2009 * @license GNU/GPL, see JROOT/LICENSE.php */ ecrLoadMedia('config'); JFactory::getApplication()->JComponentTitle = sprintf(jgettext('%s Configuration'), 'EasyCreator'); if (false == class_exists('g11n')) { ?> <div class="g11nNotice"> EasyCreator is in "English ONLY" mode ! If you want a localized version, please install the g11n library. - <a href="http://joomlacode.org/gf/project/elkuku/frs/?action=FrsReleaseBrowse&frs_package_id=5915"> Download lib_g11n </a> </div> <?php } ?> <?php echo $this->loadTemplate($this->legacyTemplate);