Overview

Packages

  • None
  • PHPShopArray
  • PHPShopClass
    • Helper
  • PHPShopCore
  • PHPShopElements
  • PHPShopGUI
  • PHPShopInc
  • PHPShopObj
  • PHPShopParser
  • PHPShopTest

Classes

  • fase4_rdf
  • PHPShopAdminRule
  • PHPShopArray
  • PHPShopBannerElement
  • PHPShopBase
  • PHPShopBaseXml
  • PHPShopCatalogElement
  • PHPShopCategory
  • PHPShopCategoryArray
  • PHPShopCloudElement
  • PHPShopCore
  • PHPShopCoretest
  • PHPShopCssParser
  • PHPShopDate
  • PHPShopDebug
  • PHPShopDoc
  • PHPShopElements
  • PHPShopFile
  • PHPShopForma
  • PHPShopFrontInterface
  • PHPShopGbook
  • PHPShopGbookElement
  • PHPShopGUI
  • PHPShopIndex
  • PHPShopInterface
  • PHPShopLang
  • PHPShopLinks
  • PHPShopMail
  • PHPShopMailFile
  • PHPShopMap
  • PHPShopModules
  • PHPShopNav
  • PHPShopNews
  • PHPShopNewsElement
  • PHPShopObj
  • PHPShopOpros
  • PHPShopOprosElement
  • PHPShopOrm
  • PHPShopPage
  • PHPShopPageCategory
  • PHPShopPageCategoryArray
  • PHPShopPages
  • PHPShopParser
  • PHPShopPhoto
  • PHPShopPhotoCategory
  • PHPShopPhotoCategoryArray
  • PHPShopPhotoElement
  • PHPShopReadCsv
  • PHPShopReadCsvNative
  • PHPShopReadCsvPro
  • PHPShopRestore
  • PHPShopRssParser
  • PHPShopSearch
  • PHPShopSecurity
  • PHPShopSkinElement
  • PHPShopSkinmarket
  • PHPShopSliderElement
  • PHPShopString
  • PHPShopSystem
  • PHPShopText
  • PHPShopTextElement
  • PHPShopUpdate
  • XMLparser

Functions

  • __
  • allowedFunctions
  • array2iconv
  • CheckCanGzip
  • debug
  • evalstr
  • GzDocOut
  • Open
  • output_handler
  • parseDatabase
  • Parser
  • ParseTemplate
  • ParseTemplateReturn
  • PHPShopAutoLoadClass
  • phpshopparserevalstr
  • preExtractCallBack
  • readDatabase
  • stripslashes_deep
  • SysValueReturn
  • timer
  • tmpGetFile
  • utf8_win1251
  • writeLangFile
  • xml2array
  • Overview
  • Package
  • Class
  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:  33:  34:  35:  36:  37:  38:  39:  40:  41:  42:  43:  44:  45:  46:  47:  48:  49:  50:  51:  52:  53:  54:  55:  56:  57:  58:  59:  60:  61:  62:  63:  64:  65:  66:  67:  68:  69:  70:  71:  72:  73:  74:  75:  76:  77:  78:  79:  80:  81:  82:  83:  84:  85:  86:  87:  88:  89:  90:  91:  92:  93:  94:  95:  96:  97:  98:  99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 
<?php

/**

 * @version 1.4
 * @package PHPShopClass
 * @subpackage Helper
 */
class PHPShopText {

    /**


     * @return string
     */
    static function nbsp($n = 1) {
        $i = 0;
        $nbsp = null;
        while ($i < $n) {
            $nbsp.='&nbsp;';
            $i++;
        }
        return $nbsp;
    }

    /**



     * @return string
     */
    static function b($string, $style = false) {
        return '<b style="' . $style . '">' . $string . '</b>';
    }

    /**




     * @return string
     */
    static function notice($string, $icon = false, $size = false) {
        if (!empty($icon))
            $img = PHPShopText::img($icon);
        else
            $img = null;
        return $img . '<span style="color:red;font-size:' . $size . '">' . $string . '</span>';
    }

    /**





     * @return string
     */
    static function message($string, $icon = false, $size = false, $color = 'green') {
        if (!empty($icon))
            $img = PHPShopText::img($icon);
        else
            $img = null;
        return $img . '<span style="color:' . $color . ';font-size:' . $size . '">' . $string . '</span>';
    }

    /**





     * @return string
     */
    static function img($src, $hspace = 5, $align = 'left', $css=null ) {
        return '<img src="' . $src . '" hspace="' . $hspace . '" align="' . $align . '" border="0" style="'. $css.'">';
    }

    /**

     * @return string
     */
    static function br() {
        return '<br>';
    }

    /**








     * @return string
     */
    static function a($href, $text, $title = false, $color = false, $size = false, $target = false, $class = false) {
        //$style = 'text-decoration:underline;';
        if ($size)
            $style.='font-size:' . $size . 'px;';
        if ($color)
            $style.='color:' . $color;
        if (empty($title))
            $title = $text;

        if ($title)
            $title = ' title="' . $title . '" ';
        if ($target)
            $target = ' target="' . $target . '" ';
        if ($class)
            $class = ' class="' . $class . '" ';
        if ($style)
            $style = ' style="' . $style . '" ';
        return '<a href="' . $href . '"' . $title . $target . $class . $style . '>' . $text . '</a>';
    }

    /**


     * @return string
     */
    static function slide($name) {
        return '<a name="' . $name . '"></a>';
    }

    /**


     * @return string
     */
    static function h1($string) {
        return '<h1>' . $string . '</h1>';
    }

    /**


     * @return string
     */
    static function h2($string) {
        return '<h2>' . $string . '</h2>';
    }

    /**


     * @return string
     */
    static function h3($string) {
        return '<h3>' . $string . '</h3>';
    }

    /**


     * @param string $class css
     * @return string
     */
    static function ul($string,$class='list-group') {
        return '<ul class="'.$class.'">' . $string . '</ul>';
    }

    /**



     * @return string
     */
    static function ol($string, $type = null) {
        return '<ol type="' . $type . '">' . $string . '</ol>';
    }

    /**



     * @param string $class css
     * @return string
     */
    static function li($string, $href = null, $class="list-group-item") {
        if (!empty($href)) {
            $text = PHPShopText::a($href, $string);
            $li = '<li class="'.$class.'">' . $text . '</li>';
        }
        else
            $li = '<li class="'.$class.'">' . $string . '</li>';
        return $li;
    }

    /**

     * @return string
     */
    static function tr() {
        $Arg = func_get_args();
        $tr = '<tr class=tablerow>';
        foreach ($Arg as $val) {
            $tr.=PHPShopText::td($val, 'tablerow');
        }
        $tr.='</tr>';
        return $tr;
    }

    /**

     * <code>
     * // example:


     * PHPShopText::select('my',$value,100);
     * </code>



     * @param string $float float




     * @return string
     */
    static function select($name, $value, $width, $float = "none", $caption = false, $onchange = "return true", $height = false, $size = 1, $id = false, $class="form-control selectpicker show-menu-arrow") {

        if (empty($id))
            $id = $name;

        if ($name)
            $name = ' name="' . $name . '"';

        if ($id)
            $id = ' id="' . $id . '"';

        if ($size)
            $size = ' size="' . $size . '"';

        if ($onchange)
            $onchange = ' onchange="' . $onchange . '"';
                
                if($class)
                    $class = ' class="'.$class.'"';
            

        $select = $caption . ' <select' . $name . $id . $size . ' style="float:' . $float . ';width:' . $width . 'px;height:' . $height . 'px"' . $onchange . $class.'>';
        if (is_array($value))
            foreach ($value as $val)
                $select.='<option value="' . $val[1] . '" ' . @$val[2] . '>' . $val[0] . '</option>';
        $select.='</select>';
        return $select;
    }

    /**





     * @return string
     */
    static function td($string, $class = false, $colspan = false, $id = false) {
        if($class)
            $class = ' class="' . $class . '"';
        if($id)
            $id = ' id="' . $id . '"';
        if($colspan)
            $colspan = ' colspan="' . $colspan . '"';
        
        return '<td' . $class . $id . $colspan . '>' . $string . '</td>';
    }

    /**


     * @return string
     */
    static function th($string) {
        return '<th>' . $string . '</th>';
    }

    /**






     * @return string
     */
    static function div($string, $align = "left", $style = false, $id = false, $class = false) {
        if(empty($id)) $id=time();
        if(empty($class)) $class=__CLASS__.'-'.__FUNCTION__;
        return '<div  id="' . $id . '" style="text-align:'.$align.';' . $style . '" class="' . $class . '">' . $string . '</div>';
    }

    /**


     * @return string
     */
    static function strike($string) {
        
        //
        if(strstr($string," ")){
            $string_array=explode(" ",$string);
            return '<span style="text-decoration: line-through">' . $string_array[0] . '</span><span class="rubznak">'.$string_array[1].'</span>';
        }
        else return '<span style="text-decoration: line-through">' . $string . '</span>';
    }

    /**


     * @return string
     */
    static function comment($type = '<') {
        if ($type == '<')
            return '<!--';
        else
            return '-->';
    }

    /**



     * @return string
     */
    static function p($string = '<br>', $style = false) {
        if(empty($style)) $style=__CLASS__.'-'.__FUNCTION__;
        return '<p style="' . $style . '">' . $string . '</p>';
    }

    /**




     * @return string
     */
    static function button($value, $onclick, $class = 'ok', $id=false) {

        if ($value)
            $value = ' value="' . $value . '"';

        if ($id)
            $id = ' id="' . $id . '"';

        if ($class)
            $class = ' class="' . $class . '"';

        if ($onclick)
            $onclick = ' onclick="' . $onclick . '"';
            
        return '<input type="button"' . $value . $onclick . $class . $id.'>';
    }

    /**


     * @param string $cellpadding cellpadding
     * @param string $cellspacing cellspacing





     * @return string
     */
    static function table($content, $cellpadding = 3, $cellspacing = 1, $align = 'center', $width = '98%', $bgcolor = false, $border = 0, $id = false, $class=false) {
        if($cellpadding)
            $cellpadding = ' cellpadding="' . $cellpadding . '"';
        if($cellspacing)
            $cellspacing = ' cellspacing="' . $cellspacing . '"';
        if($align)
            $align = 'text-align:' . $align . ';';
        if($width)
            $width = 'width:' . $width . ';';
        if($bgcolor)
            $bgcolor = 'background:' . $bgcolor . ';';
        if($border)
            $border = 'border:' . $border . 'px;';
        if($id)
            $id = ' id="' . $id . '"';
        if($class)
            $class = ' class="' . $class . '"';
        
        $style = ' style="' . $align . $width . $bgcolor . $border . '"';
        
        return '<table ' . $id . $style . $class . '>' . $content . '</table>';
    }

    /**






     * @return string
     */
    static function form($content, $name, $method = 'post', $action = '', $target = '_self') {
        return '<form action="' . $action . '" target="' . $target . '" name="' . $name . '" id="' . $name . '" method="' . $method . '">' . $content . '</form>';
    }

    /**
     * Input



     * @param int $float float





     * @return string
     */
    static function setInput($type, $name, $value, $float = "none", $size = 200, $onclick = "return true", $class = false, $caption = false, $description = false) {
        
        if(!empty($onclick))
            $onclick='onclick="'.$onclick.'"';

        $input = ' <input type="' . $type . '" value="' . $value . '" name="' . $name . '" id="' . $name . '" '.$onclick.'> ';

        if ($type != 'hidden')
            $input='<div style="float:' . $float . $padding . '">
             <label>' . $caption . $input . $description . '</label></div>';

        return $input;
    }

    /**






     * @param string $float  float

     * @return string
     */
    static function setInputText($caption, $name, $value, $size = 300, $description = false, $float = "none", $class = false) {
        return PHPShopText::setInput('text', $name, $value, $float, $size, false, $class, $caption, $description);
    }

}

?>
API documentation generated by ApiGen