|
From: <txm...@us...> - 2014-03-02 14:33:55
|
Revision: 12339
http://sourceforge.net/p/xoops/svn/12339
Author: txmodxoops
Date: 2014-03-02 14:33:52 +0000 (Sun, 02 Mar 2014)
Log Message:
-----------
Added more html elements
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php 2014-03-02 08:37:41 UTC (rev 12338)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php 2014-03-02 14:33:52 UTC (rev 12339)
@@ -38,17 +38,17 @@
* @param mixed $table
* @param string $file_name
*/
- public function __construct($module, $table) {
+ public function __construct($module, $table, $lang_pref = '_AM_', $lang_post = '') {
$this->module = $module;
$this->table = $table;
- $this->language = $this->geLanguage('_AM_', '_');
+ $this->language = $this->geLanguage($lang_pref, $lang_post);
}
/*
* @public function getHtmlDiv
* @param string $class
* @param string $content
*/
- public function getHtmlDiv($class = '', $content = '') {
+ public function getHtmlDiv($class = 'bnone', $content = '') {
$ret = <<<EOT
<div class='{$class}'>
{$content}
@@ -61,7 +61,7 @@
* @param string $class
* @param string $content
*/
- public function getHtmlSpan($class = '', $content = '') {
+ public function getHtmlSpan($class = 'bnone', $content = '') {
$ret = <<<EOT
<span class='{$class}'>
{$content}
@@ -70,11 +70,38 @@
return $ret;
}
/*
+ * @public function getHtmlAnchor
+ * @param string $class
+ * @param string $url
+ * @param string $target
+ * @param string $content
+ */
+ public function getHtmlAnchor($class = 'bnone', $url = 'http://', $target = '_top', $content = '') {
+ $ret = <<<EOT
+ <a class='{$class}' href='{$url}' target='{$target}'>
+ {$content}
+ </a>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlImage
+ * @param string $class
+ * @param string $src
+ * @param string $alt
+ */
+ public function getHtmlImage($class = 'bnone', $src = 'blank.gif', $alt = 'blank.gif') {
+ $ret = <<<EOT
+ <img class='{$class}' src='{$src}' alt='{$alt}' />
+EOT;
+ return $ret;
+ }
+ /*
* @public function getHtmlTable
* @param string $class
* @param string $content
*/
- public function getHtmlTable($class = '', $content = '') {
+ public function getHtmlTable($class = 'bnone', $content = '') {
$ret = <<<EOT
<table class='{$class}'>
{$content}
@@ -87,7 +114,7 @@
* @param string $class
* @param string $content
*/
- public function getHtmlTableThead($class = '', $content = '') {
+ public function getHtmlTableThead($class = 'bnone', $content = '') {
$ret = <<<EOT
<thead class='{$class}'>
{$content}
@@ -100,7 +127,7 @@
* @param string $class
* @param string $content
*/
- public function getHtmlTableTbody($class = '', $content = '') {
+ public function getHtmlTableTbody($class = 'bnone', $content = '') {
$ret = <<<EOT
<tbody class='{$class}'>
{$content}
@@ -113,7 +140,7 @@
* @param string $class
* @param string $content
*/
- public function getHtmlTableTfoot($class = '', $content = '') {
+ public function getHtmlTableTfoot($class = 'bnone', $content = '') {
$ret = <<<EOT
<tfoot class='{$class}'>
{$content}
@@ -126,7 +153,7 @@
* @param string $class
* @param mixed $field_name
*/
- public function getHtmlTableHead($class = '', $field_name) {
+ public function getHtmlTableHead($class = 'bnone', $field_name) {
$field_name = strtoupper($field_name);
$ret = <<<EOT
<th class='{$class}'><{{$this->language}{$field_name}}></th>
@@ -138,7 +165,7 @@
* @param string $class
* @param string $content
*/
- public function getHtmlTableRow($class = '', $content = '') {
+ public function getHtmlTableRow($class = 'bnone', $content = '') {
$ret = <<<EOT
<tr class='{$class}'>
{$content}
@@ -151,7 +178,7 @@
* @param string $class
* @param mixed $field_name
*/
- public function getHtmlTableData($class = '', $field_name) {
+ public function getHtmlTableData($class = 'bnone', $field_name) {
$table_fieldname = $this->table->getVar('table_fieldname');
$ret = <<<EOT
<td class='{$class}'><{\${$table_fieldname}.{$field_name}}></td>
@@ -178,15 +205,14 @@
* @param mixed $content_else
*/
public function getSmartyConditions($condition = '', $operator = '==', $type = '1', $content_if = '', $content_else = false) {
- $ret = '';
if(!$content_else) {
- $ret .= <<<EOT
+ $ret <<<EOT
<{if ${$condition} {$operator} {$type}'}>
{$content_if}
<{/if}>
EOT;
} else {
- $ret .= <<<EOT
+ $ret <<<EOT
<{if ${$condition} {$operator} {$type}'}>
{$content_if}
<{else}>
|