diff options
| author | makitso <makitso@gmail.com> | 2015-01-22 13:23:55 -0700 |
|---|---|---|
| committer | makitso <makitso@gmail.com> | 2015-01-22 13:23:55 -0700 |
| commit | 2b234d3663d0617988d6c90cf8c7dcd87683f6c2 (patch) | |
| tree | 769a1c8dec83bff9113e6630bb616c416268abcb | |
| parent | 9d576aac3e16d94f8eae0d814fcc958c9dcd9af8 (diff) | |
| parent | 8d2596c94f1aaf9d1493f47946ab0cad746e24d0 (diff) | |
| download | webtrees-2b234d3663d0617988d6c90cf8c7dcd87683f6c2.tar.gz webtrees-2b234d3663d0617988d6c90cf8c7dcd87683f6c2.tar.bz2 webtrees-2b234d3663d0617988d6c90cf8c7dcd87683f6c2.zip | |
Merge branch 'master' of https://github.com/fisharebest/webtrees
| -rw-r--r-- | admin.php | 3 | ||||
| -rw-r--r-- | library/WT/Theme/Administration.php | 4 | ||||
| -rw-r--r-- | library/WT/Theme/BaseTheme.php | 38 | ||||
| -rw-r--r-- | library/WT/Theme/Clouds.php | 6 | ||||
| -rw-r--r-- | library/WT/Theme/Colors.php | 6 | ||||
| -rw-r--r-- | library/WT/Theme/Fab.php | 6 | ||||
| -rw-r--r-- | library/WT/Theme/Minimal.php | 6 | ||||
| -rw-r--r-- | library/WT/Theme/Webtrees.php | 8 | ||||
| -rw-r--r-- | library/WT/Theme/Xenea.php | 6 | ||||
| -rw-r--r-- | modules_v3/lightbox/module.php | 6 | ||||
| -rw-r--r-- | modules_v3/stories/module.php | 175 |
11 files changed, 140 insertions, 124 deletions
@@ -96,9 +96,6 @@ $user_languages = WT_DB::prepare( $stats = new WT_Stats(WT_GEDCOM); ?> -<ol class="breadcrumb small"> - <li class="active"><?php echo WT_I18N::translate('Administration'); ?></li> -</ol> <h2><?php echo $controller->getPageTitle(); ?></h2> <div> diff --git a/library/WT/Theme/Administration.php b/library/WT/Theme/Administration.php index 509a7b98b6..934c8395ff 100644 --- a/library/WT/Theme/Administration.php +++ b/library/WT/Theme/Administration.php @@ -32,12 +32,12 @@ class Administration extends BaseTheme { WT_FONT_AWESOME_CSS_URL, WT_BOOTSTRAP_CSS_URL, WT_DATATABLES_BOOTSTRAP_CSS_URL, - $this->cssUrl() . 'style.css', + $this->assetUrl() . 'style.css', ); } /** {@inheritdoc} */ - public function cssUrl() { + public function assetUrl() { return 'themes/_administration/css-1.7.0/'; } diff --git a/library/WT/Theme/BaseTheme.php b/library/WT/Theme/BaseTheme.php index 88fa6e6d31..a8e59791ef 100644 --- a/library/WT/Theme/BaseTheme.php +++ b/library/WT/Theme/BaseTheme.php @@ -165,11 +165,11 @@ abstract class BaseTheme { } /** - * Where are our CSS assets? + * Where are our CSS, JS and other assets? * * @return string A relative path, such as "themes/foo/" */ - public function cssUrl() { + public function assetUrl() { return ''; } @@ -487,12 +487,12 @@ abstract class BaseTheme { */ public function icon(WT_Fact $fact) { $icon = 'images/facts/' . $fact->getTag() . '.png'; - $dir = substr($this->cssUrl(), strlen(WT_STATIC_URL)); + $dir = substr($this->assetUrl(), strlen(WT_STATIC_URL)); if (file_exists($dir . $icon)) { - return '<img src="' . $this->cssUrl() . $icon . '" title="' . WT_Gedcom_Tag::getLabel($fact->getTag()) . '">'; + return '<img src="' . $this->assetUrl() . $icon . '" title="' . WT_Gedcom_Tag::getLabel($fact->getTag()) . '">'; } elseif (file_exists($dir . 'images/facts/NULL.png')) { // Spacer image - for alignment - until we move to a sprite. - return '<img src="' . Theme::theme()->cssUrl() . 'images/facts/NULL.png">'; + return '<img src="' . Theme::theme()->assetUrl() . 'images/facts/NULL.png">'; } else { return ''; } @@ -1532,20 +1532,20 @@ abstract class BaseTheme { 'stats-small-chart-x' => 440, 'stats-small-chart-y' => 125, 'stats-large-chart-x' => 900, - 'image-dline' => $this->cssUrl() . 'images/dline.png', - 'image-dline2' => $this->cssUrl() . 'images/dline2.png', - 'image-hline' => $this->cssUrl() . 'images/hline.png', - 'image-spacer' => $this->cssUrl() . 'images/spacer.png', - 'image-vline' => $this->cssUrl() . 'images/vline.png', - 'image-add' => $this->cssUrl() . 'images/add.png', - 'image-button_family' => $this->cssUrl() . 'images/buttons/family.png', - 'image-minus' => $this->cssUrl() . 'images/minus.png', - 'image-plus' => $this->cssUrl() . 'images/plus.png', - 'image-remove' => $this->cssUrl() . 'images/delete.png', - 'image-search' => $this->cssUrl() . 'images/go.png', - 'image-default_image_F' => $this->cssUrl() . 'images/silhouette_female.png', - 'image-default_image_M' => $this->cssUrl() . 'images/silhouette_male.png', - 'image-default_image_U' => $this->cssUrl() . 'images/silhouette_unknown.png', + 'image-dline' => $this->assetUrl() . 'images/dline.png', + 'image-dline2' => $this->assetUrl() . 'images/dline2.png', + 'image-hline' => $this->assetUrl() . 'images/hline.png', + 'image-spacer' => $this->assetUrl() . 'images/spacer.png', + 'image-vline' => $this->assetUrl() . 'images/vline.png', + 'image-add' => $this->assetUrl() . 'images/add.png', + 'image-button_family' => $this->assetUrl() . 'images/buttons/family.png', + 'image-minus' => $this->assetUrl() . 'images/minus.png', + 'image-plus' => $this->assetUrl() . 'images/plus.png', + 'image-remove' => $this->assetUrl() . 'images/delete.png', + 'image-search' => $this->assetUrl() . 'images/go.png', + 'image-default_image_F' => $this->assetUrl() . 'images/silhouette_female.png', + 'image-default_image_M' => $this->assetUrl() . 'images/silhouette_male.png', + 'image-default_image_U' => $this->assetUrl() . 'images/silhouette_unknown.png', ); if (array_key_exists($parameter_name, $parameters)) { diff --git a/library/WT/Theme/Clouds.php b/library/WT/Theme/Clouds.php index 26c0920b03..f6dc84649d 100644 --- a/library/WT/Theme/Clouds.php +++ b/library/WT/Theme/Clouds.php @@ -27,13 +27,13 @@ use WT_Menu; */ class Clouds extends BaseTheme { /** {@inheritdoc} */ - public function cssUrl() { + public function assetUrl() { return 'themes/clouds/css-1.7.0/'; } /** {@inheritdoc} */ protected function favicon() { - return '<link rel="icon" href="' . $this->cssUrl() . 'favicon.png" type="image/png">'; + return '<link rel="icon" href="' . $this->assetUrl() . 'favicon.png" type="image/png">'; } /** {@inheritdoc} */ @@ -119,7 +119,7 @@ class Clouds extends BaseTheme { protected function stylesheets() { return array( 'themes/clouds/jquery-ui-1.11.2/jquery-ui.css', - $this->cssUrl() . 'style.css', + $this->assetUrl() . 'style.css', ); } diff --git a/library/WT/Theme/Colors.php b/library/WT/Theme/Colors.php index 38e70e50da..de7d683a35 100644 --- a/library/WT/Theme/Colors.php +++ b/library/WT/Theme/Colors.php @@ -35,7 +35,7 @@ class Colors extends Clouds { protected $sub_color; /** {@inheritdoc} */ - public function cssUrl() { + public function assetUrl() { return 'themes/colors/css-1.7.0/'; } @@ -156,8 +156,8 @@ class Colors extends Clouds { protected function stylesheets() { return array( 'themes/colors/jquery-ui-1.11.2/jquery-ui.css', - $this->cssUrl() . 'style.css', - $this->cssUrl() . 'palette/' . $this->sub_color . '.css', + $this->assetUrl() . 'style.css', + $this->assetUrl() . 'palette/' . $this->sub_color . '.css', ); } diff --git a/library/WT/Theme/Fab.php b/library/WT/Theme/Fab.php index 70b594ef98..07e19763e5 100644 --- a/library/WT/Theme/Fab.php +++ b/library/WT/Theme/Fab.php @@ -26,13 +26,13 @@ use WT_Menu; */ class Fab extends BaseTheme { /** {@inheritdoc} */ - public function cssUrl() { + public function assetUrl() { return 'themes/fab/css-1.7.0/'; } /** {@inheritdoc} */ protected function favicon() { - return '<link rel="icon" href="' . $this->cssUrl() . 'favicon.png" type="image/png">'; + return '<link rel="icon" href="' . $this->assetUrl() . 'favicon.png" type="image/png">'; } /** {@inheritdoc} */ @@ -110,7 +110,7 @@ class Fab extends BaseTheme { protected function stylesheets() { return array( 'themes/fab/jquery-ui-1.11.2/jquery-ui.css', - $this->cssUrl() . 'style.css', + $this->assetUrl() . 'style.css', ); } diff --git a/library/WT/Theme/Minimal.php b/library/WT/Theme/Minimal.php index 286d9d6076..b1beddf8c4 100644 --- a/library/WT/Theme/Minimal.php +++ b/library/WT/Theme/Minimal.php @@ -25,13 +25,13 @@ use WT_I18N; */ class Minimal extends BaseTheme { /** {@inheritdoc} */ - public function cssUrl() { + public function assetUrl() { return 'themes/minimal/css-1.7.0/'; } /** {@inheritdoc} */ protected function favicon() { - return '<link rel="icon" href="' . $this->cssUrl() . 'favicon.png" type="image/png">'; + return '<link rel="icon" href="' . $this->assetUrl() . 'favicon.png" type="image/png">'; } /** {@inheritdoc} */ @@ -107,7 +107,7 @@ class Minimal extends BaseTheme { protected function stylesheets() { return array( 'themes/minimal/jquery-ui-1.11.2/jquery-ui.css', - $this->cssUrl() . 'style.css', + $this->assetUrl() . 'style.css', ); } diff --git a/library/WT/Theme/Webtrees.php b/library/WT/Theme/Webtrees.php index 5eb4108e51..f6804195b4 100644 --- a/library/WT/Theme/Webtrees.php +++ b/library/WT/Theme/Webtrees.php @@ -26,13 +26,13 @@ use WT_I18N; */ class Webtrees extends BaseTheme { /** {@inheritdoc} */ - public function cssUrl() { + public function assetUrl() { return 'themes/webtrees/css-1.7.0/'; } /** {@inheritdoc} */ protected function favicon() { - return '<link rel="icon" href="' . $this->cssUrl() . 'favicon.png" type="image/png">'; + return '<link rel="icon" href="' . $this->assetUrl() . 'favicon.png" type="image/png">'; } /** {@inheritdoc} */ @@ -73,7 +73,7 @@ class Webtrees extends BaseTheme { 'chart-background-m' => 'b1cff0', 'distribution-chart-high-values' => '84beff', 'distribution-chart-low-values' => 'c3dfff', - 'image-search' => $this->cssUrl() . 'images/search.png', + 'image-search' => $this->assetUrl() . 'images/search.png', ); if (array_key_exists($parameter_name, $parameters)) { @@ -87,7 +87,7 @@ class Webtrees extends BaseTheme { protected function stylesheets() { return array( 'themes/webtrees/jquery-ui-1.11.2/jquery-ui.css', - $this->cssUrl() . 'style.css', + $this->assetUrl() . 'style.css', ); } diff --git a/library/WT/Theme/Xenea.php b/library/WT/Theme/Xenea.php index d90de4a671..f15e4eb522 100644 --- a/library/WT/Theme/Xenea.php +++ b/library/WT/Theme/Xenea.php @@ -25,13 +25,13 @@ use WT_I18N; */ class Xenea extends BaseTheme { /** {@inheritdoc} */ - public function cssUrl() { + public function assetUrl() { return 'themes/xenea/css-1.7.0/'; } /** {@inheritdoc} */ protected function favicon() { - return '<link rel="icon" href="' . $this->cssUrl() . 'favicon.png" type="image/png">'; + return '<link rel="icon" href="' . $this->assetUrl() . 'favicon.png" type="image/png">'; } /** {@inheritdoc} */ @@ -97,7 +97,7 @@ class Xenea extends BaseTheme { protected function stylesheets() { return array( 'themes/xenea/jquery-ui-1.11.2/jquery-ui.css', - $this->cssUrl() . 'style.css', + $this->assetUrl() . 'style.css', ); } diff --git a/modules_v3/lightbox/module.php b/modules_v3/lightbox/module.php index e3dc30cc9b..dac8f8698d 100644 --- a/modules_v3/lightbox/module.php +++ b/modules_v3/lightbox/module.php @@ -65,19 +65,19 @@ class lightbox_WT_Module extends WT_Module implements WT_Module_Tab { // Add a new media object if ($WT_TREE->getPreference('MEDIA_UPLOAD') >= WT_USER_ACCESS_LEVEL) { $html .= '<span><a href="#" onclick="window.open(\'addmedia.php?action=showmediaform&linktoid=' . $controller->record->getXref() . '\', \'_blank\', \'resizable=1,scrollbars=1,top=50,height=780,width=600\');return false;">'; - $html .= '<img src="' . Theme::theme()->cssUrl() . 'images/image_add.png" id="head_icon" class="icon" title="' . WT_I18N::translate('Add a new media object') . '" alt="' . WT_I18N::translate('Add a new media object') . '">'; + $html .= '<img src="' . Theme::theme()->assetUrl() . 'images/image_add.png" id="head_icon" class="icon" title="' . WT_I18N::translate('Add a new media object') . '" alt="' . WT_I18N::translate('Add a new media object') . '">'; $html .= WT_I18N::translate('Add a new media object'); $html .= '</a></span>'; // Link to an existing item $html .= '<span><a href="#" onclick="window.open(\'inverselink.php?linktoid=' . $controller->record->getXref() . '&linkto=person\', \'_blank\', \'resizable=1,scrollbars=1,top=50,height=300,width=450\');">'; - $html .= '<img src="' . Theme::theme()->cssUrl() . 'images/image_link.png" id="head_icon" class="icon" title="' . WT_I18N::translate('Link to an existing media object') . '" alt="' . WT_I18N::translate('Link to an existing media object') . '">'; + $html .= '<img src="' . Theme::theme()->assetUrl() . 'images/image_link.png" id="head_icon" class="icon" title="' . WT_I18N::translate('Link to an existing media object') . '" alt="' . WT_I18N::translate('Link to an existing media object') . '">'; $html .= WT_I18N::translate('Link to an existing media object'); $html .= '</a></span>'; } if (WT_USER_GEDCOM_ADMIN && $this->get_media()) { // Popup Reorder Media $html .= '<span><a href="#" onclick="reorder_media(\'' . $controller->record->getXref() . '\')">'; - $html .= '<img src="' . Theme::theme()->cssUrl() . 'images/images.png" id="head_icon" class="icon" title="' . WT_I18N::translate('Re-order media') . '" alt="' . WT_I18N::translate('Re-order media') . '">'; + $html .= '<img src="' . Theme::theme()->assetUrl() . 'images/images.png" id="head_icon" class="icon" title="' . WT_I18N::translate('Re-order media') . '" alt="' . WT_I18N::translate('Re-order media') . '">'; $html .= WT_I18N::translate('Re-order media'); $html .= '</a></span>'; } diff --git a/modules_v3/stories/module.php b/modules_v3/stories/module.php index c7f778f7ab..77c7c71ff3 100644 --- a/modules_v3/stories/module.php +++ b/modules_v3/stories/module.php @@ -278,89 +278,108 @@ class stories_WT_Module extends WT_Module implements WT_Module_Tab, WT_Module_Co */ private function config() { require_once WT_ROOT . 'includes/functions/functions_edit.php'; - if (WT_USER_GEDCOM_ADMIN) { - $controller = new WT_Controller_Page; - $controller - ->setPageTitle($this->getTitle()) - ->pageHeader() - ->addExternalJavascript(WT_JQUERY_DATATABLES_URL) - ->addInlineJavascript(' - jQuery("#story_table").dataTable({ - dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\', - ' . WT_I18N::datatablesI18N() . ', - autoWidth: false, - paging: true, - pagingType: "full_numbers", - lengthChange: true, - filter: true, - info: true, - jQueryUI: true, - sorting: [[0,"asc"]], - columns: [ - /* 0-name */ null, - /* 1-NAME */ null, - /* 2-NAME */ { sortable:false }, - /* 3-NAME */ { sortable:false } - ] - }); - '); + $controller = new WT_Controller_Page; + $controller + ->restrictAccess(WT_USER_GEDCOM_ADMIN) + ->setPageTitle($this->getTitle()) + ->pageHeader() + ->addExternalJavascript(WT_JQUERY_DATATABLES_URL) + ->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL) + ->addInlineJavascript(' + jQuery("#story_table").dataTable({ + ' . WT_I18N::datatablesI18N() . ', + autoWidth: false, + paging: true, + pagingType: "full_numbers", + lengthChange: true, + filter: true, + info: true, + sorting: [[0,"asc"]], + columns: [ + /* 0-name */ null, + /* 1-NAME */ null, + /* 2-NAME */ { sortable:false }, + /* 3-NAME */ { sortable:false } + ] + }); + '); - $stories = WT_DB::prepare( - "SELECT block_id, xref" . - " FROM `##block` b" . - " WHERE module_name=?" . - " AND gedcom_id=?" . - " ORDER BY xref" - )->execute(array($this->getName(), WT_GED_ID))->fetchAll(); + $stories = WT_DB::prepare( + "SELECT block_id, xref" . + " FROM `##block` b" . + " WHERE module_name=?" . + " AND gedcom_id=?" . + " ORDER BY xref" + )->execute(array($this->getName(), WT_GED_ID))->fetchAll(); - ?> - <ol class="breadcrumb small"> - <li><a href="admin.php"><?php echo WT_I18N::translate('Administration'); ?></a></li> - <li><a href="admin_modules.php"><?php echo WT_I18N::translate('Module administration'); ?></a></li> - <li class="active"><?php echo $controller->getPageTitle(); ?></li> - </ol> - <h2><?php echo $controller->getPageTitle(); ?></h2> - <?php + ?> + <ol class="breadcrumb small"> + <li><a href="admin.php"><?php echo WT_I18N::translate('Administration'); ?></a></li> + <li><a href="admin_modules.php"><?php echo WT_I18N::translate('Module administration'); ?></a></li> + <li class="active"><?php echo $controller->getPageTitle(); ?></li> + </ol> + <h2><?php echo $controller->getPageTitle(); ?></h2> - echo - '<form>', - WT_I18N::translate('Family tree'), ' ', - '<input type="hidden" name="mod" value="', $this->getName(), '">', - '<input type="hidden" name="mod_action" value="admin_config">', - select_edit_control('ged', WT_Tree::getNameList(), null, WT_GEDCOM), - '<input type="submit" value="', WT_I18N::translate('show'), '">', - '</form>'; + <form class="form form-inline"> + <label for="ged" class="sr-only"> + <?php echo WT_I18N::translate('Family tree'); ?> + </label> + <input type="hidden" name="mod" value="<?php echo $this->getName(); ?>"> + <input type="hidden" name="mod_action" value="admin_config"> + <?php echo select_edit_control('ged', WT_Tree::getNameList(), null, WT_GEDCOM, 'class="form-control"'); ?> + <input type="submit" class="btn btn-primary" value="<?php echo WT_I18N::translate('show'); ?>"> + </form> - echo '<h3><a href="module.php?mod=', $this->getName(), '&mod_action=admin_edit">', WT_I18N::translate('Add a story'), '</a></h3>'; - if (count($stories) > 0) { - echo '<table id="story_table">'; - echo '<thead><tr> - <th>', WT_I18N::translate('Story title'), '</th> - <th>', WT_I18N::translate('Individual'), '</th> - <th></th> - <th></th> - </tr></thead>'; - } - echo '<tbody>'; - foreach ($stories as $story) { - $story_title = get_block_setting($story->block_id, 'title'); - $indi = WT_Individual::getInstance($story->xref); - if ($indi) { - echo '<tr><td><a href="', $indi->getHtmlUrl() . '#stories">', $story_title, '</a></td> - <td><a href="', $indi->getHtmlUrl() . '#stories">' . $indi->getFullName(), '</a></td>'; - } else { - echo '<tr><td>', $story_title, '</td><td class="error">', $story->xref, '</td>'; - } - echo '<td><a href="module.php?mod=', $this->getName(), '&mod_action=admin_edit&block_id=', $story->block_id, '"><div class="icon-edit"> </div></a></td> - <td><a href="module.php?mod=', $this->getName(), '&mod_action=admin_delete&block_id=', $story->block_id, '" onclick="return confirm(\'', WT_I18N::translate('Are you sure you want to delete this story?'), '\');"><div class="icon-delete"> </div></a></td> - </tr>'; - } - echo '</tbody></table>'; - } else { - header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH); - exit; - } + <p> + <a href="module.php?mod=<?php echo $this->getName(); ?>&mod_action=admin_edit" class="btn btn-default"> + <i class="fa fa-plus"></i> + <?php echo WT_I18N::translate('Add a story'); ?> + </a> + </p> + + <table class="table table-bordered table-condensed"> + <thead> + <tr> + <th><?php echo WT_I18N::translate('Story title'); ?></th> + <th><?php echo WT_I18N::translate('Individual'); ?></th> + <th><?php echo WT_I18N::translate('Edit'); ?></th> + <th><?php echo WT_I18N::translate('Delete'); ?></th> + </tr> + </thead> + <tbody> + <?php foreach ($stories as $story): ?> + <tr> + <td> + <?php echo WT_Filter::escapeHtml(get_block_setting($story->block_id, 'title')); ?> + </td> + <td> + <?php if ($indi = WT_Individual::getInstance($story->xref)): ?> + <a href="<?php echo $indi->getHtmlUrl(); ?>#stories"> + <?php echo $indi->getFullName(); ?> + </a> + <?php else: ?> + <?php echo $story->xref; ?> + <?php endif; ?> + </td> + <td> + <a href="module.php?mod=', $this->getName(), '&mod_action=admin_edit&block_id=', $story->block_id, '"> + <div class="icon-edit"> </div> + </a> + </td> + <td> + <a + href="module.php?mod=<?php echo $this->getName(); ?>&mod_action=admin_delete&block_id=<?php echo $story->block_id; ?>" + onclick="return confirm('<?php echo WT_I18N::translate('Are you sure you want to delete this story?'); ?>');" + > + <div class="icon-delete"> </div> + </a> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php } /** |
