本文整理匯總了PHP中page_title函數的典型用法代碼示例。如果您正苦於以下問題:PHP page_title函數的具體用法?PHP page_title怎麽用?PHP page_title使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了page_title函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onSubmit
function onSubmit($vals)
{
// here is where we handle the form.
// in this case, we simply display its output to the screen
page_title($vals['title']);
return $vals['body'];
}
示例2: SiteglossaryEditForm
function SiteglossaryEditForm()
{
parent::MailForm();
$this->parseSettings('inc/app/siteglossary/forms/edit/settings.php');
global $cgi;
page_title(intl_get('Editing Glossary Term') . ': ' . $cgi->_key);
page_add_script('
function cms_cancel (f) {
if (arguments.length == 0) {
window.location.href = "/index/cms-app";
} else {
if (f.elements["_return"] && f.elements["_return"].value.length > 0) {
window.location.href = f.elements["_return"].value;
} else {
window.location.href = "/index/siteglossary-app";
}
}
return false;
}
');
// add cancel handler
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel (this.form)"';
$res = db_single('select * from siteglossary_term where word = ?', $cgi->_key);
foreach (get_object_vars($res) as $k => $v) {
$this->widgets[$k]->setValue($v);
}
}
示例3: SitefaqEditForm
function SitefaqEditForm()
{
parent::MailForm();
global $page, $cgi;
$this->extra = 'id="cms-edit-form"';
// get copy from repository
loader_import('cms.Versioning.Rex');
$rex = new Rex($cgi->_collection);
// default: database, database
$_document = $rex->getCurrent($cgi->_key);
$widgets = $rex->getStruct();
if (!$widgets) {
$widgets = array();
}
// edit widgets go here
$this->widgets = array_merge($this->widgets, $widgets);
foreach ($this->widgets as $k => $v) {
if (isset($_document->{$k})) {
$this->widgets[$k]->setValue($_document->{$k});
}
}
$w =& $this->addWidget('hidden', '_key');
$w =& $this->addWidget('hidden', '_collection');
$w =& $this->addWidget('hidden', '_return');
if ($rex->isVersioned) {
$t =& $this->addWidget('textarea', 'changelog');
$t->alt = intl_get('Change Summary');
$t->rows = 3;
$t->labelPosition = 'left';
$t->extra = 'id="changelog"';
}
// submit buttons
$w =& $this->addWidget('msubmit', 'submit_button');
$b =& $w->getButton();
$b->setValues(intl_get('Save'));
$b =& $w->addButton('submit_button', intl_get('Cancel'));
$b->extra = 'onclick="return cms_cancel (this.form)"';
$this->error_mode = 'all';
if ($rex->info['Collection']['singular']) {
page_title(intl_get('Editing') . ' ' . $rex->info['Collection']['singular'] . ': ' . $_document->{$rex->key});
} else {
page_title(intl_get('Editing Item') . ': ' . $_document->{$rex->key});
}
// the SiteFAQ additions:
if (appconf('user_anonymity')) {
unset($this->widgets['name']);
unset($this->widgets['email']);
unset($this->widgets['url']);
unset($this->widgets['ip']);
unset($this->widgets['member_id']);
}
$admin_roles = session_admin_roles();
$this->widgets['assigned_to']->setValues(db_pairs('select username, concat(lastname, ", ", firstname, " (", username, ")")
from sitellite_user
where role in("' . join('", "', $admin_roles) . '")
order by lastname, firstname, username'));
if (!$_document->assigned_to) {
$this->widgets['assigned_to']->setValue(session_username());
}
}
示例4: SiteblogEditForm
function SiteblogEditForm()
{
parent::MailForm();
global $cgi;
$refer = $_SERVER['HTTP_REFERER'];
$this->parseSettings('inc/app/siteblog/forms/edit/settings.php');
$this->widgets['refer']->setValue($refer);
//if add is true, we're creating a blog post, otherwise we're editing a blog post
$add = isset($cgi->_key) && !empty($cgi->_key) ? false : true;
$this->widgets['status']->setValues(array('Live', 'Not Live'));
$cats = db_pairs('select id, title from siteblog_category where status = "on"');
if ($add) {
page_title('Adding a Blog Post');
$this->widgets['author']->setValue(session_username());
unset($this->widgets['icategory']);
$this->widgets['category']->setValues($cats);
} else {
loader_import('cms.Versioning.Rex');
$rex = new Rex('siteblog_post');
$document = $rex->getCurrent($cgi->_key);
page_title('Editing a Blog Post');
//populate fields
$this->widgets['subject']->setValue($document->subject);
$this->widgets['author']->setValue($document->author);
$this->widgets['status']->setValue($document->status);
unset($this->widgets['category']);
$catname = db_shift('select title from siteblog_category where id = ?', $document->category);
$this->widgets['icategory']->setValue($catname);
$this->widgets['oldcat']->setValue($document->category);
$this->widgets['body']->setValue($document->body);
}
}
示例5: RealtyAddForm
function RealtyAddForm()
{
parent::MailForm();
$w =& $this->addWidget('hidden', 'collection');
$w =& $this->addWidget('hidden', '_return');
global $cgi;
loader_import('cms.Versioning.Rex');
$rex = new Rex($cgi->collection);
$widgets = $rex->getStruct();
if (!$widgets) {
die($rex->error);
}
$this->widgets = array_merge($this->widgets, $widgets);
foreach (array_keys($this->widgets) as $k) {
if (strtolower(get_class($this->widgets[$k])) == 'mf_widget_xeditor') {
$this->extra = 'onsubmit="xed_copy_value (this, \'' . $k . '\')"';
}
}
if (isset($rex->info['Collection']['singular'])) {
page_title(intl_get('Adding') . ' ' . $rex->info['Collection']['singular']);
} else {
page_title(intl_get('Adding Item'));
}
$w =& $this->addWidget('msubmit', 'submit_button');
$b =& $w->getButton();
$b->setValues(intl_get('Create'));
$b =& $w->addButton('submit_button', intl_get('Cancel'));
$b->extra = 'onclick="return cms_cancel (this.form)"';
}
示例6: BoxchooserSettingsForm
function BoxchooserSettingsForm()
{
parent::MailForm();
page_title(intl_get('Box Settings'));
//set(array('title'=>'Add a Box'));
global $cgi;
//set
if (!$cgi->box) {
echo 'Missing parameter: box';
exit;
}
ini_add_filter('ini_filter_split_comma_single', array('rule 0', 'rule 1', 'rule 2', 'rule 3', 'rule 4', 'rule 5', 'rule 6', 'rule 7', 'rule 8', 'button 0', 'button 1', 'button 2', 'button 3', 'button 4', 'button 5', 'button 6', 'button 7', 'button 8'));
$this->_box_settings = ini_parse('inc/app/' . $cgi->app . '/boxes/' . $cgi->box . '/settings.php');
ini_clear();
unset($this->_box_settings['Meta']);
if (count($this->_box_settings) === 0) {
$this->onSubmit((array) $cgi);
return;
}
foreach ($this->_box_settings as $k => $v) {
$this->createWidget($k, $v);
}
$this->addWidget('hidden', 'app');
$this->addWidget('hidden', 'box');
$this->addWidget('hidden', 'name');
$w =& $this->addWidget('submit', 'sub');
$w->setValues(intl_get('Done'));
}
示例7: page_breadcrumb
function page_breadcrumb($page, $sidebar)
{
$title = preg_quote(page_title($page), '!');
$lines = explode("\n", $sidebar);
$index = $level = null;
foreach ($lines as $line_no => $line) {
if (preg_match('![\\[\\*\\|]' . $title . '[\\]\\*]!', $line)) {
$index = $line_no;
$level = strpos($line, '* ');
break;
}
}
if (!$index) {
return [];
}
for ($i = $index - 1; $i > 0; $i--) {
$line = $lines[$i];
if (strpos($line, '* ') < $level) {
$level = strpos($line, '* ');
if (preg_match('|(\\[\\[[^\\]]+\\]\\])|', $line, $matches)) {
list($page, $title) = parse_wikilink($matches[1]);
$breadcrumb[] = [$title, $page];
} else {
if (preg_match('|\\* \\*\\*([^\\*]+)\\*\\*|', $line, $matches)) {
$breadcrumb[] = [$matches[1], null];
}
}
}
if (!$level) {
break;
}
}
$breadcrumb[] = ['Home', 'Home'];
return array_reverse($breadcrumb);
}
示例8: AppdocTranslationAddForm
function AppdocTranslationAddForm()
{
parent::MailForm();
$this->parseSettings('inc/app/appdoc/forms/translation/add/settings.php');
page_title(intl_get('Add Language'));
global $cgi;
if ($cgi->appname == 'GLOBAL') {
$this->_file = 'inc/lang/languages.php';
} else {
$this->_file = 'inc/app/' . $cgi->appname . '/lang/languages.php';
}
$list = array('no' => 'None');
$info = ini_parse($this->_file);
foreach ($info as $k => $v) {
$list[$k] = $v['name'];
}
$this->widgets['fallback']->setValues($list);
$this->widgets['default']->setValues(array('yes' => 'Yes', 'no' => 'No'));
if (count($list) == 1) {
$this->widgets['default']->setDefault('yes');
} else {
$this->widgets['default']->setDefault('no');
}
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="window.history.go (-1); return false"';
}
示例9: SiteblogCommentForm
function SiteblogCommentForm()
{
parent::MailForm();
global $cgi;
$this->parseSettings('inc/app/siteblog/forms/comment/settings.php');
if (isset($cgi->_key) && !empty($cgi->_key)) {
//edit a comment
page_title('Editing Comment');
$comment = db_single('select * from siteblog_comment where id = ?', $cgi->_key);
$this->widgets['name']->setValue($comment->author);
$this->widgets['email']->setValue($comment->email);
$this->widgets['url']->setValue($comment->url);
$this->widgets['body']->setValue($comment->body);
} elseif (!isset($cgi->post)) {
header('Location: ' . site_prefix() . '/index');
exit;
} else {
if (session_valid()) {
$this->widgets['name']->setValue(session_username());
$user = session_get_user();
$this->widgets['email']->setValue($user->email);
$this->widgets['url']->setValue($user->website);
}
$this->widgets['post']->setValue($cgi->post);
//page_title ('Post a Comment');
}
if (!appconf('comments_security')) {
unset($this->widgets['security_test']);
}
}
示例10: SitetemplateEditsetForm
function SitetemplateEditsetForm()
{
parent::MailForm();
global $cgi;
$set = $cgi->set;
$this->parseSettings('inc/app/sitetemplate/forms/editset/settings.php');
$settings = array();
if (file_exists('inc/html/' . $set . '/config.ini.php')) {
$settings = ini_parse('inc/html/' . $set . '/config.ini.php', false);
}
$name = $settings['set_name'];
if (!$name) {
$name = $set;
}
$settings['set'] = $set;
//put form values into respective forms
foreach ($settings as $k => $v) {
$this->widgets[$k]->setDefault($v);
}
if (@file_exists('inc/html/' . $set . '/modes.php')) {
$this->widgets['modes']->setDefault(@join('', @file('inc/html/' . $set . '/modes.php')));
} else {
$this->widgets['modes']->setDefault($modesd);
}
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="history.go (-1); return false"';
page_title(intl_get('Editing Properties') . ': ' . $name);
}
示例11: SiteblogPropertiesForm
function SiteblogPropertiesForm()
{
parent::MailForm();
global $cgi;
if (empty($cgi->blog)) {
return;
}
$this->parseSettings('inc/app/siteblog/forms/properties/settings.php');
page_title('Editing Category Properties: ' . $cgi->blog);
$category = db_single('select * from siteblog_category where id = ?', $cgi->blog);
$set = array();
if ($category->comments == 'on') {
$set[] = 'Enable Comments';
}
if ($category->poster_visible == 'yes') {
$set[] = 'Author Visible';
}
if ($category->display_rss == 'yes') {
$set[] = 'Include RSS Links';
}
if ($category->status == 'on') {
$set[] = 'Enabled';
}
$this->widgets['blog_properties']->setValue($set);
$this->widgets['blog']->setValue($cgi->blog);
$this->widgets['refer']->setValue($_SERVER['HTTP_REFERER']);
}
示例12: DeadlinesAddForm
function DeadlinesAddForm()
{
parent::MailForm();
$this->parseSettings('inc/app/deadlines/forms/add/settings.php');
page_title('Deadlines - Add Item');
$this->widgets['ts']->setDefault(date('Y-m-d H:i:s'));
}
示例13: SitepresenterEditSlideForm
function SitepresenterEditSlideForm()
{
parent::MailForm();
$this->parseSettings('inc/app/sitepresenter/forms/edit/slide/settings.php');
page_add_script('
function cms_cancel (f) {
if (arguments.length == 0) {
window.location.href = "/index/cms-app";
} else {
if (f.elements["_return"] && f.elements["_return"].value.length > 0) {
window.location.href = f.elements["_return"].value;
} else {
window.location.href = "/index/sitepresenter-app";
}
}
return false;
}
');
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel (this.form)"';
global $cgi;
page_title(intl_get('Adding Slide to Presentation') . ': ' . db_shift('select title from sitepresenter_presentation where id = ?', $cgi->presentation));
$res = db_single('select * from sitepresenter_slide where id = ?', $cgi->id);
foreach (get_object_vars($res) as $k => $v) {
$this->widgets[$k]->setValue($v);
}
}
示例14: onSubmit
function onSubmit($vals)
{
$vals['name'] = strtolower($vals['name']);
//make sure that file doesnt exit
if (file_exists('inc/html/' . $vals['set_name'] . '/' . $vals['name'] . '.css')) {
echo '<p>' . intl_get('A file with that name already exists. Choose a different file name.') . '</p>';
echo '<p>' . intl_get('Go <a href=javascript:history.back()>back</a> to choose a different file name.') . '</p>';
}
if (preg_match('/\\.css$/i', $vals['name'])) {
$ext = '';
} else {
$ext = '.css';
}
if (!file_overwrite('inc/html/' . $vals['set_name'] . '/' . $vals['name'] . $ext, $vals['body'])) {
page_title(intl_get('An Error Occurred'));
echo '<p>' . intl_get('The file was unable to be saved. Please verify your server settings before trying again.') . '</p>';
return;
}
umask(00);
chmod('inc/html/' . $vals['set_name'] . '/' . $vals['name'] . $ext, 0777);
list($set, $tpl) = explode('/', $vals['path']);
echo $set . ' ' . $tpl;
page_title('File Saved');
echo '<p><a href="' . site_prefix() . '/index/sitetemplate-templateselect-action?set_name=' . $vals['set_name'] . '">' . intl_get('Return to template set') . '</a></p>';
}
示例15: SitepresenterAddForm
function SitepresenterAddForm()
{
parent::MailForm();
global $page, $cgi;
$this->parseSettings('inc/app/sitepresenter/forms/add/settings.php');
page_title(intl_get('Adding Presentation'));
loader_import('ext.phpsniff');
$sniffer = new phpSniff();
$this->_browser = $sniffer->property('browser');
// include formhelp, edit panel init, and cancel handler
page_add_script(site_prefix() . '/js/formhelp.js');
page_add_script(CMS_JS_FORMHELP_INIT);
page_onload('cms_init_edit_panels ()');
page_add_script('
function cms_cancel (f) {
if (arguments.length == 0) {
window.location.href = "/index/cms-app";
} else {
if (f.elements["_return"] && f.elements["_return"].value.length > 0) {
window.location.href = f.elements["_return"].value;
} else {
window.location.href = "/index/sitepresenter-app";
}
}
return false;
}
');
// add cancel handler
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="return cms_cancel (this.form)"';
}