本文整理汇总了PHP中Home::launch方法的典型用法代码示例。如果您正苦于以下问题:PHP Home::launch方法的具体用法?PHP Home::launch怎么用?PHP Home::launch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Home
的用法示例。
在下文中一共展示了Home::launch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: launch
/**
* Process incoming parameters and display the page.
*
* @return void
* @access public
*/
public function launch()
{
global $interface;
global $configArray;
if (isset($_POST['submit'])) {
$result = $this->sendEmail($_POST['from'], $_POST['message']);
if (!PEAR::isError($result)) {
include_once 'Home.php';
Home::launch();
exit;
} else {
$interface->assign('errorMsg', $result->getMessage());
}
}
// Display Page
$institutionDetails = $this->recordDriver->getInstitutionDetails();
$datasources = getExtraConfigArray('datasources');
if (!$institutionDetails['institution']) {
$interface->assign('institution', $configArray['Site']['title']);
$interface->assign('datasource', $configArray['Site']['title']);
} else {
$interface->assign('institution', $institutionDetails['institution']);
$interface->assign('datasource', $institutionDetails['datasource']);
}
$interface->assign('formTargetPath', '/MetaLib/Record?id=' . urlencode($_GET['id']) . '/Feedback');
if (isset($_GET['lightbox'])) {
$interface->assign('title', $_GET['message']);
return $interface->fetch('Record/Feedback.tpl');
} else {
$interface->setPageTitle('Give Feedback on a Record');
$interface->assign('subTemplate', 'Feedback.tpl');
$interface->setTemplate('view-alt.tpl');
$interface->display('layout.tpl', 'RecordFeedback' . $_GET['id']);
}
}
示例2: launch
/**
* Process incoming parameters and display the page.
*
* @return void
* @access public
*/
public function launch()
{
global $interface;
global $configArray;
if (isset($_POST['submit'])) {
$result = $this->sendEmail($_POST['to'], $_POST['from'], $_POST['message']);
if (!PEAR::isError($result)) {
include_once 'Home.php';
Home::launch();
exit;
} else {
$interface->assign('errorMsg', $result->getMessage());
}
}
// Display Page
$interface->assign('formTargetPath', '/MetaLib/' . urlencode($_GET['id']) . '/Email');
$interface->assign('recordId', urlencode($_GET['id']));
if (isset($_GET['lightbox'])) {
$interface->assign('title', $_GET['message']);
return $interface->fetch('MetaLib/email.tpl');
} else {
$interface->setPageTitle('Email Record');
$interface->assign('subTemplate', 'email.tpl');
$interface->setTemplate('view-alt.tpl');
$interface->display('layout.tpl', 'RecordEmail' . $_GET['id']);
}
}
示例3: launch
/**
* Display the page.
*
* @return void
* @access public
*/
public function launch()
{
global $interface;
global $configArray;
// Connect to Solr:
$db = ConnectionManager::connectToIndex();
// Process incoming parameters:
$source = isset($_GET['source']) ? $_GET['source'] : false;
$from = isset($_GET['from']) ? $_GET['from'] : false;
$rowid = isset($_GET['rowid']) ? $_GET['rowid'] : false;
$page = isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 0;
$limit = isset($configArray['AlphaBrowse']['page_size']) ? $configArray['AlphaBrowse']['page_size'] : 20;
$extras = isset($configArray['AlphaBrowse_Extras'][$source]) ? $configArray['AlphaBrowse_Extras'][$source] : null;
// Normalize input for call numbers
if ($source == 'lcc' && $from) {
$from = $this->_normalizeCallNumber($from);
}
// If required parameters are present, load results:
if ($source && ($from !== false || $rowid !== false)) {
// Load Solr data or die trying:
$result = $db->alphabeticBrowse($source, $from, $rowid, $page, $limit, $extras, true);
$this->_checkError($result);
// No results? Try the previous page just in case we've gone past the
// end of the list....
if ($result['Browse']['totalCount'] == 0) {
$page--;
$result = $db->alphabeticBrowse($source, $from, $rowid, $page, $limit, $extras, true);
$this->_checkError($result);
}
// Only display next/previous page links when applicable:
$interface->assign('nextpage', $page + 1);
$interface->assign('nextRowid', $result['Browse']['endRow']);
if ($result['Browse']['startRow'] > 1) {
$interface->assign('prevpage', -1);
$interface->assign('prevRowid', $result['Browse']['startRow']);
}
// Send other relevant values to the template:
$interface->assign('source', $source);
$interface->assign('from', $from);
// Before assigning results, lets dedupe the extras
foreach ($result['Browse']['items'] as &$item) {
if (isset($item['extras'])) {
foreach ($item['extras'] as &$extra) {
$extra = array_unique($extra);
}
}
}
$interface->assign('result', $result);
}
// We also need to load all the same details as the basic Home action:
parent::launch();
}