Source for file function.textarea.php
Documentation is available at function.textarea.php
* @link http://www.bitweaver.org/wiki/function_textarea function_textarea
* -------------------------------------------------------------
* File: function.textarea.php
* -------------------------------------------------------------
global $gBitSystem, $gContent, $gLibertySystem;
$class = 'form-control ';
if (((!empty($gLibertySystem->mPlugins['bithtml']) && $gLibertySystem->mPlugins['bithtml']['is_active'] == 'y') ||
(!empty($gLibertySystem->mPlugins['tikiwiki']) && $gLibertySystem->mPlugins['tikiwiki']['is_active'] == 'y' &&
&& empty( $pParams['nowysiwyg'] )
if (empty($pParams['rows'])) {
$pParams['rows'] = (empty($_COOKIE['rows']) ? $gBitSystem->getConfig('liberty_textarea_height', 20) : $_COOKIE['rows']);
if (empty($pParams['cols'])) {
$pParams['cols'] = (empty($_COOKIE['cols']) ? $gBitSystem->getConfig('liberty_textarea_width', 35) : $_COOKIE['rows']);
if (empty($pParams['id'])) {
if( empty( $pParams['name'] ) ){
$pParams['name'] = 'edit';
if( empty( $pParams['maxchars'] ) ){
// prevent smarty presistence of vars
$pParams['maxchars'] = 0;
foreach ($pParams as $_key=> $_value) {
$pSmarty->assign("textarea_". $_key, $_value);
$pSmarty->assign('formatGuid', $_value);
$pSmarty->assign('langCode', $_value);
$pSmarty->assign('gContent', $_value);
$attributes .= $_key. '="'. $_value. '" ';
// We control hieght here when bnspell is on so as to be able to not
// lose the rest of the style on the textarea.
if ($gBitSystem->isPackageActive('bnspell')) {
$style .= (empty($style) ? '' : ';'). 'height:'. $pParams['rows']. 'em;';
$pSmarty->assign('textarea_attributes', $attributes);
$pSmarty->assign('textarea_style', 'style="'. $style. '"');
$pSmarty->assign('textarea_class', 'class="'. $class. '"');
$ret = $pSmarty->fetch("bitpackage:liberty/edit_textarea.tpl");
if( $formatGuid = $gContent->getField( 'format_guid' ) ) {
$pSmarty->assign('formatGuid', $formatGuid);
if( $langCode = $gContent->getField( 'lang_code' ) ) {
$pSmarty->assign( 'langCode', $langCode );
if (isset ($oldContent)) {
$pSmarty->assign('gContent', $oldContent);
// since we have the funky {textarea} in play, we'll display the edit help tab
$pSmarty->assign( 'display_help_tab', TRUE );
|