示例#1
0
文件: Ext.php 项目: uwitec/outbuying
    /**
     * 使用yui-ext建立TableGrid
     * 
     * <code>
     * $grid->showMe( array('gridId'=>'sql_grid') );
     * Watt_View_Helper_Ext::buildTableGrid( 'sql_grid' );
     * </code>
     *
     * @param string $gridId grid的ID
     */
    public static function buildTableGrid($gridId)
    {
        if (!self::$_loadedTableGridLib) {
            ?>
<script src="<?php 
            echo Watt_Config::getSiteRoot();
            ?>
js/ext-1.0/tpm/TableGrid.js"></script>
<?php 
            self::$_loadedTableGridLib = true;
        }
        ?>
<script>
/*
 * Ext JS Library 1.0
 * Copyright(c) 2006-2007, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://www.extjs.com/license
 */
Ext.onReady(function() {
	// create the grid
    var grid = new Ext.grid.TableGrid('<?php 
        echo $gridId;
        ?>
');
    grid.render();
});
</script>
<?php 
    }
示例#2
0
 public function build($name, $value = null, $attribs = null, $disable = false)
 {
     //$info = $this->_getInfo($name, $value, $attribs);
     //extract($info); // name, value, attribs, options, listsep, disable
     // build the element
     if ($disable) {
         // disabled
         $xhtml = $this->_hidden($name, $value) . htmlspecialchars($value);
     } else {
         // enabled
         if (!isset($attribs["id"])) {
             $id = "person_selector_" . $name;
             $attribs["id"] = $id;
         }
         if (!isset($attribs["onclick"])) {
             $attribs["onclick"] = 'userSelTool.show( null, \'' . $attribs["id"] . '\', this, \'' . @$attribs["param"] . '\' );return false;';
             if (!isset($attribs["style"])) {
                 $attribs["style"] = 'cursor:pointer;';
             }
         }
         $sitePath = Watt_Config::getSiteRoot();
         $xhtml = $this->_getCommonHtml();
         $xhtml .= Watt_View_Helper::buildElmentByVartype("C", $name, $value, $attribs);
         /*
                     $xhtml = '<input type="text"'
                            . ' name="' . htmlspecialchars($name) . '"'
                            . ' value="' . htmlspecialchars($value) . '"'
                            . $this->_htmlAttribs($attribs)
                            . ' />';*/
         $xhtml .= '<a href="#" class="btn" type="button" id="btnSelectCr" onclick="userSelTool.show( null, \'' . $attribs["id"] . '\', this, \'' . @$attribs["param"] . '\' );return false;">' . i18ntrans('#选') . '</a>';
     }
     return $xhtml;
 }
示例#3
0
 public function build($name, $value = null, $attribs = null, $disable = false)
 {
     //$info = $this->_getInfo($name, $value, $attribs);
     //extract($info); // name, value, attribs, options, listsep, disable
     // build the element
     if ($disable) {
         // disabled
         $xhtml = $this->_hidden($name, $value) . htmlspecialchars($value);
     } else {
         // enabled
         $id = "dingdan_selector_" . $name;
         $attribs["id"] = $id;
         $sitePath = Watt_Config::getSiteRoot();
         $xhtml = $this->_getCommonHtml();
         $xhtml .= Watt_View_Helper::buildElmentByVartype("C", $name, $value, $attribs);
         //echo "<script>alert('aa');</script>";
         /*
                     $xhtml = '<input type="text"'
                            . ' name="' . htmlspecialchars($name) . '"'
                            . ' value="' . htmlspecialchars($value) . '"'
                            . $this->_htmlAttribs($attribs)
                            . ' />';*/
         $xhtml .= '<a href="#" class="btn" type="button" id="btnSelectCr" onclick="ddSelTool.show(  \'' . $attribs["id"] . '\', this,\'\',\'s0=\'+document.all.' . $name . '.value+\'\' );return false;">' . i18ntrans('#选') . '</a>';
     }
     return $xhtml;
 }
示例#4
0
    public function build($name, $value = null, $attribs = null, $disable = false)
    {
        //$info = $this->_getInfo($name, $value, $attribs);
        //extract($info); // name, value, attribs, options, listsep, disable
        // build the element
        if ($disable) {
            // disabled
            $xhtml = $this->_hidden($name, $value) . htmlspecialchars($value);
        } else {
            // enabled
            if (!isset($attribs['id'])) {
                $id = "date" . mt_rand(1000, 9999);
                $attribs["id"] = $id;
            } else {
                $id = $attribs["id"];
            }
            $sitePath = Watt_Config::getSiteRoot();
            $xhtml = Watt_View_Helper::buildElmentByVartype("C", $name, $value, $attribs);
            $xhtml .= $this->_getCommonHtml();
            /*
                        $xhtml = '<input type="text"'
                               . ' name="' . htmlspecialchars($name) . '"'
                               . ' value="' . htmlspecialchars($value) . '"'
                               . $this->_htmlAttribs($attribs)
                               . ' />';*/
            $xhtml .= <<<EOT
<img id="dateButton_{$id}" src="{$sitePath}js/john/jscalendar/calendar.gif" border="0" align="absmiddle" style="cursor:pointer" />
<!--<input   name="start_date[{\$i}]" type="text" class="Input1" id="start_date[{\$i}]" value="{\$start_mren}" size="14" readonly/>-->
<script type="text/javascript">
    Calendar.setup({
        inputField     :    "{$id}",
EOT;
            if ($this->_showTimes) {
                $xhtml .= '
        ifFormat       :    "%Y-%m-%d %H:%M",
        showsTime      :    true,';
            } else {
                if ($this->_showTimeSecs) {
                    $xhtml .= '
        ifFormat       :    "%Y-%m-%d %H:%M:%S",
        showsTime      :    true,';
                } else {
                    $xhtml .= '
        ifFormat       :    "%Y-%m-%d",';
                }
            }
            $xhtml .= <<<EOT
        button         :    "dateButton_{$id}",
        singleClick    :    true,
        step           :    1
    });
</script>
EOT;
            /* $xhtml .= <<<EOT
                    <img id="dateButton_{$id}" src="{$sitePath}js/john/jscalendar/calendar.gif" border="0" align="absmiddle" style="cursor:pointer" onClick="Calendar.setDayHM(document.getElementById({$id}),0,'');"/>       
            EOT;*/
        }
        return $xhtml;
    }
示例#5
0
 function __construct()
 {
     $this->_selector_lib_path = Watt_Config::getSiteRoot() . 'js/tpm/';
 }
示例#6
0
文件: Menu.php 项目: uwitec/outbuying
 function __construct()
 {
     $this->_menu_lib_path = Watt_Config::getSiteRoot(1) . 'js/jsmenu/';
 }
示例#7
0
 public static function ExportToXls($arr, $file_name = null, $is_fullname = false, $expand_name = 'xls', $path = null, $is_model = false, $is_output = false)
 {
     set_time_limit(36000000);
     if (!$expand_name || $expand_name == '') {
         $expand_name = 'xls';
     }
     if (strtolower($expand_name) != 'xls' && strtolower($expand_name) != 'pdf') {
         $expand_name = 'xls';
     }
     if ($is_fullname && $file_name && $file_name != '') {
     } else {
         if (!$file_name) {
             $file_name = 'Export' . date('-ymd-His', time());
         } else {
             $file_name = $file_name . date('-ymd-His', time());
         }
         //防止重名
         $guid = Watt_Util_Utils::getGuId();
         $file_name .= '-' . substr($guid, 0, 8);
     }
     if ($path) {
         if (!$is_model) {
             $new_path = $path . $file_name . "." . $expand_name;
         }
     } else {
         $new_path = Watt_Config::getUploadPath() . $file_name . "." . $expand_name;
     }
     //输出的路径
     $out_path = Watt_Config::getSiteRoot() . "upload/" . $file_name . "." . $expand_name;
     if ($is_model) {
         self::getXlsByModel($arr, $path, $new_path, $file_name, $expand_name, $is_output);
     } else {
         self::getXlsPathByArr($arr, $new_path, $file_name, $expand_name, $is_output);
     }
     return $out_path;
 }