本文整理汇总了PHP中TemplateRendererFactory类的典型用法代码示例。如果您正苦于以下问题:PHP TemplateRendererFactory类的具体用法?PHP TemplateRendererFactory怎么用?PHP TemplateRendererFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TemplateRendererFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$this->table = null;
$this->owner = null;
$this->item = null;
$this->mail_notification_builder = new MailNotificationBuilder(new MailBuilder(TemplateRendererFactory::build()));
}
示例2: html_get_timezone_popup
function html_get_timezone_popup($selected = 0)
{
$GLOBALS['HTML']->includeFooterJavascriptFile('/scripts/jstimezonedetect/jstz.min.js');
$GLOBALS['HTML']->includeFooterJavascriptFile('/scripts/tuleap/timezone.js');
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/account/');
return $renderer->renderToString('timezone', new Account_TimezoneSelectorPresenter($selected));
}
示例3: __construct
public function __construct(EventManager $event_manager)
{
$this->event_manager = $event_manager;
$this->renderer = TemplateRendererFactory::build()->getRenderer(array(ForgeConfig::get('codendi_dir') . '/src/templates/search'));
$this->search_types = array(Search_SearchTrackerV3::NAME => new Search_SearchTrackerV3(new ArtifactDao()), Search_SearchProject::NAME => new Search_SearchProject(new ProjectDao()), Search_SearchPeople::NAME => new Search_SearchPeople(UserManager::instance()), Search_SearchForum::NAME => new Search_SearchForum(new ForumDao()), Search_SearchSnippet::NAME => new Search_SearchSnippet(new SnippetDao()), Search_SearchWiki::NAME => new Search_SearchWiki(new WikiDao()));
$this->plugin_manager = PluginManager::instance();
}
示例4: getContent
/**
* @see AgileDashboard_Pane::getContent()
*/
public function getContent()
{
$columns = $this->config->getDashboardColumns();
$renderer = TemplateRendererFactory::build()->getRenderer(dirname(__FILE__) . '/../templates');
return $renderer->renderToString('agiledashboard-pane', $this->getPresenterUsingMappedFields($columns));
// TODO what if no semantic status and no mapping????
}
示例5: displayBody
private function displayBody()
{
$items = $this->data_mapper->fetchAll($this->getProjectFromRequest());
$presenter = new ChooseNewsPresenter($items, $this->request->get('project_id'));
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/news/');
$renderer->renderToPage('choose_news', $presenter);
}
示例6: send_new_user_email
function send_new_user_email($to, $login, $password, $confirm_hash, $template, $isAdminPresenter)
{
//needed by new_user_email.txt
$base_url = get_server_url();
$defaultTheme = $GLOBALS['sys_themedefault'];
$color_logo = "#0000";
$color_button = "#347DBA";
if (themeIsFlamingParrot($defaultTheme)) {
$defaultThemeVariant = $GLOBALS['sys_default_theme_variant'];
$color_logo = FlamingParrot_Theme::getColorOfCurrentTheme($defaultThemeVariant);
$color_button = $color_logo;
}
$logo_url = $base_url . "/themes/" . $defaultTheme . "/images/organization_logo.png";
$has_logo = file_exists(dirname(__FILE__) . '/../themes/' . $defaultTheme . '/images/organization_logo.png');
if ($isAdminPresenter) {
$subject = $GLOBALS['Language']->getText('account_register', 'welcome_email_title', $GLOBALS['sys_name']);
include $GLOBALS['Language']->getContent('account/new_account_email');
$presenter = new MailRegisterByAdminPresenter($has_logo, $logo_url, $title, $section_one, $section_two, $section_after_login, $thanks, $signature, $help, $color_logo, $login, $section_three, $section_after_password, $password);
} else {
$subject = $GLOBALS['Language']->getText('include_proj_email', 'account_register', $GLOBALS['sys_name']);
include $GLOBALS['Language']->getContent('include/new_user_email');
$redirect_url = $base_url . "/account/verify.php?confirm_hash={$confirm_hash}";
$presenter = new MailRegisterByUserPresenter($has_logo, $logo_url, $title, $section_one, $section_two, $section_after_login, $thanks, $signature, $help, $color_logo, $login, $redirect_url, $redirect_button, $color_button);
}
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/mail/');
$mail = initializeMail($subject, $GLOBALS['sys_noreply'], $to, $renderer->renderToString($template, $presenter), $message);
return $mail->send();
}
示例7: __construct
public function __construct(Codendi_Request $request, Tracker_Hierarchy_HierarchicalTracker $tracker, Tracker_Hierarchy_HierarchicalTrackerFactory $factory, Tracker_Hierarchy_Dao $dao)
{
$this->request = $request;
$this->tracker = $tracker;
$this->factory = $factory;
$this->dao = $dao;
$this->renderer = TemplateRendererFactory::build()->getRenderer(dirname(__FILE__) . '/../../../templates');
}
示例8: index
public function index(CSRFSynchronizerToken $csrf, Response $response)
{
$title = $GLOBALS['Language']->getText('plugin_tracker_config', 'title');
$params = array('title' => $title);
$renderer = TemplateRendererFactory::build()->getRenderer(TRACKER_TEMPLATE_DIR);
$response->header($params);
$renderer->renderToPage(self::$TEMPLATE, new TrackerPluginConfigPresenter($csrf, $title, $this->localincfinder->getLocalIncPath(), $this->config));
$response->footer($params);
}
示例9: site_index
public function site_index(HTTPRequest $request)
{
$this->assertSiteAdmin($request);
$presenter = new MediawikiSiteAdminAllowedProjectsPresenter($this->resource_restrictor->searchAllowedProjects());
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/resource_restrictor');
$GLOBALS['HTML']->header(array('title' => 'Mediawiki', 'selected_top_tab' => 'admin'));
$renderer->renderToPage($presenter::TEMPLATE, $presenter);
$GLOBALS['HTML']->footer(array());
}
示例10: getAdminIndex
public function getAdminIndex(HTTPRequest $request)
{
$this->checkAccess($request);
$presenter = new SVN_Admin_AllowedProjectsPresenter($this->token_manager->getProjectsAuthorizingTokens(), true);
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/resource_restrictor');
$GLOBALS['HTML']->header(array('title' => 'SVN', 'selected_top_tab' => 'admin'));
$renderer->renderToPage($presenter::TEMPLATE, $presenter);
$GLOBALS['HTML']->footer(array());
}
示例11: display
public function display(Codendi_Request $request)
{
$title = $GLOBALS['Language']->getText('plugin_git', 'descriptor_name');
$renderer = TemplateRendererFactory::build()->getRenderer(dirname(GIT_BASE_DIR) . '/templates');
$admin_presenter = new Git_AdminGerritPresenter($title, $this->csrf, $this->getListOfGerritServersPresenters());
$GLOBALS['HTML']->header(array('title' => $title, 'selected_top_tab' => 'admin'));
$renderer->renderToPage('admin-plugin', $admin_presenter);
$GLOBALS['HTML']->footer(array());
}
示例12: getAdminIndex
public function getAdminIndex(HTTPRequest $request)
{
$this->checkAccess($request);
$presenter = new PHPWikiAdminAllowedProjectsPresenter($this->wiki_migrator->searchProjectsUsingPlugin());
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/resource_restrictor');
$GLOBALS['HTML']->header(array('title' => 'PHPWiki', 'selected_top_tab' => 'admin'));
$renderer->renderToPage($presenter::TEMPLATE, $presenter);
$GLOBALS['HTML']->footer(array());
}
示例13: __construct
public function __construct(Git_Mirror_MirrorDataMapper $data_mapper, $etc_templates_path)
{
$this->data_mapper = $data_mapper;
$template_dirs = array();
if (is_dir($etc_templates_path)) {
$template_dirs[] = $etc_templates_path . '/' . self::TEMPLATES_PATH;
}
$template_dirs[] = GIT_TEMPLATE_DIR . '/' . self::TEMPLATES_PATH;
$this->template_renderer = TemplateRendererFactory::build()->getRenderer($template_dirs);
}
示例14: service_public_areas
public function service_public_areas($params)
{
if ($params['project']->usesService($this->getServiceShortname())) {
$service = $params['project']->getService($this->getServiceShortname());
$wiki = new PHPWiki($params['project']->getID());
$presenter = new WidgetPublicAreaPresenter($service->getUrl(), $GLOBALS['HTML']->getImagePath('ic/wiki.png'), $this->text, $wiki->getProjectPageCount());
$renderer = TemplateRendererFactory::build()->getRenderer(PHPWIKI_TEMPLATE_DIR);
$params['areas'][] = $renderer->renderToString('widget_public_area', $presenter);
}
}
示例15: send_approval_new_user_email
function send_approval_new_user_email($to, $login)
{
//needed by new_user_email.txt
$base_url = get_server_url();
$presenter = new MailPresenterFactory();
$renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/mail/');
$mail = new TuleapRegisterMail($presenter, $renderer, "mail-admin-approval");
$mail = $mail->getMail($login, '', '', $base_url, $GLOBALS['sys_noreply'], $to, "admin-approval");
return $mail->send();
}