-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtextareasize.php
32 lines (27 loc) · 1.45 KB
/
textareasize.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/* $Header: /cvsroot-fuse/tikiwiki/tiki/textareasize.php,v 1.3 2004/03/27 21:23:52 mose Exp $
* \brief: 4 buttoms to change a textArea size - works with textareaSize.tpl template
* \param: $defaultRows - optional : the number of rows by default
* \comment: the cols nb is managed by a javascript program to optimize the display perf (seems to work generally with browsers)
* the rows nb is managed by a redisplayed of the page to be effective on different browsers and different styles (specially with floating div column)
*/
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== FALSE) {
//smarty is not there - we need setup
require_once('tiki-setup.php');
$smarty->assign('msg',tra("This script cannot be called directly"));
$smarty->display("error.tpl");
die;
}
$rows = isset($_REQUEST['rows'])? $_REQUEST['rows']: (isset($defaultRows)?$defaultRows: 20);
// the rows modification is managed by a javascript program
// is ok: for IE6, firebird 0.6, opera 7.23, NN7
// is doesn't work for other browser, must be managed as rows input
$smarty->assign('rows', (int) $rows);
$cols = isset($_REQUEST['cols'])? $_REQUEST['cols']: 80;
if (isset($_REQUEST['enlargeW']) || isset($_REQUEST['enlargeW_x']))
$cols += 20;
elseif ((isset($_REQUEST['reduceW']) || isset($_REQUEST['reduceW_x'])) && $cols >= 40)
$cols -= 20;
$smarty->assign('cols', (int) $cols);
?>