title = JText::_('Templates');
$rightTasks['templates']->image = 'wizard';
$rightTasks['templates']->tasks = array('templates');
$rightTasks['stdfiles'] = new JObject();
$rightTasks['stdfiles']->title = JText::_('STD Files');
$rightTasks['stdfiles']->image = 'copy';
$rightTasks['stdfiles']->tasks = array('stdfiles');
$rightTasks['logfiles'] = new JObject();
$rightTasks['logfiles']->title = JText::_('Logfiles');
$rightTasks['logfiles']->image = 'menus';
$rightTasks['logfiles']->tasks = array('logfiles');
$rightTasks['configuration'] = new JObject();
$rightTasks['configuration']->title = JText::_('Configuration');
$rightTasks['configuration']->image = 'config';
$rightTasks['configuration']->tasks = array('configuration');
$rightTasks['configuration']->href = JURI::root().'administrator/index.php?option=com_config&controller=component&component=com_easycreator&path=';
$rightTasks['configuration']->class = 'modal';
$rightTasks['configuration']->js = '';
$rightTasks['configuration']->rel = ' rel="{handler: \'iframe\', size: {y: 610}}"';
$rightTasks['sandbox'] = new JObject();
$rightTasks['sandbox']->title = JText::_('Sandbox');
$rightTasks['sandbox']->image = 'default';
$rightTasks['sandbox']->tasks = array();
$rightTasks['sandbox']->href = JURI::root().'index.php?option='.com_EASY_APP_ELKUKU_1;
$rightTasks['sandbox']->class = 'external';
$rightTasks['sandbox']->js = '';
$rightTasks['sandbox']->rel = ' target="_blank"';
$rightTasks['help'] = new JObject();
$rightTasks['help']->title = JText::_('Help');
$rightTasks['help']->image = 'help';
$rightTasks['help']->tasks = array('help', 'quicky', 'credits');
$task = JRequest::getVar('task');
$ebc_project = JRequest::getVar('ebc_project', '');
//--Menu highlighting... set css class _active
$actives = array();
$rTasks = array();
foreach( $tasks as $k=>$v)
{
$actives[$k]=( in_array($task, $tasks[$k]) ) ? '_active' : '';
}
foreach( $rightTasks as $k=>$v)
{
$actives[$k] = ( in_array($task, $v->tasks) ) ? '_active' : '';
$rTasks = array_merge($rTasks, $v->tasks);
}
//--Debug
if( defined('ECR_DEBUG') )
{
$checked = ' checked="checked"';
$style = ' style="color: red; cursor: pointer;"';
}
else
{
$checked = '';
$style = ' style="color: blue; cursor: pointer;"';
}
$js = 'onchange="submitbutton(\''.$task.'\')"';
?>
get('save_versioned') );
$checked =( $save_versioned ) ? ' checked="checked"' : '';
$html = ''.JText::_('Save versioned').' ';
return $html;
}//function
/**
* draws a checkbox
* select if the file remains open afer save
*/
public static function chkGoonEdit()
{
$params = &JComponentHelper::getParams( com_EASY_APP_ELKUKU_1 );
$goon_edit = JRequest::getInt('goon_edit', $params->get('goon_edit'));
$checked =( $goon_edit ) ? ' checked="checked"' : '';
$html = '';
$html .= ' ';
$html .= ''.JText::_('Continue editing').' ';
echo $html;
}//function
/**
* Draws a project selector
*
* @return void
*/
public static function drawProjectSelector()
{
jimport('joomla.filesystem.file');
JLoader::import('helpers.project', JPATH_COMPONENT);
$easyProject = new easyProject();
$ebc_project = JRequest::getVar('ebc_project', '');
$task = JRequest::getVar('task', '');
$comTypes = array(
JText::_('Components') => 'component'
, JText::_('Modules') => 'module'
, JText::_('Plugins') => 'plugin'
, JText::_('Templates') => 'template'
);
foreach ($comTypes as $display=>$type)
{
//--init array
$projects[$type] = array();
}//foreach
$scripts = JFolder::files(JPATH_COMPONENT.DS.'builds'.DS.'scripts', $filter = '.ebc');
echo JText::_('Project').': ';
$i = 0;
foreach( $scripts as $script )
{
if( ! $p = $easyProject->getProject(JFile::stripExt($script)) )
{
JError::raiseWarning(100, JText::sprintf('Unable to load the project %s', JFile::stripExt($script)));
//--something went very wrong..
continue;
}
if( $p->comtype == 'plugin' )
{
$projects[$p->comtype][$i]['name'] = ucfirst($p->comscope).' - '.$p->com_name;
}
else
{
$projects[$p->comtype][$i]['name'] = $p->com_name;
}
$projects[$p->comtype][$i]['com_name'] = $p->com_com_name;
$i++;
}//foreach
echo NL.'';
echo NL.''.JText::_('select').'... ';
$selected =( $ebc_project == 'ecr_new_project') ? ' selected="selected"' : '';
echo NL.'* '.JText::_('New Project').' ';
foreach ($comTypes as $display=>$comType)
{
if( count($projects[$comType]))
{
echo '';
foreach( $projects[$comType] as $project )
{
$file = JFile::stripExt($script);
$selected =( $project['com_name'] == $ebc_project ) ? ' selected="selected"' : '';
echo NL.''.($project['name']).' ';
}//foreach
echo ' ';
}
}//foreach
echo NL.' ';
}// function
/**
* Draws a fileselector
*
* @param string $pathToDir path to directory
* @param string $task task for javascript
* @return void
*/
public static function drawFileSelector( $pathToDir, $task )
{
if( ! $pathToDir || ! is_dir($pathToDir))
{
return JText::_('invalid path');
}
//--just for highlighting
$the_file = JRequest::getVar('file', NULL);
//--get the file list
$files = JFolder::files($pathToDir);
echo NL.'';
}// function
/**
* Draws a minibutton
*
* @param string $img
* @param string $title
* @param string $task
* @param string $javascript
*/
public static function drawMiniButton( $img, $title, $task, $javascript='' )
{
$js =( $javascript ) ? $javascript : 'onclick="javascript: submitbutton(\''.$task.'\')"';
echo NL.'';
echo NL.' ';
echo NL.$title;
echo NL.' ';
}// function
public function drawButtonCreateLanguageFile($fileName, $lang, $scope)
{
$button = ''.JText::_('Create language file').' ';
self::displayMessage(array(JText::_('File not found'), ''.$fileName.' ', $button), 'error');
}//function
public function drawButtonRemoveBOM($fileName)
{
$tPath = substr($fileName, strlen(JPATH_ROOT));
$link = 'See: W3C FAQ: Display problems caused by the UTF-8 BOM ';
$button = 'Remove BOM ';
self::displayMessage(array(JText::_('Found a BOM in languagefile'), $fileName, $link, $button), 'notice');
}
/**
* Draws the standard footer
*
*/
public static function footer()
{
$version = '';
$version .=( defined('EASY_APP_ELKUKU_1_VERSION') ) ? ''.EASY_APP_ELKUKU_1_VERSION.' ' : '';
$version .=( defined('EASY_APP_ELKUKU_1_VERSION_TAG') ) ? ' '.EASY_APP_ELKUKU_1_VERSION_TAG.' ' : '';
?>
com_name;
$pType = ucfirst($project->comtype);
if( $project->comtype == 'plugin')
{
$pName = ucfirst($project->comscope).' - '.$pName;
}
$str = '';
$str .= $title;
$str .=( $pType ) ? ' '.JText::_($pType).' ' : '';
$str .=( $pName ) ? ' '.$pName.' ' : '';
echo ''.$str.' ';
if( ! $project )
{
//---NO PROJECT SELECTED
ecrHTML::displayMessage(JText::_('Please select a project'));
}
}//function
/**
* This will write the 'opening' tags for our form
* we also provide an id tag - as the name tag will be deprecated..
*/
public static function easyFormStart()
{
?>
JText::_('Hot logging')
'files' => JText::_('Log file contents')
, 'profile' => JText::_('Profile')
);
//--Get component parameters
$params =& JComponentHelper::getParams( com_EASY_APP_ELKUKU_1 );
#echo ''.print_r($params, true).' ';
echo NL.'';
}// function
function xxdrawLoggingOptions()
{
?>
:
get('archive_zip');
$cfg_archive_tgz = $params->get('archive_tgz');
# $cfg_archive_bz = $params->get('archive_bz');
$formats = array(
'archive_zip' => 'zip'
, 'archive_tgz' => 'tar.gz'
# , 'archive_bz' => 'bz2'
);
foreach( $formats as $name => $ext )
{
//TODO set default from config ?
$checked =( $params->get($name) ) ? ' checked="checked"' : '';
echo NL.'';
echo NL.' ';
echo NL.' '.$ext.' ';
echo NL.'
';
}//foreach
}// function
/**
* Load the great code editor
*
* **************
* ** EditArea **
* **************
* CFG:
* path - to EditArea file
* type - EditArea file name
* form - name
* textarea - name
* syntax - for highlighting
*/
public static function loadEditArea( $cfg )
{
$document =& JFactory::getDocument();
$document->addScript(JURI::root(true).$cfg['path'].'/'.$cfg['type']);
$translates = array('txt');
if( in_array($cfg['syntax'], $translates))
{
$cfg['syntax'] = 'brainfuck';
}
?>
Id: [1] => CHANGELOG.php [2] => 362 [3] => 2007-12-14 [4] => 22:22:19Z [5] => elkuku [6] => ;)
*/
public static function getVersionFromCHANGELOG( $appName )
{
// TODO change to getVersionFromFile
$file = JPATH_ADMINISTRATOR.DS.'components'.DS.$appName.DS.'CHANGELOG.php';
if( ! file_exists( $file ) ) { return FALSE; }
//--we do not use JFile here cause we only need one line which is
//--normally at the beginning..
$f = fopen( $file, 'r' );
$ret = FALSE;
while( $line = fgets( $f, 1000 ) )
{
if( strpos( $line, '@version'))
{
$line = explode( '$', $line );
$line = explode( ' ', $line[1] );
$svn_rev = $line[2];
$svn_date = date("d-M-Y", strtotime($line[3]));
$ret = $svn_rev.' / '.$svn_date;
break;
}
}// while
fclose($f);
return $ret;
}// function
/**
* Wizard
* displays the project information introduced so far
*
* @param JObject $project
* @param array $formFieldNames fields already displayed
*/
public static function displayResult($project, $formFieldNames=array())
{
?>
name) )
{
ecrHTML::displayResultFieldRow('Name', 'name', 'com_name', $project, $formFieldNames);
ecrHTML::displayResultFieldRow('Version', 'version', 'version', $project, $formFieldNames);
ecrHTML::displayResultFieldRow('Description', 'description', 'description', $project, $formFieldNames);
}
if( isset($project->ebc_author) )
{
ecrHTML::displayResultFieldRow('Author', 'ebc_author', 'ebc_author', $project, $formFieldNames);
ecrHTML::displayResultFieldRow('Author e-mail', 'authoremail', 'authoremail', $project, $formFieldNames);
ecrHTML::displayResultFieldRow('Author URL', 'authorurl', 'authorurl', $project, $formFieldNames);
ecrHTML::displayResultFieldRow('License', 'license', 'license', $project, $formFieldNames);
ecrHTML::displayResultFieldRow('Copyright ©', 'copyright', 'copyright', $project, $formFieldNames);
}
if( isset($project->languages) && $project->languages)
{
ecrHTML::displayResultFieldRow('Languages', 'languages', 'langs', $project, $formFieldNames);
}
?>
$property ) { return; }
?>
$property; ?>
1 )
{
//...workaround cause first page is named 'wizard' - rename to 'wizard1' - to-do..
$zNum =( $num == 2 ) ? '' : $num - 1;
}
?>
', '>', $cleaned);
return $cleaned;
}//function
function drawSelectScope()
{
?>
 :
:
';
echo ''.JText::_('Add').'
';
}
/**
* Displays a message with standard Joomla! backend css styles
* Type can be:
*
* 'notice' : YELLOW
* 'error' : RED
* '[EMPTY]': BLUE [default]
*
* @param array $messages
* @param string $type empty, notice, error
*/
public static function displayMessage($messages, $type='')
{
if( ! is_array($messages) )
{
$messages = array( $messages );
}
?>
'.$message.'';
}//foreach
?>