------------------------------------------------------------
revno: 1082
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Thu 2012-02-09 21:35:59 +0100
message:
breadcrumb titles
modified:
index.php
libs/Output.php
libs/widgets.php
--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk
Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'index.php'
--- index.php 2012-01-22 19:22:18 +0000
+++ index.php 2012-02-09 20:35:59 +0000
@@ -67,12 +67,12 @@
$html_output = $layout->html_output;
} else {
$html_output = $aiki->Output->headers();
- if (isset($aiki->Output->title)) {
- $layout->html_output = str_replace(
+
+ $layout->html_output = str_replace(
'[page_title]',
- $aiki->Output->title,
+ $aiki->Output->get_title(),
$layout->html_output);
- }
+
$html_output .= $layout->html_output;
$html_output .= $aiki->Output->footer();
}
=== modified file 'libs/Output.php'
--- libs/Output.php 2012-01-26 05:04:38 +0000
+++ libs/Output.php 2012-02-09 20:35:59 +0000
@@ -41,20 +41,57 @@
* @var string
*/
public $title;
+ public $titleSeparator =" / ";
/**
* buffer for header output
* @var string
*/
private $headers = '';
+
/**
* Mutator for setting title
*
* @param strign $title page title
- */
- public function set_title($title)
- {
- $this->title = $title;
+ */
+
+ public function set_title_separator($separator){
+ $this->titleSeparator = array($title);
+ }
+
+
+ /**
+ * set title or add a part to title
+ *
+ * @param string $title new title part
+ * @param booleann $reset if true title is added.
+ */
+
+ public function set_title($title, $reset = false ){
+ global $aiki;
+ if ( (boolean) $reset) {
+ $this->title = array($title);
+ } else {
+ if ( is_null($this->title )){
+ $this->title = array ( t($aiki->site->site_name()));
+ }
+ $this->title[] = t($title);
+ }
+ }
+
+ /**
+ * returns title as string joining all parts
+ *
+ * @return string the title
+ */
+
+ public function get_title(){
+ global $aiki;
+ if ( is_null($this->title )){
+ $this->title = array ( t($aiki->site->site_name()));
+ }
+
+ return implode ( $this->titleSeparator, $this->title );
}
/**
@@ -119,8 +156,7 @@
*/
public function title_and_metas() {
global $aiki, $config;
- $title = '<title>' . ( $this->title ? "$this->title - " : "" ) .
- $aiki->site->site_name() . '</title>' . "\n";
+ $title = '<title>' . $this->get_title() . "</title>";
$aiki->Plugins->doAction("output_title", $title);
$encoding = isset($config["db_encoding"]) ? $this->correct_encoding($config["db_encoding"]) : "utf-8";
=== modified file 'libs/widgets.php'
--- libs/widgets.php 2012-02-02 19:16:11 +0000
+++ libs/widgets.php 2012-02-09 20:35:59 +0000
@@ -590,7 +590,11 @@
$title = $this->parsDBpars($widget->pagetitle, $widget_value);
$title = $aiki->input->requests($title);
- $aiki->Output->set_title($title);
+ if ( $title[0]=="+") {
+ $aiki->Output->set_title( substr($title,1));
+ } else {
+ $aiki->Output->set_title($title, true);
+ }
}
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp