Esempio n. 1
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);
 }
Esempio n. 2
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();
 }
Esempio n. 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)
 {
     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();
 }
Esempio n. 4
0
 /**
  * Tables View.
  *
  * @return void
  */
 private function tables()
 {
     ecrScript('addelement');
     $this->setLayout('tables');
 }
Esempio n. 5
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>
Esempio n. 6
0
 */
//-- 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');
?>
</th>
    <th><?php 
Esempio n. 7
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;
Esempio n. 8
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
 */
ecrScript('templates');
echo EcrHelp::help(jgettext('Select a template package to import'), EcrHelp::ALL, 'ecrBigInfo');
?>

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

<div class="ecr_floatbox">
    <form enctype="multipart/form-data" action="index.php" method="post" name="installForm">
        <div>
            <label class="inline" for="install_package"><?php 
echo jgettext('Package File');
?>
</label>

            <input class="input_box" id="install_package" name="install_package" type="file" size="57"/>

            <input class="btn btn-success btn-large" type="button" value="<?php 
echo jgettext('Upload and install package');
Esempio n. 9
0
<?php

/**
 * @package       EasyCreator
 * @subpackage    Help
 * @author        Nikolai Plath (elkuku)
 * @author        Created on 15-Jul-2009
 * @license       GNU/GPL, see JROOT/LICENSE.php
 */
//-- No direct access
defined('_JEXEC') || die('=;)');
$input = JFactory::getApplication()->input;
$pathHelp = JPATH_COMPONENT . DS . 'helpers' . DS . 'jclasslists';
$fName = 'jclasslist_' . str_replace('.', '_', JVERSION);
//-- Add javascript
ecrScript('jhelp', 'php2js');
if (false == JFile::exists($pathHelp . DS . $fName . '.php')) {
    //-- Class list not found
    EcrHtmlButton::createClassList();
    echo '<div id="jsonDebug"></div>';
    return;
}
JLoader::import($fName, $pathHelp);
JHTML::_('behavior.tooltip');
$out_format = $input->get('out_format', 'source');
if ($out_format == '') {
    $out_format = 'source';
}
$className = $input->get('className');
$methodName = $input->get('methodName');
$packageName = $input->get('packageName');
Esempio n. 10
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';";
Esempio n. 11
0
    /**
     * Load the great code editor EditArea.
     *
     *       **************
     *       ** EditArea **
     *       **************
     * CFG:
     * path        - to EditArea file
     * type        - EditArea file name
     * form        - name
     * textarea    - name
     * syntax    - for highlighting
     *
     * @param array $cfg
     */
    public static function loadEditArea($cfg)
    {
        $document = JFactory::getDocument();
        $document->addScript(JURI::root(true) . $cfg['path'] . '/' . $cfg['type']);
        $translates = array('txt' => 'brainfuck', 'pot' => 'po');
        $syntax = array_key_exists($cfg['syntax'], $translates) ? $translates[$cfg['syntax']] : $cfg['syntax'];
        $debug = ECR_DEBUG ? ',debug: true' . NL : '';
        $js = <<<EOF
    <!-- **************** -->
    <!-- ****  load  **** -->
    <!-- *** EditArea *** -->
    <!-- **************** -->
    editAreaLoader.init({
        id : "{$cfg['textarea']}"
        ,syntax: "{$syntax}"
        ,start_highlight: true
        ,replace_tab_by_spaces: 3
        ,end_toolbar: 'html_select, autocompletion'
        ,plugins: "html, autocompletion"
        ,autocompletion: true
        ,font_size: {$cfg['font-size']}
  //      ,is_multi_files: true
        {$debug}
    });
EOF;
        $document->addScriptDeclaration($js);
        ecrScript('editor');
    }
Esempio n. 12
0
 /**
  * Zipper view.
  *
  * @return void
  */
 private function ziper()
 {
     ecrScript('stuffer');
     $this->setLayout('ziper');
 }
Esempio n. 13
0
        }
        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
        $controller->execute($input->get('task'));
        if (ECR_DEV_MODE && ECR_DEBUG_LANG && class_exists('g11n')) {
Esempio n. 14
0
    $js[] = "sortSubMenu = new Sortables('#divSubmenu', {\n        constrain: true,\n        clone: true,\n        revert: true,\n\n        onStart: function(el) {\n            el.setStyle('background','#add8e6');\n        },\n        onComplete: function(el) {\n            el.setStyle('background','#fff');\n        }\n\n    });";
    $js[] = '//--Package modules added by PHP';
    foreach ($this->project->modules as $module) {
        $js[] = "addPackageElement('module', '" . $module->scope . "', '" . $module->name . "', '" . $module->title . "', '" . $module->position . "', '" . $module->ordering . "');";
    }
    $js[] = '//--Package plugins added by PHP';
    foreach ($this->project->plugins as $plugin) {
        $js[] = "addPackageElement('plugin', '" . $plugin->scope . "', '" . $plugin->name . "', '" . $plugin->title . "', '', '" . $plugin->ordering . "');";
    }
    $js[] = '});';
}
$js[] = "window.addEvent('domready', function() {";
$js[] = '   Stuffer.init();';
$js[] = '});';
JFactory::getDocument()->addScriptDeclaration(implode(NL, $js));
ecrScript('addelement', 'menu');
?>
<!-- just for js.. -->
<input type="hidden" value="0" id="totalCopys" />
<input type="hidden" value="0" id="totalSubmenu" />
<input type="hidden" value="0" id="totalPackageElementsModules" />
<input type="hidden" value="0" id="totalPackageElementsPlugins" />


<div class="row-fluid">
    <div id="actionButtons" class="span3">

        <a class="btn btn-large" coords="info">
            <i class="img24 icon24-info"></i>
            <?php 
echo jgettext('Info');
Esempio n. 15
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 = '';
Esempio n. 16
0
<?php

/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath (elkuku)
 * @author     Created on 08-Mar-2008
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
//-- No direct access
defined('_JEXEC') || die('=;)');
jimport('joomla.html.pane');
ecrScript('parameter');
?>

<div class="toolbar" style="float: right;">
	<table class="toolbar">
		<tr valign="top">
			<td>
			<?php 
echo $this->xmlSelector;
?>
			</td>
			<?php 
if ($this->selected_xml && $this->params) {
    ?>
			<td>
				<div class="ecr_button img icon16-add" onclick="div_new_group.toggle(); $('addGroupName').focus();"><?php 
    echo jgettext('New group');
    ?>
</div>
Esempio n. 17
0
<?php

defined('_JEXEC') || die('=;)');
/**
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath
 * @author     Created on 15-Aug-2011
 * @license    GNU/GPL
 */
ecrScript('g11n');
$item = $this->g11nInfo;
?>

<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) {
    echo '<th>' . $lang['tag'] . '</th>';
Esempio 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('=;)');
$formFieldNames = array();
$img_base = JURI::root() . 'media/com_easycreator/admin/images';
ecrScript('wizard2');
?>

<div class="ecr_floatbox left" style="width: 55%;">
    <div class="buttonBox">
        <a class="btn" onclick="submitbutton('wizard');"
           title="<?php 
echo jgettext('Back');
?>
">
            <i class="img icon16-2leftarrow"></i>
            <?php 
echo jgettext('Back');
?>
        </a>
        <a class="btn" onclick="submitbutton('wizard3');"
           title="<?php 
echo jgettext('Next');
Esempio n. 19
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
 */
ecrScript('util', 'pollrequest');
if ('package' == $this->project->type && !$this->project->elements) {
    EcrHtml::message(jgettext('Please add some extensions to your package before creating it'), 'error');
    return;
}
JFactory::getDocument()->addScriptDeclaration("window.addEvent('domready', function() { EcrZiper.updateName(); });");
?>
<div class="ecr_floatbox buttonZip">
    <?php 
echo $this->loadTemplate('button');
?>
</div>

<div class="ecr_floatbox">
    <div class="infoHeader img icon24-preset">
        <?php 
echo jgettext('Preset');
?>
    </div>
    <?php 
echo EcrHtmlSelect::presets($this->project, array('onchange' => 'EcrZiper.loadPreset(this);', 'style' => 'font-size: 1.5em;'));
Esempio n. 20
0
    //-- @todo php 5.2
    spl_autoload_register('easy_creator_loader', true);
} else {
    spl_autoload_register('easy_creator_loader', true, true);
}
//-- Load the special Language
//-- 1) Check if g11n is installed as a PEAR package - see: http://elkuku.github.com/pear/
//@include 'elkuku/g11n/language.php';
//-- @todo: check for installed g11n PEAR package to remove the "shut-up"
//-- @require_once 'elkuku/g11n/language.php';
if (!class_exists('g11n')) {
    //-- 2) Check the libraries folder
    if (!jimport('g11n.language')) {
        //-- 3) Load a dummy language handler -> english only !
        ecrLoadHelper('g11n_dummy');
        ecrScript('g11n_dummy', 'php2js');
    }
}
if (class_exists('g11n')) {
    //-- TEMP@@debug
    if (ECR_DEV_MODE && ECR_DEBUG_LANG) {
        //-- @@DEBUG
        g11n::cleanStorage();
        g11n::setDebug(ECR_DEBUG_LANG);
    }
    //-- Get our special language file
    g11n::loadLanguage();
}
/*
 * Functions
 */
Esempio n. 21
0
 * @package    EasyCreator
 * @subpackage Views
 * @author     Nikolai Plath
 * @author     Created on 28-Sep-2009
 * @license    GNU/GPL, see JROOT/LICENSE.php
 */
//-- No direct access
defined('_JEXEC') || die('=;)');
//$highChartsVersion = '1.2.5';
$highChartsVersion = '2.0.5';
//$highChartsVersion = '2.1.4';
//$highChartsVersion = '2.3.2';
if (ECR_DEBUG) {
    ecrScript('highcharts-' . $highChartsVersion . '/highcharts.src');
} else {
    ecrScript('highcharts-' . $highChartsVersion . '/highcharts');
}
$matrix = $this->projectMatrix;
JFactory::getDocument()->addCustomTag($matrix->chartCode);
?>
<script type="text/javascript">
<!--
var myEffect = new Fx.Morph($('foooo'));
myEffect.start();

//-->
</script>
<div class="ecr_floatbox" id="foooo">
    <table>
        <tr>
            <th style="background-color: #cce5ff;"><?php 
Esempio n. 22
0
/**
 * @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]');\"");
?>

<table width="100%">
Esempio n. 23
0
defined('_JEXEC') || die('=;)');
/**
 * @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;">