function smarty_function_gymex_body($params, Smarty_Internal_Template &$template) { /* @var $ex GymEx */ $ex = $params['ex']; $exId = $ex->getId(); $tplPath = "gym/exercises/{$exId}.tpl"; if (PSSmarty::smarty()->templateExists($tplPath)) { PSSmarty::template($tplPath)->display(); } else { // message_warn("Шаблон для упражнения с кодом [$exId] не найден"); } }
protected function doBuild(PageContext $ctxt, PageBuilderContext $builderCtxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams) { //1. ЗАГОЛОВОК $builderCtxt->setTitle('Тестовая страница'); //2. NO JAVASCRIPT //3. SMARTY RESOURCES $builderCtxt->setSmartyParam4Resources('MATHJAX_DISABLE', true); $builderCtxt->setSmartyParam4Resources('TIMELINE_ENABE', true); $builderCtxt->setSmartyParam4Resources('UPLOADIFY_ENABE', true); //4. GET SMARTY PARAMS FOR TPL //Подсчитаем кол-во тестовых страниц по кол-ву шаблонов $SM = PSSmarty::smarty(); $cnt = 0; do { ++$cnt; } while ($SM->templateExists("test/page{$cnt}.tpl")); $content = $this->getContentImpl($requestParams, $SM); $smartyParams['cnt'] = $cnt; $smartyParams['content'] = $content; return $smartyParams; }
protected function doBuild(PageContext $ctxt, PageBuilderContext $builderCtxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams) { //1. ЗАГОЛОВОК $builderCtxt->setTitle('Тестовая страница'); //2. NO JAVASCRIPT //3. SMARTY RESOURCES $builderCtxt->setSmartyParam4Resources('MATHJAX_DISABLE', true); $builderCtxt->setSmartyParam4Resources('TIMELINE_ENABE', true); //4. GET SMARTY PARAMS FOR TPL //Подсчитаем кол-во тестовых страниц по кол-ву шаблонов $SM = PSSmarty::smarty(); $cnt = 0; do { ++$cnt; } while ($SM->templateExists("test/page{$cnt}.tpl")); $content = $this->getContentImpl($requestParams, $SM); $galls = DirManager::mmedia()->getDirContent('gallery', DirItemFilter::DIRS); $smartyParams['cnt'] = $cnt; $smartyParams['galls'] = $galls; $smartyParams['content'] = $content; $smartyParams['processors'] = Handlers::getInstance()->getPostsProcessors(); return $smartyParams; }
imagedestroy($im); } die; $client_id = '3485070'; // ID приложения $client_secret = 'lYjfUZwZmlJJlFIqQFAj'; // Защищённый ключ $redirect_uri = 'http://localhost/vk-auth'; // Адрес сайта $url = 'http://oauth.vk.com/authorize'; $params = array('client_id' => $client_id, 'redirect_uri' => $redirect_uri, 'response_type' => 'code'); echo urlencode(http_build_query($params)); //echo PsEnvironment::isIncluded(); //print_r(PsMathRebusSolver::solve('драма+драма=театр')); die; PSSmarty::smarty(); echo (new SmartyFunctions())->psctrl(array()); die; print_r(FoldedStorage::listFoldingUniques()); print_r(FoldedStorageInsts::listFoldingUniques()); die; var_dump(ConfigIni::projectSrcAdminDir()); br(); var_dump(ConfigIni::projectSrcCommonDir()); br(); var_dump(ConfigIni::projectGlobalsFilePath()); br(); new YouTubePluginAdmin(); die; ExceptionHandler::dumpError(new Exception('XXXX'), 'Additional info'); die;
<?php header('Content-Type: text/html; charset=utf-8'); require_once 'ps-includes/MainImport.php'; header('Content-Type: text/html; charset=utf-8'); ExceptionHandler::registerPretty(); $suffix = RequestArrayAdapter::inst()->str('page', 'img'); $tplPath = "crop/crop-page-{$suffix}.tpl"; if (!PSSmarty::smarty()->templateExists($tplPath)) { $suffix = 'img'; $tplPath = "crop/crop-page-{$suffix}.tpl"; } $SMARTY_PARAMS['JS_DEFS'] = PageBuilder::inst()->buildJsDefs(); $SMARTY_PARAMS['CROP_SUFFIX'] = $suffix; $PARAMS['RESOURCES'] = PSSmarty::template('crop/page_resources.tpl', $SMARTY_PARAMS)->fetch(); $PARAMS['CONTENT'] = PSSmarty::template($tplPath)->fetch(); $PARAMS['TITLE'] = 'Мои мысли'; PSSmarty::template('crop/page_pattern.tpl', $PARAMS)->display();