public function generate() { $configFile = FULL_PATH . '/files/config.xml'; if (!file_exists($configFile)) { Util\Error::kill(Util\Error::XML_CONFIG_NOT_FOUND, $configFile, __FILE__, __LINE__); } $conf = simplexml_load_string(file_get_contents($configFile)); $configTpl = new Util\Template(Util\Template::SITE, ['generator', 'config']); foreach ($conf->servers->server as $server) { if (strpos($_SERVER['HTTP_HOST'], $server->attributes()->host->__toString()) === false) { continue; } $configTpl->set('httpHost', $server->attributes()->host); $configTpl->set('siteFolder', $server->siteFolder); $configTpl->set('adminFolder', $server->adminFolder); $configTpl->set('dbHost', $server->db->host); $configTpl->set('dbPort', $server->db->port); $configTpl->set('dbUsername', $server->db->username); $configTpl->set('dbPassword', $server->db->password); $configTpl->set('dbName', $server->db->name); $configTpl->set('type', $server->mail->type); $configTpl->set('email', $server->mail->email); if ($server->mail->type == 'smtp') { $configTpl->set('host', $server->mail->host); $configTpl->set('port', $server->mail->port); $configTpl->set('option', $server->mail->option); $configTpl->set('password', $server->mail->password); } else { $configTpl->set('host', ''); $configTpl->set('port', ''); $configTpl->set('option', ''); $configTpl->set('password', ''); } break; } $langs = []; foreach ($conf->languages->language as $language) { $tpl = new Util\Template(Util\Template::SITE, ['generator', 'config']); $tpl->set('lang', $language->attributes()->lang); $tpl->set('locale', $language->locale); $langs[] = $tpl->render('lang'); } $configTpl->set('lang', implode('', $langs)); $settings = []; foreach ($conf->settings->setting as $setting) { $tpl = new Util\Template(Util\Template::SITE, ['generator', 'config']); $tpl->set('key', $setting->attributes()->key); $tpl->set('value', $setting); $settings[] = $tpl->render('setting'); } $configTpl->set('key', implode('', $settings)); $configPath = \Rebond\Config::getPath('rebond') . 'Cache/Config.php'; Util\File::save($configPath, 'w', str_replace('<#php', '<?php', $configTpl->render('config'))); }
private function produceService() { // Service template $serviceTpl = new Template(Template::SITE, ['generator', 'service']); $serviceTpl->set('package', $this->package); $serviceTpl->set('entity', $this->entity); $servicePath = \Rebond\Config::getPath('rebond') . $this->package . '/' . $this->entity . '/Service.php'; if (!file_exists($servicePath)) { $render = str_replace('<#php', '<?php', $serviceTpl->render('service')); \Rebond\Util\File::save($servicePath, 'w', $render); $this->info[] = '<div>Service created.</div>'; } else { $this->info[] = '<div class="exist">Service already exists.</div>'; } }
public static function log($code, $message, $file, $line) { $app = \Rebond\App::instance(); $d = new \DateTime(); $message = self::textify($message); if ($app->step() != \Rebond\Config::STEP_RUNNING) { $log = \Rebond\Config::getPath('log') . 'log.txt'; $file = str_replace(FULL_PATH, '/', str_replace('\\', '/', $file)); $trace = stripos($file, 'SplClassLoader') !== false ? self::textify(debug_backtrace()) : ''; // date # code # message # trace # file # line $message = $d->format('Y-m-d H:i:s') . '#' . Error::value($code) . '#' . str_replace(FULL_PATH, '/', $message) . '#' . $trace . '#' . $file . '#' . $line . PHP_EOL; \Rebond\Util\File::save($log, 'a', $message); } else { if (!in_array($code, [Error::LANG_NOT_FOUND, Error::PAGE_NOT_FOUND]) && $app->env() == \Rebond\Config::ENV_PROD && $app->site()->getSendMailOnError()) { $emails = $app->site()->getMailListOnError(); if ($emails != '') { $emails = explode(',', $emails); \Rebond\App\Error\Mail::error($app->site()->getTitle(), $emails, $code, $message, $file, $line); } } $log = null; if ($code == Error::LANG_NOT_FOUND) { $options = []; $options['where'][] = ['log.request_uri = ?', $_SERVER['REQUEST_URI']]; $options['where'][] = ['log.message = ?', $message]; $log = \Rebond\Core\Log\Data::load($options); } if (!isset($log)) { $log = new \Rebond\Core\Log\Model(); $log->setCode($code); $log->setMessage($message); $log->setRequestUri($_SERVER['REQUEST_URI']); } $log->setUserId($app->userId()); $log->setFile($file); $log->setLine($line); $log->setTrace(self::textify(debug_backtrace())); $log->setIp($_SERVER['REMOTE_ADDR']); $log->setReferer(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''); return $log->save(); } return 0; }
public function produceScript() { $scriptTpl = new Template(Template::SITE, ['generator', 'mysql']); $scriptTpl->set('table', $this->table); $fieldList = []; $multipleKey = []; foreach ($this->xmlProperties as $property) { if ($this->ignoreColumn($property)) { continue; } $type = $property->getAttribute('type'); $propertyName = $property->getAttribute('name'); $sqlType = $this->getDefaultMysqlType($property->getAttribute('mysql'), $type); $maxLength = $this->maxLength; $validations = $property->getElementsByTagName('validation'); foreach ($validations as $validation) { if ($validation->getAttribute('condition') == 'maxLength') { $maxLength = $validation->getAttribute('value'); break; } } if ($type == 'primaryKey') { $propertyName = $this->package == 'App' ? 'app_id' : 'id'; $primaryKey = $propertyName; $scriptTpl->set('primaryKey', $primaryKey); } if ($type == 'multipleKey') { $multipleKey[] = $propertyName . '_id'; } $fieldList[] = $this->fieldList('field', $propertyName, $type, $sqlType, $maxLength); } $scriptTpl->set('multipleKey', implode(', ', $multipleKey)); $scriptTpl->set('fieldList', implode(',', $fieldList)); $scriptPath = \Rebond\Config::getPath('rebond') . $this->package . '/' . $this->entity . '/mysql.sql'; \Rebond\Util\File::save($scriptPath, 'w', $scriptTpl->render('table')); $this->info[] = '<div>SQL scripts created.</div>'; $existQuery = 'SHOW TABLES LIKE \'?\''; $exist = count($this->db->selectOne($existQuery, [$this->table])); if ($exist == 0) { $this->db->runScript('Rebond/' . $this->package . '/' . $this->entity . '/', 'mysql.sql'); $this->info[] = '<div>SQL table created.</div>'; } else { if ($exist > 0 && $this->db->count('SELECT COUNT(*) FROM ' . $this->table) == 0) { $this->db->execute('DROP TABLE ' . $this->table); $this->db->runScript('Rebond/' . $this->package . '/' . $this->entity . '/', 'mysql.sql'); $this->info[] = '<div>SQL table recreated.</div>'; } else { $sqlCols = $this->db->select('SHOW COLUMNS FROM ' . $this->table)->fetchAll(); $updated = self::updateColumns($sqlCols); if ($updated) { $sqlCols = $this->db->select('SHOW COLUMNS FROM ' . $this->table)->fetchAll(); } self::removeColumns($sqlCols); self::addColumns($sqlCols); $this->info[] = '<div>SQL table updated.</div>'; } } }
public function text_editor() { // auth Auth::isAdminAuthorized($this->signedUser, 'admin.media.image', true, '/media'); // check $info = null; $generate = Converter::bool('generate'); $imageListPath = \Rebond\Config::getPath('admin') . 'js/tinymce/imageList.js'; // action if ($generate) { $url = \Rebond\Config::getPath('siteUrl') . \Rebond\Config::getPath('mediaFolder'); $list = '['; $options = []; $options['clearSelect'] = true; $options['select'][] = \Rebond\Core\Media\Data::getList(['id', 'title', 'path', 'upload']); $options['where'][] = 'media.status = 1'; $options['where'][] = 'media.extension IN ("png", "gif", "jpg", "jpeg")'; $options['order'][] = 'media.title'; $medium = \Rebond\Core\Media\Data::loadAll($options); foreach ($medium as $media) { $list .= '{title:"' . $media->getTitle() . '", value:"http://' . $url . $media->getPath() . $media->getUpload() . '"},' . chr(10); } if (count($medium) > 0) { $list = substr($list, 0, -2); } $list .= ']'; File::save($imageListPath, 'w', $list); $info = '<p class="bg-success">' . count($medium) . ' ' . Lang::lang('photosGenerated') . '</p>'; } // view $this->setTpl(); // main $tplMain = new Template(Template::SITE, ['admin', 'media']); $tplMain->set('info', $info); if (file_exists($imageListPath)) { $tplMain->set('date', \Rebond\Util\Format::smartDate(filemtime($imageListPath))); $tplMain->set('link', '/js/tinymce/imageList.js'); } else { $tplMain->set('date', 'n/a'); } // layout $this->tplLayout->set('column1', $tplMain->render('text-editor')); // master $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col')); return $this->tplMaster->render('tpl-default'); }
private function produceData() { $dataTplName = 'data'; // Data class $dataTpl = new Template(Template::SITE, ['generator', 'data']); $dataTpl->set('package', $this->package); $dataTpl->set('entity', $this->entity); $dataPath = \Rebond\Config::getPath('rebond') . $this->package . '/' . $this->entity . '/Data.php'; if (!file_exists($dataPath)) { if ($this->package == 'App') { $dataTplName = 'data-app'; } $render = str_replace('<#php', '<?php', $dataTpl->render($dataTplName)); \Rebond\Util\File::save($dataPath, 'w', $render); $this->info[] = '<div>Data created.</div>'; } else { $this->info[] = '<div class="exist">Data already exists.</div>'; } }
private function produceModel() { $modelTplName = 'model'; // Model template $modelTpl = new Template(Template::SITE, ['generator', 'model']); $modelTpl->set('package', $this->package); $modelTpl->set('entity', $this->entity); $modelPath = \Rebond\Config::getPath('rebond') . $this->package . '/' . $this->entity . '/Model.php'; if (!file_exists($modelPath)) { if ($this->package == 'App') { $modelTplName = 'model-app'; } $render = str_replace('<#php', '<?php', $modelTpl->render($modelTplName)); \Rebond\Util\File::save($modelPath, 'w', $render); $this->info[] = '<div>Model created.</div>'; } else { $this->info[] = '<div class="exist">Model already exists.</div>'; } }
public function backup($type = null) { $this->checkConnection(); $backupPath = FULL_PATH . 'files/backup/'; if (!is_dir($backupPath)) { mkdir($backupPath, 0777, true); } $tables = []; $res = $this->pdo->query('SHOW TABLES'); while ($row = $res->fetch(\PDO::FETCH_NUM)) { $tables[] = $row[0]; } $sqlFile = ''; // cycle through foreach ($tables as $table) { $stmt = $this->pdo->prepare('SELECT * FROM ' . $table); $stmt->execute(); $sqlFile .= '-- TABLE ' . $table . ";\n\n"; $sqlFile .= 'DROP TABLE IF EXISTS ' . $table . ";\n"; $result2 = $this->pdo->query('SHOW CREATE TABLE ' . $table); $row2 = $result2->fetch(\PDO::FETCH_NUM); $sqlFile .= "\n" . $row2[1] . ";\n\n"; if (in_array($table, ['core_log'])) { $sqlFile .= 'TRUNCATE TABLE ' . $table . ";\n\n"; continue; } $sqlFile .= $this->backupData($table, $stmt); } //save file $type = isset($type) ? $type . '-' : ''; $backup = $backupPath . 'db-' . $type . date('Ymd-His') . '.sql'; \Rebond\Util\File::save($backup, 'w', $sqlFile); }
private static function compact(array $files, $filepath) { $buffer = ''; foreach ($files as $file) { $buffer .= file_get_contents($file); } // Remove comments and spaces $expr = '/(?:(?:\\/\\*(?:[^*]|(?:\\*+[^*\\/]))*\\*+\\/)|(?:(?<!\\:|\\\\)\\/\\/.*))/'; $buffer = preg_replace($expr, '', $buffer); $buffer = str_replace(["\r\n", "\r", "\n", "\t", ' '], '', $buffer); $buffer = str_replace([': ', ' :', ' : '], ':', $buffer); $buffer = str_replace(['= ', ' =', ' = '], '=', $buffer); $buffer = str_replace(['+ ', ' +', ' + '], '+', $buffer); $buffer = str_replace(['+= ', ' +=', ' += '], '+', $buffer); $buffer = str_replace(['} ', ' }', ' } '], '}', $buffer); $buffer = str_replace(['{ ', ' {', ' { '], '{', $buffer); $buffer = str_replace([', ', ' ,', ' , '], ',', $buffer); \Rebond\Util\File::save($filepath, 'w', $buffer); }
private function generateJavascript(array $xmlLangs) { foreach (\Rebond\Config::getLang() as $lang => $locale) { $adminList = []; $siteList = []; $langTpl = new Template(Template::SITE, ['generator', 'lang']); $langTpl->set('lang', $lang); foreach ($xmlLangs as $xmlLang) { $valueList = $xmlLang->getElementsByTagName('language')->item(0); if (isset($valueList) && $valueList->hasChildNodes()) { foreach ($valueList->childNodes as $node) { if (in_array($node->nodeType, [XML_COMMENT_NODE, XML_TEXT_NODE])) { continue; } if ($node->getAttribute('js') == 'both' || $node->getAttribute('js') == 'admin') { $message = $node->getElementsByTagName($lang)->item(0)->nodeValue; $adminList[] = str_repeat(' ', 4) . $node->nodeName . ' : "' . addslashes(ucfirst($message)) . '",' . chr(10); } if ($node->getAttribute('js') == 'both' || $node->getAttribute('js') == 'site') { $message = $node->getElementsByTagName($lang)->item(0)->nodeValue; $siteList[] = str_repeat(' ', 4) . $node->nodeName . ' : "' . addslashes(ucfirst($message)) . '",' . chr(10); } } } } $langTpl->set('list', implode('', $adminList)); $adminLangPath = \Rebond\Config::getPath('admin') . 'js/lang-' . $lang . '.js'; File::save($adminLangPath, 'w', $langTpl->render('js')); $langTpl->set('list', implode('', $siteList)); $siteLangPath = \Rebond\Config::getPath('site') . 'js/lang-' . $lang . '.js'; File::save($siteLangPath, 'w', $langTpl->render('js')); } }
public function produceViews() { foreach ($this->views as $view) { $viewPath = \Rebond\Config::getPath('rebond') . $this->package . '/' . $this->entity . '/template/' . $view . '.tpl'; if (file_exists($viewPath) && in_array($view, ['filter', 'form-success'])) { $this->info[] = '<div class="exist">' . $view . ' already exists.</div>'; continue; } $propertyList = []; $propertyList2 = []; $multipleKey = []; $primaryKey = null; $viewTpl = new Template(Template::SITE, ['generator', 'views']); $viewTpl->set('package', $this->package); $viewTpl->set('entity', $this->entity); $viewTpl->set('isGenerated', false); $viewTpl->set('hasStatus', false); if (!in_array($view, ['filter'])) { foreach ($this->xmlProperties as $property) { $type = $property->getAttribute('type'); $viewList = $property->getAttribute('view-list') == 'false' ? false : true; $skip = $property->getAttribute('persistent') == 'false' ? true : false; $skip = in_array($view, ['listing', 'bus-listing', 'admin-listing', 'admin-trail']) && (!$viewList || in_array($type, ['foreignKeyLink', 'singleKeyList'])) ? true : $skip; if ($skip) { continue; } $propertyName = Converter::toCamelCase($property->getAttribute('name')); if ($type == 'primaryKey') { $propertyName = $this->package == 'App' ? 'appId' : 'id'; $primaryKey = $propertyName; $viewTpl->set('primaryKey', $primaryKey); } if ($type == 'multipleKey') { $multipleKey[] = $propertyName . 'Id'; } if ($type == 'status') { $viewTpl->set('hasStatus', true); } $propertyList[] = $this->addViewList($this->package, $this->entity, $propertyName, $type, $propertyName == $this->main, $view); if (in_array($view, ['listing', 'admin-listing', 'bus-listing', 'admin-trail'])) { $propertyList2[] = $this->addViewList($this->package, $this->entity, $propertyName, $type, $propertyName == $this->main, $view . '-2'); } } $viewTpl->set('propertyList', implode('', $propertyList)); if (in_array($view, ['listing', 'admin-listing', 'bus-listing', 'admin-trail'])) { $viewTpl->set('propertyList2', implode('', $propertyList2)); } } $realView = $view; if (in_array($view, ['bus-editor', 'editor'])) { if (!isset($primaryKey)) { $realView .= '-nokey'; } } else { if (in_array($view, ['bus-listing', 'listing'])) { if (count($multipleKey) > 0) { $viewTpl->set('multipleKey', $multipleKey); $realView .= '-multikey'; } else { if (!isset($primaryKey)) { $realView .= '-nokey'; } } } } if (file_exists($viewPath) && in_array($view, ['editor', 'view', 'listing', 'form', 'list', 'detail', 'single'])) { if (!$this->generate) { continue; } $fileNoExt = \Rebond\Util\File::getNoExtension($viewPath); $viewPath = $fileNoExt . '-generated.tpl'; $viewTpl->set('isGenerated', true); $this->info[] = '<div class="exist">' . $view . ' already exists. ' . $view . '-generated has been created.</div>'; } else { $this->info[] = '<div>' . $view . ' created.</div>'; } $render = str_replace('<#php', '<?php', $viewTpl->render($realView)); \Rebond\Util\File::save($viewPath, 'w', $render); } }
private function produceGadget() { // Base class $gadgetTpl = new Template(Template::SITE, ['generator', 'gadget']); $gadgetTpl->set('entity', $this->entity); $gadgetTpl->set('hasContent', $this->hasContent); $viewList = []; $detail = false; foreach ($this->xmlViews as $xmlView) { $view = $xmlView->getAttribute('name'); if ($view == '') { continue; } if ($view == 'list') { $view = 'full-list'; } $viewList[] = $view; if (!$detail && in_array($view, ['full-list', 'filtered-list'])) { $detail = true; $viewList[] = 'detail'; } } // add component $component = new \Rebond\Cms\Component\Model(); $component->setModuleId($this->id); $component->setStatus(0); foreach ($viewList as $view) { $component->setId(0); switch ($view) { case 'full-list': $options = []; $options['where'][] = ['component.type = ?', ComponentType::LISTING]; $options['where'][] = ['component.module_id = ?', $this->id]; if (\Rebond\Cms\Component\Data::count($options) == 0) { $component->setType(1); $component->setTitle('full listing'); $component->setSummary('full listing'); $component->setMethod('fullList'); $component->save(); } break; case 'filtered-list': $options = []; $options['where'][] = ['component.type = ?', ComponentType::FILTERED_LISTING]; $options['where'][] = ['component.module_id = ?', $this->id]; if (\Rebond\Cms\Component\Data::count($options) == 0) { $component->setType(2); $component->setTitle('filtered listing'); $component->setSummary('filtered listing'); $component->setMethod('filteredList'); $component->save(); } break; case 'single': $options = []; $options['where'][] = ['component.type = ?', ComponentType::SINGLE_ITEM]; $options['where'][] = ['component.module_id = ?', $this->id]; if (\Rebond\Cms\Component\Data::count($options) == 0) { $component->setType(0); $component->setTitle('single item'); $component->setSummary('single item'); $component->setMethod('single'); $component->save(); } break; case 'form': $options = []; $options['where'][] = ['component.type = ?', ComponentType::GENERIC]; $options['where'][] = ['component.module_id = ?', $this->id]; $options['where'][] = 'component.method = \'form\''; if (\Rebond\Cms\Component\Data::count($options) == 0) { $component->setType(4); $component->setTitle('form'); $component->setSummary('form'); $component->setMethod('form'); $component->save(); } break; } } $gadgetTpl->set('viewList', $viewList); $gadgetPath = \Rebond\Config::getPath('rebond') . 'App/' . $this->entity . '/Gadget.php'; if (!file_exists($gadgetPath)) { $render = str_replace('<#php', '<?php', $gadgetTpl->render('gadget')); \Rebond\Util\File::save($gadgetPath, 'w', $render); $this->info[] = '<div>Gadget created.</div>'; } else { $this->info[] = '<div class="exist">Gadget already exists.</div>'; } }
public function index() { // check $this->db = new \Rebond\Util\Data(); $this->authFile = \Rebond\Config::getPath('config') . 'authentication.txt'; $this->queryTables = 'SELECT COUNT(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = \'' . \Rebond\Config::getDb('name') . '\''; $this->queryCheckUser = '******'; $this->info = []; $isAuth = Session::int('auth'); $action = Converter::string('action'); // action if ($isAuth == 0) { $this->step = 'auth'; // check auth if (!file_exists($this->authFile)) { $auth = \Rebond\Util\Security::encrypt(time()); File::save($this->authFile, 'w', $auth); } else { $auth = File::read($this->authFile, 'r'); } if (isset($_POST['submitAuth'])) { if ($auth == $_POST['auth']) { Session::set('auth', 1); $isAuth = 1; unlink($this->authFile); $this->step = 'db'; $this->info[] = '<p class="bg-success">You have been authenticated!</p>'; } else { $this->info[] = '<p class="bg-error">The identification number you entered is incorrect. Please try again.</p>'; } } } if ($isAuth == 1) { // check db $tableCount = $this->db->count($this->queryTables); $userTable = $this->db->selectOne($this->queryCheckUser); if ($tableCount != 0 && $tableCount !== self::TABLECOUNT) { $this->info[] = '<p class="bg-error">Your database contains ' . $tableCount . ' table(s). A fresh install of Rebond should contain ' . self::TABLECOUNT . ' tables. Please check your database name to make sure that you want to install Rebond in this database.</p>'; } if (count($userTable) == 0) { $this->step = 'db'; if ($action == 'db') { $scripts = \Rebond\Util\File::getFiles('files/install'); sort($scripts); foreach ($scripts as $script) { $result = $this->db->runScript('files/install', $script); if ($result['status'] == \Rebond\Core\ResultType::SUCCESS) { $this->info[] = '<p>' . $script . '... success.</p>'; } else { $this->info[] = '<p>' . $script . '... failed: <span class="error">' . $result['message'] . '</span></p>'; break; } } $tableCount = $this->db->count($this->queryTables); $userTable = $this->db->selectOne($this->queryCheckUser); if (count($userTable) == 0) { $this->info[] = '<p class="bg-error">The database has NOT been installed correctly. Please try to reinstall the database.</p>'; } else { $this->info[] = '<p class="bg-success">The database has been installed successfully.</p>'; $this->step = 'db-ok'; } } // check user } else { if (\Rebond\Core\User\Data::count() == 0) { $this->step = 'user'; $user = new \Rebond\Core\User\Model(); $userForm = new \Rebond\Core\User\Form($user); if (isset($_POST['submitUser'])) { if ($userForm->setFromPost()->validate()->isValid()) { $user->setPassword(Security::encryptPassword($user->getPassword())); $user->setIsAdmin(true); $user->setIsDev(true); $user->save(); $this->step = 'ready'; } else { Session::set('adminError', $userForm->getValidation()->getMessage()); } } // ready } else { $this->step = 'ready'; if ($action == 'launch') { $adminPath = \Rebond\Config::getPath('admin'); $sitePath = \Rebond\Config::getPath('site'); rename($adminPath . 'index.php', $adminPath . 'index_install.php'); rename($adminPath . 'index_admin.php', $adminPath . 'index.php'); rename($sitePath . 'index.php', $sitePath . 'index_install.php'); rename($sitePath . 'index_cms.php', $sitePath . 'index.php'); $db = new \Rebond\Util\Data(); $db->backup('launch'); Session::kill('auth'); Session::setAndRedirect('signedUser', 1, '/configuration/site'); } } } } // menu $tplMenu = new Template(Template::SITE, ['admin', 'install']); $tplMenu->set('menuAuth', $this->step == 'auth' ? ' class="active"' : ''); $tplMenu->set('menuDb', in_array($this->step, ['db', 'db-ok']) ? ' class="active"' : ''); $tplMenu->set('menuUser', $this->step == 'user' ? ' class="active"' : ''); $tplMenu->set('menuReady', $this->step == 'ready' ? ' class="active"' : ''); // main $tplMain = new Template(Template::SITE, ['admin', 'install']); // layout $this->tplLayout->set('column1', $tplMenu->render('menu')); $this->tplLayout->add('column1', implode($this->info)); if ($this->step == 'user') { if (!isset($user)) { $userForm = new \Rebond\Core\User\Form(); $userForm->setFromPost(); } $tplMain->set('form', $userForm); } $this->tplLayout->add('column1', $tplMain->render($this->step)); // master $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col')); $this->tplMaster->set('jsLauncher', 'install'); $this->tplMaster->addCss('/css/normalize.css'); $this->tplMaster->addCss('/css/rebond.css'); $this->tplMaster->addCss('/css/custom.css'); $this->tplMaster->addJs('//code.jquery.com/jquery-2.1.3.min.js'); $this->tplMaster->addJs('/js/rebond.js'); $this->tplMaster->addJs('/js/custom.js'); return $this->tplMaster->render('tpl-install'); }