diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2005-08-07 17:45:10 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2005-08-07 17:45:10 +0000 |
| commit | bd892588c4e5d87c3baa92f97b0ca5dd6755bda7 (patch) | |
| tree | a450253bb359f02d574cd4f25530818f883ce9b5 | |
| parent | 94cbc9a6ab0edf3da14f485a7fcb8d981ef43641 (diff) | |
| download | themes-bd892588c4e5d87c3baa92f97b0ca5dd6755bda7.tar.gz themes-bd892588c4e5d87c3baa92f97b0ca5dd6755bda7.tar.bz2 themes-bd892588c4e5d87c3baa92f97b0ca5dd6755bda7.zip | |
merge recent changes from R1 to HEAD
| -rw-r--r-- | admin/admin_content_templates.php | 4 | ||||
| -rw-r--r-- | base.css | 4 | ||||
| -rw-r--r-- | templates/admin_content_templates.tpl | 28 | ||||
| -rw-r--r-- | templates/admin_themes_manager.tpl | 4 | ||||
| -rw-r--r-- | templates/edit_css.tpl | 10 | ||||
| -rw-r--r-- | templates/header_inc.tpl | 24 | ||||
| -rw-r--r-- | templates/theme_control.tpl | 20 | ||||
| -rw-r--r-- | templates/theme_control_objects.tpl | 22 | ||||
| -rw-r--r-- | templates/theme_control_sections.tpl | 12 | ||||
| -rw-r--r-- | templates_lib.php | 35 | ||||
| -rw-r--r-- | theme_control_lib.php | 48 |
11 files changed, 111 insertions, 100 deletions
diff --git a/admin/admin_content_templates.php b/admin/admin_content_templates.php index 43950ff..945111f 100644 --- a/admin/admin_content_templates.php +++ b/admin/admin_content_templates.php @@ -1,6 +1,6 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_themes/admin/Attic/admin_content_templates.php,v 1.2 2005/08/01 18:41:27 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_themes/admin/Attic/admin_content_templates.php,v 1.3 2005/08/07 17:45:04 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. @@ -25,7 +25,7 @@ if (!isset($_REQUEST["template_id"])) { $gBitSmarty->assign('template_id', $_REQUEST["template_id"]); if ($_REQUEST["template_id"]) { - $info = $gBitSystem->get_template($_REQUEST["template_id"]); + $info = $templateslib->get_template($_REQUEST["template_id"]); if ($templateslib->template_is_in_section($_REQUEST["template_id"], 'html')) { $info["section_html"] = 'y'; @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/bitweaver/_bit_themes/Attic/base.css,v 1.3 2005/07/17 17:36:18 squareing Exp $ */ +/* $Header: /cvsroot/bitweaver/_bit_themes/Attic/base.css,v 1.4 2005/08/07 17:45:04 squareing Exp $ */ /* essential and basic css settings */ body {background:#fff; margin:0; padding:0;} table {border-collapse:collapse; border-spacing:0; padding:0; margin:0; width:100%;} @@ -19,6 +19,8 @@ pre, code {font-family:monospace; font-size:12px; overflow:auto; text-align:left .menu .item {display:block;} .highlight {font-weight:bolder;} a.create {font-style:italic} +a.skip {position:absolute; top:0; left:-999em;} +a.skip:active, a.skip:focus {left:0em;} .quicktag {margin:1px;} .selected {font-weight:bolder} .floaticon {float:right;} diff --git a/templates/admin_content_templates.tpl b/templates/admin_content_templates.tpl index 75c4cd0..7e4d388 100644 --- a/templates/admin_content_templates.tpl +++ b/templates/admin_content_templates.tpl @@ -12,11 +12,11 @@ {/if}
{if $template_id > 0}
<h2>{tr}Edit this template:{/tr} {$info.name}</h2>
- <a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php">{tr}Create new template{/tr}</a>
+ <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php">{tr}Create new template{/tr}</a>
{else}
<h2>{tr}Create new template{/tr}</h2>
{/if}
- <form action="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php" method="post">
+ <form action="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php" method="post">
<input type="hidden" name="template_id" value="{$template_id|escape}" />
<div class="panel">
<div class="row">
@@ -60,7 +60,7 @@ <table class="find">
<tr><td>{tr}Find{/tr}</td>
<td>
- <form method="get" action="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php">
+ <form method="get" action="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php">
<input type="text" name="find" value="{$find|escape}" />
<input type="submit" value="{tr}find{/tr}" name="search" />
<input type="hidden" name="sort_mode" value="{$sort_mode|escape}" />
@@ -71,8 +71,8 @@ <table class="data">
<tr>
- <th><a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}name{/tr}</a></th>
- <th><a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={if $sort_mode eq 'created_desc'}created_asc{else}created_desc{/if}">{tr}last modif{/tr}</a></th>
+ <th><a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}name{/tr}</a></th>
+ <th><a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={if $sort_mode eq 'created_desc'}created_asc{else}created_desc{/if}">{tr}last modif{/tr}</a></th>
<th>{tr}sections{/tr}</th>
<th>{tr}action{/tr}</th>
</tr>
@@ -83,12 +83,12 @@ <td>{$channels[user].created|bit_short_datetime}</td>
<td>
{section name=ix loop=$channels[user].sections}
- {$channels[user].sections[ix]} <a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?removesection={$channels[user].sections[ix]}&rtemplate_id={$channels[user].template_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this template?{/tr}')" title="{tr}Click here to delete this template{/tr}">{biticon ipackage=liberty iname="delete_small" iexplain="remove"}</a> |
+ {$channels[user].sections[ix]} <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?removesection={$channels[user].sections[ix]}&rtemplate_id={$channels[user].template_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this template?{/tr}')" title="{tr}Click here to delete this template{/tr}">{biticon ipackage=liberty iname="delete_small" iexplain="remove"}</a> |
{/section}
</td>
<td>
- <a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].template_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this template?{/tr}')" title="{tr}Click here to delete this template{/tr}">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a>
- <a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={$sort_mode}&template_id={$channels[user].template_id}"><img class="icon" alt="{tr}Edit{/tr}" src="{$gBitLoc.LIBERTY_PKG_URL}icons/edit.gif" /></a>
+ <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].template_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this template?{/tr}')" title="{tr}Click here to delete this template{/tr}">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a>
+ <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={$sort_mode}&template_id={$channels[user].template_id}"><img class="icon" alt="{tr}Edit{/tr}" src="{$smarty.const.LIBERTY_PKG_URL}icons/edit.gif" /></a>
</td>
</tr>
{else}
@@ -97,12 +97,12 @@ <td>{$channels[user].created|bit_short_datetime}</td>
<td>
{section name=ix loop=$channels[user].sections}
- {$channels[user].sections[ix]} <a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?removesection={$channels[user].sections[ix]}&rtemplate_id={$channels[user].template_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this template?{/tr}')" title="{tr}Click here to delete this template{/tr}">{biticon ipackage=liberty iname="delete_small" iexplain="remove"}</a> |
+ {$channels[user].sections[ix]} <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?removesection={$channels[user].sections[ix]}&rtemplate_id={$channels[user].template_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this template?{/tr}')" title="{tr}Click here to delete this template{/tr}">{biticon ipackage=liberty iname="delete_small" iexplain="remove"}</a> |
{/section}
</td>
<td>
- <a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].template_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this template?{/tr}')" title="{tr}Click here to delete this template{/tr}">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a>
- <a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={$sort_mode}&template_id={$channels[user].template_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a>
+ <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].template_id}" onclick="return confirmTheLink(this,'{tr}Are you sure you want to delete this template?{/tr}')" title="{tr}Click here to delete this template{/tr}">{biticon ipackage=liberty iname="delete" iexplain="remove"}</a>
+ <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?offset={$offset}&sort_mode={$sort_mode}&template_id={$channels[user].template_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a>
</td>
</tr>
{/if}
@@ -115,17 +115,17 @@ <div class="pagination">
{if $prev_offset >= 0}
- [<a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}prev{/tr}</a>]
+ [<a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}prev{/tr}</a>]
{/if}
{tr}Page{/tr}: {$actual_page}/{$cant_pages}
{if $next_offset >= 0}
- [<a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}next{/tr}</a>]
+ [<a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}next{/tr}</a>]
{/if}
{if $direct_pagination eq 'y'}
<br />
{section loop=$cant_pages name=foo}
{assign var=selector_offset value=$smarty.section.foo.index|times:$maxRecords}
- <a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_content_templates.php?find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}">
+ <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_content_templates.php?find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}">
{$smarty.section.foo.index_next}</a>
{/section}
{/if}
diff --git a/templates/admin_themes_manager.tpl b/templates/admin_themes_manager.tpl index 7faedc5..bda984e 100644 --- a/templates/admin_themes_manager.tpl +++ b/templates/admin_themes_manager.tpl @@ -16,11 +16,11 @@ {if $style eq $s.style} {biticon ipackage=liberty iname=success iexplain="Current Theme"} {/if} - <a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_themes_manager.php?site_style={$s.style}">{$s.style}</a> + <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_themes_manager.php?site_style={$s.style}">{$s.style}</a> </h2> {if $s.preview} - <a href="{$gBitLoc.THEMES_PKG_URL}admin/admin_themes_manager.php?site_style={$s.style}"> + <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_themes_manager.php?site_style={$s.style}"> <img class="thumb" src="{$s.preview}" alt="{tr}Theme Preview{/tr}" title="{$s.style}" /> </a> {/if} diff --git a/templates/edit_css.tpl b/templates/edit_css.tpl index 54e2ec7..424a3f1 100644 --- a/templates/edit_css.tpl +++ b/templates/edit_css.tpl @@ -14,7 +14,7 @@ return false; </script> {/literal} -<a class="pagetitle" href="{$gBitLoc.THEMES_PKG_URL}edit_css.php">{tr}Edit Custom Theme{/tr}</a><br /><br /> +<a class="pagetitle" href="{$smarty.const.THEMES_PKG_URL}edit_css.php">{tr}Edit Custom Theme{/tr}</a><br /><br /> {if $successMsg} <div style="color: green">{$successMsg}</div> {/if} @@ -22,7 +22,7 @@ return false; <div style="color: red">{$errorMsg}</div> {/if} <div> - <form method="post" action="{$gBitLoc.THEMES_PKG_URL}edit_css.php"> + <form method="post" action="{$smarty.const.THEMES_PKG_URL}edit_css.php"> <div style="padding:4px;border-bottom:1px solid #c3b3a3;"> <textarea name="textData" rows="42" cols="80" wrap="virtual" style="padding:7px;padding-right:0;">{$data|escape}</textarea> </div> @@ -63,9 +63,9 @@ return false; <td cellpadding="3"> {biticon ipackage=liberty iname=view iexplain=preview onclick="javascript"} {biticon ipackage=liberty iname=view iexplain=preview onclick="javascript:popup('preview_image.php?fImg=$customCSSImageURL/$themeImages[ix]')"} - <a href="{$gBitLoc.THEMES_PKG_URL}/edit_css.php?fDeleteImg={$themeImages[ix]}"> + <a href="{$smarty.const.THEMES_PKG_URL}/edit_css.php?fDeleteImg={$themeImages[ix]}"> {biticon ipackage=liberty iname=delete iexplain=remove onclick="return confirm('Are you sure you want to delete $themeImages[ix]?');"} - <img class="icon" src="{$gBitLoc.LIBERTY_PKG_URL}icons/delete.gif" title="{tr}Remove{/tr}" alt="{tr}Remove{/tr}" onclick="return confirm('Are you sure you want to delete {$themeImages[ix]}?');"/> + <img class="icon" src="{$smarty.const.LIBERTY_PKG_URL}icons/delete.gif" title="{tr}Remove{/tr}" alt="{tr}Remove{/tr}" onclick="return confirm('Are you sure you want to delete {$themeImages[ix]}?');"/> </a> </input> </td> @@ -73,7 +73,7 @@ return false; {/section} </table> <br /> -<form enctype="multipart/form-data" method="post" action="{$gBitLoc.THEMES_PKG_URL}edit_css.php" +<form enctype="multipart/form-data" method="post" action="{$smarty.const.THEMES_PKG_URL}edit_css.php" <input type="hidden" name="MAX_FILE_SIZE" value="1024000"> Upload Image: <input type="file" name="fImgUpload"> <br /> <br/> <input type="submit" value="Upload Image" name="fUpload"> diff --git a/templates/header_inc.tpl b/templates/header_inc.tpl index 8ad806a..0fb0c8f 100644 --- a/templates/header_inc.tpl +++ b/templates/header_inc.tpl @@ -1,27 +1,27 @@ -{* $Header: /cvsroot/bitweaver/_bit_themes/templates/header_inc.tpl,v 1.3 2005/07/25 20:02:52 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_themes/templates/header_inc.tpl,v 1.4 2005/08/07 17:45:10 squareing Exp $ *} {strip} -{if $gBitLoc.styleSheet} - <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitLoc.styleSheet}" media="all" /> +{if $gBitSystem->mStyles.styleSheet} + <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitSystem->mStyles.styleSheet}" media="all" /> {/if} -{if $gBitLoc.browserStyleSheet} - <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitLoc.browserStyleSheet}" media="all" /> +{if $gBitSystem->mStyles.browserStyleSheet} + <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitSystem->mStyles.browserStyleSheet}" media="all" /> {/if} -{if $gBitLoc.customStyleSheet} - <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitLoc.custumStyleSheet}" media="all" /> +{if $gBitSystem->mStyles.customStyleSheet} + <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitSystem->mStyles.custumStyleSheet}" media="all" /> {/if} -{foreach from=$gBitLoc.altStyleSheets item=alt_path key=alt_name} +{foreach from=$gBitSystem->mStyles.altStyleSheets item=alt_path key=alt_name} <link rel="alternate stylesheet" title="{$alt_name}" type="text/css" href="{$alt_path}" media="screen" /> {/foreach} {if $gBitSystemPrefs.disable_jstabs ne 'y'} - <script type="text/javascript" src="{$gBitLoc.THEMES_PKG_URL}js/tabs/tabpane.js"></script> + <script type="text/javascript" src="{$smarty.const.THEMES_PKG_URL}js/tabs/tabpane.js"></script> {/if} {/strip} -{if $gBitLoc.browser.client eq 'ie'} +{if $gSniffer->mBrowserInfo.client eq 'ie'} <!-- this wierdness fixes png display and CSS driven dropdown menus in GUESS WHAT BROWSER --> <!--[if gte IE 5.5000]> - <script type="text/javascript" src="{$gBitLoc.THEMES_PKG_URL}js/sleight.js"></script> + <script type="text/javascript" src="{$smarty.const.THEMES_PKG_URL}js/sleight.js"></script> <![endif]--> <!--[if gte IE 5.0]> <script type="text/javascript"> @@ -31,6 +31,6 @@ {include file=$hoverfix} {/if} </script> - <script type="text/javascript" src="{$gBitLoc.THEMES_PKG_URL}js/hoverfix.js"></script> + <script type="text/javascript" src="{$smarty.const.THEMES_PKG_URL}js/hoverfix.js"></script> <![endif]--> {/if} diff --git a/templates/theme_control.tpl b/templates/theme_control.tpl index 92db7cb..2a63475 100644 --- a/templates/theme_control.tpl +++ b/templates/theme_control.tpl @@ -10,11 +10,11 @@ <h2>{tr}Assign themes to categories{/tr}</h2> <div class="navbar above"> - <a href="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php">{tr}Control by Object{/tr}</a> - <a href="{$gBitLoc.THEMES_PKG_URL}theme_control_sections.php">{tr}Control by Sections{/tr}</a> + <a href="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php">{tr}Control by Object{/tr}</a> + <a href="{$smarty.const.THEMES_PKG_URL}theme_control_sections.php">{tr}Control by Sections{/tr}</a> </div> -<form action="{$gBitLoc.THEMES_PKG_URL}theme_control.php" method="post"> +<form action="{$smarty.const.THEMES_PKG_URL}theme_control.php" method="post"> <table class="panel"> <tr> <th>{tr}Category{/tr}</th> @@ -48,7 +48,7 @@ </form> <h2>{tr}Assigned categories{/tr}</h2> -<form method="get" action="{$gBitLoc.THEMES_PKG_URL}theme_control.php"> +<form method="get" action="{$smarty.const.THEMES_PKG_URL}theme_control.php"> <table class="find"> <tr><td>{tr}Find{/tr}</td> <td> @@ -62,12 +62,12 @@ </form> -<form action="{$gBitLoc.THEMES_PKG_URL}theme_control.php" method="post"> +<form action="{$smarty.const.THEMES_PKG_URL}theme_control.php" method="post"> <table class="data"> <tr> <th> </th> -<th><a href="{$gBitLoc.THEMES_PKG_URL}theme_control.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}category{/tr}</a></th> -<th><a href="{$gBitLoc.THEMES_PKG_URL}theme_control.php?offset={$offset}&sort_mode={if $sort_mode eq 'theme_desc'}theme_asc{else}theme_desc{/if}">{tr}theme{/tr}</a></th> +<th><a href="{$smarty.const.THEMES_PKG_URL}theme_control.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}category{/tr}</a></th> +<th><a href="{$smarty.const.THEMES_PKG_URL}theme_control.php?offset={$offset}&sort_mode={if $sort_mode eq 'theme_desc'}theme_asc{else}theme_desc{/if}">{tr}theme{/tr}</a></th> </tr> {cycle values="even,odd" print=false} {section name=user loop=$channels} @@ -87,17 +87,17 @@ <div class="pagination"> {if $prev_offset >= 0} -[<a href="{$gBitLoc.THEMES_PKG_URL}theme_control.php?find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}prev{/tr}</a>] +[<a href="{$smarty.const.THEMES_PKG_URL}theme_control.php?find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}prev{/tr}</a>] {/if} {tr}Page{/tr}: {$actual_page}/{$cant_pages} {if $next_offset >= 0} - [<a href="{$gBitLoc.THEMES_PKG_URL}theme_control.php?find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}next{/tr}</a>] + [<a href="{$smarty.const.THEMES_PKG_URL}theme_control.php?find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}next{/tr}</a>] {/if} {if $direct_pagination eq 'y'} <br /> {section loop=$cant_pages name=foo} {assign var=selector_offset value=$smarty.section.foo.index|times:$maxRecords} -<a href="{$gBitLoc.THEMES_PKG_URL}theme_control.php?tasks_use_dates={$tasks_use_dates}&find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}"> +<a href="{$smarty.const.THEMES_PKG_URL}theme_control.php?tasks_use_dates={$tasks_use_dates}&find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}"> {$smarty.section.foo.index_next}</a> {/section} {/if} diff --git a/templates/theme_control_objects.tpl b/templates/theme_control_objects.tpl index d505f9f..cc0289a 100644 --- a/templates/theme_control_objects.tpl +++ b/templates/theme_control_objects.tpl @@ -10,11 +10,11 @@ <h2>{tr}Assign themes to objects{/tr}</h2> <div class="navbar above"> - <a href="{$gBitLoc.THEMES_PKG_URL}theme_control.php">{tr}Control by category{/tr}</a> - <a href="{$gBitLoc.THEMES_PKG_URL}theme_control_sections.php">{tr}Control by Sections{/tr}</a> + <a href="{$smarty.const.THEMES_PKG_URL}theme_control.php">{tr}Control by category{/tr}</a> + <a href="{$smarty.const.THEMES_PKG_URL}theme_control_sections.php">{tr}Control by Sections{/tr}</a> </div> -<form id="objform" action="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php" method="post"> +<form id="objform" action="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php" method="post"> <!--<input type="submit" name="settype" value="{tr}set{/tr}" />--> <table class="panel"> <tr> @@ -62,7 +62,7 @@ <table class="find"> <tr><td>{tr}Find{/tr}</td> <td> - <form method="get" action="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php"> + <form method="get" action="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php"> <input type="text" name="find" value="{$find|escape}" /> <input type="submit" value="{tr}find{/tr}" name="search" /> <input type="hidden" name="sort_mode" value="{$sort_mode|escape}" /> @@ -70,16 +70,16 @@ </td> </tr> </table> -<form action="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php" method="post"> +<form action="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php" method="post"> <input type="hidden" name="type" value="{$type|escape}" /> <table class="data"> <tr> <th> </th> -<th><a href="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php?offset={$offset}&sort_mode={if $sort_mode eq 'type_desc'}type_asc{else}type_desc{/if}">{tr}type{/tr}</a></th> -<th><a href="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}name{/tr}</a></th> -<th><a href="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php?offset={$offset}&sort_mode={if $sort_mode eq 'theme_desc'}theme_asc{else}theme_desc{/if}">{tr}theme{/tr}</a></th> +<th><a href="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php?offset={$offset}&sort_mode={if $sort_mode eq 'type_desc'}type_asc{else}type_desc{/if}">{tr}type{/tr}</a></th> +<th><a href="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}name{/tr}</a></th> +<th><a href="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php?offset={$offset}&sort_mode={if $sort_mode eq 'theme_desc'}theme_asc{else}theme_desc{/if}">{tr}theme{/tr}</a></th> </tr> {cycle values="even,odd" print=false} {section name=user loop=$channels} @@ -102,17 +102,17 @@ <div class="pagination"> {if $prev_offset >= 0} -[<a href="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php?find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}prev{/tr}</a>] +[<a href="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php?find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}prev{/tr}</a>] {/if} {tr}Page{/tr}: {$actual_page}/{$cant_pages} {if $next_offset >= 0} - [<a href="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php?find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}next{/tr}</a>] + [<a href="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php?find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}next{/tr}</a>] {/if} {if $direct_pagination eq 'y'} <br /> {section loop=$cant_pages name=foo} {assign var=selector_offset value=$smarty.section.foo.index|times:$maxRecords} -<a href="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php?tasks_use_dates={$tasks_use_dates}&find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}">{$smarty.section.foo.index_next}</a> +<a href="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php?tasks_use_dates={$tasks_use_dates}&find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}">{$smarty.section.foo.index_next}</a> {/section} {/if} </div> diff --git a/templates/theme_control_sections.tpl b/templates/theme_control_sections.tpl index 6ff5008..760120f 100644 --- a/templates/theme_control_sections.tpl +++ b/templates/theme_control_sections.tpl @@ -10,11 +10,11 @@ <h2>{tr}Assign themes to sections{/tr}</h2> <div class="navbar above"> - <a href="{$gBitLoc.THEMES_PKG_URL}theme_control_objects.php">{tr}Control by Object{/tr}</a> - <a href="{$gBitLoc.THEMES_PKG_URL}theme_control.php">{tr}Control by Categories{/tr}</a> + <a href="{$smarty.const.THEMES_PKG_URL}theme_control_objects.php">{tr}Control by Object{/tr}</a> + <a href="{$smarty.const.THEMES_PKG_URL}theme_control.php">{tr}Control by Categories{/tr}</a> </div> -<form action="{$gBitLoc.THEMES_PKG_URL}theme_control_sections.php" method="post"> +<form action="{$smarty.const.THEMES_PKG_URL}theme_control_sections.php" method="post"> <table class="panel"> <tr> <th>{tr}Section{/tr}</th> @@ -48,12 +48,12 @@ </form> <h2>{tr}Assigned sections{/tr}</h2> -<form action="{$gBitLoc.THEMES_PKG_URL}theme_control_sections.php" method="post"> +<form action="{$smarty.const.THEMES_PKG_URL}theme_control_sections.php" method="post"> <table class="data"> <tr> <th> </th> -<th><a href="{$gBitLoc.THEMES_PKG_URL}theme_control_sections.php?offset={$offset}&sort_mode={if $sort_mode eq 'section_desc'}section_asc{else}section_desc{/if}">{tr}section{/tr}</a></th> -<th><a href="{$gBitLoc.THEMES_PKG_URL}theme_control_sections.php?offset={$offset}&sort_mode={if $sort_mode eq 'theme_desc'}theme_asc{else}theme_desc{/if}">{tr}theme{/tr}</a></th> +<th><a href="{$smarty.const.THEMES_PKG_URL}theme_control_sections.php?offset={$offset}&sort_mode={if $sort_mode eq 'section_desc'}section_asc{else}section_desc{/if}">{tr}section{/tr}</a></th> +<th><a href="{$smarty.const.THEMES_PKG_URL}theme_control_sections.php?offset={$offset}&sort_mode={if $sort_mode eq 'theme_desc'}theme_asc{else}theme_desc{/if}">{tr}theme{/tr}</a></th> </tr> {cycle values="even,odd" print=false} {section name=user loop=$channels} diff --git a/templates_lib.php b/templates_lib.php index b1639d8..d35ca67 100644 --- a/templates_lib.php +++ b/templates_lib.php @@ -14,15 +14,15 @@ class TemplatesLib extends BitBase { $mid = ""; } - $query = "select `name`,`created`,`template_id` from `".BIT_DB_PREFIX."tiki_content_templates` $mid order by ".$this->convert_sortmode($sort_mode); + $query = "select `name`,`created`,`template_id` from `".BIT_DB_PREFIX."tiki_content_templates` $mid order by ".$this->mDb->convert_sortmode($sort_mode); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_content_templates` $mid"; - $result = $this->query($query,$bindvars,$maxRecords,$offset); - $cant = $this->getOne($query_cant,$bindvars); + $result = $this->mDb->query($query,$bindvars,$maxRecords,$offset); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { $query2 = "select `section` from `".BIT_DB_PREFIX."tiki_content_templates_sections` where `template_id`=?"; - $result2 = $this->query($query2,array((int)$res["template_id"])); + $result2 = $this->mDb->query($query2,array((int)$res["template_id"])); $sections = array(); while ($res2 = $result2->fetchRow()) { $sections[] = $res2["section"]; @@ -37,6 +37,15 @@ class TemplatesLib extends BitBase { return $retval; } + /*shared*/ + function get_template($template_id) { + $query = "select * from `".BIT_DB_PREFIX."tiki_content_templates` where `template_id`=?"; + $result = $this->mDb->query($query,array((int)$template_id)); + if (!$result->numRows()) return false; + $res = $result->fetchRow(); + return $res; + } + function replace_template($template_id, $name, $content) { $now = date("U"); $bindvars = array($content,$name,(int)$now); @@ -45,35 +54,35 @@ class TemplatesLib extends BitBase { $bindvars[] = (int) $template_id; } else { $query = "delete from `".BIT_DB_PREFIX."tiki_content_templates` where `content`=? and `name`=?"; - $this->query($query,array($content,$name),-1,-1); + $this->mDb->query($query,array($content,$name),-1,-1); $query = "insert into `".BIT_DB_PREFIX."tiki_content_templates`(`content`,`name`,`created`) values(?,?,?)"; } - $result = $this->query($query,$bindvars); - $id = $this->getOne("select max(`template_id`) from `".BIT_DB_PREFIX."tiki_content_templates` where `created`=? and `name`=?",array((int)$now,$name)); + $result = $this->mDb->query($query,$bindvars); + $id = $this->mDb->getOne("select max(`template_id`) from `".BIT_DB_PREFIX."tiki_content_templates` where `created`=? and `name`=?",array((int)$now,$name)); return $id; } function add_template_to_section($template_id, $section) { - $this->query("delete from `".BIT_DB_PREFIX."tiki_content_templates_sections` where `template_id`=? and `section`=?",array((int)$template_id,$section),-1,-1); + $this->mDb->query("delete from `".BIT_DB_PREFIX."tiki_content_templates_sections` where `template_id`=? and `section`=?",array((int)$template_id,$section),-1,-1); $query = "insert into `".BIT_DB_PREFIX."tiki_content_templates_sections`(`template_id`,`section`) values(?,?)"; - $result = $this->query($query,array((int)$template_id,$section)); + $result = $this->mDb->query($query,array((int)$template_id,$section)); } function remove_template_from_section($template_id, $section) { - $result = $this->query("delete from `".BIT_DB_PREFIX."tiki_content_templates_sections` where `template_id`=? and `section`=?",array((int)$template_id,$section)); + $result = $this->mDb->query("delete from `".BIT_DB_PREFIX."tiki_content_templates_sections` where `template_id`=? and `section`=?",array((int)$template_id,$section)); } function template_is_in_section($template_id, $section) { - $cant = $this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_content_templates_sections` where `template_id`=? and `section`=?",array((int)$template_id,$section)); + $cant = $this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_content_templates_sections` where `template_id`=? and `section`=?",array((int)$template_id,$section)); return $cant; } function remove_template($template_id) { $query = "delete from `".BIT_DB_PREFIX."tiki_content_templates` where `template_id`=?"; - $result = $this->query($query,array((int)$template_id)); + $result = $this->mDb->query($query,array((int)$template_id)); $query = "delete from `".BIT_DB_PREFIX."tiki_content_templates_sections` where `template_id`=?"; - $result = $this->query($query,array((int)$template_id)); + $result = $this->mDb->query($query,array((int)$template_id)); return true; } } diff --git a/theme_control_lib.php b/theme_control_lib.php index b7df98d..159db9b 100644 --- a/theme_control_lib.php +++ b/theme_control_lib.php @@ -9,9 +9,9 @@ class ThemeControlLib extends BitBase { $this->tc_remove_cat($category_id); $query = "delete from `".BIT_DB_PREFIX."tiki_theme_control_categs` where `category_id`=?"; - $this->query($query,array($category_id),-1,-1); + $this->mDb->query($query,array($category_id),-1,-1); $query = "insert into `".BIT_DB_PREFIX."tiki_theme_control_categs`(`category_id`,`theme`) values(?,?)"; - $this->query($query,array($category_id,$theme)); + $this->mDb->query($query,array($category_id,$theme)); } /* deprecated @@ -19,9 +19,9 @@ deprecated $this->tc_remove_section($section); $query = "delete from `".BIT_DB_PREFIX."tiki_theme_control_sections` where `section`=?"; - $this->query($query,array($section),-1,-1); + $this->mDb->query($query,array($section),-1,-1); $query = "insert into `".BIT_DB_PREFIX."tiki_theme_control_sections`(`section`,`theme`) values(?,?)"; - $this->query($query,array($section,$theme)); + $this->mDb->query($query,array($section,$theme)); } */ function tc_assign_object($obj_id, $theme, $type, $name) { @@ -29,24 +29,24 @@ deprecated $obj_id = md5($type . $obj_id); $this->tc_remove_object($obj_id); $query = "delete from `".BIT_DB_PREFIX."tiki_theme_control_objects` where `obj_id`=?"; - $this->query($query,array($obj_id),-1,-1); + $this->mDb->query($query,array($obj_id),-1,-1); $query = "insert into `".BIT_DB_PREFIX."tiki_theme_control_objects`(`obj_id`,`theme`,`type`,`name`) values(?,?,?,?)"; - $this->query($query,array($obj_id,$theme,$type,$name)); + $this->mDb->query($query,array($obj_id,$theme,$type,$name)); } function tc_get_theme_by_categ( $pCategory ) { $ret = ''; if( !empty( $pCategory['category_id'] ) && is_numeric( $pCategory['category_id'] ) ) { - if ($this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_theme_control_categs` where `category_id`=?",array($pCategory['category_id']))) { - return $this->getOne("select `theme` from `".BIT_DB_PREFIX."tiki_theme_control_categs` where `category_id`=?",array($pCategory['category_id'])); + if ($this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_theme_control_categs` where `category_id`=?",array($pCategory['category_id']))) { + return $this->mDb->getOne("select `theme` from `".BIT_DB_PREFIX."tiki_theme_control_categs` where `category_id`=?",array($pCategory['category_id'])); } } return $ret; } /* function tc_get_theme_by_section($section) { - if ($this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_theme_control_sections` where `section`=?",array($section))) { - return $this->getOne("select `theme` from `".BIT_DB_PREFIX."tiki_theme_control_sections` where `section`=?",array($section)); + if ($this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_theme_control_sections` where `section`=?",array($section))) { + return $this->mDb->getOne("select `theme` from `".BIT_DB_PREFIX."tiki_theme_control_sections` where `section`=?",array($section)); } else { return ''; } @@ -55,8 +55,8 @@ deprecated function tc_get_theme_by_object($type, $obj_id) { $obj_id = md5($type . $obj_id); - if ($this->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_theme_control_objects` where `type`=? and `obj_id`=?",array($type,$obj_id))) { - return $this->getOne("select `theme` from `".BIT_DB_PREFIX."tiki_theme_control_objects` where `type`=? and `obj_id`=?",array($type,$obj_id)); + if ($this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_theme_control_objects` where `type`=? and `obj_id`=?",array($type,$obj_id))) { + return $this->mDb->getOne("select `theme` from `".BIT_DB_PREFIX."tiki_theme_control_objects` where `type`=? and `obj_id`=?",array($type,$obj_id)); } else { return ''; } @@ -73,10 +73,10 @@ deprecated $bindvars=array(); } - $query = "select tc.`category_id`,tc.`name`,`theme` from `".BIT_DB_PREFIX."tiki_theme_control_categs` ttt,`".BIT_DB_PREFIX."tiki_categories` tc where ttt.`category_id`=tc.`category_id` $mid order by ".$this->convert_sortmode($sort_mode); + $query = "select tc.`category_id`,tc.`name`,`theme` from `".BIT_DB_PREFIX."tiki_theme_control_categs` ttt,`".BIT_DB_PREFIX."tiki_categories` tc where ttt.`category_id`=tc.`category_id` $mid order by ".$this->mDb->convert_sortmode($sort_mode); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_theme_control_categs` ttt,`".BIT_DB_PREFIX."tiki_categories` tc where ttt.`category_id`=tc.`category_id` $mid"; - $result = $this->query($query,$bindvars,$maxRecords,$offset); - $cant = $this->getOne($query_cant,$bindvars); + $result = $this->mDb->query($query,$bindvars,$maxRecords,$offset); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { @@ -101,10 +101,10 @@ deprecated $bindvars=array(); } - $query = "select * from `".BIT_DB_PREFIX."tiki_theme_control_sections` $mid order by ".$this->convert_sortmode($sort_mode); + $query = "select * from `".BIT_DB_PREFIX."tiki_theme_control_sections` $mid order by ".$this->mDb->convert_sortmode($sort_mode); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_theme_control_sections` $mid"; - $result = $this->query($query,$bindvars,$maxRecords,$offset); - $cant = $this->getOne($query_cant,$bindvars); + $result = $this->mDb->query($query,$bindvars,$maxRecords,$offset); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { @@ -128,10 +128,10 @@ deprecated $bindvars=array($type); } - $query = "select * from `".BIT_DB_PREFIX."tiki_theme_control_objects` where `type`=? $mid order by ".$this->convert_sortmode($sort_mode); + $query = "select * from `".BIT_DB_PREFIX."tiki_theme_control_objects` where `type`=? $mid order by ".$this->mDb->convert_sortmode($sort_mode); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_theme_control_objects` where `type`=? $mid"; - $result = $this->query($query,$bindvars,$maxRecords,$offset); - $cant = $this->getOne($query_cant,$bindvars); + $result = $this->mDb->query($query,$bindvars,$maxRecords,$offset); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { @@ -147,19 +147,19 @@ deprecated function tc_remove_cat($cat) { $query = "delete from `".BIT_DB_PREFIX."tiki_theme_control_categs` where `category_id`=?"; - $this->query($query,array($cat)); + $this->mDb->query($query,array($cat)); } /* function tc_remove_section($section) { $query = "delete from `".BIT_DB_PREFIX."tiki_theme_control_sections` where `section`=?"; - $this->query($query,array($section)); + $this->mDb->query($query,array($section)); } */ function tc_remove_object($obj_id) { $query = "delete from `".BIT_DB_PREFIX."tiki_theme_control_objects` where `obj_id`=?"; - $this->query($query,array($obj_id)); + $this->mDb->query($query,array($obj_id)); } function getStyles( $pDir = NULL, $pNullOption = NULL, $bIncludeCustom = FALSE ) { |
