Changeset 3791


Ignore:
Timestamp:
Aug 24, 2009, 7:03:22 PM (11 years ago)
Author:
nikrou
Message:

Allow admin to change number of column
Use $confdir_thumbnail and $confprefix_thumbnail in ak_jquery-load.js for replace('thumbnail\/TN-', )

Location:
extensions/akBookStyle/trunk
Files:
2 added
1 deleted
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • extensions/akBookStyle/trunk/admin.php

    r3764 r3791  
    2525}
    2626
     27load_language('plugin.lang', AK_PLUGIN_LANG);
     28
     29$me = get_plugin_data($plugin_id);
     30$save_config = false;
     31
     32if (!empty($_POST['submit'])) {
     33  if (!empty($_POST['ak_by_line']) && intval($_POST['ak_by_line'])!=$me->ak_by_line) {
     34    $me->ak_by_line = intval($_POST['ak_by_line']);
     35    array_push($GLOBALS['page']['infos'], $lang['ak_by_line_changed']);
     36    $save_config = true;
     37  }
     38
     39  if ($save_config) {
     40    $me->save_config();
     41  }
     42}
     43
    2744$GLOBALS['template']->set_filenames(array('plugin_admin_content' => AK_PLUGIN_TEMPLATE . '/admin.tpl'));
     45$GLOBALS['template']->assign('AK_PLUGIN_CSS', AK_PLUGIN_CSS);
     46$GLOBALS['template']->assign('AK_BY_LINE', $me->ak_by_line);
    2847$GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    2948?>
  • extensions/akBookStyle/trunk/css/ak_style.css

    r3773 r3791  
    22}
    33
     4table.ak_display tr td {
     5  vertical-align: top;
     6}
     7
    48td table.thumbnails {
    5         margin-right:20%;
     9  margin-right:20%;
    610}
    711
    812tr.nline {
    9         max-height:90px;
    10         overflow:hidden;
     13  max-height:90px;
     14  overflow:hidden;
    1115}
    1216
    1317td.ncol {
    14         max-height:90px;
    15         max-width:90px;
    16         overflow:hidden;
    17         text-align:center;
    18         padding:2px 8px;
     18  max-height:90px;
     19  max-width:90px;
     20  overflow:hidden;
     21  text-align:center;
     22  padding:2px 8px;
    1923}
    2024
    2125td.ak_pic {
    22         min-width:640px;
    23         text-align:center;
     26  min-width:640px;
     27  text-align:center;
    2428}
    2529
    2630a.load {
    27         height:90px;
    28         width:90px;
     31  height:90px;
     32  width:90px;
    2933}
    3034
    3135a.load img {
    32         height:90px;
    33         overflow:hidden;
     36  height:90px;
     37  overflow:hidden;
    3438}
    3539
    3640td.left {
    37         text-align:left;
     41  text-align:left;
    3842}
    3943
  • extensions/akBookStyle/trunk/default_values.inc.php

    r3790 r3791  
    2525}
    2626
    27 $GLOBALS['template']->set_filenames(array('plugin_admin_content' => AK_PLUGIN_TEMPLATE . '/admin.tpl'));
    28 $GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
     27$default_values['ak_by_line'] = 2;
    2928?>
  • extensions/akBookStyle/trunk/include/akConfig.class.php

    r3764 r3791  
    4646      $this->config = $c;
    4747    }
     48
     49    $this->setDefaults();
    4850  }
    4951
     
    7779    return $menu;
    7880  }
     81
     82  private function setDefaults() {
     83    include_once $this->plugin_dir.'/default_values.inc.php';
     84
     85    foreach ($default_values as $key => $value) {
     86      if (empty($this->config[$key])) {
     87        $this->config[$key] = $value;
     88      }
     89    }
     90  }
    7991}
    8092?>
  • extensions/akBookStyle/trunk/include/akContent.class.php

    r3788 r3791  
    4545
    4646    $template->set_filenames(array('index_thumbnails'=> AK_PLUGIN_TEMPLATE . '/ak_thumbnails.tpl'));
    47     $template->assign('AK_PIC_SRC', get_image_url($images[$this->current_picture]));
    48     $template->assign('AK_BY_LINE', 3);
    49     $template->assign('AK_RELOADED_IMAGE_TPL', AK_PLUGIN_TEMPLATE. '/ak_reloaded_image.tpl');
    5047    $template->assign('AK_PLUGIN_CSS', AK_PLUGIN_CSS);
    5148    $template->assign('AK_PLUGIN_JS', AK_PLUGIN_JS);
     49
     50    $template->assign('AK_DIR_THUMBNAIL', $GLOBALS['conf']['dir_thumbnail']);
     51    $template->assign('AK_PREFIX_THUMBNAIL', $GLOBALS['conf']['prefix_thumbnail']);
     52    $template->assign('AK_PIC_SRC', get_image_url($images[$this->current_picture]));
     53    $template->assign('AK_BY_LINE', $this->plugin_config->ak_by_line);
     54    $template->assign('AK_RELOADED_IMAGE_TPL', AK_PLUGIN_TEMPLATE. '/ak_reloaded_image.tpl');
    5255  }
    5356
  • extensions/akBookStyle/trunk/js/ak_jquery-load.js

    r3788 r3791  
    22    $("a.load")
    33      .click(function() {
    4           $('#akPicture').attr('src', $(this).children('img').attr('src').replace('thumbnail\/TN-', ''));
     4          $('#akPicture').attr('src', $(this).children('img').attr('src').replace(dir_thumbnail+'\/'+prefix_thumbnail, ''));
    55          return false;
    66        });
  • extensions/akBookStyle/trunk/language/en_UK/plugin.lang.php

    r3764 r3791  
    11<?php
     2/** admin **/
    23$lang['ak_title'] = "ak Book Style";
    34$lang['ak_intro'] = "That plugin give an alternate presentation for galleries. It gives you in a whole page access to medium image and thumbnails.";
    45$lang['ak_info'] = "";
     6
     7$lang['ak_general_config'] = "Main configuration";
     8$lang['ak_by_line'] = "Number of column";
     9$lang['ak_by_line_changed'] = "Number of column has been updated";
    510?>
  • extensions/akBookStyle/trunk/language/fr_FR/plugin.lang.php

    r3764 r3791  
    11<?php
     2/** admin **/
    23$lang['ak_title'] = "ak Book Style";
    34$lang['ak_intro'] = "Ce plugin permet de gérer une présentation alternative de votre galerie avec les miniatures sur la même page qu'une photo medium.";
    45$lang['ak_info'] = "";
     6
     7$lang['ak_general_config'] = "Configuration générale";
     8$lang['ak_by_line'] = "Nombre de colonnes";
     9$lang['ak_by_line_changed'] = "Le nombre de colonne a été mis à jour";
     10
    511?>
  • extensions/akBookStyle/trunk/template/admin.tpl

    r3764 r3791  
    1111</p>
    1212
     13<form method="post" action="" class="general">
     14<fieldset>
     15  <legend>{'ak_general_config'|@translate}</legend>
     16  <p class="field">
     17    <label>{'ak_by_line'|@translate}
     18      <input type="text" name="ak_by_line" value="{$AK_BY_LINE}">
     19    </label>
     20  </p>
     21</fieldset>
     22
     23<p><input class="submit" type="submit" name="submit" value="{'Submit'|@translate}"></p>
     24</form>
     25
     26{html_head}
     27<link rel="stylesheet" type="text/css" href="{$AK_PLUGIN_CSS}/ak_admin_style.css">
     28{/html_head}
  • extensions/akBookStyle/trunk/template/ak_reloaded_image.tpl

    r3788 r3791  
    1 {if !empty($AK_PIC_SRC) or true}
     1{if !empty($AK_PIC_SRC) }
    22<div id="reload">
    33  <table class="picture">
     
    3737</div>
    3838{/if}
    39 
    40 
    41 {known_script id="jquery" src=$ROOT_URL|cat:"template-common/lib/jquery.packed.js"}
    42 {html_head}
    43 <link rel="stylesheet" type="text/css" href="{$AK_PLUGIN_CSS}/ak_style.css">
    44 {literal}
    45 <script type="text/javascript">// <![CDATA[
    46 $(document).ready(function() {
    47   $("a.load")
    48   .click(function() {
    49   $("#reload").load("./plugins/ak_loader.php?"+this.href);
    50     return false;
    51   });
    52 });
    53  // ]]>
    54 </script>
    55 {/literal}
    56 {/html_head}
  • extensions/akBookStyle/trunk/template/ak_thumbnails.tpl

    r3788 r3791  
    2929  <tr>
    3030    <td>
    31 
    3231      <table class="thumbnails">
    3332        {foreach from=$thumbnails item=thumbnail name=tn}
     
    3635          {/if}
    3736          <td class="ncol">
    38             <a href="{$thumbnail.URL}" class="load">
     37            <a href="{$thumbnail.AK_URL}" class="load">
    3938              <img class="thumbnail" src="{$thumbnail.TN_SRC}"
    4039             alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}">
     
    7271    </td>
    7372   
    74     <td> <!-- Picture -->
     73    <td> {* Picture *}
    7574      {include file=$AK_RELOADED_IMAGE_TPL|@get_extent:'picture_reload'}
    7675    </td>
     
    7877</table>
    7978{/if}
     79
    8080{known_script id="jquery" src=$ROOT_URL|cat:"template-common/lib/jquery.packed.js"}
    8181{html_head}
    8282<link rel="stylesheet" type="text/css" href="{$AK_PLUGIN_CSS}/ak_style.css">
     83<script type="text/javascript">
     84var dir_thumbnail = '{$AK_DIR_THUMBNAIL}';prefix_thumbnail = '{$AK_PREFIX_THUMBNAIL}';
     85</script>
    8386<script type="text/javascript" src="{$AK_PLUGIN_JS}/ak_jquery-load.js"></script>
    8487{/html_head}
Note: See TracChangeset for help on using the changeset viewer.