Example #1
0
 /**
  * Get insert options.
  *
  * @return void
  */
 public function getOptions()
 {
     $db = JFactory::getDBO();
     $tables = $db->getTableList();
     $ajaxLink = 'index.php?option=com_easycreator&tmpl=component&controller=ajax&task=part_task';
     $ajaxLink .= '&group=tables&part=admin_map';
     $ajaxLink .= '&part_task=show_tablefields';
     $ajax = "new Request({ url: '" . $ajaxLink . "'+'&table_name='+this.value, update:'addPartTableFields', onComplete: function() '\n        .'{ div_new_element.show(); } }).send();";
     echo '<strong id="table_name_label">' . jgettext('Table') . ' :</strong>';
     echo '<select name="table_name" id="table_name" onchange="' . $ajax . '">';
     echo '<option value="">' . jgettext('Choose') . '...</option>';
     $prefix = $db->getPrefix();
     foreach ($tables as $table) {
         $v = str_replace($prefix, '', $table);
         echo '<option value="' . $v . '">' . $v . '</option>';
     }
     //foreach
     echo '</select>';
     echo '<div id="addPartTableFields"></div>';
     EcrHtmlSelect::name();
     echo '<strong>' . jgettext('Menu link') . ' :</strong><br />';
     echo '<input type="checkbox" name="create_menu_link" checked="checked"' . ' id="create_menu_link" value="create_menu_link">';
     echo '<label for="create_menu_link">' . jgettext('Create a menu link') . '</label><br />';
     echo '<hr />';
     EcrHtmlOptions::logging();
     $requireds = array('element_name', 'table_name');
     EcrHtmlButton::submitParts($requireds);
 }
Example #2
0
 /**
  * Open the AutoCode for edit.
  *
  * @param EcrProjectAutocode $AutoCode The AutoCode
  *
  * @return void
  */
 public function edit(EcrProjectAutocode $AutoCode)
 {
     /* Array with required fields */
     $requireds = array();
     $requireds[] = EcrHtmlSelect::scope($this->scope);
     echo '<input type="hidden" name="element" value="' . $this->element . '" />';
     /* Draws an input box for a name field */
     $requireds[] = EcrHtmlSelect::name($this->element, jgettext('Table'));
     $tableFields = EcrTableHelper::getTableColumns($this->element);
     echo '<br />';
     $key = $AutoCode->getKey() . '.row';
     if (array_key_exists($key, $AutoCode->fields)) {
         $acFields = $AutoCode->fields[$key];
     } else {
         $acFields = array();
     }
     echo '<div style="background-color: #f3fbe6;">Header</div>';
     echo '<table>';
     echo '<tr>';
     echo '<th>' . jgettext('Field') . '</th>';
     echo '<th>' . jgettext('Label') . '</th>';
     echo '<th>' . jgettext('Input type') . '</th>';
     echo '</tr>';
     foreach ($tableFields as $name => $tableField) {
         if (array_key_exists($name, $acFields)) {
             //-- Autocode present
             $label = $acFields[$name]->label;
             $inputType = $acFields[$name]->inputType;
             $width = $acFields[$name]->width;
         } else {
             //-- New field
             $label = $tableField->Field;
             $inputType = 'text';
             $width = 0;
         }
         echo '<tr>';
         echo '<th>';
         echo $name;
         echo '</th>';
         echo '<td>';
         echo '<input type="text" name="field[' . $name . '][label]" value="' . $label . '" />';
         echo '</td>';
         echo '<td>';
         echo '<select name="field[' . $name . '][input_type]">';
         $selected = $inputType == 'text' ? ' selected="selected"' : '';
         echo '<option value="text"' . $selected . '>&lt;text&gt;</option>';
         $selected = $inputType == 'hidden' ? ' selected="selected"' : '';
         echo '<option value="hidden"' . $selected . '>&lt;hidden&gt;</option>';
         $selected = $inputType == 'category' ? ' selected="selected"' : '';
         echo '<option value="category"' . $selected . '>Catergory select</option>';
         echo '</select>';
         echo '</td>';
         echo '</tr>';
     }
     //foreach
     echo '</table>';
     /* Draws the submit button */
     EcrHtmlButton::autoCode($requireds);
 }
Example #3
0
 /**
  * Get insert options.
  *
  * @return void
  */
 public function getOptions()
 {
     EcrHtmlSelect::scope();
     EcrHtmlSelect::name();
     EcrHtmlOptions::logging();
     $requireds = array('element_name', 'element_scope');
     EcrHtmlButton::submitParts($requireds);
 }
Example #4
0
 /**
  * Get the input fields
  *
  * @param int $cnt A counter value.
  *
  * @return string
  */
 public function getFields($cnt)
 {
     $html = array();
     $html[] = $this->getLabel($cnt, 'script', jgettext('Path'));
     $html[] = $this->getInput($cnt, 'script', $this->script);
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, '', jgettext('Abort on failure'));
     $html[] = EcrHtmlSelect::yesno('fields[' . $cnt . '][abort]', $this->abort);
     return implode("\n", $html);
 }
Example #5
0
 /**
  * Get the input fields
  *
  * @param int $cnt A counter value.
  *
  * @return string
  */
 public function getFields($cnt)
 {
     $html = array();
     $html[] = '<label class="inline" for="fields_' . $cnt . '_releaseState">' . jgettext('Release state') . '</label>';
     $html[] = EcrHtmlSelect::releaseStates(array('name' => 'fields[' . $cnt . '][releaseState]', 'id' => 'fields_' . $cnt . '_releaseState', 'selected' => $this->releaseState));
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, 'abort', jgettext('Abort on failure'));
     $html[] = EcrHtmlSelect::yesno('fields[' . $cnt . '][abort]', $this->abort);
     return implode("\n", $html);
 }
Example #6
0
 /**
  * Get the input fields
  *
  * @param int $cnt A counter value.
  *
  * @return string
  */
 public function getFields($cnt)
 {
     $js = array();
     JFactory::getDocument()->addScriptDeclaration(implode("\n", $js));
     $html[] = $this->getLabel($cnt, 'dboxKey', jgettext('Dropbox Key'));
     $html[] = $this->getInput($cnt, 'dboxKey', $this->dboxKey);
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, 'dboxSecret', jgettext('Dropbox Secret'));
     $html[] = $this->getInput($cnt, 'dboxSecret', $this->dboxSecret);
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, '', jgettext('Abort on failure'));
     $html[] = EcrHtmlSelect::yesno('fields[' . $cnt . '][abort]', $this->abort);
     $html[] = '<br />';
     $link = JRoute::_('&option=com_easycreator&controller=stuffer&task=checkdropbox' . '&key=' . $this->dboxKey . '&seqret=' . $this->dboxSecret);
     $html[] = '<strong>Note</strong> Be sure to <a target="_blank" href="' . $link . '">Register the app</a>';
     return implode("\n", $html);
 }
Example #7
0
 /**
  * Get the input fields
  *
  * @param int $cnt A counter value.
  *
  * @return string
  */
 public function getFields($cnt)
 {
     $html = array();
     $html[] = $this->getLabel($cnt, 'host', jgettext('Host'));
     $html[] = $this->getInput($cnt, 'host', $this->host);
     $html[] = $this->getLabel($cnt, 'port', jgettext('Port'));
     $html[] = $this->getInput($cnt, 'port', $this->port, array('class' => 'span1'));
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, 'user', jgettext('User name'));
     $html[] = $this->getInput($cnt, 'user', $this->user);
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, 'pass', jgettext('Password'));
     $html[] = $this->getInput($cnt, 'pass', $this->pass);
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, 'folder', jgettext('Folder'));
     $html[] = $this->getInput($cnt, 'folder', $this->folder);
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, 'files', jgettext('Files'));
     $html[] = $this->getInput($cnt, 'files', $this->files);
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, '', jgettext('Abort on failure'));
     $html[] = EcrHtmlSelect::yesno('fields[' . $cnt . '][abort]', $this->abort);
     return implode("\n", $html);
 }
Example #8
0
 /**
  * Open the part for edit.
  *
  * @param EcrProjectAutocode $AutoCode TheAutocode
  *
  * @return void
  */
 public function edit(EcrProjectAutocode $AutoCode)
 {
     $var_scope = $AutoCode->options['varscope'];
     /* Array with required fields */
     $requireds = array();
     $requireds[] = EcrHtmlSelect::scope($this->scope);
     echo '<input type="hidden" name="element" value="' . $this->element . '" />';
     /* Draws an input box for a name field */
     $requireds[] = EcrHtmlSelect::name($this->element, jgettext('Table'));
     echo '<strong>Var Scope:</strong><br />';
     foreach ($this->varScopes as $vScope) {
         $checked = $vScope == $var_scope ? ' checked="checked"' : '';
         echo '<input type="radio" name="var_scope" value="' . $vScope . '"' . ' id="vscope-' . $vScope . '"' . $checked . '> <label for="vscope-' . $vScope . '">' . $vScope . '</label><br />';
     }
     //foreach
     $tableFields = EcrTableHelper::getTableColumns($this->element);
     $acFields = $AutoCode->fields[$AutoCode->getKey() . '.var'];
     echo '<table>';
     echo '<tr>';
     echo '<th>' . jgettext('Field') . '</th>';
     echo '<th>' . jgettext('Label') . '</th>';
     echo '</tr>';
     foreach ($tableFields as $name => $tableField) {
         if (array_key_exists($name, $acFields)) {
             //-- Autocode present
             $value = $acFields[$name]->label;
         } else {
             //-- New field
             $value = $tableField[$name]->field;
         }
         echo '<tr>';
         echo '<th>';
         echo '<input type="hidden" name="field[' . $name . '][name]" value="' . $name . '" />';
         echo $name;
         echo '</th>';
         echo '<td>';
         echo '<input type="text" name="field[' . $name . '][label]" value="' . $value . '" />';
         echo '</td>';
         echo '</tr>';
     }
     //foreach
     echo '</table>';
     /* Draws the submit button */
     EcrHtmlButton::autoCode($requireds);
 }
Example #9
0
 /**
  * Edit the AutoCode.
  *
  * @param object $AutoCode The AutoCode
  *
  * @return boolean
  */
 public function edit($AutoCode)
 {
     $input = JFactory::getApplication()->input;
     EcrHtmlSelect::scope($this->_scope);
     echo '<input type="hidden" name="element" value="' . $this->_element . '" />';
     /* Draws an input box for a name field */
     EcrHtmlSelect::name($this->_element, jgettext('Table'));
     $ecr_project = $input->get('ecr_project');
     $element_name = $input->get('element');
     $table_name = $input->get('table_name');
     //$req_table_fields = JxRequest::getVar('table_fields', array());
     //$req_table_fields_edits = JxRequest::getVar('table_fields_edits', array());
     //$req_table_fields_types = JxRequest::getVar('table_fields_types', array());
     if (!$table_name) {
         $table_name = $element_name;
     }
     if (!$table_name) {
         echo 'No table given';
         return false;
     }
     $basePath = $this->_scope == 'admin' ? JPATH_ADMINISTRATOR : JPATH_SITE;
     $basePath .= DS . 'components' . DS . $ecr_project . DS . 'views' . DS . $table_name;
     if (!JFolder::exists($basePath)) {
         JFactory::getApplication()->enqueueMessage(jgettext('View not found'), 'error');
         return false;
     }
     $key = '##ECR_OPTIONS##';
     $this->show_tablefields($table_name, $AutoCode->fields[$key]);
     EcrHtmlButton::submitParts();
 }
Example #10
0
 /**
  * Stuffer View.
  *
  * @return void
  */
 private function stuffer()
 {
     $this->projectList = EcrProjectHelper::getProjectList();
     $this->installFiles = EcrProjectHelper::findInstallFiles($this->project);
     $this->lists['presets'] = EcrHtmlSelect::presets($this->project, array('onchange' => 'Stuffer.loadPreset(this);'));
     $this->setLayout('stuffer');
 }
Example #11
0
 /**
  * Open the AutoCode for edit.
  *
  * @param EcrProjectAutocode $AutoCode The AutoCode
  *
  * @return void
  */
 public function edit(EcrProjectAutocode $AutoCode)
 {
     JFactory::getApplication()->enqueueMessage(__METHOD__ . ' not finished', 'warning');
     /* Array with required fields */
     $requireds = array();
     $requireds[] = EcrHtmlSelect::scope($this->scope);
     echo '<input type="hidden" name="element" value="' . $this->element . '" />';
     /* Draws an input box for a name field */
     $requireds[] = EcrHtmlSelect::name($this->element, jgettext('Table'));
     $tableFields = EcrTableHelper::getTableColumns($this->element);
     $elements = array('header', 'cell');
     echo '<br />';
     /*
      * Header
      */
     $key = $AutoCode->getKey() . '.header';
     if (array_key_exists($key, $AutoCode->fields)) {
         $acFields = $AutoCode->fields[$key];
     } else {
         $acFields = array();
     }
     echo '<div style="background-color: #f3fbe6;">Header</div>';
     echo '<table>';
     echo '<tr>';
     echo '<th>' . jgettext('Field') . '</th>';
     echo '<th>' . jgettext('Label') . '</th>';
     echo '<th>' . jgettext('Display') . '</th>';
     echo '<th>' . jgettext('Width') . '</th>';
     echo '</tr>';
     foreach ($tableFields as $name => $tableField) {
         if (array_key_exists($name, $acFields)) {
             //-- Autocode present
             $label = $acFields[$name]->label;
             $display = $acFields[$name]->display;
             $width = $acFields[$name]->width;
         } else {
             //-- New field
             $label = $tableField->Field;
             $display = 'on';
             $width = 0;
         }
         echo '<tr>';
         echo '<th>';
         echo $name;
         echo '</th>';
         echo '<td>';
         echo '<input type="text" name="field[header][' . $name . '][label]" value="' . $label . '" />';
         echo '</td>';
         echo '<td>';
         echo '<select name="field[header][' . $name . '][display]">';
         $selected = $display == 'on' ? ' selected="selected"' : '';
         echo '<option value="on"' . $selected . '>' . jgettext('On') . '</option>';
         $selected = $display == 'off' ? ' selected="selected"' : '';
         echo '<option value="off"' . $selected . '>' . jgettext('Off') . '</option>';
         echo '</select>';
         echo '</td>';
         echo '<td>';
         echo '<input type="text" name="field[header][' . $name . '][width]" value="' . $width . '" />';
         echo '</td>';
         echo '</tr>';
     }
     //foreach
     echo '</table>';
     /*
      * Cell
      */
     $key = $AutoCode->getKey() . '.cell';
     if (array_key_exists($key, $AutoCode->fields)) {
         $acFields = $AutoCode->fields[$key];
     } else {
         $acFields = array();
     }
     echo '<div style="background-color: #f3fbe6;">Cell</div>';
     echo '<table>';
     echo '<tr>';
     echo '<th>' . jgettext('Field') . '</th>';
     //            echo '<th>'.jgettext('Label').'</th>';
     echo '</tr>';
     foreach ($tableFields as $name => $tableField) {
         if (array_key_exists($name, $acFields)) {
             //-- Autocode present
             $value = $acFields[$name]->label;
         } else {
             //-- New field
             $value = $tableField->Field;
         }
         echo '<tr>';
         echo '<th>';
         echo $name;
         echo '<input type="hidden" name="field[cell][' . $name . '][name]" value="' . $name . '" />';
         echo '</th>';
         echo '</tr>';
     }
     //foreach
     echo '</table>';
     /* Draws the submit button */
     EcrHtmlButton::autoCode($requireds);
 }
Example #12
0
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;'));
?>
</div>
<div class="clr"></div>
<div class="ecr_floatbox">
    <?php 
echo $this->loadTemplate('actions');
?>
</div>


<div id="zipResult" style="display: none;"></div>

<div class="ecr_floatbox">
    <?php 
echo $this->loadTemplate('folder');
Example #13
0
 /**
  * Edit the AutoCode.
  *
  * @param object $AutoCode The AutoCode
  *
  * @return boolean
  */
 public function edit($AutoCode)
 {
     /* Array with required fields */
     $requireds = array();
     $requireds[] = EcrHtmlSelect::scope($this->_scope);
     echo '<input type="hidden" name="element" value="' . $this->_element . '" />';
     /* Draws an input box for a name field */
     $requireds[] = EcrHtmlSelect::name($this->_element, jgettext('Table'));
     //        JLoader::import('helpers.autocode', JPATH_COMPONENT);
     //        $AutoCode = new EcrProjectAutocode;
     $ecr_project = $input->get('ecr_project');
     $element_name = $input->get('element');
     $table_name = $input->get('table_name');
     if (!$table_name) {
         $table_name = $element_name;
     }
     //$req_table_fields = JxRequest::getVar('table_fields', array());
     //$req_table_fields_edits = JxRequest::getVar('table_fields_edits', array());
     //$req_table_fields_types = JxRequest::getVar('table_fields_types', array());
     if (!$table_name) {
         JFactory::getApplication()->enqueueMessage(jgettext('No table given'), 'error');
         return false;
     }
     if (!($scope = $input->get('scope'))) {
         JFactory::getApplication()->enqueueMessage(jgettext('No scope given'), 'error');
         return false;
     }
     $basePath = $scope == 'admin' ? JPATH_ADMINISTRATOR : JPATH_SITE;
     $basePath .= DS . 'components' . DS . $ecr_project . DS . 'views' . DS . $table_name . 's';
     if (!JFolder::exists($basePath)) {
         JFactory::getApplication()->enqueueMessage(jgettext('View not found'), 'error');
         return false;
     }
     $fileList = JFolder::files($basePath, '.', true, true);
     $fields = array();
     if (count($fileList)) {
         foreach ($fileList as $fileName) {
             $file = new stdClass();
             $file->path = str_replace(JPATH_ROOT . DS, '', $fileName);
             $file->autoCodes = $AutoCode->getContents(JFile::read($fileName));
             foreach ($file->autoCodes as $key => $content) {
                 $fields[$key] = $AutoCode->getFields($this->patterns[$key], $content, array($this->keys[$key]));
             }
             //foreach
         }
         //foreach
     }
     $selecteds = isset($fields['##ECR_VIEW1_TMPL1_THS##']) ? $fields['##ECR_VIEW1_TMPL1_THS##'] : array(array());
     $key = key($this->keys);
     if (isset($AutoCode->fields[$key]) && count($AutoCode->fields[$key])) {
         $selecteds = $AutoCode->fields[$key];
     }
     $this->show_tablefields($table_name, $selecteds);
     EcrHtmlButton::submitParts();
 }
Example #14
0
    public static function main()
    {
        $input = JFactory::getApplication()->input;
        /*   //                                                          //
         *  //--We start our form HERE ! this is for the whole app !    //
         * //                                                          //
         */
        EcrHtml::formStart();
        $task = $input->get('task', 'stuffer');
        $ecr_project = $input->get('ecr_project');
        $project = false;
        if ($ecr_project) {
            try {
                $project = EcrProjectHelper::getProject();
            } catch (Exception $e) {
                echo '';
                //-- To satisfy the sniffer - aka: do nothing.
            }
        }
        //--Menu highlighting... set css class _active
        $actives = array();
        $tasks = array();
        $rightTasks = array();
        if ($project instanceof EcrProjectBase && $project->isValid) {
            //-- Left bar
            $tasks['stuffer'] = new stdClass();
            $tasks['stuffer']->title = jgettext('Project');
            $tasks['stuffer']->image = 'ecr_settings';
            $tasks['stuffer']->tasks = array('stuffer', 'stufferstuff', 'projectinfo', 'files', 'save_config', 'projectparams', 'projectdelete', 'tables', 'install');
            if ('package' != $project->type) {
                $tasks['languages'] = new stdClass();
                $tasks['languages']->title = jgettext('Languages');
                $tasks['languages']->image = 'ecr_languages';
                $tasks['languages']->tasks = array('languages', 'translations', 'searchfiles', 'langcorrectdeforder', 'langcorrectorder', 'show_version', 'show_versions', 'language_check', 'create_langfile', 'convert', 'g11nUpdate');
                $tasks['codeeye'] = new stdClass();
                $tasks['codeeye']->title = jgettext('CodeEye');
                $tasks['codeeye']->image = 'xeyes';
                $tasks['codeeye']->tasks = array('codeeye', 'phpcs', 'phpcpd', 'phpunit', 'selenium', 'phpdoc', 'phploc', 'stats', 'stats2', 'reflection', 'runcli', 'runwap');
            }
            $tasks['ziper'] = new stdClass();
            $tasks['ziper']->title = jgettext('Package');
            $tasks['ziper']->image = 'ecr_package';
            $tasks['ziper']->tasks = array('ziper', 'delete', 'archive');
            $tasks['deploy'] = new stdClass();
            $tasks['deploy']->title = jgettext('Deploy');
            $tasks['deploy']->image = 'ecr_deploy';
            $tasks['deploy']->tasks = array('deploy', 'package');
            foreach ($tasks as $k => $v) {
                $actives[$k] = in_array($task, $v->tasks) ? ' active' : '';
            }
        }
        //-- Right bar
        $rightTasks['config'] = new stdClass();
        $rightTasks['config']->title = jgettext('Configuration');
        $rightTasks['config']->image = 'ecr_config';
        $rightTasks['config']->tasks = array('config');
        $rightTasks['templates'] = new stdClass();
        $rightTasks['templates']->title = jgettext('Templates');
        $rightTasks['templates']->image = 'wizard';
        $rightTasks['templates']->tasks = array('templates', 'tplinstall', 'export');
        $rightTasks['logfiles'] = new stdClass();
        $rightTasks['logfiles']->title = jgettext('Logfiles');
        $rightTasks['logfiles']->image = 'text';
        $rightTasks['logfiles']->tasks = array('logfiles');
        $rightTasks['help'] = new stdClass();
        $rightTasks['help']->title = jgettext('Help');
        $rightTasks['help']->image = 'ecr_help';
        $rightTasks['help']->tasks = array('help', 'quicky', 'credits');
        $rightTasks['sandbox'] = new stdClass();
        $rightTasks['sandbox']->title = jgettext('Sandbox');
        $rightTasks['sandbox']->image = 'sandbox';
        $rightTasks['sandbox']->tasks = array();
        $rightTasks['sandbox']->href = JURI::root() . 'index.php?option=com_easycreator';
        $rightTasks['sandbox']->class = ' external';
        $rightTasks['sandbox']->js = '';
        $rightTasks['sandbox']->rel = ' target="_blank"';
        $rTasks = array();
        foreach ($rightTasks as $k => $v) {
            $actives[$k] = in_array($task, $v->tasks) ? ' active' : '';
            $rTasks = array_merge($rTasks, $v->tasks);
        }
        $helpActive = 'jhelp' == $task ? ' active' : '';
        ?>
    <div class="white_box">
        <div style="float: right;">
            <a class="btn<?php 
        echo ECR_TBAR_SIZE . $helpActive;
        ?>
" href="javascript:;"
               onclick="document.id('file_name').value=''; easySubmit('jhelp', 'help');">
                <?php 
        echo ECR_TBAR_ICONS ? '<div class="img32d icon32-JHelp_btn"></div>' : '';
        ?>
                <?php 
        echo jgettext('J! API');
        ?>
            </a>
        </div>

        <?php 
        echo ECR_DEBUG ? '<div class="debug_ON">Debug</div>' : '';
        ?>

        <div style="float: left; margin-top: -7px;"><img
            src="<?php 
        echo JURI::Root();
        ?>
media/com_easycreator/admin/images/ico/icon-64-easycreator.png"
            alt="EasyCreator Logo"/>
        </div>

        <div style="float: left; padding-left: 0.5em;">
            <span class="ecrTopTitle" style="font-size: 1.4em; font-weight: bold;">EasyCreator</span>
            <br/>
            <?php 
        EcrHtmlSelect::project();
        ?>
 <br/>
            <span id="ecr_stat_project"></span>
        </div>

        <div style="float: left; width: 0.5em;">&nbsp;</div>

        <div style="float: left;"><?php 
        if ($ecr_project && $ecr_project != 'ecr_new_project' && $ecr_project != 'ecr_register_project') {
            ?>
                <div class="btn-group">
                    <?php 
            foreach ($tasks as $k => $v) {
                echo '<a class="btn' . ECR_TBAR_SIZE . $actives[$k] . '" href="javascript:;"' . 'onclick="$(\'file_name\').value=\'\'; easySubmit(\'' . $k . '\', \'' . $k . '\');">';
                echo ECR_TBAR_ICONS ? '<div class="img32d icon32-' . $v->image . '" title="' . $v->title . '"></div>' : '';
                echo $v->title . NL;
                echo '</a>';
            }
            ?>
                </div>
                <?php 
        }
        ?>
        </div>

        <div style="float: left; width: 0.5em;">&nbsp;</div>

        <?php 
        if (false == in_array($task, $rTasks)) {
            ?>
 <a class="hasTip btn<?php 
            echo ECR_TBAR_SIZE;
            ?>
" href="javascript:;"
                  title="<?php 
            echo jgettext('More...') . '::' . jgettext('Click for more options');
            ?>
"
                  onclick="this.setStyle('display', 'none'); ecr_options_box.toggle();">
            <?php 
            echo ECR_TBAR_ICONS ? '<i class="img icon16-add"></i>' : '';
            ?>
            <?php 
            echo jgettext('More...');
            ?>
 </a> <?php 
        }
        $stdJS = '';
        $stdJS .= "\$('adminForm').value='';";
        $stdJS .= "\$('file_name').value='';";
        ?>
        <div id="ecr_options_box" class="btn-group" style="margin-left: 1em;">
            <?php 
        foreach ($rightTasks as $k => $v) {
            $controller = isset($v->controller) ? $v->controller : $k;
            $cJS = " easySubmit('" . $k . "', '" . $controller . "');";
            $class = isset($v->class) ? $v->class : '';
            $href = isset($v->href) ? $v->href : 'javascript:;';
            $rel = isset($v->rel) ? $v->rel : '';
            $js = isset($v->js) ? $v->js : 'onclick="' . $stdJS . $cJS . '"';
            echo '<a class="btn ' . $class . ECR_TBAR_SIZE . $actives[$k] . '" href="' . $href . '" ' . $js . $rel . ' >' . NL;
            if (ECR_TBAR_ICONS) {
                echo '<div class="img32d icon32-' . $v->image . '" title="' . $v->title . '"></div>' . NL;
            }
            echo $v->title . NL;
            echo '</a>' . NL;
            ?>
                <?php 
        }
        ?>
        </div>
        <?php 
        if (false == in_array($task, $rTasks)) {
            ?>
            <script type="text/javascript">
                var ecr_options_box = new Fx.Slide('ecr_options_box');
                ecr_options_box.hide();
            </script> <?php 
        }
        ?>

        <div style="clear: both"></div>
    </div>
    <?php 
    }
    <hr/>

    <fieldset>

        <h4><?php 
echo jgettext('New Action');
?>
</h4>
        <label class="inline">
            <?php 
echo jgettext('Action');
?>
        </label>
        <?php 
echo EcrHtmlSelect::actions(array('class' => 'span7'));
?>


        <label class="inline" for="sel_event">
            <?php 
echo jgettext('Event');
?>
        </label>
        <select class="span7" id="sel_event" name="event">
            <option value="precopy">Pre Copy</option>
            <option value="postcopy">Post Copy</option>
            <option value="postbuild">Post Build</option>
        </select>

        <div class="btn-toolbar">
Example #16
0
 /**
  * Open the part for edit.
  *
  * @param object $AutoCode The AutoCode
  *
  * @return void
  */
 public function edit($AutoCode)
 {
     $var_scope = $AutoCode->options['varScope'];
     /* Array with required fields */
     $requireds = array();
     $requireds[] = EcrHtmlSelect::scope($this->_scope);
     echo '<input type="hidden" name="element" value="' . $this->_element . '" />';
     /* Draws an input box for a name field */
     $requireds[] = EcrHtmlSelect::name($this->_element, jgettext('Table'));
     echo '<strong>Var Scope:</strong><br />';
     foreach ($this->_varScopes as $vScope) {
         $checked = $vScope == $var_scope ? ' checked="checked"' : '';
         echo '<input type="radio" name="var_scope" value="' . $vScope . '" id="vscope-' . $vScope . '"' . $checked . '> <label for="vscope-' . $vScope . '">' . $vScope . '</label><br />';
     }
     //foreach
     /* Draws the submit button */
     EcrHtmlButton::submitParts($requireds);
 }