cvs: phd(PHD_0_4) /formats xhtml.php /include PhDMediaManager.class.php /themes/pear pearweb.php /themes/php phpweb.php
| From: | Christian Weiske | Date: | Tue, 10 Feb 2009 22:32:30 +0000 |
| Subject: | cvs: phd(PHD_0_4) /formats xhtml.php /include PhDMediaManager.class.php /themes/pear pearweb.php /themes/php phpweb.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3183@lists.php.net to get a copy of this message | ||
cweiske Tue Feb 10 22:32:30 2009 UTC
Added files: (Branch: PHD_0_4)
/phd/include PhDMediaManager.class.php
Modified files:
/phd/formats xhtml.php
/phd/themes/pear pearweb.php
/phd/themes/php phpweb.php
Log:
Copy images automatically into images/ folder.
http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.67.2.2.2.19&r2=1.67.2.2.2.20&diff_format=u
Index: phd/formats/xhtml.php
diff -u phd/formats/xhtml.php:1.67.2.2.2.19 phd/formats/xhtml.php:1.67.2.2.2.20
--- phd/formats/xhtml.php:1.67.2.2.2.19 Thu Jan 29 15:49:46 2009
+++ phd/formats/xhtml.php Tue Feb 10 22:32:29 2009
@@ -1,5 +1,6 @@
<?php
-/* $Id: xhtml.php,v 1.67.2.2.2.19 2009/01/29 15:49:46 cweiske Exp $ */
+/* $Id: xhtml.php,v 1.67.2.2.2.20 2009/02/10 22:32:29 cweiske Exp $ */
+require $ROOT. "/include/PhDMediaManager.class.php";
class XHTMLPhDFormat extends PhDFormat {
protected $elementmap = array( /* {{{ */
@@ -204,6 +205,7 @@
'replaceable' => 'span',
'row' => 'format_row',
'screen' => 'format_screen',
+ 'screenshot' => 'div',
'sect1' => 'format_chunk',
'sect2' => 'format_chunk',
'sect3' => 'format_chunk',
@@ -368,6 +370,14 @@
* @see CDATA()
*/
public $role = false;
+
+ /**
+ * Media manager object
+ *
+ * @var PhDMediaManager
+ */
+ public $mediamanager = null;
+
/* Current Chunk variables */
protected $cchunk = array();
/* Default Chunk variables */
@@ -405,9 +415,18 @@
),
);
- public function __construct(array $IDs) {
+ public function __construct(array $IDs)
+ {
parent::__construct($IDs);
+ $this->mediamanager = new PhDMediaManager();
}
+
+ public function registerTheme(PhDTheme $theme)
+ {
+ parent::registerTheme($theme);
+ $this->mediamanager->output_dir = $theme->outputdir;
+ }
+
public function __call($func, $args) {
if ($args[0]) {
trigger_error("No mapper found for '{$func}'", E_USER_WARNING);
@@ -1237,10 +1256,13 @@
$this->cchunk["mediaobject"]["alt"] = $value;
}
public function format_imagedata($open, $name, $attrs) {
+ $file = $attrs[PhDReader::XMLNS_DOCBOOK]["fileref"];
+ $newpath = $this->mediamanager->handleFile($file);
+
if ($this->cchunk["mediaobject"]["alt"] !== false) {
- return '<img src="'
.$attrs[PhDReader::XMLNS_DOCBOOK]["fileref"]. '" alt="'
.$this->cchunk["mediaobject"]["alt"]. '" />';
+ return '<img src="' . $newpath . '" alt="'
.$this->cchunk["mediaobject"]["alt"]. '" />';
}
- return '<img src="'
.$attrs[PhDReader::XMLNS_DOCBOOK]["fileref"]. '" />';
+ return '<img src="' . $newpath . '" />';
}
public function format_dl($open, $name, $attrs, $props)
http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearweb.php?r1=1.1.6.2.2.3&r2=1.1.6.2.2.4&diff_format=u
Index: phd/themes/pear/pearweb.php
diff -u phd/themes/pear/pearweb.php:1.1.6.2.2.3 phd/themes/pear/pearweb.php:1.1.6.2.2.4
--- phd/themes/pear/pearweb.php:1.1.6.2.2.3 Fri Jan 2 12:08:55 2009
+++ phd/themes/pear/pearweb.php Tue Feb 10 22:32:29 2009
@@ -5,15 +5,15 @@
* PEAR theme for the many php files used for pearweb
*
* @package PhD
-* @version CVS: $Id: pearweb.php,v 1.1.6.2.2.3 2009/01/02 12:08:55 cweiske Exp $
+* @version CVS: $Id: pearweb.php,v 1.1.6.2.2.4 2009/02/10 22:32:29 cweiske Exp $
*/
class pearweb extends peartheme
{
protected $streams = array();
protected $writeit = false;
-
- protected $outputdir = '';
+
+ public $outputdir = '';
/**
* URL prefix for all API doc link generated with <phd:pearapi>.
http://cvs.php.net/viewvc.cgi/phd/themes/php/phpweb.php?r1=1.27.4.2&r2=1.27.4.3&diff_format=u
Index: phd/themes/php/phpweb.php
diff -u phd/themes/php/phpweb.php:1.27.4.2 phd/themes/php/phpweb.php:1.27.4.3
--- phd/themes/php/phpweb.php:1.27.4.2 Fri Jan 2 12:38:39 2009
+++ phd/themes/php/phpweb.php Tue Feb 10 22:32:30 2009
@@ -1,11 +1,11 @@
<?php
-/* $Id: phpweb.php,v 1.27.4.2 2009/01/02 12:38:39 bjori Exp $ */
+/* $Id: phpweb.php,v 1.27.4.3 2009/02/10 22:32:30 cweiske Exp $ */
require_once $ROOT . '/themes/php/phpdotnet.php';
class phpweb extends phpdotnet {
protected $streams = array();
protected $writeit = false;
- protected $outputdir = '';
+ public $outputdir = '';
public function __construct($IDs, $filename, $ext = "php", $chunked = true) {
http://cvs.php.net/viewvc.cgi/phd/include/PhDMediaManager.class.php?view=markup&rev=1.1
Index: phd/include/PhDMediaManager.class.php
+++ phd/include/PhDMediaManager.class.php