Ejemplo n.º 1
0
 /**
  * Draws a debug console "window".
  *
  * @static
  * @return string
  */
 public static function logConsole()
 {
     JFactory::getDocument()->addScriptDeclaration("window.addEvent('domready', function() {\n                document.id('ecrDebugBoxConsole').makeResizable({\n                    modifiers: {x: false, y: 'height'},\n                    limit: {y: [1, 600]},\n                    invert: true,\n                    handle: 'pollStatusGrip'\n                });\n            });");
     ecrStylesheet('logconsole');
     $html = array();
     $html[] = '<div id="ecrDebugBoxConsole">';
     $html[] = '   <div id="pollStatusGrip">&uArr;&dArr;</div>';
     $html[] = '   <div id="pollStatus">idle</div>';
     $html[] = '   <div class="debugTitle">' . jgettext('Log console') . '</div>';
     $html[] = '   <div id="ecrDebugBox"></div>';
     $html[] = '</div>';
     return implode(NL, $html);
 }
Ejemplo n.º 2
0
 /**
  * Displays available options with input fields.
  *
  * @param EcrProjectBase $project The project
  *
  * @return string HTML
  */
 public function displayOptions(EcrProjectBase $project)
 {
     ecrScript('dbtables');
     ecrStylesheet('dbtables');
     if (false == in_array('mysql', $project->dbTypes)) {
         $project->dbTypes = array_merge(array('mysql'), $project->dbTypes);
     }
     $fields = array();
     $field = new EcrTableField();
     $field->name = 'catid';
     $field->label = 'Category id';
     $field->type = 'INT';
     $field->length = '11';
     $field->attributes = 'UNSIGNED';
     $field->null = 'NOT_NULL';
     $field->comment = 'Category ID';
     $fields[] = $field;
     $field = new EcrTableField();
     $field->name = 'checked_out';
     $field->label = 'Checked out';
     $field->type = 'INT';
     $field->length = '11';
     $field->attributes = 'UNSIGNED';
     $field->default = '0';
     $field->null = 'NOT_NULL';
     $fields[] = $field;
     $html = array();
     $html[] = '<script type="text/javascript">';
     $html[] = '//--Set object count to 3 - 0 is the standard field "id"';
     $html[] = '//-- 1 is "catid" and 2 is "checked_out"';
     $html[] = 'var obCount = 3;';
     $html[] = 'var obCountOrig = 3;';
     $html[] = '</script>';
     $html[] = '<h3>' . jgettext('Database support') . '</h3>';
     $html[] = EcrHtmlOptions::database($project);
     $html[] = '<h3>' . jgettext('User defined table fields') . '</h3>';
     $html[] = '<strong>' . sprintf(jgettext('Please define the fields for the table %s that will be created for your component.'), '"' . strtolower($project->name) . '"') . '</strong>';
     $html[] = EcrTableHelper::startDbEditor();
     foreach ($fields as $count => $field) {
         $html[] = EcrTableHelper::drawPredefinedRow($field, $count + 1);
     }
     $html[] = EcrTableHelper::endDbEditor();
     return implode(NL, $html);
 }
Ejemplo n.º 3
0
 /**
  * Standard display method.
  *
  * @param string $tpl The name of the template file to parse;
  *
  * @throws Exception
  * @return mixed|void
  */
 public function display($tpl = null)
 {
     $input = JFactory::getApplication()->input;
     //-- Add javascript
     ecrScript('codeeye', 'pollrequest', 'logconsole');
     //-- Add css
     ecrStylesheet('codeeye');
     $this->ecr_project = $input->get('ecr_project');
     $this->task = $input->get('task');
     //--Get the project
     try {
         $this->project = EcrProjectHelper::getProject();
         if (0 == count($this->project->copies)) {
             throw new Exception(jgettext('No files found'));
         }
     } catch (Exception $e) {
         EcrHtml::message($e);
         EcrHtml::formEnd();
         return;
     }
     if (in_array($this->task, get_class_methods($this))) {
         //--Execute the task
         $this->{$this->task}();
         if ($this->task == 'display_snip') {
             //--Raw view
             parent::display($tpl);
             return;
         }
     } else {
         if ($this->task) {
             echo sprintf('UNDEFINED Task "%s" in %s', $this->task, __CLASS__) . '<br />';
         }
     }
     //--Draw the submenu
     echo $this->displayBar();
     parent::display($tpl);
     EcrHtml::formEnd();
 }
Ejemplo n.º 4
0
 /**
  * Standard display method.
  *
  * @param null|string $tpl The name of the template file to parse;
  *
  * @return mixed|void
  */
 public function display($tpl = null)
 {
     ecrStylesheet('deploy');
     ecrScript('deploy', 'php2js', 'pollrequest');
     $task = JFactory::getApplication()->input->get('task');
     try {
         $this->project = EcrProjectHelper::getProject();
     } catch (Exception $e) {
         EcrHtml::message($e);
         EcrHtml::formEnd();
         return;
     }
     //-- Draw h1 header
     //EcrHtml::header(jgettext('Deploy'), $this->project, 'ecr_deploy');
     if (in_array($task, get_class_methods($this))) {
         //-- Execute the task
         $this->{$task}();
         $this->setLayout($task);
     }
     //-- Draw the submenu
     echo $this->displayBar();
     parent::display($tpl);
     EcrHtml::formEnd();
 }
Ejemplo n.º 5
0
<?php

defined('_JEXEC') || die('=;)');
/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath
 * @author     Created on 10-Aug-2009
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
ecrScript('dbtables', 'parts', 'autocode', 'util');
ecrStylesheet('stuffer');
echo '<h2 style="color: red; float: right;">W I P !';
echo '</h2>';
$tableHelper = new EcrTableHelper();
$db = JFactory::getDBO();
$dbTables = $db->getTableList();
$dbPrefix = $db->getPrefix();
$dbName = JFactory::getConfig()->get('db');
$scopes = array('admin' => jgettext('Admin'), 'site' => jgettext('Site'));
$allTables = array();
$allTables = $this->project->tables;
$discoveredTables = $tableHelper->discoverTables($this->project);
foreach ($discoveredTables as $table) {
    if (!array_key_exists($table->name, $allTables)) {
        $allTables[$table->name] = $table;
    }
}
//foreach
$tables = array();
$infoQuery = "SHOW TABLE STATUS FROM `%s` LIKE '%s';";
Ejemplo n.º 6
0
<?php

/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath
 * @author     Created on 15-Aug-2011
 * @license    GNU/GPL
 */
//-- No direct access
defined('_JEXEC') || die('=;)');
ecrStylesheet('g11n');
?>

<div id="editcell">
	<table class="adminlist">
	<thead>
		<tr>
			<th>
				<?php 
echo jgettext('Scope');
?>
			</th>
            <th style="background-color: #ffc;">
                <?php 
echo jgettext('Template');
?>
            </th>
			<?php 
foreach ($this->languages['all'] as $lang) {
    if ($lang['tag'] == 'xx-XX') {
Ejemplo n.º 7
0
<?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 = '';
Ejemplo n.º 8
0
 /**
  * Displays the submenu.
  *
  * @param string $task The actual task
  *
  * @return string html
  */
 private function displayBar($task)
 {
     $subtasks = array(array('title' => jgettext('Building'), 'description' => jgettext('Shows options for building your project like credits, files and folders to copy, languages and admin menu.'), 'icon' => 'ecr_config', 'task' => 'stuffer'), array('title' => jgettext('Files'), 'description' => jgettext('Shows all the files belonging to your project'), 'icon' => 'directory', 'task' => 'files'));
     if ('cliapp' != $this->project->type && 'webapp' != $this->project->type) {
         $subtasks[] = array('title' => jgettext('Installing'), 'description' => jgettext('Create and modify install and uninstall files for your project.'), 'icon' => 'installfolder', 'task' => 'install');
         $subtasks[] = array('title' => jgettext('Parameters'), 'description' => jgettext('Modify your project parameters stored in XML files.'), 'icon' => 'ecr_params', 'task' => 'projectparams');
         $subtasks[] = array('title' => jgettext('DataDesigner'), 'description' => jgettext('Automated source code and db creation for your project.'), 'icon' => 'ecr_db', 'task' => 'tables');
     }
     $subtasks[] = array('title' => jgettext('Remove Project'), 'description' => jgettext('This will your delete your project.'), 'icon' => 'delete', 'task' => 'projectdelete');
     $rightTasks = array();
     if ($task == 'stuffer') {
         if (version_compare(ECR_JVERSION, '3') >= 0) {
             ecrStylesheet('stuffer3');
             $icon = ECR_TBAR_ICONS ? '<i class="img icon16-ecr_save"></i>' : '';
             $btn = '<a class="btn' . ECR_TBAR_SIZE . ' btn-success" href="javascript:;"' . ' onclick="submitStuffer(\'save_config\', this);">' . $icon . jgettext('Save') . '</a>';
             JToolbar::getInstance('toolbar')->appendButton('Custom', $btn);
         } else {
             //-- @Joomla!-compat 2.5
             $rightTasks[] = array('title' => jgettext('Save'), 'description' => jgettext('Save the configuration'), 'icon' => 'save', 'task' => 'save_config');
         }
     }
     return EcrHtmlMenu::sub($subtasks, $rightTasks);
 }
Ejemplo n.º 9
0
<?php

defined('_JEXEC') || die('=;)');
/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath
 * @author     Created on 26-Mar2010
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
JHTML::_('behavior.modal', 'a.ecr_modal');
ecrStylesheet('doccomment');
ecrScript('doccomment');
jimport('joomla.html.pane');
$pane = JPane::getInstance('sliders');
$input = JFactory::getApplication()->input;
$the_path = $input->getPath('file_path');
$the_file = $input->getPath('file_name');
?>

<script type="text/javascript">
    var divCount = 0;

    function reflectFile(file_path, file_nameame) {
        document.id('file_path').value = file_path;
        document.id('file_name').value = file_nameame;
        submitform('reflect');
    }
</script>

<div id="ecr_title_file"></div>
Ejemplo n.º 10
0
 * @author     Created on 25-Sep-2008
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
//-- No direct access
defined('_JEXEC') || die(';)');
echo '<h1>' . jgettext('Versions') . '</h1>';
if (!$this->sel_language) {
    EcrHtml::message(jgettext('Please choose a language'));
    return;
}
if (!count($this->versions)) {
    EcrHtml::message(jgettext('No versions found'), 'notice');
    return;
}
//-- Add css
ecrStylesheet('diff');
//-- Add Javascript
ecrScript('versions');
if ($this->selected_version) {
    $this->easyLanguage->displayVersion($this->selected_version, $this->sel_language);
}
?>
<table class="adminlist">
  <tr>
    <th><?php 
echo jgettext('Version');
?>
</th>
    <th><?php 
echo jgettext('Size');
?>
Ejemplo n.º 11
0
<?php

/**
 * @package
 * @subpackage
 * @author     Nikolai Plath
 * @author     Created on 22.04.2010
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
//-- No direct access
defined('_JEXEC') || die('=;)');
ecrStylesheet('diff', 'languages');
$fixForJVersion = '1.6';
$languageTags = $this->converter->getKnownLanguageTags();
$selected_file = JFactory::getApplication()->input->getPath('selected_file');
$allPaths = $this->project->getLanguagePaths();
$paths = (array) $allPaths[$this->scope];
echo $this->menuBoxes['file'];
$color = count($this->badDefinitions) ? 'yellow' : 'green';
echo '<div class="ecr_menu_box" style="margin-left: 0.3em; background-color: ' . $color . ';">';
printf('Found <b>%d</b> errors in project', count($this->badDefinitions));
echo '</div>';
echo $this->menuBox('php_show_all', jgettext('Show all PHP code'));
echo $this->menuBox('convert_quotes', jgettext('Convert quotes'));
echo '<div style="padding-top: 1em; padding-bottom: 1em;">';
echo $this->menuBox('convert_forbidden', jgettext('Convert forbidden keys'));
echo $this->menuBox('remove_bads', jgettext('Remove bad charcters'));
echo $this->menuBox('convert_white_space', jgettext('Convert white space'));
echo $this->menuBox('add_prefix', jgettext('Add prefix'));
echo $this->menuBox('convert_all_caps', jgettext('Convert to all caps'));
?>
Ejemplo n.º 12
0
<?php

defined('_JEXEC') || die('=;)');
/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath
 * @author     Created on 25-Sep-2012
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
ecrStylesheet('config3');
JToolbar::getInstance('toolbar')->appendButton('Custom', $this->loadTemplate('buttons'));
?>

<?php 
foreach ($this->form->getFieldSets() as $fieldSet) {
    ?>

<?php 
    if ('Debug' == $fieldSet->name && !ECR_DEV_MODE) {
        continue;
    }
    ?>

<div class="ecr_floatbox">

    <div class="infoHeader imgbarleft icon24-<?php 
    echo $fieldSet->name;
    ?>
">
        <?php 
Ejemplo n.º 13
0
<?php

defined('_JEXEC') || die('=;)');
/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath
 * @author     Created on 30-Sep-2009
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
ecrStylesheet('php_file_tree');
ecrStylesheet();
?>

<h2><?php 
echo jgettext('Run a CLI application');
?>
</h2>

<ul class="php-file-tree">

    <li class="pft-file ext-php">

        <label class="inline" for="cliargs"><?php 
echo $this->project->comName . '.php';
?>
</label>
        <input type="text" size="50" id="cliargs" class="cliargs"/>

        <a href="javascript:;" class="btn"
           onclick="runCli('<?php 
Ejemplo n.º 14
0
        if (version_compare(JVERSION, '3.2.2-dev', '<')) {
            JFactory::getApplication()->JComponentTitle = 'EasyCreator';
        }
        break;
    case '4':
        // Get prepared
        $application = JFactory::getApplication();
        $application->JComponentTitle = 'EasyCreator';
        $application->enqueueMessage(sprintf(jgettext('EasyCreator %1$s is in testing stage with Joomla! %2$s'), ECR_VERSION, ECR_JVERSION), 'warning');
        break;
    default:
        JFactory::getApplication()->enqueueMessage(sprintf(jgettext('EasyCreator version %s may not work well with your Joomla! version %s'), ECR_VERSION, ECR_JVERSION), 'error');
        break;
}
// Add CSS
ecrStylesheet('default', 'toolbar', 'icon');
// Add JavaScript
ecrScript('global_vars', 'easycreator');
JFactory::getDocument()->addScriptDeclaration("var ECR_VERSION = '" . ECR_VERSION . "';" . NL);
JFactory::getDocument()->addScriptDeclaration("var ECR_JVERSION = '" . ECR_JVERSION . "';" . NL);
$prevErrorReporting = error_reporting(-1);
try {
    $controller = EcrEasycreator::getController();
    $input = JFactory::getApplication()->input;
    if ('component' == $input->get('tmpl')) {
        // Perform the Request task only - raw view
        $controller->execute($input->get('task'));
    } else {
        // Display the menu
        EcrHtmlMenu::main();
        // Perform the Request task
Ejemplo n.º 15
0
<?php

defined('_JEXEC') || die('=;)');
/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath (elkuku)
 * @author     Created on 07-Mar-2008
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
/* @var EcrProjectBase $pType */
//-- Add css
ecrStylesheet('php_file_tree');
$comTypes = EcrProjectHelper::getProjectTypes();
$jVersions = array('25', '30');
?>

<div class="white_box">
    <div class="wizard-header">
        <span id="wizard-loader" class="img32 icon32-wizard"></span>
        <span class="wiz_step">1 / 3</span><?php 
echo jgettext('Extension type');
?>
    </div>
    <div class="ecr_wiz_desc">
        <?php 
echo jgettext('Choose a component type from a predefined template');
?>
    </div>
    <div>
        <?php 
Ejemplo n.º 16
0
<?php

defined('_JEXEC') || die('=;)');
/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath (elkuku)
 * @author     Created on 07-Mar-2008
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
/* @var EasyCreatorViewStuffer $this */
//-- Add CSS
ecrStylesheet('menu', 'stuffer');
$extProps['module'] = array('name' => 'comName', 'client' => 'scope', 'position' => 'position', 'ordering' => 'ordering');
$extProps['plugin'] = array('name' => 'comName', 'client' => 'scope', 'order' => 'ordering');
$js = array();
$js[] = "var definedProjects = {";
$komma1 = false;
foreach ($extProps as $eName => $eProps) {
    if (!isset($this->projectList[$eName])) {
        continue;
    }
    if ($komma1) {
        $js[] = '  , ';
    }
    $komma1 = true;
    $js[] = "'" . $eName . "s' : {";
    $komma2 = false;
    $prs = array();
    foreach ($this->projectList[$eName] as $ext) {
        $ps = array();
Ejemplo n.º 17
0
<?php

/**
 * @package    EasyCreator
 * @subpackage	Views
 * @author		Nikolai Plath (elkuku)
 * @author		Created on 11-Sep-2008
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
//-- No direct access
defined('_JEXEC') || die(';)');
JHTML::_('behavior.mootools');
ecrScript('lang_orderdefault');
ecrStylesheet('lang_orderdefault');
$isHeader = true;
$started = false;
?>
<div class="ecr_code">

<?php 
foreach ($this->default_language as $lang) {
    if ($lang->key == '#' || $lang->key == ';') {
        $dString = $lang->value;
        if ($isHeader) {
            echo '<input type="hidden" name="langfile[]" value="' . $dString . '" />';
            echo '<span style="color: green;">' . $dString . '</span><br />';
        } else {
            $dfString = '<span style="color: orange;">' . $dString . '</span>';
        }
    } else {
        $isHeader = false;
Ejemplo n.º 18
0
<?php

/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath (elkuku)
 * @author     Created on 09-Mar-2008
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
//-- 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]');\"");
?>
Ejemplo n.º 19
0
<?php

defined('_JEXEC') || die('=;)');
/**
 * @package    EasyCreator
 * @subpackage Help
 * @author     Nikolai Plath (elkuku)
 * @author     Created on 07-Mar-2008
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
ecrStylesheet('help');
?>

<div class="white_box">

    <i class="pull-right img128 icon128-easycreator"></i>

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

    <p>
    <span class="img32a icon32-ecr_help">
        EasyCreator documentation can be found on the unofficial german Joomla-Wiki.de - in english only.
        <br/>
        As this is a wiki (just like wikipedia) - your are hereby invited to contribute or correct any errors -
        <big>BIG</big> thanks !
        <h3>
            <a class="external" href="<?php 
echo ECR_DOCU_LINK;