Changeset 5189


Ignore:
Timestamp:
03/19/10 14:15:02 (10 years ago)
Author:
plg
Message:

feature 724: bug fixed on element_set_unit for FCKB, better use
$("#tags-123, #tags-456") than $(".tags") to apply FCKB widget on
the select box.

Use a dedicated function to return the tag list, formatted for FCKB.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin.php

    r5173 r5189  
    4040  $query = ' 
    4141SELECT 
    42     id, 
    43     name 
     42    id AS tag_id, 
     43    name AS tag_name 
    4444  FROM '.TAGS_TABLE.' 
    4545;'; 
    46   $result = pwg_query($query); 
    47   $taglist = array(); 
    48   while ($row = pwg_db_fetch_assoc($result)) 
    49   { 
    50     array_push( 
    51       $taglist, 
    52       array( 
    53         'caption' => $row['name'], 
    54         'value' => '~~'.$row['id'].'~~', 
    55         ) 
    56       ); 
    57   } 
    58   echo json_encode($taglist); 
     46  echo json_encode(get_fckb_taglist($query)); 
    5947  exit(); 
    6048} 
  • trunk/admin/themes/default/template/element_set_unit.tpl

    r5188 r5189  
    44 
    55{known_script id="jquery.fcbkcomplete" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.fcbkcomplete.js"} 
     6<script type="text/javascript"> 
     7  var tag_boxes_selector = ""; 
     8{foreach from=$elements item=element name=element} 
     9  {if $smarty.foreach.element.first} 
     10  var prefix = ""; 
     11  {else} 
     12  prefix = ", "; 
     13  {/if} 
     14  tag_boxes_selector = tag_boxes_selector + prefix + "#tags-" + {$element.ID}; 
     15{/foreach} 
    616{literal} 
    7 <script type="text/javascript"> 
    817  $(document).ready(function() { 
    9     $(".tags").fcbkcomplete({ 
     18    $(tag_boxes_selector).fcbkcomplete({ 
    1019      json_url: "admin.php?fckb_tags=1", 
    1120      cache: false, 
     
    97106      <td> 
    98107 
    99 <select class="tags" name="tags-{$element.ID}"> 
     108<select id="tags-{$element.ID}" name="tags-{$element.ID}"> 
    100109{foreach from=$element.TAGS item=tag} 
    101110  <option value="{$tag.value}" class="selected">{$tag.caption}</option> 
Note: See TracChangeset for help on using the changeset viewer.