當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Installer::getTemplatePath方法代碼示例

本文整理匯總了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;
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:7,代碼來源:Field.php

示例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'));
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:10,代碼來源:AcceptText.php

示例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();
//.........這裏部分代碼省略.........
開發者ID:patmark,項目名稱:care2x-tz,代碼行數:101,代碼來源:InstallerEngine.php

示例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;
開發者ID:patmark,項目名稱:care2x-tz,代碼行數:15,代碼來源:install.php

示例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'));
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:10,代碼來源:SQLFile.php

示例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'));
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:15,代碼來源:SQLOptions.php


注:本文中的Installer::getTemplatePath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。