PDA

Zobacz pełną wersję : Problem z modułem od zmiany Template'a



Raffael
05-02-2006, 23:31
Mam takie pytanie do modułu od zmiany skórek
Aktualnie wygląda on u mnie tak:
http://img441.imageshack.us/img441/8241/19qd.png

A chciałbym przesunąć guzik Ustaw obok rozwijanego menu, żeby to wyglądało tak:
http://img441.imageshack.us/img441/610/29lx1.png

Czy ktoś wie jak to zrobić?

A tu jest zawartość pliku PHP z modułem


<?php
/**
* @version $Id: mod_templatechooser.php 1492 2005-12-20 16:07:35Z Jinx $
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );

global $cur_template;

// titlelength can be set in module params
$titlelength = $params->get( 'title_length', 20 );
$preview_height = $params->get( 'preview_height', 90 );
$preview_width = $params->get( 'preview_width', 140 );
$show_preview = $params->get( 'show_preview', 0 );

// Read files from template directory
$template_path = "$mosConfig_absolute_path/templates";
$templatefolder = @dir( $template_path );
$darray = array();

if ($templatefolder) {
while ($templatefile = $templatefolder->read()) {
if ($templatefile != "." && $templatefile != ".." && $templatefile != ".svn" && $templatefile != "css" && is_dir( "$template_path/$templatefile" ) ) {
if(strlen($templatefile) > $titlelength) {
$templatename = substr( $templatefile, 0, $titlelength-3 );
$templatename .= "...";
} else {
$templatename = $templatefile;
}
$darray[] = mosHTML::makeOption( $templatefile, $templatename );
}
}
$templatefolder->close();
}

sort( $darray );

// Show the preview image
// Set up JavaScript for instant preview
$onchange = "";
if ($show_preview) {
$onchange = "showimage()";
?>
<img src="<?php echo "templates/$cur_template/template_thumbnail.png";?>" name="preview" border="1" width="<?php echo $preview_width;?>" height="<?php echo $preview_height;?>" alt="<?php echo $cur_template; ?>" />
<script language='JavaScript1.2' type='text/javascript'>
<!--
function showimage() {
//if (!document.images) return;
document.images.preview.src = 'templates/' + getSelectedValue( 'templateform', 'jos_change_template' ) + '/template_thumbnail.png';
}
function getSelectedValue( frmName, srcListName ) {
var form = eval( 'document.' + frmName );
var srcList = eval( 'form.' + srcListName );

i = srcList.selectedIndex;
if (i != null && i > -1) {
return srcList.options[i].value;
} else {
return null;
}
}
-->
</script>
<?php
}
?>
<form action="index.php" name="templateform" method="post">
<?php
echo mosHTML::selectList( $darray, 'jos_change_template', "id=\"mod_templatechooser_jos_change_template\" class=\"button\" onchange=\"$onchange\"",'value', 'text', $cur_template );
?>
<input class="button" type="submit" value="<?php echo _CMN_SELECT;?>" />
</form>

magic
06-02-2006, 01:32
Kolumna w której ten moduł prezentujesz jest za wąska.
Rozwiązanie: sięgnij do pliku index.php szablonu graficznego (templatki), który używasz i ew. pliku CSS i powiększ szerokość tej kolumny.

Raffael
06-02-2006, 17:13
Dziękuję za pomoc. Krótszy napis na buttonie ('ok' zamiast 'ustaw') rozwiązał mój wcześniejszy problem. Niestety powstał następny :>

http://img101.imageshack.us/img101/1668/11sn.png

Button "OK" jest troszeczkę za wysoko względem rozwijanego menu.
Chciałbym żeby to wyglądało tak:

http://img139.imageshack.us/img139/8702/29ug.png

Z góry dziękuję za pomoc :)

Pozdrawiam