summaryrefslogtreecommitdiff
path: root/modules_v3/tree
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2011-10-06 16:18:21 +0000
committerfisharebest <fisharebest@gmail.com>2011-10-06 16:18:21 +0000
commit8ced4e792cf758f241749b7f30cb404b1338938c (patch)
tree037bc849d87f66b1285962de5c2467e1dcbaccef /modules_v3/tree
parent8f249e2b91d995d98df2b5a5c6d1fcf5a707b3da (diff)
downloadwebtrees-8ced4e792cf758f241749b7f30cb404b1338938c.tar.gz
webtrees-8ced4e792cf758f241749b7f30cb404b1338938c.tar.bz2
webtrees-8ced4e792cf758f241749b7f30cb404b1338938c.zip
Add initial support for serving static files from a content delivery network.
Diffstat (limited to 'modules_v3/tree')
-rw-r--r--modules_v3/tree/class_treeview.php14
-rw-r--r--modules_v3/tree/help_text.php56
-rw-r--r--modules_v3/tree/module.php8
3 files changed, 38 insertions, 40 deletions
diff --git a/modules_v3/tree/class_treeview.php b/modules_v3/tree/class_treeview.php
index c8db0a6307..f53b567f6b 100644
--- a/modules_v3/tree/class_treeview.php
+++ b/modules_v3/tree/class_treeview.php
@@ -77,14 +77,14 @@ class TreeView {
// Read styles (20 maxi) in a hidden list
$sd = WT_MODULES_DIR.'tree/css/styles/';
$rs = '<ul id="tvStylesSubmenu">';
- $cs = '<img src="'.$sd.'default/button.gif" alt="d" onclick="'.$this->name.'Handler.style(\''.$sd.'\', \'default\', this);" title="'.WT_I18N::translate('Style').'" />';
+ $cs = '<img src="'.WT_STATIC_URL.$sd.'default/button.gif" alt="d" onclick="'.$this->name.'Handler.style(\''.$sd.'\', \'default\', this);" title="'.WT_I18N::translate('Style').'" />';
$rs .= '<li class="tv_button'.($style == '' || $style=='default' ? ' tvPressed' : '').'">'.$cs.'</li>';
$nbStyles = 1;
if (@is_dir($sd) && @is_readable($sd) && ($d=@opendir($sd))) {
while (($s = readdir($d)) !== false && ($nbStyles < 20)) {
if ($s[0] == '.' || $s=='default' || !is_dir($sd.$s))
continue;
- $sHTML = '<img src="'.$sd.$s.'/button.gif" alt="'.$s[0].'" onclick="'.$this->name.'Handler.style(\''.$sd.'\', \''.$s.'\', this);" title="'.WT_I18N::translate('Style').'" />';
+ $sHTML = '<img src="'.WT_STATIC_URL.$sd.$s.'/button.gif" alt="'.$s[0].'" onclick="'.$this->name.'Handler.style(\''.$sd.'\', \''.$s.'\', this);" title="'.WT_I18N::translate('Style').'" />';
if ($s == $style) {
$cs = $sHTML;
$pressedState = ' tvPressed';
@@ -104,25 +104,25 @@ class TreeView {
'<li id="tvToolsHandler" title="'.WT_I18N::translate('Move the toolbar').'"></li>'.
'<li id="tvbZoomIn" class="tv_button"><img src="'.$WT_IMAGES['zoomin'].'" alt="'.WT_I18N::translate('Zoom in').'" title="'.WT_I18N::translate('Zoom in').'" /></li>'.
'<li id="tvbZoomOut" class="tv_button"><img src="'.$WT_IMAGES['zoomout'].'" alt="'.WT_I18N::translate('Zoom out').'" title="'.WT_I18N::translate('Zoom out').'" /></li>'.
- '<li id="tvbNoZoom" class="tv_button"><img src="'.WT_MODULES_DIR.'tree/images/zoom0.png" alt="'.WT_I18N::translate('Reset').'" title="'.WT_I18N::translate('Reset').'" /></li>'.
+ '<li id="tvbNoZoom" class="tv_button"><img src="'.WT_STATIC_URL.WT_MODULES_DIR.'tree/images/zoom0.png" alt="'.WT_I18N::translate('Reset').'" title="'.WT_I18N::translate('Reset').'" /></li>'.
'<li id="tvbLeft" class="tv_button"><img src="'.$WT_IMAGES['ldarrow'].'" alt="'.WT_I18N::translate('Align left').'" title="'.WT_I18N::translate('Align left').'" /></li>'.
'<li id="tvbCenter" class="tv_button"><img src="'.$WT_IMAGES['center'].'" alt="'./* I18N: verb/action */ WT_I18N::translate('Center').'" title="'.WT_I18N::translate('Center').'" /></li>'.
'<li id="tvbRight" class="tv_button"><img src="'.$WT_IMAGES['rdarrow'].'" alt="'.WT_I18N::translate('Align right').'" title="'.WT_I18N::translate('Align right').'" /></li>'.
- '<li id="tvbDates" class="tv_button tvPressed"><img src="'.WT_MODULES_DIR.'tree/images/dates.png" alt="'.WT_I18N::translate('Show year of birth and death').'" title="'.WT_I18N::translate('Show year of birth and death').'" /></li>'.
- '<li id="tvbCompact" class="tv_button"><img src="'.WT_MODULES_DIR.'tree/images/compact.png" alt="'.WT_I18N::translate('Use compact layout').'" title="'.WT_I18N::translate('Use compact layout').'" /></li>'.
+ '<li id="tvbDates" class="tv_button tvPressed"><img src="'.WT_STATIC_URL.WT_MODULES_DIR.'tree/images/dates.png" alt="'.WT_I18N::translate('Show year of birth and death').'" title="'.WT_I18N::translate('Show year of birth and death').'" /></li>'.
+ '<li id="tvbCompact" class="tv_button"><img src="'.WT_STATIC_URL.WT_MODULES_DIR.'tree/images/compact.png" alt="'.WT_I18N::translate('Use compact layout').'" title="'.WT_I18N::translate('Use compact layout').'" /></li>'.
// TODO: this is temporarily disabled (as it sends a flood of AJAX requests?)
//'<li id="tvbOpen" class="tv_button"><img src="'.$WT_IMAGES["media"].'" alt="o" title="'.WT_I18N::translate('Show all details').'" /></li>'.
//'<li id="tvbClose" class="tv_button"><img src="'.$WT_IMAGES["fambook"].'" alt="f" title="'.WT_I18N::translate('Hide all details').'" /></li>'.
// If the position/order of the style button moves, update TreeViewHandler() in treeview.js
'<li id="tvStyleButton" class="tv_button">'.$cs.'</li>'.
- '<li id="tvbPrint" class="tv_button"><img src="'.WT_MODULES_DIR.'tree/images/print.png" alt="p" title="'./* I18N: verb/action */ WT_I18N::translate('Print').'" /></li>'.
+ '<li id="tvbPrint" class="tv_button"><img src="'.WT_STATIC_URL.WT_MODULES_DIR.'tree/images/print.png" alt="p" title="'./* I18N: verb/action */ WT_I18N::translate('Print').'" /></li>'.
'<li class="tv_button'.($this->allPartners ? ' tvPressed' : '').'"><a href="'.$path.'"><img src="'.$WT_IMAGES["sfamily"].'" alt="'.WT_I18N::translate('Show all spouses and ancestors').'" title="'.WT_I18N::translate('Show all spouses and ancestors').'" /></a></li>';
if (safe_GET('mod_action') != 'treeview') {
$r.='<li class="tv_button"><a href="module.php?mod=tree&mod_action=treeview&rootid='.$rootPerson->getXref().'#tv_content" title="'. /* I18N: Button label - view this chart in full-screen mode */ WT_I18N::translate('Full screen').'"><img src="'.$WT_IMAGES["fscreen"].'" alt="full screen" /></a></li>';
}
// Help, and hidden loading image
$r.='<li class="tv_button">'.help_link("TV_MODULE", 'tree').'</li>
- <li class="tv_button" id="'.$this->name.'_loading"><img src="images/loading.gif" alt="Loading..." /></li>
+ <li class="tv_button" id="'.$this->name.'_loading"><img src="'.WT_STATIC_URL.'images/loading.gif" alt="Loading..." /></li>
</ul>'.$rs;
$r.='</div><div id="'.$this->name.'_in" class="tv_in">';
$parent = null;
diff --git a/modules_v3/tree/help_text.php b/modules_v3/tree/help_text.php
index c340b17be8..097e73ac73 100644
--- a/modules_v3/tree/help_text.php
+++ b/modules_v3/tree/help_text.php
@@ -1,29 +1,27 @@
<?php
-/**
- * TreeView Module help text.
- *
- * This file is included from the application help_text.php script.
- * It simply needs to set $title and $text for the help topic $help_topic
- *
- * webtrees: Web based Family History software
- * Copyright (C) 2011 Daniel Faivre
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @version $Id$
- */
+// TreeView Module help text.
+//
+// This file is included from the application help_text.php script.
+// It simply needs to set $title and $text for the help topic $help_topic
+//
+// webtrees: Web based Family History software
+// Copyright (C) 2011 webtrees development team
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// $Id$
if (!defined('WT_WEBTREES')) {
header('HTTP/1.0 403 Forbidden');
@@ -42,7 +40,7 @@ case 'TV_MODULE':
WT_I18N::translate('Zoom in : enlarge texts and person\'s boxes.').'</td></tr>'.
'<tr><td><img src="'.$WT_IMAGES['zoomout'].'"'.$imgStyle.' alt="zoomout" /></td><td>'.
WT_I18N::translate('Zoom out : reduce texts and person\'s boxes.').'</td></tr>'.
- '<tr><td><img src="'.WT_MODULES_DIR.'/tree/images/zoom0.png"'.$imgStyle.' alt="nozoom" /></td><td>'.
+ '<tr><td><img src="'.WT_STATIC_URL.WT_MODULES_DIR.'/tree/images/zoom0.png"'.$imgStyle.' alt="nozoom" /></td><td>'.
WT_I18N::translate('No zoom.').'</td></tr>'.
'<tr><td><img src="'.$WT_IMAGES['ldarrow'].'"'.$imgStyle.'alt="alignLeft" /></td><td>'.
WT_I18N::translate('Align on top left corner. Useful before printing.').'</td></tr>'.
@@ -50,16 +48,16 @@ case 'TV_MODULE':
WT_I18N::translate('Center on the root person.').'</td></tr>'.
'<tr><td><img src="'.$WT_IMAGES['rdarrow'].'"'.$imgStyle.' alt="alignRight" /></td><td>'.
WT_I18N::translate('Align on top right corner.').'</td></tr>'.
- '<tr><td><img src="'.WT_MODULES_DIR.'/tree/images/dates.png"'.$imgStyle.' alt="hide dates" /></td><td>'.
+ '<tr><td><img src="'.WT_STATIC_URL.WT_MODULES_DIR.'/tree/images/dates.png"'.$imgStyle.' alt="hide dates" /></td><td>'.
WT_I18N::translate('Hide/show dates on small boxes.').'</td></tr>'.
- '<tr><td><img src="'.WT_MODULES_DIR.'/tree/images/compact.png"'.$imgStyle.' alt="c/e" /></td><td>'.
+ '<tr><td><img src="'.WT_STATIC_URL.WT_MODULES_DIR.'/tree/images/compact.png"'.$imgStyle.' alt="c/e" /></td><td>'.
WT_I18N::translate('Compact tree / fixed boxes : switch beetween fixed-width boxes and compact tree. <i>fixed-width</i> display one generation\'s boxes in one column, and <i>compact</i> display more persons on the same area.').'</td></tr>'.
// function not enabled yet
// '<tr><td><img src="'.$WT_IMAGES['media'].'"'.$imgStyle.' alt="open" /></td><td>'.
// WT_I18N::translate('Open details for all displayed boxes. Could be long.').'</td></tr>'.
'<tr><td><img src="'.$WT_IMAGES["fambook"].'"'.$imgStyle.' alt="close" /></td><td>'.
WT_I18N::translate('Close all opened boxes.').'</td></tr>'.
- '<tr><td><img src="'.WT_MODULES_DIR.'/tree/images/print.png"'.$imgStyle.' alt="print" /></td><td>'.
+ '<tr><td><img src="'.WT_STATIC_URL.WT_MODULES_DIR.'/tree/images/print.png"'.$imgStyle.' alt="print" /></td><td>'.
WT_I18N::translate('Download full resolution medias instead of thumbnails for opened person\'s boxes and open the print dialog when done.').'</td></tr>'.
'<tr><td><img src="'.$WT_IMAGES["sfamily"].'"'.$imgStyle.' alt="partners" /></td><td>'.
WT_I18N::translate('Show / hide multiples life partners or spouses.').'</td></tr>'.
diff --git a/modules_v3/tree/module.php b/modules_v3/tree/module.php
index ba7ffa85cf..674ecd745e 100644
--- a/modules_v3/tree/module.php
+++ b/modules_v3/tree/module.php
@@ -34,19 +34,19 @@ class tree_WT_Module extends WT_Module implements WT_Module_Tab {
function __construct() {
// define the module inclusions for the page header
- $this->headers = '<link rel="stylesheet" type="text/css" href="'.WT_MODULES_DIR.$this->getName().'/css/treeview.css" />';
- $this->js = '<script type="text/javascript" language="javascript" src="'.WT_MODULES_DIR.$this->getName().'/js/treeview.js"></script>';
+ $this->headers = '<link rel="stylesheet" type="text/css" href="'.WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/css/treeview.css" />';
+ $this->js = '<script type="text/javascript" language="javascript" src="'.WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/treeview.js"></script>';
// Retrieve the user's personalized style
if (isset($_COOKIE['tvStyle'])) {
$this->style = $_COOKIE['tvStyle'];
- $this->css = '<link id="tvCSS" rel="stylesheet" type="text/css" href="'.WT_MODULES_DIR.$this->getName().'/css/styles/'.$this->style.'/'.$this->style.'.css" />';
+ $this->css = '<link id="tvCSS" rel="stylesheet" type="text/css" href="'.WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/css/styles/'.$this->style.'/'.$this->style.'.css" />';
}
else {
$this->style = false;
$this->css = '';
}
- $this->css .= '<link rel="stylesheet" type="text/css" href="'.WT_MODULES_DIR.$this->getName().'/css/treeview_print.css" media="print" />';
+ $this->css .= '<link rel="stylesheet" type="text/css" href="'.WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/css/treeview_print.css" media="print" />';
}
// Extend WT_Module. This title should be normalized when this module will be added officially