本文整理汇总了PHP中Installer::getTemplatePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::getTemplatePath方法的具体用法?PHP Installer::getTemplatePath怎么用?PHP Installer::getTemplatePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Installer
的用法示例。
在下文中一共展示了Installer::getTemplatePath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHTML
function getHTML($smarty)
{
$smarty->assign_by_ref('field', $this);
$output = $smarty->fetch(Installer::getTemplatePath("field_{$this->type}.tpl"));
$smarty->clear_assign('field');
return $output;
}
示例2: getHTML
function getHTML($smarty)
{
$file_contents = 'Could not read file ' . $this->file_name;
if (is_readable($this->file_name)) {
$file_contents = file($this->file_name);
$file_contents = join('', $file_contents);
}
$smarty->assign('FILE_CONTENTS', $file_contents);
return $smarty->fetch(Installer::getTemplatePath('action_accept_text.tpl'));
}
示例3: run
function run()
{
$output = '';
$field_form = '';
$versions =& $this->config->getSetting('VERSION_SET');
$smarty =& $GLOBALS['INSTALLER']['SMARTY'];
if ($this->phase == 0) {
$vc =& $this->config->getSetting('VERSION_CHECK');
$this->old_version = $vc->getCurrentVersion();
$this->special_actions = $vc->getSpecialActions($this->old_version);
$smarty->assign('INSTALLED', $this->old_version !== FALSE);
$smarty->assign('OLD_VERSION', $this->old_version);
$smarty->assign('VERSION', $versions->getNewestVersion());
$smarty->assign('LONG_VERSION', $versions->getNewestLongVersion());
$output .= $smarty->fetch(Installer::getTemplatePath('version_check.tpl'));
$smarty->assign('CAN_CONTINUE', true);
} elseif ($this->phase == 1) {
$fields = $versions->getFieldsForUpgrade($this->old_version);
$field_count = count($fields);
if ($field_count == 0) {
$this->phase++;
return $this->run();
}
if (isset($_REQUEST['save_data'])) {
// Save the data
for ($i = 0; $i < $field_count; $i++) {
$field =& $fields[$i];
$field->saveField();
}
$this->phase++;
return $this->run();
} else {
// Draw the form fields
$field_form .= "<INPUT TYPE='hidden' name='save_data' value='true'>\n";
for ($i = 0; $i < $field_count; $i++) {
$field =& $fields[$i];
$field_form .= $field->getHTML($smarty);
}
$smarty->assign('FORM_FIELDS', $field_form);
$output .= $smarty->fetch(Installer::getTemplatePath('collect_data.tpl'));
}
} elseif ($this->phase == 2) {
$tests =& $versions->getTestsForUpgrade($this->old_version);
$test_count = count($tests);
for ($i = 0; $i < $test_count; $i++) {
$test =& $tests[$i];
$test->perform();
$smarty->assign_by_ref('test', $test);
$output .= $smarty->fetch(Installer::getTemplatePath('test_result.tpl'));
$smarty->clear_assign('test');
}
if ($versions->testsComplete($this->old_version)) {
$smarty->assign('CAN_CONTINUE', true);
} else {
$smarty->assign('CAN_CONTINUE', false);
}
} elseif ($this->phase == 3) {
if (is_a($this->special_actions, 'ActionSet')) {
// Handle saving of data
if (isset($_REQUEST['save_action'])) {
$actions =& $this->special_actions;
$action_count = count($actions);
for ($i = 0; $i < $action_count; $i++) {
$action =& $actions[$i];
if ($action->isInteractive()) {
$action->dataSubmitted();
$action->perform();
$smarty->assign_by_ref('ACTION', $action);
$action_html .= $smarty->fetch(Installer::getTemplatePath('action_complete.tpl'));
$smarty->clear_assign('ACTION');
}
}
}
// See whats next
$actions =& $this->special_actions;
$action_count = count($actions);
for ($i = 0; $i < $action_count; $i++) {
$action =& $actions[$i];
if (!$action->success()) {
if ($action->isInteractive()) {
$action_html .= $action->getHTML($smarty);
} else {
$action->perform();
$smarty->assign_by_ref('ACTION', $action);
$action_html .= $smarty->fetch(Installer::getTemplatePath('action_complete.tpl'));
$smarty->clear_assign('ACTION');
}
}
}
$smarty->assign('ACTION_HTML', $action_html);
$output .= $smarty->fetch(Installer::getTemplatePath('actions.tpl'));
$smarty->clear_assign('ACTION_HTML');
if ($versions->actionsComplete($this->old_version)) {
$smarty->assign('CAN_CONTINUE', true);
} else {
$smarty->assign('CAN_CONTINUE', false);
}
} else {
$this->phase++;
$output .= $this->run();
//.........这里部分代码省略.........
示例4: realpath
<?php
require_once realpath(dirname(__FILE__)) . '/Installer.php';
$smarty = new InstallerSmarty();
$GLOBALS['INSTALLER']['SMARTY'] =& $smarty;
$output = '';
if (!isset($run_output)) {
$run_output = '';
}
$run_output .= $GLOBALS['INSTALLER']['ENGINE']->run();
$smarty->assign('INSTALLER_PHASE', $GLOBALS['INSTALLER']['ENGINE']->getPhaseName());
$output .= $smarty->fetch(Installer::getTemplatePath('header.tpl'));
$output .= $run_output;
$output .= $smarty->fetch(Installer::getTemplatePath('footer.tpl'));
print $output;
示例5: getHTML
function getHTML($smarty)
{
$smarty->assign("loop", $this->loop);
$smarty->assign_by_ref('ACTION', $this);
if ($this->loop < 2) {
$es =& $GLOBALS['INSTALLER']['SMARTY'];
$es->assign('HEADER_EXTRAS', '<META HTTP-EQUIV=Refresh CONTENT="2; URL=install.php?save_action=true">');
}
return $smarty->fetch(Installer::getTemplatePath('action_sql_file.tpl'));
}
示例6: getHTML
function getHTML($smarty)
{
if ($this->prepareParameters() === FALSE) {
$this->result = INSTALLER_ACTION_FAIL;
return $this->result;
}
$smarty->assign("files", $this->file_list);
$smarty->assign("loop", $this->loop);
$smarty->assign_by_ref('ACTION', $this);
if ($this->loop == 3) {
$es =& $GLOBALS['INSTALLER']['SMARTY'];
$es->assign('HEADER_EXTRAS', '<META HTTP-EQUIV=Refresh CONTENT="2; URL=install.php?save_action=true">');
}
return $smarty->fetch(Installer::getTemplatePath('action_sql_options.tpl'));
}