Example #1
0
    /**
     * Wizard
     * Displays the project information introduced so far.
     *
     * @param \EcrProjectBase  $project
     * @param array            $formFieldNames fields already displayed
     */
    public static function displayResult(EcrProjectBase $project, $formFieldNames = array())
    {
        ?>
    <div class="ecr_result">
        <h3><?php 
        echo jgettext('Your extension so far');
        ?>
</h3>

        <?php 
        echo self::displayRow(jgettext('Type'), 'type', 'tpl_type', $project, $formFieldNames);
        echo self::displayRow(jgettext('Template'), 'tplName', 'tpl_name', $project, $formFieldNames);
        echo self::displayRow(jgettext('JVersion'), 'JCompat', 'jcompat', $project, $formFieldNames);
        echo '<div style="background-color: #fff; border: 1px solid gray; padding-left: 0.5em;">';
        $info = EcrProjectTemplateHelper::getTemplateInfo($project->type, $project->tplName);
        echo $info ? $info->description : '';
        echo '</div>';
        echo '<div class=extension" style="background-color: #ffff99; padding: 1em; font-size: 1.2em;">';
        echo self::displayRow(jgettext('Name'), 'name', 'com_name', $project, $formFieldNames);
        echo self::displayRow(jgettext('Version'), 'version', 'version', $project, $formFieldNames);
        echo self::displayRow(jgettext('Description'), 'description', 'description', $project, $formFieldNames);
        echo '</div>';
        echo '<div class="credits" style="background-color: #ffc;">';
        echo self::displayRow(jgettext('Author'), 'author', 'author', $project, $formFieldNames);
        echo self::displayRow(jgettext('Author e-mail'), 'authorEmail', 'authorEmail', $project, $formFieldNames);
        echo self::displayRow(jgettext('Author URL'), 'authorUrl', 'authorUrl', $project, $formFieldNames);
        echo self::displayRow(jgettext('License'), 'license', 'license', $project, $formFieldNames);
        echo self::displayRow(jgettext('Copyright (C)'), 'copyright', 'copyright', $project, $formFieldNames);
        echo self::displayRow(jgettext('List postfix'), 'listPostfix', 'list_postfix', $project, $formFieldNames);
        echo '</div>';
        ?>
</div>
    <?php 
    }
Example #2
0
 /**
  * Display the template list.
  *
  * @return void
  */
 private function templates()
 {
     $input = JFactory::getApplication()->input;
     $profiling = false;
     if ($profiling) {
         //            jimport('joomla.error.profiler');
         $this->profiler = JProfiler::getInstance('EasyCreator');
     }
     $this->task = $input->get('task');
     $this->ecr_project = $input->get('ecr_project');
     $this->path = ECRPATH_EXTENSIONTEMPLATES;
     $this->file_path = $input->getPath('file_path');
     $this->file_name = $input->getPath('file_name');
     $this->com_type = $input->get('com_type');
     $this->template = $input->get('template');
     $this->comTypes = EcrProjectHelper::getProjectTypes();
     $cache = JFactory::getCache();
     $cache->setCaching(1);
     if ($profiling) {
         $this->profiler->mark('start get templates');
     }
     $this->templates = EcrProjectTemplateHelper::getTemplateList();
     if ($profiling) {
         $this->profiler->mark('end get cached templates');
     }
     if ($profiling) {
         echo '<pre>' . print_r($this->profiler->getBuffer(), true) . '</pre>';
     }
     $this->setLayout('templates');
 }
Example #3
0
 /**
  * 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();
 }
Example #4
0
?>
            </div>

            <div class="ecr_floatbox">
                <h3><?php 
echo jgettext('Template variables');
?>
</h3>

                <h4><?php 
echo jgettext('Common variables');
?>
</h4>
                <ul class="unstyled">
                    <?php 
foreach (EcrProjectTemplateHelper::getReplacementInfo() as $infoKey => $infoText) {
    ?>
                    <li>
                        <?php 
    echo '' == $infoText ? '<strong>' : '<strong class="hasTip img icon16-info" title="' . $infoKey . '::' . $infoText . '">';
    ?>
                        <?php 
    echo $infoKey . '</strong>';
    ?>
                    </li>
                    <?php 
}
?>
                </ul>
                <hr />
                <h4><?php 
Example #5
0
<?php

defined('_JEXEC') || die('=;)');
/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath
 * @author     Created on 14-Oct-2009
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
$templateList = EcrProjectTemplateHelper::getTemplateList();
echo EcrHelp::help(jgettext('Select the templates to export'), EcrHelp::ALL, 'ecrBigInfo');
?>

<h1><?php 
echo jgettext('Export templates');
?>
</h1>

<div class="btn btn-success btn-large" onclick="submitbutton('do_export');">
    <i class="img icon16-ecr_save"></i>
    <?php 
echo jgettext('Export');
?>
</div>

<div style="clear: both;"></div>

<?php 
foreach ($templateList as $group => $templates) {
    echo '<div class="ecr_floatbox">';
Example #6
0
 /**
  * Installs EasyCreator extension templates.
  *
  * @return void
  */
 public function do_install()
 {
     $input = JFactory::getApplication()->input;
     try {
         EcrProjectTemplateHelper::installTemplates();
         EcrHtml::message(jgettext('Templates have been installed.'));
         $input->set('task', 'templates');
     } catch (Exception $e) {
         EcrHtml::message($e);
         $input->set('task', 'tplinstall');
     }
     //try
     $input->set('view', 'templates');
     parent::display();
 }