@my wife Roline van der Merwe
'.$totalHours.' Hours or '.$totalDays.' Eight Hour Days (actual time you saved)
';
$message .= '(if creating a folder and file took 5 seconds and writing one line of code took 10 seconds, never making one mistake or taking any coffee break.)
';
$message .= ''.$actualHoursSpent.' Hours or '.$actualDaysSpent.' Eight Hour Days (the actual time you spent)
';
$message .= '(with the following break down: debugging @'.$debuggingHours.'hours = codingtime / 4; planning @'.$planningHours.'hours = codingtime / 7; mapping @'.$mappingHours.'hours = codingtime / 10; office @'.$officeHours.'hours = codingtime / 6;)
'.$actualTotalHours.' Hours or '.$actualTotalDays.' Eight Hour Days (a total of the realistic time frame for this project)
';
$message .= '(if creating a folder and file took 5 seconds and writing one line of code took 10 seconds, with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
Project duration: '.$projectWeekTime. ' weeks or '.$projectMonthTime.' months
'; $message .= 'Path: '.$counter['filePath'].'
';
$message .= 'URL: '.$url.'
';
$message .= 'Hey! you can also download the file right now!
Download
Remember! This file is in your tmp folder and therefore publicly accessible untill you click [Clear tmp]!
'; // set redirect $this->setRedirect($redirect_url,$message,'message'); $app->setUserState('com_componentbuilder.extension_name', $counter['filename']); } else { // wipe out the user state when we're going to redirect $app->setUserState('com_componentbuilder.redirect_url', ''); $app->setUserState('com_componentbuilder.message', ''); $app->setUserState('com_componentbuilder.extension_message', ''); $app->setUserState('com_componentbuilder.extension_name', ''); // set redirect $this->setRedirect($redirect_url,$message); } return true; } return false; } public function clearTmp() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // check if user has the right $user = JFactory::getUser(); // set page redirect $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false); $message = 'Could not clear the tmp folder'; if($user->authorise('core.admin', 'com_componentbuilder')) { // get the model $model = $this->getModel('compiler'); // get tmp folder $comConfig = JFactory::getConfig(); $tmp = $comConfig->get('tmp_path'); if ($model->emptyFolder($tmp)) { $message = 'The tmp folder has been clear successfully!'; $this->setRedirect($redirect_url,$message,'message'); return true; } } $this->setRedirect($redirect_url,$message,'error'); return false; } public function installExtention() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // check if user has the right $user = JFactory::getUser(); // set page redirect $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false); $message = 'Could not install component!'; if($user->authorise('core.admin')) { // get the model $model = $this->getModel('compiler'); $app = JFactory::getApplication(); $fileName = $app->getUserState('com_componentbuilder.extension_name'); if (ComponentbuilderHelper::checkString($fileName)) { $lang = JFactory::getLanguage(); $extension = 'com_installer'; $base_dir = JPATH_ADMINISTRATOR; $language_tag = 'en-GB'; $reload = true; $lang->load($extension, $base_dir, $language_tag, $reload); $message = '('.$fileName.'.zip) file was also removed from tmp!'; $this->setRedirect($redirect_url,$message,'message'); return $model->install($fileName.'.zip');; } } $this->setRedirect($redirect_url,$message,'error'); return false; } }