ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 1122


Ignore:
Timestamp:
Dec 11, 2006, 8:19:39 PM (14 years ago)
Author:
ishida
Message:

#323 NoImage画像も「デフォルトに戻す」機能
実装完了

Location:
OpenPNE/branches/ishida/prj_dev26
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/ishida/prj_dev26/webapp/lib/db/etc.php

    r1015 r1122  
    649649}
    650650
     651/**
     652 * デフォルト画像をマスター画像からコピー(デフォルトに戻すの一環)
     653 */
     654function db_master_copy_c_skin_filename($skinname)
     655{
     656
     657    $data = array(
     658        'skinname' => strval($skinname),
     659        'filename' => 'skin_'.strval($skinname).'.gif',
     660    );
     661    db_insert('c_skin_filename', $data);
     662
     663    $sql = "INSERT INTO c_image (SELECT '', ?, bin, ?, type FROM c_image WHERE filename = ?)";
     664    $params = array(
     665        'skin_'.strval($skinname).'.gif',
     666        db_now(),
     667        'skin_'.strval($skinname).'_master.gif',
     668    );
     669    db_query($sql, $params);
     670}
     671
    651672//---
    652673
  • OpenPNE/branches/ishida/prj_dev26/webapp/modules/admin/do/delete_skin_image.php

    r2 r1122  
    1212        db_delete_c_skin_filename($requests['skinname']);
    1313
     14        //マスタ-画像からコピーするスキン名
     15        $skinname_list = array(
     16            'no_image',
     17            'no_logo',
     18            'no_logo_small',
     19        );
     20        if (in_array($requests['skinname'], $skinname_list)) {
     21            db_master_copy_c_skin_filename($requests['skinname']);
     22        }
     23
    1424        admin_client_redirect('edit_skin_image', '画像をデフォルトに戻しました');
    1525    }
  • OpenPNE/branches/ishida/prj_dev26/webapp/modules/admin/templates/edit_skin_image.tpl

    r278 r1122  
    508508({assign var=skinname value=no_image})
    509509<img src="({t_img_url_skin filename=$skinname w=180 h=180})">
     510({if $skin_list[$skinname] != "skin_$skinname.gif"})<br><br>[<a href="?m=({$module_name})&amp;a=do_({$hash_tbl->hash('delete_skin_image','do')})&amp;skinname=({$skinname})&amp;sessid=({$PHPSESSID})">デフォルトに戻す</a>]({/if})
    510511</td>
    511512<td class="skin_image">
    512513({assign var=skinname value=no_logo})
    513514<img src="({t_img_url_skin filename=$skinname w=180 h=180})">
     515({if $skin_list[$skinname] != "skin_$skinname.gif"})<br><br>[<a href="?m=({$module_name})&amp;a=do_({$hash_tbl->hash('delete_skin_image','do')})&amp;skinname=({$skinname})&amp;sessid=({$PHPSESSID})">デフォルトに戻す</a>]({/if})
    514516</td>
    515517<td class="skin_image">
    516518({assign var=skinname value=no_logo_small})
    517519<img src="({t_img_url_skin filename=$skinname w=76 h=76})">
     520({if $skin_list[$skinname] != "skin_$skinname.gif"})<br><br>[<a href="?m=({$module_name})&amp;a=do_({$hash_tbl->hash('delete_skin_image','do')})&amp;skinname=({$skinname})&amp;sessid=({$PHPSESSID})">デフォルトに戻す</a>]({/if})
    518521</td>
    519522</tr>
Note: See TracChangeset for help on using the changeset viewer.