本文整理汇总了PHP中Template::setModuleTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP Template::setModuleTemplate方法的具体用法?PHP Template::setModuleTemplate怎么用?PHP Template::setModuleTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template::setModuleTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadTemplate
protected function loadTemplate()
{
$modal = new \Modal('edit-file-form');
$this->template = new \Template();
$this->template->setModuleTemplate('filecabinet', 'FC_Forms/folders.html');
$this->template->add('modal', $modal->get());
}
示例2: form
public static function form(\Request $request, $command = null)
{
javascript('jquery');
\Form::requiredScript();
if (empty($command)) {
$command = 'run_search';
}
$system_locations = \systemsinventory\Factory\SystemDevice::getSystemLocations();
$location_options = '<option value="0">All</opton>';
foreach ($system_locations as $val) {
$location_options .= '<option value="' . $val['id'] . '">' . $val['display_name'] . '</option>';
}
$vars['locations'] = $location_options;
$system_types = \systemsinventory\Factory\SystemDevice::getSystemTypes();
$type_options = '<option value="0">All</opton>';
foreach ($system_types as $val) {
$type_options .= '<option value="' . $val['id'] . '">' . $val['description'] . '</option>';
}
$vars['system_types'] = $type_options;
$system_dep = \systemsinventory\Factory\SystemDevice::getSystemDepartments();
$dep_optons = '<option value="0">All</opton>';
foreach ($system_dep as $val) {
$dep_optons .= '<option value="' . $val['id'] . '">' . $val['display_name'] . '</option>';
}
$vars['departments'] = $dep_optons;
$vars['form_action'] = "./systemsinventory/search/" . $command;
$template = new \Template($vars);
$template->setModuleTemplate('systemsinventory', 'Search_System.html');
return $template->get();
}
示例3: contactLogin
private function contactLogin()
{
$vars = array();
$form = self::contactForm();
$vars = $form->getTemplate();
$template = new \Template($vars);
$template->setModuleTemplate('properties', 'contact_login.html');
\Layout::add($template->get());
}
示例4: printFolderFiles
public function printFolderFiles()
{
$files = $this->getFolderFileList('multimedia');
$template = new \Template();
$template->setModuleTemplate('filecabinet', 'FC_Forms/multimedia_files.html');
if (empty($files)) {
return null;
} else {
$template->addVariables(array('files' => $files, 'empty' => null));
}
return $template->get();
}
示例5: show
public function show()
{
$residentStudents = $this->room->get_assignees();
$home_http = PHPWS_SOURCE_HTTP;
$residents = array();
foreach ($residentStudents as $s) {
$residents[] = array('studentId' => $s->getBannerId(), 'name' => $s->getName());
}
$vars = array();
javascript('jquery');
// Load header for Angular Frontend
/**
* Uncomment below for DEVELOPMENT
* Comment out for PRODUCTION
*/
//Layout::addJSHeader("<script src='{$home_http}mod/hms/javascript/react/build/react.js'></script>");
//Layout::addJSHeader("<script src='{$home_http}mod/hms/javascript/react/build/JSXTransformer.js'></script>");
//Layout::addJSHeader("<script type='text/jsx' src='{$home_http}mod/hms/javascript/CheckOut/src/CheckOut.jsx'></script>");
/**
* Uncomment below for PRODUCTION
* Comment out for DEVELOPMENT
*/
Layout::addJSHeader("<script src='{$home_http}mod/hms/javascript/react/build/react.min.js'></script>");
Layout::addJSHeader("<script src='{$home_http}mod/hms/javascript/CheckOut/build/CheckOut.js'></script>");
/**
* Remainder of code is untouched regardless of development status
*/
Layout::addJSHeader("<script type='text/javascript'>var sourceHttp = '{$home_http}';</script>");
$vars['student'] = $this->student->getFullName();
$vars['banner_id'] = $this->student->getBannerId();
$vars['hall_name'] = $this->hall->getHallName();
$vars['room_number'] = $this->room->getRoomNumber();
$vars['residents'] = json_encode($residents);
$vars['checkin_id'] = $this->checkin->id;
$vars['previous_key_code'] = $this->checkin->key_code;
$vars['room_pid'] = $this->room->persistent_id;
$damage_types = DamageTypeFactory::getDamageTypeAssoc();
$damage_options = array();
foreach ($damage_types as $dt) {
$damage_options[$dt['category']][] = array('id' => $dt['id'], 'description' => $dt['description']);
}
$vars['damage_types'] = json_encode($damage_types);
if (empty($this->damages)) {
$vars['existing_damage'] = '[]';
} else {
$this->addResponsible($residents);
$vars['existing_damage'] = json_encode($this->damages);
}
$tpl = new \Template($vars);
$tpl->setModuleTemplate('hms', 'admin/CheckOut.html');
return $tpl->get();
}
示例6: showResults
public function showResults($electionId)
{
\Layout::addStyle('election', 'Admin/Report/style.css');
$singleResults = Factory::getSingleResults($electionId);
$multipleResults = Factory::getMultipleResults($electionId);
$referendumResults = Factory::getReferendumResults($electionId);
$template = new \Template();
$template->add('single', $singleResults);
$template->add('multiple', $multipleResults);
$template->add('referendum', $referendumResults);
$template->setModuleTemplate('election', 'Admin/Report/Results.html');
return $template->get();
}
示例7: getHtmlView
public function getHtmlView($data, \Request $request)
{
javascript('jquery');
$tplvars['studentDataApiUrl'] = \PHPWS_Settings::get('election', 'studentDataApiUrl');
$tplvars['studentOrgApiUrl'] = \PHPWS_Settings::get('election', 'studentOrgApiUrl');
$tplvars['fromAddress'] = \PHPWS_Settings::get('election', 'fromAddress');
$tplvars['surveyLink'] = \PHPWS_Settings::get('election', 'surveyLink');
$tplvars['supportLink'] = \PHPWS_Settings::get('election', 'supportLink');
$template = new \Template($tplvars);
$template->setModuleTemplate('election', 'Admin/Settings.html');
$content = $template->get();
$view = new \View\HtmlView($content);
return $view;
}
示例8: userStatusSidebar
public static function userStatusSidebar()
{
$game = Factory::getCurrent();
if (empty($game)) {
$vars['current_game'] = 'No game scheduled. Check back later.';
} else {
$vars['current_game'] = Factory::getGameStatus($game);
}
$vars['student_status'] = \tailgate\Factory\Lottery::getStudentStatus();
$template = new \Template();
$template->addVariables($vars);
$template->setModuleTemplate('tailgate', 'User/sidebar.html');
$content = $template->get();
\Layout::add($content, 'tailgate', 'user_info');
}
示例9: printFile
public function printFile($id)
{
$db = \Database::newDB();
$t = $db->addTable('documents');
$t->addFieldConditional('id', (int) $id);
$row = $db->selectOneRow();
if (empty($row)) {
return null;
}
$template = new \Template();
$template->setModuleTemplate('filecabinet', 'FC_Forms/document_view.html');
$template->add('title', $row['title']);
$template->add('filepath', './filecabinet/' . $row['id']);
return $template->get();
}
示例10: printFile
public function printFile($id)
{
$db = \Database::newDB();
$t = $db->addTable('images');
$t->addFieldConditional('id', (int) $id);
$row = $db->selectOneRow();
if (empty($row)) {
return null;
}
$template = new \Template();
$template->setModuleTemplate('filecabinet', 'FC_Forms/image_view.html');
$template->add('title', $row['title']);
$template->add('alt', $row['alt']);
$template->add('filepath', $row['file_directory'] . $row['file_name']);
return $template->get();
}
示例11: welcomeScreen
public static function welcomeScreen()
{
\Layout::addStyle('election', 'User/style.css');
$template = new \Template();
$template->setModuleTemplate('election', 'User/welcome.html');
if (!\Current_User::isLogged()) {
$template->add('color', 'primary');
$template->add('label', '<i class="fa fa-check-square-o"></i> Sign in to Vote');
$template->add('url', ELECTION_LOGIN_DIRECTORY);
} else {
$template->add('color', 'success');
$template->add('label', '<i class="fa fa-check-square-o"></i> Get started voting!');
$template->add('url', 'election/');
}
$template->add('image', PHPWS_SOURCE_HTTP . 'mod/election/img/background1.jpg');
\Layout::add($template->get());
}
示例12: pager
private function pager(\Request $request)
{
\Pager::prepare();
$template = new \Template();
$template->setModuleTemplate('pulse', 'pager.html');
if (\Settings::get('pulse', 'allow_web_access')) {
$template->add('button_class', 'btn-success');
$template->add('button_status', 'Web Access Allowed');
$template->add('button_icon', 'fa-check');
$template->add('button_title', 'Pulse will process schedules via the web.');
} else {
$template->add('button_class', 'btn-danger');
$template->add('button_status', 'Web Access Denied');
$template->add('button_icon', 'fa-ban');
$template->add('button_title', 'Pulse will not allow access via the web.');
}
return $template;
}
示例13: emailStudent
private static function emailStudent(\election\Resource\Student $student, array $election)
{
if (STUDENT_DATA_TEST) {
$email_address = TEST_STUDENT_EMAIL;
} else {
$email_address = $student->getEmail();
}
$transport = \Swift_MailTransport::newInstance();
$template = new \Template();
$template->setModuleTemplate('election', 'Admin/VoteSuccess.html');
$template->add('title', $election['title']);
$content = $template->get();
$message = \Swift_Message::newInstance();
$message->setSubject('Vote complete');
$message->setFrom(\PHPWS_Settings::get('election', 'fromAddress'));
$message->setTo($email_address);
$message->setBody($content, 'text/html');
$mailer = \Swift_Mailer::newInstance($transport);
$mailer->send($message);
}
示例14: show
public function show()
{
$autoassign = $this->AutoassignScheduleSet();
$vars = array();
if ($autoassign) {
$vars['autoassign'] = 'Auto Assign schedule set for ' . $autoassign->getExecuteAfter('%Y/%m/%d %l:%M %P');
$vars['autoassign_remove'] = 1;
} else {
$vars['autoassign'] = 'Auto Assign has not been created.';
$vars['autoassign_create'] = 1;
}
$reportrunner = $this->ReportRunnerScheduleSet();
if ($reportrunner) {
$vars['reportrunner'] = 'Report Runner schedule set for ' . $reportrunner->getExecuteAfter('%Y/%m/%d %l:%M %P');
$vars['reportrunner_remove'] = 1;
} else {
$vars['reportrunner'] = 'Report Runner has not been created.';
$vars['reportrunner_create'] = 1;
}
$withdrawn = $this->WithdrawnSearchEmailScheduleSet();
if ($withdrawn) {
$vars['withdrawn'] = 'Withdrawn schedule set for ' . $withdrawn->getExecuteAfter('%Y/%m/%d %l:%M %P');
$vars['withdrawn_remove'] = 1;
} else {
$vars['withdrawn'] = 'Withdrawn schedule has not been created.';
$vars['withdrawn_create'] = 1;
}
$nightly_cache = $this->NightlyCacheScheduleSet();
if ($nightly_cache) {
$vars['nightly_cache'] = 'Nightly cache schedule set for ' . $nightly_cache->getExecuteAfter('%Y/%m/%d %l:%M %P');
$vars['nightly_cache_remove'] = 1;
} else {
$vars['nightly_cache'] = 'Nightly cache has not been created.';
$vars['nightly_cache_create'] = 1;
}
$tpl = new \Template($vars);
$tpl->setModuleTemplate('hms', 'admin/pulse/settings.html');
return $tpl->get();
}
示例15: get
public static function get()
{
if (!\Current_User::isLogged()) {
return;
}
$modlist = PHPWS_Core::getModuleNames();
$tpl['MINIADMIN_TITLE'] = dgettext('miniadmin', 'MiniAdmin');
$tpl['MINIADMIN_TITLE_ALT'] = dgettext('miniadmin', 'Administrate');
if (isset($GLOBALS['MiniAdmin'])) {
foreach ($GLOBALS['MiniAdmin'] as $module => $links) {
$mod_title = $modlist[$module];
if (isset($links['title_link'])) {
$mod_title = sprintf('<a href="%s">%s</a>', $links['title_link'], $mod_title);
}
$module_links[$mod_title] = $links;
}
$tpl['module_links'] = $module_links;
}
$template = new \Template($tpl);
$template->setModuleTemplate('miniadmin', MINIADMIN_TEMPLATE);
$content = $template->get();
Layout::set($content, 'miniadmin', 'mini_admin');
}