[
  {
    "path": "Admin/Controller/BookController.class.php",
    "content": "<?php\nnamespace Admin\\Controller;\nuse Base\\BaseController;\nuse Admin\\Model\\BookModel;\nuse Admin\\Model\\BorrowModel;\nuse Tool\\Pager;\n\nfinal class Book extends BaseController{\n\n    public function index(){\n        $this->accessPage();\n\n        //页面参数\n        $currentPage = isset($_GET[\"page\"]) ? $_GET[\"page\"] : 1;    //当前页数\n        $eachPerPage = 10;      //每页显示条数\n\n        //获取搜索条件\n        if(isset($_GET['keyword']) && !empty($_GET['keyword'])){\n            $where = \"name LIKE '%{$_GET['keyword']}%'\";\n            $parms = array(\"keyword\"=>$_GET['keyword']);\n            $mode  = \"keyword\";\n        }else if(isset($_GET['bookId']) && !empty($_GET['bookId'])){\n            $where = \"id = '{$_GET['bookId']}'\";\n            $parms = array(\"bookId\"=>$_GET['bookId']);\n            $mode  = \"bookId\";\n        }else{\n            $where = \"2>1\";\n            $parms = array();\n            $mode  = \"\";\n        }\n        \n        $bookModel = new BookModel;\n        //获取图书总数用于计算总页数\n        $count  = $bookModel->rowCount($where);\n\n        //判断页数是否合法\n        if($count != 0){\n            if($currentPage < 1){\n                $currentPage = 1;\n            }else if($currentPage > ceil($count/$eachPerPage)){\n                $currentPage = ceil($count/$eachPerPage);\n            }\n        }else{\n            //记录数为0时，直接从第一页开始，避免offset计算错误\n            $currentPage = 1;\n        }\n\n        //获取每页图书信息\n        $offset = ($currentPage - 1) * $eachPerPage;\n        $books = $bookModel->fetchAllWithJoin($where,\"LIMIT {$offset},{$eachPerPage}\");\n\n        //分页\n        $pager = new Pager($currentPage,$count,$eachPerPage,\"?p=Admin&c=Book&a=index\",$parms);\n        \n        $this->smarty->assign(\"books\",$books);\n        $this->smarty->assign(\"mode\",$mode);\n        $this->smarty->assign(\"pageStr\",$pager->page());\n        $this->smarty->display(\"Book/index.html\");\n    }\n\n    //显示图书详情页面\n    public function detail(){\n        $this->accessPage();\n\n        $id = $_GET['id'];\n\n        $bookModel = new BookModel;\n        $result = $bookModel->fetchOneWithJoin(\"book_info.id={$id}\");\n        \n        $this->smarty->assign(\"book\",$result);\n        $this->smarty->display(\"Book/detail.html\");\n    }\n\n    //显示添加图书页面\n    public function add(){\n        $this->accessPage();\n\n        $this->smarty->display(\"Book/add.html\");\n    }\n\n    //显示编辑图书页面\n    public function edit(){\n        $this->accessPage();\n\n        $id = $_GET['id'];\n\n        $bookModel =    new BookModel;\n        $book      =    $bookModel->fetchOne(\"id={$id}\");\n        \n        $this->smarty->assign(\"book\",$book);\n        $this->smarty->display(\"Book/edit.html\");\n    }\n\n    //Json添加图书接口\n    public function insert(){\n        $this->accessJson();\n        $bookInfo['name']       =    $_POST['name'];\n        $bookInfo['author']     =    $_POST['author'];\n        $bookInfo['press']      =    $_POST['press'];\n        $bookInfo['press_time']  =   $_POST['pressTime'];\n        $bookInfo['price']      =    $_POST['price'];\n        $bookInfo['ISBN']       =    $_POST['ISBN'];\n        $bookInfo['desc']       =    $_POST['desc'];\n\n        //验证信息是否填写完整\n        if(in_array(\"\",$bookInfo)){\n            $this->sendJsonMessage(\"请输入完整信息\",1);\n        }\n\n        $bookModel = new BookModel;\n        if($bookModel->insert($bookInfo)){\n            $this->sendJsonMessage(\"添加成功\",0);\n        }else{\n            $this->sendJsonMessage(\"添加失败\",1);\n        }\n    }\n\n    //Json接口修改图书\n    public function update(){\n        $this->accessJson();\n        \n        $id                      =    $_POST['id'];\n        $bookInfo['name']        =    $_POST['name'];\n        $bookInfo['author']      =    $_POST['author'];\n        $bookInfo['press']       =    $_POST['press'];\n        $bookInfo['press_time']  =    $_POST['press_time'];\n        $bookInfo['price']       =    $_POST['price'];\n        $bookInfo['ISBN']        =    $_POST['ISBN'];\n        $bookInfo['desc']        =    $_POST['desc'];\n\n        //验证信息是否填写完整\n        if(in_array(\"\",$bookInfo)){\n            $this->sendJsonMessage(\"请输入完整信息\",1);\n        }\n\n        $bookModel = new BookModel;\n        if($bookModel->update($bookInfo,\"id={$id}\")){\n            $this->sendJsonMessage(\"修改成功\",0);\n        }else{\n            $this->sendJsonMessage(\"修改失败\",1);\n        }\n    }\n\n    //Json删除图书接口\n    public function delete(){\n        $this->accessJson();\n\n        $id = $_POST['id'];\n\n        $bookModel   = new BookModel;\n        $borrowModel = new BorrowModel;\n        if($bookModel->delete(\"id={$id}\") && $borrowModel->delete(\"book_id={$id}\")){\n            $this->sendJsonMessage(\"删除成功\",0);\n        }else{\n            $this->sendJsonMessage(\"删除失败\",1);\n        }\n    }\n}"
  },
  {
    "path": "Admin/Controller/BorrowController.class.php",
    "content": "<?php\nnamespace Admin\\Controller;\nuse Base\\BaseController;\nuse Admin\\Model\\BorrowModel;\n\nfinal class Borrow extends BaseController{\n\n    public function index(){\n        $this->accessPage();\n\n        $this->smarty->display(\"Borrow/index.html\");\n    }\n\n    //Json借书和还书接口\n    public function manage(){\n        $this->accessJson();\n\n        $bookId  =  $_POST['bookId'];\n        $userId  =  $_POST['userId'];\n        $action  =  $_POST['action'];\n\n        if($userId == \"\" || $bookId == \"\"){\n            $this->sendJsonMessage(\"请填写完整信息\",1);\n        }\n\n        $borrowModel = new BorrowModel;\n        if($action == \"borrow\"){\n            //借书\n            if($borrowModel->canBorrow($bookId,$userId)){\n                $data = array(\n                    \"book_id\"     =>  $bookId,\n                    \"user_id\"     =>  $userId,\n                    \"borrow_date\" =>  date(\"Y-m-d\"),\n                    \"back_date\"   =>  date(\"Y-m-d\",strtotime(\"+2 month\"))\n                );\n                if($borrowModel->insert($data)){\n                    $this->sendJsonMessage(\"借书成功\",0);\n                }else{\n                    $this->sendJsonMessage(\"借书失败\",1);\n                }\n            }else{\n                $this->sendJsonMessage(\"信息错误或该书已借出\",1);\n            }\n        }else if($action == \"return\"){\n            //还书\n            if($borrowModel->canReturn($bookId,$userId)){\n                if($borrowModel->delete(\"book_id={$bookId} AND user_id={$userId}\")){\n                    $this->sendJsonMessage(\"还书成功\",0);\n                }else{\n                    $this->sendJsonMessage(\"还书失败\",1);\n                }\n            }else{\n                $this->sendJsonMessage(\"信息错误或该用户未借此书\",1);\n            }\n        }else{\n            $this->sendJsonMessage(\"参数错误\",1);\n        }\n    }\n\n    //Json续借接口\n    public function prolong(){\n        $this->accessJson();\n\n        //未传参中断\n        if(!isset($_POST['bookId']) || !isset($_POST['userId'])){\n            $this->sendJsonMessage(\"缺少参数\",1);\n        }\n\n        $bookId = $_POST['bookId'];\n        $userId = $_POST['userId'];\n\n        $borrowModel = new BorrowModel;\n        $result = $borrowModel->fetchOne(\"book_id={$bookId} AND user_id={$userId}\");\n\n        //没有借书就不能续借\n        if(empty($result)){\n            $this->sendJsonMessage(\"该用户没有借阅此书\",1);\n        }\n        //超期不能续借\n        if(strtotime($result['back_date']) < time()){\n            $this->sendJsonMessage(\"超期的书不能续借\",1);\n        }\n\n        //计算应还时间\n        $backTime = date(\"Y-m-d\",strtotime(\"+1 month\",strtotime($result['back_date'])));\n        $data = array(\"back_date\"=>$backTime);\n        if($borrowModel->update($data,\"book_id={$bookId} AND user_id={$userId}\")){\n            $this->sendJsonMessage(\"续借成功\",0);\n        }else{\n            $this->sendJsonMessage(\"续借失败\",1);\n        }\n    }\n\n    //Json还书接口\n    public function returnBook(){\n        $this->accessJson();\n\n        $bookId = $_POST['bookId'];\n        $userId = $_POST['userId'];\n\n        $borrowModel = new BorrowModel;\n        if($borrowModel->canReturn($bookId,$userId)){\n            if($borrowModel->delete(\"book_id={$bookId} AND user_id={$userId}\")){\n                $this->sendJsonMessage(\"还书成功\",0);\n            }else{\n                $this->sendJsonMessage(\"还书失败\",1);\n            }\n        }else{\n            $this->sendJsonMessage(\"信息错误或该用户未借此书\",1);\n        }\n    }\n}"
  },
  {
    "path": "Admin/Controller/IndexController.class.php",
    "content": "<?php\nnamespace Admin\\Controller;\nuse Base\\BaseController;\nuse Admin\\Model\\UserModel;\nuse Admin\\Model\\BookModel;\n\nfinal class Index extends BaseController{\n\n    public function index(){\n        $this->accessPage();\n\n        $userModel = new UserModel;\n        //查询用户人数\n        $userNum   =  $userModel->rowCount(\"admin != 1\");\n\n        $bookModel = new BookModel;\n        //查询图书数量\n        $bookNum   =  $bookModel->rowCount();\n\n        $this->smarty->assign(\"userNum\",$userNum);\n        $this->smarty->assign(\"bookNum\",$bookNum);\n        $this->smarty->display(\"Index/index.html\"); \n    }\n\n}"
  },
  {
    "path": "Admin/Controller/UserController.class.php",
    "content": "<?php\nnamespace Admin\\Controller;\nuse Base\\BaseController;\nuse Admin\\Model\\UserModel;\nuse Admin\\Model\\BorrowModel;\nuse Tool\\Pager;\n\nfinal class User extends BaseController{\n\n    public function index(){\n        $this->accessPage();\n\n        //页面参数\n        $currentPage = isset($_GET[\"page\"]) ? $_GET[\"page\"] : 1;    //当前页数\n        $eachPerPage = 10;      //每页显示条数\n\n        //获取搜索条件\n        if(isset($_GET['name']) && !empty($_GET['name'])){\n            $where = \"name LIKE '%{$_GET['name']}%'\";\n            $parms = array(\"name\"=>$_GET['name']);\n            $mode  = \"name\";\n        }else if(isset($_GET['userId']) && !empty($_GET['userId'])){\n            $where = \"id = '{$_GET['userId']}'\";\n            $parms = array(\"userId\"=>$_GET['userId']);\n            $mode  = \"userId\";\n        }else{\n            $where = \"2>1\";\n            $parms = array();\n            $mode  = \"\";\n        }\n\n        $userModel = new UserModel;\n        //获取记录条数，用于计算总页面数目\n        $count = $userModel->rowCount($where);\n\n        //判断页数是否合法\n        if($count != 0){\n            if($currentPage < 1){\n                $currentPage = 1;\n            }else if($currentPage > ceil($count/$eachPerPage)){\n                $currentPage = ceil($count/$eachPerPage);\n            }\n        }else{\n            //记录数为0时，直接从第一页开始，避免offset计算错误\n            $currentPage = 1;\n        }\n\n        //获取每页用户信息\n        $offset = ($currentPage - 1) * $eachPerPage;\n        $users = $userModel->fetchAllUser($where,\"LIMIT {$offset},{$eachPerPage}\");        \n\n        //分页\n        $pager = new Pager($currentPage,$count,$eachPerPage,\"?p=Admin&c=User&a=index\",$parms);\n\n        $this->smarty->assign(\"users\",$users);\n        $this->smarty->assign(\"mode\",$mode);\n        $this->smarty->assign(\"pageStr\",$pager->page());\n        $this->smarty->display(\"User/index.html\");\n    }\n\n    //显示添加用户界面\n    public function add(){\n        $this->accessPage();\n\n        $this->smarty->display(\"User/add.html\");\n    }\n\n    //显示管理用户界面\n    public function manage(){\n        $this->accessPage();\n\n        $id = $_GET['id'];\n\n        $userModel = new UserModel;\n        //获取用户信息\n        $userInfo  = $userModel->fetchOne(\"id={$id}\");\n        \n        //阻止url非法传参\n        if(empty($userInfo)){\n            echo \"<script>alert('该用户不存在');</script>\";\n            die();\n        }\n\n        $borrowModel = new BorrowModel;\n        //获取用户借阅信息\n        $borrowInfo = $borrowModel->getBorrowInfo(\"borrow_list.user_id={$id}\");\n        \n        $this->smarty->assign(\"userInfo\",$userInfo);\n        $this->smarty->assign(\"borrowInfo\",$borrowInfo);\n        $this->smarty->display(\"User/manage.html\");\n    }\n\n    //Json添加用户接口\n    public function insert(){\n        $this->accessJson();\n\n        $user['id']      =  $_POST['userId'];\n        $user['pwd']     =  md5($_POST['password']);\n        $user['name']    =  $_POST['name'];\n        $user['class']   =  $_POST['class'];\n        $user['status']  =  $_POST['status'] ? 1 : 0;\n\n        $usermodel = new UserModel;\n\n        if(in_array(\"\",$user)){\n            $this->sendJsonMessage(\"请将信息填写完整\",1);\n        }\n\n        if($usermodel->rowCount(\"id={$user['id']}\")){\n            $this->sendJsonMessage(\"该用户ID已存在\",1);\n        }\n\n        if($usermodel->insert($user)){\n            $this->sendJsonMessage(\"添加用户成功\",0);\n        }else{\n            $this->sendJsonMessage(\"添加用户失败\",1);\n        }\n    }\n\n    //Json修改用户接口\n    public function changeInfo(){\n        $this->accessJson();\n\n        $id             =  $_POST['userId'];\n        $data['name']   =  $_POST['name'];\n        $data['class']  =  $_POST['class'];\n\n        if(in_array(\"\",$data)){\n            $this->sendJsonMessage(\"请填写完整信息\",1);\n        }\n\n        $userModel = new UserModel;\n\n        if($userModel->update($data,\"id={$id}\")){\n            $this->sendJsonMessage(\"修改成功\",0);\n        }else{\n            $this->sendJsonMessage(\"修改失败\",1);\n        }\n    }\n\n    //Json挂失用户接口\n    public function lost(){\n        $this->accessJson();\n\n        $id  =  $_POST['userId'];\n\n        $userModel = new UserModel;\n        if($userModel->update(array(\"status\"=>0),\"id={$id}\")){\n            $this->sendJsonMessage(\"挂失成功\",0);\n        }else{\n            $this->sendJsonMessage(\"挂失失败\",1);\n        }\n    }\n\n    //Json启用用户接口\n    public function open(){\n        $this->accessJson();\n\n        $id  =  $_POST['userId'];\n\n        $userModel = new UserModel;\n        if($userModel->update(array(\"status\"=>1),\"id={$id}\")){\n            $this->sendJsonMessage(\"启用成功\",0);\n        }else{\n            $this->sendJsonMessage(\"启用失败\",1);\n        }\n    }\n\n    //Json修改用户密码接口\n    public function changePwd(){\n        $this->accessJson();\n\n        if(!$_POST['pwd']){\n            $this->sendJsonMessage(\"请输入密码\",1);\n        }\n\n        $id   = $_POST['userId'];\n        $pwd  = md5($_POST['pwd']);\n\n        $userModel = new UserModel;\n        if($userModel->update(array(\"pwd\"=>$pwd),\"id={$id}\")){\n            $this->sendJsonMessage(\"修改成功\",0);\n        }else{\n            $this->sendJsonMessage(\"修改失败\",1);\n        }\n    }\n\n    //Json删除用户接口\n    public function delete(){\n        $this->accessJson();\n\n        $id  =  $_POST['userId'];\n\n        $userModel   = new UserModel;\n        $borrowModel = new BorrowModel;\n        if($userModel->delete(\"id={$id}\") && $borrowModel->delete(\"user_id={$id}\")){\n            $this->sendJsonMessage(\"删除成功\",0);\n        }else{\n            $this->sendJsonMessage(\"删除失败\",1);\n        }\n    }\n}"
  },
  {
    "path": "Admin/Model/BookModel.class.php",
    "content": "<?php\nnamespace Admin\\Model;\nuse Base\\BaseModel;\n\nfinal class BookModel extends BaseModel{\n\n    //要操作的数据表名\n    protected $table = \"book_info\";\n\n    public function fetchAllWithJoin($where = \"2>1\",$limit = \"\"){\n\n        $sql  = \"SELECT id,name,author,user_id FROM {$this->table} \";\n        $sql .= \"LEFT JOIN borrow_list ON id=borrow_list.book_id \";\n        $sql .= \"WHERE {$where} \";\n        $sql .= \"{$limit}\";\n        \n        $result = $this->Db->query($sql);\n\n        //条数为1时,把一维数组转换成二维数组，避免某些foreach循环出错\n        if(count($result) == count($result,1) && !empty($result)){\n            $result = array($result);\n        }\n        \n        return $result;\n    }\n\n    public function fetchOneWithJoin($where = \"2>1\"){\n\n        $sql  = \"SELECT {$this->table}.*,borrow_list.back_date,user.name AS user_name FROM {$this->table} \";\n        $sql .= \"LEFT JOIN borrow_list ON {$this->table}.id=borrow_list.book_id \";\n        $sql .= \"LEFT JOIN user ON user.id=borrow_list.user_id \";\n        $sql .= \"WHERE {$where} \";\n        $sql .= \"LIMIT 1\";\n\n        return $this->Db->query($sql);\n    }\n\n}"
  },
  {
    "path": "Admin/Model/BorrowModel.class.php",
    "content": "<?php\nnamespace Admin\\Model;\nuse Base\\BaseModel;\n\nfinal class BorrowModel extends BaseModel{\n\n    //操作的数据表名\n    protected $table = \"borrow_list\";\n\n    public function canBorrow($bookId,$userId){\n        $sql  = \"SELECT user.id FROM user,book_info \";\n        $sql .= \"WHERE user.id='{$userId}' AND book_info.id='{$bookId}' AND user.admin!=1 AND book_info.id NOT IN \";\n        $sql .= \"(SELECT book_id FROM {$this->table})\";\n\n        if($this->Db->rowCount($sql)){\n            return true;\n        }else{\n            return false;\n        }\n    }\n\n    public function canReturn($bookId,$userId){\n        $sql  = \"SELECT * FROM {$this->table} \";\n        $sql .= \"WHERE user_id='{$userId}' AND book_id='{$bookId}'\";\n\n        if($this->Db->rowCount($sql)){\n            return true;\n        }else{\n            return false;\n        }\n    }\n\n    public function getBorrowInfo($where){\n        $sql  = \"SELECT book_info.id,book_info.name,borrow_list.borrow_date,borrow_list.back_date FROM book_info \";\n        $sql .= \"LEFT JOIN {$this->table} ON book_info.id=borrow_list.book_id \";\n        $sql .= \"WHERE {$where}\";\n\n        $result =  $this->Db->query($sql);\n\n        //条数为1时,把一维数组转换成二维数组，避免某些foreach循环出错\n        if(count($result) == count($result,1) && !empty($result)){\n            $result = array($result);\n        }\n\n        return $result;\n    }\n}"
  },
  {
    "path": "Admin/Model/UserModel.class.php",
    "content": "<?php\nnamespace Admin\\Model;\nuse Base\\BaseModel;\n\nfinal class UserModel extends BaseModel{\n\n    //操作的数据表名\n    protected $table = \"user\";\n\n    //获取所有除管理员外的用户信息\n    public function fetchAllUser($where = \"2>1\",$limit = \"\"){\n        $sql  = \"SELECT id,name,class,status,last_login_time FROM {$this->table} \";\n        $sql .= \"WHERE {$where} AND admin!=1 \";\n        $sql .= \"{$limit}\";\n        \n        $result =  $this->Db->query($sql);\n\n        //条数为1时,把一维数组转换成二维数组，避免某些foreach循环出错\n        if(count($result) == count($result,1) && !empty($result)){\n            $result = array($result);\n        }\n        return $result;\n    }\n\n    //重写rowCount方法，将管理员排除在统计范围外\n    public function rowCount($where = \"2>1\")\n    {\n        $sql  = \"SELECT * FROM {$this->table} \";\n        $sql .= \"WHERE {$where} AND admin!=1\";\n\n        return $this->Db->rowCount($sql);\n    }\n}"
  },
  {
    "path": "Admin/View/Book/add.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\" aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Admin&c=Index&a=index\">主页</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Admin&c=Book&a=index\">图书管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=User&a=index\">用户管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Borrow&a=index\">借阅管理</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"h3 text-center\">\n        <b>添加图书</b>\n    </div>\n    <form id=\"form\" class=\"form-horizontal text-center\" style=\"width:500px;margin: 20px auto 0;\">\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">图书名</div>\n                <input type=\"text\" class=\"form-control\" placeholder=\"请输入图书名\" name=\"name\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">作者</div>\n                <input type=\"text\" class=\"form-control\" placeholder=\"请输入作者\" name=\"author\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">出版社</div>\n                <input type=\"text\" class=\"form-control\" placeholder=\"请输入出版社\" name=\"press\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">出版时间</div>\n                <input type=\"\" class=\"form-control\" placeholder=\"请输入出版时间\" name=\"pressTime\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">价格</div>\n                <input type=\"text\" class=\"form-control\" placeholder=\"请输入价格\" name=\"price\">\n                <div class=\"input-group-addon\">元</div>\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">ISBN</div>\n                <input type=\"text\" class=\"form-control\" placeholder=\"请输入ISBN\" name=\"ISBN\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <label class=\"text-left\" style=\"width: 100%\">作品简介：</label>\n            <textarea class=\"form-control\" id=\"text1\" style=\"height: 200px;resize: none;\" name=\"desc\"></textarea>\n        </div>\n        <div class=\"form-group\">\n            <button type=\"button\" id=\"submit\" class=\"btn btn-primary\" style=\"margin-right: 20px\">添&nbsp;加</button>\n            <button type=\"reset\" class=\"btn btn-danger\" style=\"margin-left: 20px\">重&nbsp;置</button>\n        </div>\n    </form>\n</body>\n<script>\n\n    $(function(){\n        $(\"#submit\").click(function(){\n            $.post({\n                url:\"?p=Admin&c=Book&a=insert\",\n                data:$(\"#form\").serialize(),\n                success:function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        location.href = \"?p=Admin&c=Book&a=index\";\n                    }\n                }\n            });\n        });\n    })\n\n</script>\n</html>"
  },
  {
    "path": "Admin/View/Book/detail.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\"\n                    aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Admin&c=Index&a=index\">主页</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Admin&c=Book&a=index\">图书管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=User&a=index\">用户管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Borrow&a=index\">借阅管理</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"h3 text-center\">\n        <b>图书详情</b>\n    </div>\n    <div class=\"form-horizontal text-center\" style=\"width:500px;margin: 20px auto 0;\">\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">图书名：</div>\n                <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.name>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">作者：</div>\n                <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.author>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">出版社：</div>\n                <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.press>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">出版时间：</div>\n                <input type=\"\" class=\"form-control\" readonly value=\"{<$book.press_time>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">价格：</div>\n                <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.price>}\">\n                <div class=\"input-group-addon\">元</div>\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">ISBN：</div>\n                <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.ISBN>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <label class=\"text-left\" style=\"width: 100%\">作品简介：</label>\n            <textarea class=\"form-control\" style=\"height: 150px;resize:none;\" readonly>{<$book.desc>}</textarea>\n        </div>\n        <div class=\"center-block\" style=\"width:200px;\">\n            <div class=\"form-group\">\n                <div class=\"input-group\">\n                    <div class=\"input-group-addon\">借出人</div>\n                    <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.user_name>}\">\n                </div>\n            </div>\n            <div class=\"form-group\">\n                <div class=\"input-group\">\n                    <div class=\"input-group-addon\">应还日期</div>\n                    <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.back_date>}\">\n                </div>\n            </div>\n        </div>\n    </div>\n</body>\n\n</html>"
  },
  {
    "path": "Admin/View/Book/edit.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\" aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Admin&c=Index&a=index\">主页</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Admin&c=Book&a=index\">图书管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=User&a=index\">用户管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Borrow&a=index\">借阅管理</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"h3 text-center\">\n        <b>编辑图书</b>\n    </div>\n    <form id=\"form\" class=\"form-horizontal text-center\" style=\"width:500px;margin: 20px auto 0;\">\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">图书名：</div>\n                <input type=\"text\" class=\"form-control\" name=\"name\" value=\"{<$book.name>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">作者：</div>\n                <input type=\"text\" class=\"form-control\" name=\"author\" value=\"{<$book.author>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">出版社：</div>\n                <input type=\"text\" class=\"form-control\" name=\"press\" value=\"{<$book.press>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">出版时间：</div>\n                <input type=\"\" class=\"form-control\" name=\"press_time\" value=\"{<$book.press_time>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">价格：</div>\n                <input type=\"text\" class=\"form-control\" name=\"price\" value=\"{<$book.price>}\">\n                <div class=\"input-group-addon\">元</div>\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">ISBN：</div>\n                <input type=\"text\" class=\"form-control\" name=\"ISBN\" value=\"{<$book.ISBN>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <label class=\"text-left\" style=\"width: 100%\">作品简介：</label>\n            <textarea class=\"form-control\" style=\"height: 200px; resize:none;\" name=\"desc\">{<$book.desc>}</textarea>\n        </div>\n        <div class=\"form_group\">\n            <input type=\"hidden\" name=\"id\" value=\"{<$book.id>}\">\n        </div>\n        <div class=\"form-group\">\n            <button type=\"button\" id=\"submit\" class=\"btn btn-primary\" style=\"margin-right: 20px\">确&nbsp;认</button>\n            <button type=\"reset\" class=\"btn btn-danger\" style=\"margin-left: 20px\">重&nbsp;置</button>\n        </div>\n    </form>\n</body>\n\n<script>\n\n    $(function(){\n\n        $(\"#submit\").click(function(){\n            $.post({\n                url: \"?p=Admin&c=Book&a=update\",\n                data: $(\"#form\").serialize(),\n                success:function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        location.href = \"?p=Admin&c=Book&a=index\";\n                    }\n                }\n            });\n        });\n\n    })\n\n</script>\n\n</html>"
  },
  {
    "path": "Admin/View/Book/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n    <style type=\"text/css\">\n        td {\n            vertical-align: middle !important;\n        }\n    </style>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\" aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Admin&c=Index&a=index\">主页</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Admin&c=Book&a=index\">图书管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=User&a=index\">用户管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Borrow&a=index\">借阅管理</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"container-fluid\">\n        <div style=\"width:300px;\" class=\"center-block\">\n            <div class=\"form-inline\">\n                <div class=\"form-group\">\n                    <input type=\"text\" id=\"input\" class=\"form-control\" placeholder=\"输入搜索内容\" name=\"keyword\" style=\"width:130px;\"\n                           {<if $mode == keyword>}value='{<$smarty.get.keyword>}'{<else if $mode == bookId>}value='{<$smarty.get.bookId>}'{</if>}>\n                </div>\n                <div class=\"form-group\">\n                    <select name=\"type\" class=\"form-control\">\n                        <option value=\"name\" {<if $mode == keyword>}selected{</if>}>书名查询</option>\n                        <option value=\"num\" {<if $mode == bookId>}selected{</if>}>书号查询</option>\n                    </select>\n                </div>\n                <div class=\"form-group\">\n                    <button type=\"button\" id=\"research\" class=\"btn btn-primary\">搜索</button>\n                </div>\n            </div>\n        </div>\n        <a class=\"btn btn-info pull-right\" href=\"?p=Admin&c=Book&a=add\" style=\"margin:15px 10px 10px;\">添加图书</a>\n        <table class=\"table table-bordered table-hover text-center\">\n            <thead>\n                <tr class=\"active\">\n                    <th class=\"text-center\">图书号</th>\n                    <th class=\"text-center\">图书名</th>\n                    <th class=\"text-center\">作者</th>\n                    <th class=\"text-center\" style=\"width: 90px;\">状态</th>\n                    <th class=\"text-center\" style=\"width: 100px;\">操作</th>\n                </tr>\n            </thead>\n            <tbody>\n                {<if empty($books)>}\n                    <tr>\n                        <td colspan=\"5\">无记录！</td>\n                    </tr>\n                {</if>}\n                {<foreach $books as $book>}\n                    <tr>\n                        <td>{<$book.id>}</td>\n                        <td>\n                            <a href=\"?p=Admin&c=Book&a=detail&id={<$book.id>}\">{<$book.name>}</a>\n                        </td>\n                        <td>{<$book.author>}</td>\n                        {<if $book.user_id == \"\">}\n                            <td class=\"success\">在馆</td>\n                        {<else>}\n                            <td class=\"danger\">已借出</td>\n                        {</if>}\n                        <td>\n                            <a href=\"?p=Admin&c=Book&a=edit&id={<$book.id>}\" class=\"btn btn-success btn-xs\">修改</a>&nbsp;\n                            <button class=\"btn btn-danger btn-xs delete\" bookId=\"{<$book.id>}\">删除</button>\n                        </td>\n                    </tr>\n                {</foreach>}\n            </tbody>\n        </table>\n\n        <!-- 分页 -->\n        {<$pageStr>}\n\n    </div>\n</body>\n<script>\n    \n    $(function(){\n\n        //注册回车查找\n        $(\"#input\").keydown(function(event){\n            if(event.keyCode == 13){\n                $(\"#research\").click();\n            }\n        });\n        //查找\n        $(\"#research\").click(function(){\n            if($(\"#input\").val().length > 0){\n                if($(\"[name='type']\").val() == \"name\"){\n                    var mode = \"keyword\";\n                }else if($(\"[name='type']\").val() == \"num\"){\n                    var mode = \"bookId\";\n                }\n                location.href = \"?p=Admin&c=Book&a=index&\"+ mode + \"=\" + $(\"#input\").val();\n            }else{\n                alert(\"请输入搜索条件\");\n            }\n        });\n\n        //删除\n        $(\".delete\").click(function(){\n            if(confirm(\"真的要删除吗?\")){\n                $.post({\n                    url: \"?p=Admin&c=Book&a=delete\",\n                    data: {\"id\":$(this).attr(\"bookId\")},\n                    success:function(data){\n                        alert(data.message);\n                        location.reload();\n                    }\n                });\n            }\n        })\n    });\n\n</script>\n\n</html>"
  },
  {
    "path": "Admin/View/Borrow/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n    <style type=\"text/css\">\n        td {\n            vertical-align: middle !important;\n        }\n    </style>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\" aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Admin&c=Index&a=index\">主页</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Book&a=index\">图书管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=User&a=index\">用户管理</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Admin&c=Borrow&a=index\">借阅管理</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"h3 text-center\" style=\"margin: 100px 0 25px;\">\n        <b>借阅管理(模拟机器扫描操作)</b>\n    </div>\n    <div class=\"container\" style=\"width: 350px;\">\n        <form id=\"form\">\n            <div class=\"form-group\">\n                <div class=\"input-group\">\n                    <div class=\"input-group-addon\">读者ID</div>\n                    <input type=\"text\" class=\"form-control\" name=\"userId\" placeholder=\"请输入读者ID\">\n                </div>\n            </div>\n            <div class=\"form-group\">\n                <div class=\"input-group\">\n                    <div class=\"input-group-addon\">图书号</div>\n                    <input type=\"text\" class=\"form-control\" name=\"bookId\" placeholder=\"请输入图书号\">\n                </div>\n            </div>\n            <div class=\"from-control text-center\" style=\"margin-top: 25px;\">\n                <b>操作：&nbsp;&nbsp;</b>\n                <label>\n                    <input type=\"radio\" name=\"action\" value=\"borrow\" checked>\n                    <span>借&nbsp;书</span>\n                </label>\n                &nbsp;&nbsp;\n                <label>\n                    <input type=\"radio\" name=\"action\" value=\"return\">\n                    <span>还&nbsp;书</span>\n                </label>\n            </div>\n            <div class=\"text-center\" style=\"margin-top: 20px;\">\n                <button type=\"button\" id=\"submit\" class=\"btn btn-info\">确&nbsp;定</button>&nbsp;&nbsp;&nbsp;&nbsp;\n                <button type=\"reset\" class=\"btn btn-danger\">重&nbsp;置</button>\n            </div>\n        </form>\n    </div>\n</body>\n<script>\n    $(function(){\n\n        $(\"#submit\").click(function(){\n            if($(\"[name='userId']\").val().length == 0 || $(\"[name='bookId']\").val().length == 0){\n                alert(\"请填写完整信息\");\n                return false;\n            }\n            $.post({\n                url: \"?p=Admin&c=Borrow&a=manage\",\n                data: $(\"#form\").serialize(),\n                success:function(data){\n                    alert(data.message);\n                }\n            })\n        })\n\n    })\n</script>\n</html>"
  },
  {
    "path": "Admin/View/Index/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\" style=\"height: 100%;\">\n\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n  <title>图书馆管理系统</title>\n  <!--jquery-->\n  <script src=\"./Resources/jquery.min.js\"></script>\n  <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n  <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n  <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n  <script src=\"./Resources/bootstrap.min.js\"></script>\n</head>\n\n<body style=\"background-image: url(./Resources/index.jpg);background-size:100% 100%;\">\n  <nav class=\"navbar navbar-default\">\n    <div class=\"container-fluid\">\n      <!-- Brand and toggle get grouped for better mobile display -->\n      <div class=\"navbar-header\">\n        <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\" aria-expanded=\"false\">\n          <span class=\"icon-bar\"></span>\n          <span class=\"icon-bar\"></span>\n          <span class=\"icon-bar\"></span>\n        </button>\n        <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n          <b>图书馆管理系统</b>\n        </a>\n      </div>\n\n      <!-- Collect the nav links, forms, and other content for toggling -->\n      <div class=\"collapse navbar-collapse\" id=\"nav\">\n        <ul class=\"nav navbar-nav\">\n          <li class=\"active\">\n            <a href=\"?p=Admin&c=Index&a=index\">主页</a>\n          </li>\n          <li>\n            <a href=\"?p=Admin&c=Book&a=index\">图书管理</a>\n          </li>\n          <li>\n            <a href=\"?p=Admin&c=User&a=index\">用户管理</a>\n          </li>\n          <li>\n            <a href=\"?p=Admin&c=Borrow&a=index\">借阅管理</a>\n          </li>\n        </ul>\n        <ul class=\"nav navbar-nav navbar-right\">\n          <li>\n            <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n          </li>\n          <li>\n            <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n          </li>\n          </li>\n        </ul>\n      </div>\n      <!-- /.navbar-collapse -->\n    </div>\n    <!-- /.container-fluid -->\n  </nav>\n  <div class=\"container\">\n    <div class=\"center-block\" style=\"margin-top:50px;padding:20px;width:500px;background-color:rgba(255, 255, 255, 0.55);border-radius:30px;\">\n      <h3 class=\"text-center\">{<$smarty.session.userId>}管理员，你好！</h3>\n      <h3 class=\"text-center\" style=\"margin-top:70px;\">当前共有{<$bookNum>}本图书</h3>\n      <h3 class=\"text-center\">当前共有{<$userNum>}位读者</h3>\n      <h4 class=\"text-center\" style=\"margin-top:70px;\">上次登录时间：</h4>\n      <h4 class=\"text-center\">{<$smarty.session.last_login_time>}</h4>\n    </div>\n  </div>\n</body>\n\n</html>"
  },
  {
    "path": "Admin/View/User/add.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\" aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Admin&c=Index&a=index\">主页</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Book&a=index\">图书管理</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Admin&c=User&a=index\">用户管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Borrow&a=index\">借阅管理</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"h3 text-center\" style=\"margin-top: 100px;\">\n        <b>添加用户</b>\n    </div>\n    <form id=\"form\" class=\"form-horizontal text-center\" style=\"width:250px;margin: 20px auto 0;\">\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">用户ID</div>\n                <input type=\"text\" class=\"form-control\" placeholder=\"请输入用户ID\" name=\"userId\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">密码</div>\n                <input type=\"password\" class=\"form-control\" placeholder=\"请输入密码\" name=\"password\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">姓名</div>\n                <input type=\"text\" class=\"form-control\" placeholder=\"请输入姓名\" name=\"name\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">班级</div>\n                <input type=\"text\" class=\"form-control\" placeholder=\"请输入班级\" name=\"class\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">状态</div>\n                <select name=\"status\" class=\"form-control\">\n                    <option value=\"1\">正常</option>\n                    <option value=\"0\">挂失</option>\n                </select>\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <button type=\"button\" id=\"submit\" class=\"btn btn-primary\" style=\"margin-right: 10px\">添&nbsp;加</button>\n            <button type=\"reset\" id=\"reset\" class=\"btn btn-danger\" style=\"margin-left: 10px\">重&nbsp;置</button>\n        </div>\n    </form>\n</body>\n\n<script>\n\n    $(function(){\n\n        $(\"#submit\").click(function(){\n            $.post({\n                url: \"?p=Admin&c=User&a=insert\",\n                data: $(\"#form\").serialize(),\n                success: function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        $(\"#reset\").click();\n                    }\n                }\n            })\n        });\n\n    })\n\n</script>\n\n</html>"
  },
  {
    "path": "Admin/View/User/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n    <style type=\"text/css\">\n        td {\n            vertical-align: middle !important;\n        }\n    </style>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\" aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Admin&c=Index&a=index\">主页</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Book&a=index\">图书管理</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Admin&c=User&a=index\">用户管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Borrow&a=index\">借阅管理</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"container-fluid\">\n        <div style=\"width:300px;\" class=\"center-block\">\n            <div class=\"form-inline\">\n                <div class=\"form-group\">\n                    <input type=\"text\" class=\"form-control\" placeholder=\"输入搜索内容\" id=\"input\" style=\"width:130px;\"\n                    {<if $mode == name>}value='{<$smarty.get.name>}'{<else if $mode == userId>}value='{<$smarty.get.userId>}'{</if>}>\n                </div>\n                <div class=\"form-group\">\n                    <select name=\"type\" class=\"form-control\">\n                        <option value=\"num\" {<if $mode == userId>}selected{</if>}>ID查询</option>\n                        <option value=\"name\" {<if $mode == name>}selected{</if>}>姓名查询</option>\n                    </select>\n                </div>\n                <div class=\"form-group\">\n                    <button type=\"button\" id=\"research\" class=\"btn btn-primary\">搜索</button>\n                </div>\n            </div>\n        </div>\n        <div class=\"container\">\n            <a class=\"btn btn-info pull-right\" href=\"?p=Admin&c=User&a=add\" style=\"margin:15px 10px 10px;\">添加用户</a>\n            <table class=\"table table-bordered table-hover text-center\">\n                <thead>\n                    <tr class=\"active\">\n                        <th class=\"text-center\">用户ID</th>\n                        <th class=\"text-center\">姓名</th>\n                        <th class=\"text-center\">班级</th>\n                        <th class=\"text-center\">最后登陆时间</th>\n                        <th class=\"text-center\">状态</th>\n                        <th class=\"text-center\" style=\"width:70px;\">操作</th>\n                    </tr>\n                </thead>\n                <tbody>\n                    {<if empty($users)>}\n                        <tr>\n                            <td colspan=\"6\">无记录！</td>\n                        </tr>\n                    {</if>}\n                    {<foreach $users as $user>}\n                        <tr>\n                            <td>{<$user.id>}</td>\n                            <td>{<$user.name>}</td>\n                            <td>{<$user.class>}</td>\n                            <td>{<$user.last_login_time>}</td>\n                            {<if $user.status == 1>}\n                                <td class=\"success\">正常</td>\n                            {<else>}\n                                <td class=\"danger\">挂失</td>\n                            {</if>}\n                            <td>\n                                <a href=\"?p=Admin&c=User&a=manage&id={<$user.id>}\" class=\"btn btn-primary btn-xs\">详情</a>\n                            </td>\n                        </tr>\n                    {</foreach>}\n                </tbody>\n            </table>\n        </div>\n        <!-- 分页 -->\n        {<$pageStr>}\n</body>\n<script>\n\n    $(function(){\n\n        //注册回车查找\n        $(\"#input\").keydown(function(event){\n            if(event.keyCode == 13){\n                $(\"#research\").click();\n            }\n        });\n        //查找\n        $(\"#research\").click(function(){\n            if($(\"#input\").val().length > 0){\n                if($(\"[name='type']\").val() == \"name\"){\n                    var mode = \"name\";\n                }else if($(\"[name='type']\").val() == \"num\"){\n                    var mode = \"userId\";\n                }\n                location.href = \"?p=Admin&c=User&a=index&\"+ mode + \"=\" + $(\"#input\").val();\n            }else{\n                alert(\"请输入搜索条件\");\n            }\n        });\n\n    })\n\n</script>\n\n</html>"
  },
  {
    "path": "Admin/View/User/manage.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n    <style type=\"text/css\">\n        td {\n            vertical-align: middle !important;\n        }\n    </style>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\"\n                    aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Admin&c=Index&a=index\">主页</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Book&a=index\">图书管理</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Admin&c=User&a=index\">用户管理</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Admin&c=Borrow&a=index\">借阅管理</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"text-center container\" style=\"width:65%;margin-top:40px;padding-top:10px;background-color: #f5f5f5;border-radius:20px;\">\n        <div class=\"h4\">\n            <b>用户信息</b>\n        </div>\n        <p>用户ID：{<$userInfo.id>}</p>\n        <p>用户姓名：{<$userInfo.name>}</p>\n        <p>用户班级：{<$userInfo.class>}</p>\n        <p>用户状态：{<if $userInfo.status>}正常{<else>}<font color='red'>挂失</font>{</if>}</p>\n        <div style=\"width: 450px;margin:20px auto;overflow: hidden;display: flex;justify-content: space-between\">\n            <button class=\"btn btn-success\" data-toggle=\"modal\" data-target=\"#info\">修改账户</button>\n            <button class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#lock\"> {<if $userInfo.status>}挂失{<else>}启用{</if>}账户</button>\n            <button class=\"btn btn-warning\" data-toggle=\"modal\" data-target=\"#pwd\">修改密码</button>\n            <button class=\"btn btn-danger\" data-toggle=\"modal\" data-target=\"#del\">删除账户</button>\n        </div>\n    </div>\n    <div class=\"container text-center\" style=\"width: 65%;margin-top:30px;padding:0;\">\n        <div class=\"h4\">\n            <b>用户借阅信息</b>\n        </div>\n        <table class=\"table table-bordered table-hover\">\n            <thead>\n                <tr class=\"active\">\n                    <th class=\"text-center\">图书号</th>\n                    <th class=\"text-center\">图书名称</th>\n                    <th class=\"text-center\">借书时间</th>\n                    <th class=\"text-center\">应还时间</th>\n                    <th class=\"text-center\" style=\"width:100px;\">操作</th>\n                </tr>\n            </thead>\n            <tbody>\n                {<if empty($borrowInfo)>}\n                    <tr>\n                        <td colspan=\"5\">无记录！</td>\n                    </tr>\n                {</if>}\n                {<foreach $borrowInfo as $one>}\n                    <tr {<if strtotime($one.back_date) < time()>}class=\"danger\"{</if>}>\n                        <td>{<$one.id>}</td>\n                        <td>{<$one.name>}</td>\n                        <td>{<$one.borrow_date>}</td>\n                        <td>{<$one.back_date>}</td>\n                        <td bookId=\"{<$one.id>}\">\n                            <button class=\"btn btn-info btn-xs prolong {<if strtotime($one.back_date) < time()>}disabled{</if>}\">续借</button>&nbsp;\n                            <button class=\"btn btn-success btn-xs return\">归还</button>\n                        </td>\n                    </tr>\n                {</foreach>}\n            </tbody>\n        </table>\n    </div>\n\n    <div class=\"container-fluid text-center\">\n        <!-- 修改用户信息模态框（Modal） -->\n        <div class=\"modal fade\" id=\"info\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">\n            <div class=\"modal-dialog\" style=\"margin-top:150px;\">\n                <div class=\"modal-content\">\n                    <form id=\"changeInfo\">\n                        <div class=\"modal-header\">\n                            <h4 class=\"modal-title\" id=\"myModalLabel\">\n                                修改用户信息\n                            </h4>\n                        </div>\n                        <div class=\"modal-body center-block\" style=\"width:45%\">\n                            <div class=\"form-group\">\n                                <div class=\"input-group\">\n                                    <div class=\"input-group-addon\">姓名</div>\n                                    <input name=\"name\" type=\"text\" class=\"form-control\" value=\"{<$userInfo.name>}\">\n                                </div>\n                            </div>\n                            <div class=\"form-group\" style=\"margin-bottom:0\">\n                                <div class=\"input-group\">\n                                    <div class=\"input-group-addon\">班级</div>\n                                    <input name=\"class\" type=\"text\" class=\"form-control\" value=\"{<$userInfo.class>}\">\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"modal-footer\">\n                            <button id=\"changeButton\" type=\"button\" class=\"btn btn-primary\">确认</button>\n                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">关闭</button>\n                        </div>\n                    </form>\n                </div>\n                <!-- /.modal-content -->\n            </div>\n            <!-- /.modal -->\n        </div>\n\n        <!-- 挂失用户模态框（Modal） -->\n        <div class=\"modal fade\" id=\"lock\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">\n            <div class=\"modal-dialog\" style=\"margin-top:150px;\">\n                <div class=\"modal-content\">\n                    <div class=\"modal-header\">\n                        <h4 class=\"modal-title\" id=\"myModalLabel\">\n                            {<if $userInfo.status>}挂失{<else>}启用{</if>}账户\n                        </h4>\n                    </div>\n                    <div class=\"modal-body\">\n                        <h4>确认要{<if $userInfo.status>}挂失{<else>}启用{</if>}账号为{<$userInfo.id>}的账户?</h3>\n                    </div>\n                    <div class=\"modal-footer\">\n                        <button id=\"{<if $userInfo.status>}lostButton{<else>}openButton{</if>}\" class=\"btn btn-primary\">确认</button>\n                        <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">关闭</button>\n                    </div>\n                </div>\n                <!-- /.modal-content -->\n            </div>\n            <!-- /.modal -->\n        </div>\n\n        <!-- 修改密码模态框（Modal） -->\n        <div class=\"modal fade\" id=\"pwd\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">\n            <div class=\"modal-dialog\" style=\"margin-top:150px;\">\n                <div class=\"modal-content\">\n                    <div>\n                        <div class=\"modal-header\">\n                            <h4 class=\"modal-title\" id=\"myModalLabel\">\n                                修改密码\n                            </h4>\n                        </div>\n                        <div class=\"modal-body center-block\" style=\"width:45%\">\n                            <div class=\"form-group \" style=\"margin-bottom:0\">\n                                <div class=\"input-group\">\n                                    <div class=\"input-group-addon\">新密码</div>\n                                    <input id=\"newPwd\" type=\"password\" class=\"form-control\" placeholder=\"请输入新密码\">\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"modal-footer\">\n                            <button id=\"pwdButton\" type=\"button\" class=\"btn btn-primary\">确认</button>\n                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">关闭</button>\n                        </div>\n                    </div>\n                </div>\n                <!-- /.modal-content -->\n            </div>\n            <!-- /.modal -->\n        </div>\n\n        <!-- 删除用户模态框（Modal） -->\n        <div class=\"modal fade\" id=\"del\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">\n            <div class=\"modal-dialog\" style=\"margin-top:150px;\">\n                <div class=\"modal-content\">\n                    <div class=\"modal-header\">\n                        <h4 class=\"modal-title\" id=\"myModalLabel\">\n                            删除账户\n                        </h4>\n                    </div>\n                    <div class=\"modal-body\">\n                        <h4>确认要删除账号为{<$userInfo.id>}的账户?</h3>\n                    </div>\n                    <div class=\"modal-footer\">\n                        <button id=\"deleteButton\" class=\"btn btn-primary\">确认</button>\n                        <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">关闭</button>\n                    </div>\n                </div>\n                <!-- /.modal-content -->\n            </div>\n            <!-- /.modal -->\n        </div>\n    </div>\n</body>\n<script>\n\n    $(function(){\n\n        //更改信息\n        $(\"#changeButton\").click(function(){\n            $.post({\n                url: \"?p=Admin&c=User&a=changeInfo\",\n                data: \"userId={<$userInfo.id>}&\" + $(\"#changeInfo\").serialize(),\n                success:function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        location.reload();\n                    }\n                }\n            })\n        });\n\n        //挂失和启用\n        $(\"#{<if $userInfo.status>}lostButton{<else>}openButton{</if>}\").click(function(){\n            $.post({\n                url: \"?p=Admin&c=User&a={<if $userInfo.status>}lost{<else>}open{</if>}\",\n                data:{\n                    userId : \"{<$userInfo.id>}\"\n                },\n                success:function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        location.reload();\n                    }\n                }\n            })\n        });\n\n        //修改密码\n        $(\"#pwdButton\").click(function(){\n            $.post({\n                url: \"?p=Admin&c=User&a=changePwd\",\n                data:{\n                    userId : \"{<$userInfo.id>}\",\n                    pwd : $(\"#newPwd\").val()\n                },\n                success:function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        location.reload();\n                    }\n                }\n            })\n        });\n\n        //删除用户\n        $(\"#deleteButton\").click(function(){\n            $.post({\n                url: \"?p=Admin&c=User&a=delete\",\n                data:{\n                    userId : \"{<$userInfo.id>}\"\n                },\n                success:function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        location.href = \"?p=Admin&c=User&a=index\";\n                    }\n                }\n            })\n        });\n\n        //续借\n        $(\".prolong\").click(function(){\n            $.post({\n                url: \"?p=Admin&c=Borrow&a=prolong\",\n                data:{\n                    bookId : $(this).parent().attr(\"bookID\"),\n                    userId : \"{<$userInfo.id>}\"\n                },\n                success:function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        location.reload();\n                    }\n                }\n            })\n        });\n\n        //还书\n        $(\".return\").click(function(){\n            $.post({\n                url: \"?p=Admin&c=Borrow&a=returnBook\",\n                data:{\n                    bookId : $(this).parent().attr(\"bookID\"),\n                    userId : \"{<$userInfo.id>}\"\n                },\n                success:function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        location.reload();\n                    }\n                }\n            })\n        });\n\n    })\n\n</script>\n\n</html>"
  },
  {
    "path": "Base/Base.class.php",
    "content": "<?php\nabstract class Base{\n\n    public static function Run(){\n        self::pageInit();\n        self::dirInit();\n        self::autoLoad();\n        self::readConf();\n        self::getRequest();\n        self::distributeRequest();\n    }\n\n    private static function pageInit(){\n        header(\"Content-Type:text/html;charset:UTF-8\");\n        session_start();\n    }\n    \n    private static function dirInit(){\n        //文件路径初始化\n        define(\"DS\",DIRECTORY_SEPARATOR);\n        define(\"ROOT\",getcwd().DS);\n    }\n\n    private static function autoLoad(){\n        //设置类的自动加载\n        spl_autoload_register(function($className){\n            $className = str_replace(\"\\\\\",DS,$className);\n            //获取类文件路径名\n            $files = array(\n                \"Controller.class.php\",\n                \".class.php\",\n            );\n            //循环包含需要的文件\n            foreach($files as $file){\n                $fileName = ROOT . $className . $file;\n                if(file_exists($fileName)){\n                    require_once($fileName);\n                    break;\n                }\n            }\n        });\n    }\n\n    private static function readConf(){\n        $GLOBALS['conf'] = require_once(\"./Base/Conf.php\");\n    }\n\n    //获取路由参数\n    private static function getRequest(){\n        $p = isset($_GET[\"p\"]) ? $_GET['p'] : $GLOBALS['conf']['default_plantform'];\n        $c = isset($_GET[\"c\"]) ? $_GET['c'] : $GLOBALS['conf']['default_controller'];\n        $a = isset($_GET[\"a\"]) ? $_GET['a'] : $GLOBALS['conf']['default_action'];\n        define(\"P\",$p);\n        define(\"C\",$c);\n        define(\"A\",$a);\n        //定义视图文件路径\n        define(\"VIEWPATH\",ROOT.P.DS.\"View\".DS);\n    }\n\n    //分发请求\n    private static function distributeRequest(){\n        $className = \"\\\\\" . P . \"\\\\Controller\\\\\" . C;\n        //  \\Admin\\Controller\\Index\n        $action = A;\n\n        if(class_exists($className)){\n            $Controller = new $className;\n        }else{\n            echo \"c参数错误\";\n            die();\n        }\n\n        if(method_exists($Controller,$action)){\n            $Controller->$action();\n        }else{\n            echo \"a参数错误\";\n            die();\n        }\n    }\n\n}"
  },
  {
    "path": "Base/BaseController.class.php",
    "content": "<?php\nnamespace Base;\nuse Tool\\MySmarty;\n\nabstract class BaseController{\n\n    protected $smarty;\n    \n    public function __construct(){\n        $this->smarty = MySmarty::getInstance();\n    }\n\n    //验证页面权限\n    protected function accessPage(){\n        if(isset($_SESSION['userId'])){\n            if($_SESSION['admin'] == 1 && P == \"Admin\");\n            else if($_SESSION['admin'] == 0 && P == \"Home\");\n            else{\n                $p = $_SESSION['admin'] ? \"Admin\" : \"Home\";\n                header(\"location:?p={$p}&c=Index&a=index\");\n                die();\n            }\n        }else{\n            header(\"location:?p=Common&c=Login&a=index\");\n            die();\n        }\n    }\n\n    //验证接口权限\n    protected function accessJson(){\n        header(\"Content-Type:application/json\");\n        if(isset($_SESSION['userId'])){\n            if($_SESSION['admin'] == 1 && P == \"Admin\");\n            else if($_SESSION['admin'] == 0 && P == \"Home\");\n            else{\n                $this->sendJsonMessage(\"操作权限不足\",1);\n            }\n        }else{\n            $this->sendJsonMessage(\"未登陆\",1);\n        }\n    }\n\n    //返回Json信息\n    protected function sendJsonMessage($message,$code){\n        $message = array(\"message\"=>$message,\"code\"=>$code);\n        echo json_encode($message,JSON_UNESCAPED_UNICODE);\n        die();\n    }\n\n}"
  },
  {
    "path": "Base/BaseModel.class.php",
    "content": "<?php\nnamespace Base;\nuse Tool\\Db;\n\nabstract class BaseModel{\n\n    protected $Db;\n    protected $table;   //操作的数据表名\n\n    public function __construct(){\n        $this->Db = Db::getInstance();\n    }\n\n    //获取一条数据\n    public function fetchOne($where){\n        $sql = \"SELECT * FROM {$this->table} WHERE {$where}\";\n        return $this->Db->query($sql);\n    }\n\n    //获取全部数据\n    public function fetchAll($where = \"2>1\"){\n        $sql = \"SELECT * FROM {$this->table} WHERE {$where}\";\n        $result =  $this->Db->query($sql);\n\n        //条数为1时,把一维数组转换成二维数组，避免某些foreach循环出错\n        if(count($result) == count($result,1) && !empty($result)){\n            $result = array($result);\n        }\n\n        return $result;\n    }\n\n    //获取数据条数\n    public function rowCount($where = \"2>1\"){\n        $sql = \"SELECT * FROM {$this->table} WHERE {$where}\";\n        return $this->Db->rowCount($sql);\n    }\n\n    //插入数据\n    public function insert($data){\n        $keys = \"\";\n        $values  = \"\";\n        foreach($data as $key=>$value){\n            $keys .= \"`{$key}`,\";\n            if($value == \"\"){\n                $values .= \"null,\";\n            }else{\n                $values .= \"'{$value}',\";\n            }\n        }\n        $keys = rtrim($keys,\",\");\n        $values  = rtrim($values,\",\");\n        $sql = \"INSERT INTO {$this->table}({$keys}) VALUE({$values})\";\n        return $this->Db->exec($sql);\n    }\n\n    //更新数据\n    public function update($data,$where){\n        $update = \"\";\n        foreach($data as $key => $value){\n            $update .= \"`{$key}`='{$value}',\";\n        }\n        $update = rtrim($update,\",\");\n        $sql = \"UPDATE {$this->table} SET {$update} WHERE {$where}\";\n        return $this->Db->exec($sql);\n    }\n\n    //删除数据\n    public function delete($where){\n        $sql = \"DELETE FROM {$this->table} WHERE {$where}\";\n        return $this->Db->exec($sql);\n    }\n}"
  },
  {
    "path": "Base/Conf.php",
    "content": "<?php\nreturn array(\n    //数据库配置\n    'db_host'   =>  \"127.0.0.1\",\n    'db_user'   =>  \"root\",\n    'db_pwd'    =>  \"root\",\n    'db_name'   =>  \"mybook\",\n    'db_port'   =>  \"3306\",\n    'charset'   =>  \"utf8\",\n\n    //默认路由配置\n    'default_plantform'   => \"Common\",\n    'default_controller'  => \"Login\",\n    'default_action'      => \"index\"\n);"
  },
  {
    "path": "Common/Controller/LoginController.class.php",
    "content": "<?php\nnamespace Common\\Controller;\nuse Base\\BaseController;\nuse Common\\Model\\UserModel;\nuse Tool\\Verify;\n\nfinal class Login extends BaseController{\n    \n    //检测用户是否登陆，有则导向对应的主页\n    private function checkLogin(){\n        if(isset($_SESSION['userId'])){\n            $p = $_SESSION['admin'] ? \"Admin\" : \"Home\";\n            header(\"location:?p={$p}&c=Index&a=index\");\n            die();\n        }\n    }\n\n    public function index(){\n        $this->checkLogin();\n        $this->smarty->display(\"login.html\");\n    }\n\n    public function showVerify(){\n        new Verify;\n    }\n\n    //Json登陆接口\n    public function login(){\n        header(\"Content-Type:application/json\");\n\n        $rightCode  =   strtolower($_SESSION['verifyCode']);//正确的验证码\n        $code       =   strtolower($_POST['verify']);   //输入的验证码\n        $userId     =   htmlentities($_POST['userId']);     //账号\n        $password   =   md5($_POST['password']);            //密码\n\n        //先验证验证码，正确再验证账号密码，减小数据库压力\n        if($code != $rightCode){\n            $this->sendJsonMessage(\"验证码错误\",1);\n        }\n        \n        //验证账号密码\n        $userModel = new UserModel;\n        $where = \"id='{$userId}' and pwd='{$password}'\";\n        $result = $userModel->fetchOne($where);\n        if(!empty($result) && $result['status'] == 1){\n\n            $_SESSION['userId']           =     $userId;\n            $_SESSION['admin']            =     $result['admin'];\n            $_SESSION['last_login_time']  =     $result['last_login_time'];\n\n            $message = array(\"message\"=>\"OK\",\"code\"=>0,\"admin\"=>\"{$result['admin']}\");\n            //更新最后登陆时间\n            $time = date('Y-m-d H:i:s');\n            $userModel->update(array(\"last_login_time\"=>$time),$where);\n            \n        }else if(!empty($result) && $result['status'] == 0){\n            $message = array(\"message\"=>\"该账户已挂失，请联系管理员解决\",\"code\"=>1);\n        }else{\n            $message = array(\"message\"=>\"账号或密码错误\",\"code\"=>1);\n            //销毁验证码session使其重新生成\n            $_SESSION = array();\n            session_destroy();  \n        }\n        echo json_encode($message,JSON_UNESCAPED_UNICODE);\n    }\n\n    //退出登陆\n    public function logout(){\n        $_SESSION = array();\n        session_destroy();\n        header(\"location:?p=Common&c=Login&a=index\");\n    }\n\n}"
  },
  {
    "path": "Common/Model/UserModel.class.php",
    "content": "<?php\nnamespace Common\\Model;\nuse Base\\BaseModel;\n\nfinal class UserModel extends BaseModel{\n    \n    //操作的数据表名\n    protected $table = \"user\";\n\n}"
  },
  {
    "path": "Common/View/login.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\" style=\"height: 100%;\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n</head>\n\n<body style=\"background-image: url(./Resources/index.jpg);background-size:100% 100%;\">\n    <div class=\"container\" style=\"padding:200px 0px\">\n        <div class=\"login\" style=\"width:300px;height:280px;margin:0 auto;padding: 1px 40px;background-color: rgba(255, 255, 255, 0.55);border-radius:20px;display: none;\">\n            <h2 class=\"text-center\">图书馆管理系统</h2>\n            <form id=\"form\" style=\"margin-top:20px;\">\n                <div class=\"form-group\">\n                    <div class=\"input-group\" style=\"width:100%\">\n                        <input type=\"text\" class=\"form-control\" name=\"userId\" placeholder=\"请输入账号\">\n                    </div>\n                </div>\n                <div class=\"form-group\">\n                    <div class=\"input-group\" style=\"width:100%\">\n                        <input type=\"password\" class=\"form-control\" name=\"password\" placeholder=\"请输入密码\">\n                    </div>\n                </div>\n                <div class=\"form-group form-inline\">\n                    <div class=\"input-group\" style=\"width:155px\">\n                        <input type=\"text\" class=\"form-control\" name=\"verify\" placeholder=\"请输入验证码\">\n                    </div>\n                    <div class=\"input-group\">\n                        <img src=\"?p=Common&c=Login&a=showVerify\" id=\"verifyPic\" style=\"width:60px;height:34px;border-radius:4px;\">\n                    </div>\n                </div>\n                <button type=\"button\" class=\"form-control btn btn-primary\" id=\"submit\">登录</button>\n            </form>\n        </div>\n    </div>\n</body>\n<script>\n\n    $(function(){\n        $(\".login\").fadeIn(800);\n        \n        //注册点击更换验证码事件\n        $(\"#verifyPic\").click(function(){\n            $(this).attr('src',\"?p=Common&c=Login&a=showVerify&\" + Math.random()); \n        });\n\n        //注册回车登陆事件\n        $(\"[name='verify']\").keydown(function(event){\n            if(event.keyCode == 13){\n                $(\"#submit\").click();\n            }\n        });\n        //登陆\n        $(\"#submit\").click(function(){\n            if($(\"[name='userId']\").val().length == 0 || $(\"[name='password']\").val().length == 0){\n                alert(\"请输入账号或密码！\");\n                return false;\n            }else if($(\"[name='verify']\").val().length != 4){\n                alert(\"验证码必须为4位！\");\n                return false;\n            }\n            $.post({\n                url:\"?p=Common&c=Login&a=login\",\n                data:$(\"#form\").serialize(),\n                success:function(data){\n                    if(data.code == 0 && data.admin == 1){\n                        //管理员登陆\n                        location.href = \"?p=Admin&c=Index&a=index\";\n                    }else if(data.code == 0 && data.admin == 0){\n                        //普通用户登陆\n                        location.href = \"?p=Home&c=Index&a=index\";\n                    }else{\n                        alert(data.message);\n                        $(\"#verifyPic\").click();\n                        $(\"[name='verify']\").val(\"\");\n                    }\n                }\n            });\n        })\n    });\n</script>\n\n</html>"
  },
  {
    "path": "Home/Controller/BookController.class.php",
    "content": "<?php\nnamespace Home\\Controller;\nuse Base\\BaseController;\nuse Home\\Model\\BookModel;\nuse Tool\\Pager;\n\nfinal class Book extends BaseController{\n\n    public function index(){\n        $this->accessPage();\n\n        //页面参数\n        $currentPage = isset($_GET[\"page\"]) ? $_GET[\"page\"] : 1;    //当前页数\n        $eachPerPage = 10;      //每页显示条数\n\n        //获取搜索条件\n        if(isset($_GET['keyword']) && !empty($_GET['keyword'])){\n            $where = \"name LIKE '%{$_GET['keyword']}%'\";\n            $parms = array(\"keyword\"=>$_GET['keyword']);\n            $mode  = \"keyword\";\n        }else if(isset($_GET['bookId']) && !empty($_GET['bookId'])){\n            $where = \"id = '{$_GET['bookId']}'\";\n            $parms = array(\"bookId\"=>$_GET['bookId']);\n            $mode  = \"bookId\";\n        }else{\n            $where = \"2>1\";\n            $parms = array();\n            $mode  = \"\";\n        }\n        \n        $bookModel = new BookModel;\n        //获取图书总数用于计算总页数\n        $count  = $bookModel->rowCount($where);\n\n        //判断页数是否合法\n        if($count != 0){\n            if($currentPage < 1){\n                $currentPage = 1;\n            }else if($currentPage > ceil($count/$eachPerPage)){\n                $currentPage = ceil($count/$eachPerPage);\n            }\n        }else{\n            //记录数为0时，直接从第一页开始，避免offset计算错误\n            $currentPage = 1;\n        }\n\n        //获取每页图书信息\n        $offset = ($currentPage - 1) * $eachPerPage;\n        $books = $bookModel->fetchAllWithJoin($where,\"LIMIT {$offset},{$eachPerPage}\");\n\n        //分页\n        $pager = new Pager($currentPage,$count,$eachPerPage,\"?p=Home&c=Book&a=index\",$parms);\n\n        $this->smarty->assign(\"books\",$books);\n        $this->smarty->assign(\"mode\",$mode);\n        $this->smarty->assign(\"pageStr\",$pager->page());\n        $this->smarty->display(\"Book/index.html\");\n    }\n\n    public function detail(){\n        $this->accessPage();\n\n        $id = $_GET['id'];\n\n        $bookModel = new BookModel;\n        $result = $bookModel->fetchOneWithJoin(\"book_info.id={$id}\");\n        \n        $this->smarty->assign(\"book\",$result);\n        $this->smarty->display(\"Book/detail.html\");\n    }\n\n}"
  },
  {
    "path": "Home/Controller/BorrowController.class.php",
    "content": "<?php\nnamespace Home\\Controller;\nuse Base\\BaseController;\nuse Home\\Model\\BorrowModel;\n\nfinal class Borrow extends BaseController{\n\n    protected $table = \"borrow_list\";\n\n    //Json续借接口\n    public function prolong(){\n        $this->accessJson();\n\n        //未传参中断\n        if(!isset($_POST['bookId'])){\n            $this->sendJsonMessage(\"缺少bookId参数\",1);\n        }\n\n        $bookId = $_POST['bookId'];\n\n        $borrowModel = new BorrowModel;\n        $result = $borrowModel->fetchOne(\"book_id={$bookId} AND user_id={$_SESSION['userId']}\");\n\n        //没有借书就不能续借\n        if(empty($result)){\n            $this->sendJsonMessage(\"该用户没有借阅此书\",1);\n        }\n        //超期不能续借\n        if(strtotime($result['back_date']) < time()){\n            $this->sendJsonMessage(\"超期的书不能续借\",1);\n        }\n\n        //计算应还时间\n        $backTime = date(\"Y-m-d\",strtotime(\"+1 month\",strtotime($result['back_date'])));\n        $data = array(\"back_date\"=>$backTime);\n        if($borrowModel->update($data,\"book_id={$bookId} AND user_id={$_SESSION['userId']}\")){\n            $this->sendJsonMessage(\"续借成功\",0);\n        }else{\n            $this->sendJsonMessage(\"续借失败\",1);\n        }\n    }\n}"
  },
  {
    "path": "Home/Controller/IndexController.class.php",
    "content": "<?php\nnamespace Home\\Controller;\nuse Base\\BaseController;\nuse Home\\Model\\UserModel;\nuse Home\\Model\\BookModel;\nuse Home\\Model\\BorrowModel;\n\nfinal class Index extends BaseController{\n\n    public function index(){\n        $this->accessPage();\n\n        //用户信息\n        $userModel   =  new UserModel;\n        $userName    =  $userModel->fetchOne(\"id={$_SESSION['userId']}\")['name'];\n\n        //图书总数\n        $bookModel   =  new BookModel;\n        $bookNum     =  $bookModel->rowCount();\n\n        //借阅信息\n        $borrowModel   = new BorrowModel;\n        $bookInfo      = $borrowModel->fetchAll(\"user_id={$_SESSION['userId']}\");\n        $borrowBookNum = count($bookInfo);\n        $outDateBook   = 0;\n        foreach($bookInfo as $value){\n            if(strtotime($value['back_date']) < time()){\n                $outDateBook++;\n            }\n        }\n        \n        $this->smarty->assign(\"userName\",$userName);\n        $this->smarty->assign(\"bookNum\",$bookNum);\n        $this->smarty->assign(\"borrowBookNum\",$borrowBookNum);\n        $this->smarty->assign(\"outDateBook\",$outDateBook);\n        $this->smarty->display(\"Index/index.html\");\n    }\n\n}"
  },
  {
    "path": "Home/Controller/UserController.class.php",
    "content": "<?php\nnamespace Home\\Controller;\nuse Base\\BaseController;\nuse Home\\Model\\UserModel;\nuse Home\\Model\\BorrowModel;\n\nfinal class User extends BaseController{\n\n    public function index(){\n        $this->accessPage();\n\n        //用户信息\n        $userModel = new UserModel;\n        $userInfo  = $userModel->fetchOne(\"id={$_SESSION['userId']}\");\n\n        //借阅书籍详情\n        $borrowModel = new BorrowModel;\n        $borrowInfo  = $borrowModel->getBorrowInfo();\n\n        $this->smarty->assign(\"borrowInfo\",$borrowInfo);\n        $this->smarty->assign(\"userInfo\",$userInfo);\n        $this->smarty->display(\"User/index.html\");\n    }\n\n    //Json挂失接口\n    public function lost(){\n        $this->accessJson();\n\n        $id = $_SESSION['userId'];\n\n        $userModel = new UserModel;\n        if($userModel->update(array(\"status\"=>0),\"id={$id}\")){\n            //挂失成功后销毁session，使登陆失效\n            $_SESSION = array();\n            session_destroy();\n            $this->sendJsonMessage(\"挂失成功\",0);\n        }else{\n            $this->sendJsonMessage(\"挂失失败\",1);\n        }\n    }\n\n    //Json修改密码接口\n    public function changePwd(){\n        $this->accessJson();\n\n        $originPwd  =   md5($_POST['originPwd']);\n        $newPwd     =   md5($_POST['newPwd']);\n        $confrimPwd =   md5($_POST['confirmPwd']);\n\n        //确认密码二次验证，防止非法提交\n        if($newPwd != $confrimPwd){\n            $this->sendJsonMessage(\"两次输入的密码不一致\",1);\n        }\n        \n        $userModel = new UserModel;\n        if($userModel->rowCount(\"id={$_SESSION['userId']} and pwd='{$originPwd}'\")){\n            if($userModel->update(array(\"pwd\"=>$newPwd),\"id={$_SESSION['userId']} and pwd='{$originPwd}'\")){\n                //更改密码后销毁当前session\n                $_SESSION = array();\n                session_destroy();\n                $this->sendJsonMessage(\"密码修改成功\",0);\n            }else{\n                $this->sendJsonMessage(\"密码修改失败\",1);\n            }\n        }else{\n            $this->sendJsonMessage(\"原密码错误\",1);\n        }\n    }\n\n}"
  },
  {
    "path": "Home/Model/BookModel.class.php",
    "content": "<?php\nnamespace Home\\Model;\nuse Base\\BaseModel;\n\nfinal class BookModel extends BaseModel{\n\n    protected $table = \"book_info\";\n\n    public function fetchAllWithJoin($where = \"2>1\",$limit = \"\"){\n\n        $sql  = \"SELECT id,name,author,user_id FROM {$this->table} \";\n        $sql .= \"LEFT JOIN borrow_list ON id=borrow_list.book_id \";\n        $sql .= \"WHERE {$where} \";\n        $sql .= \"{$limit}\";\n        \n        $result = $this->Db->query($sql);\n\n        //条数为1时,把一维数组转换成二维数组，避免某些foreach循环出错\n        if(count($result) == count($result,1) && !empty($result)){\n            $result = array($result);\n        }\n        \n        return $result;\n    }\n\n    public function fetchOneWithJoin($where = \"2>1\"){\n\n        $sql  = \"SELECT {$this->table}.*,borrow_list.back_date,user.name AS user_name FROM {$this->table} \";\n        $sql .= \"LEFT JOIN borrow_list ON {$this->table}.id=borrow_list.book_id \";\n        $sql .= \"LEFT JOIN user ON user.id=borrow_list.user_id \";\n        $sql .= \"WHERE {$where} \";\n        $sql .= \"LIMIT 1\";\n\n        return $this->Db->query($sql);\n    }\n\n}"
  },
  {
    "path": "Home/Model/BorrowModel.class.php",
    "content": "<?php\nnamespace Home\\Model;\nuse Base\\BaseModel;\n\nfinal class BorrowModel extends BaseModel{\n\n    protected $table = \"borrow_list\";\n\n    //获取用户借阅信息\n    public function getBorrowInfo(){\n\n        $sql  = \"SELECT book_id,book_info.name,borrow_date,back_date FROM {$this->table},book_info \";\n        $sql .= \"WHERE {$this->table}.book_id=book_info.id AND user_id={$_SESSION['userId']}\";\n\n        $result =  $this->Db->query($sql);\n\n        //条数为1时,把一维数组转换成二维数组，避免某些foreach循环出错\n        if(count($result) == count($result,1) && !empty($result)){\n            $result = array($result);\n        }\n        return $result;\n    }\n    \n}"
  },
  {
    "path": "Home/Model/UserModel.class.php",
    "content": "<?php\nnamespace Home\\Model;\nuse Base\\BaseModel;\n\nfinal class UserModel extends BaseModel{\n\n    //操作的数据表名\n    protected $table = \"user\";\n\n}"
  },
  {
    "path": "Home/View/Book/detail.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\"\n                    aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Home&c=Index&a=index\">主页</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Home&c=Book&a=index\">图书查询</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Home&c=User&a=index\">个人中心</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"h3 text-center\">\n        <b>图书详情</b>\n    </div>\n    <div class=\"form-horizontal text-center\" style=\"width:500px;margin: 20px auto 0;\">\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">图书名：</div>\n                <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.name>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">作者：</div>\n                <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.author>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">出版社：</div>\n                <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.press>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">出版时间：</div>\n                <input type=\"\" class=\"form-control\" readonly value=\"{<$book.press_time>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">价格：</div>\n                <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.price>}\">\n                <div class=\"input-group-addon\">元</div>\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <div class=\"input-group\">\n                <div class=\"input-group-addon\">ISBN：</div>\n                <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.ISBN>}\">\n            </div>\n        </div>\n        <div class=\"form-group\">\n            <label class=\"text-left\" style=\"width: 100%\">作品简介：</label>\n            <textarea class=\"form-control\" style=\"height: 150px;resize:none;\" readonly>{<$book.desc>}</textarea>\n        </div>\n        <div class=\"center-block\" style=\"width:150px;\">\n            <div class=\"form-group\">\n                <div class=\"input-group\">\n                    <div class=\"input-group-addon\">借出人</div>\n                    <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.user_name>}\">\n                </div>\n            </div>\n            <div class=\"form-group\">\n                <div class=\"input-group\">\n                    <div class=\"input-group-addon\">应还日期</div>\n                    <input type=\"text\" class=\"form-control\" readonly value=\"{<$book.back_date>}\">\n                </div>\n            </div>\n        </div>\n    </div>\n</body>\n\n</html>"
  },
  {
    "path": "Home/View/Book/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n    <style type=\"text/css\">\n        td {\n            vertical-align: middle !important;\n        }\n    </style>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\" aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Home&c=Index&a=index\">主页</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Home&c=Book&a=index\">图书查询</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Home&c=User&a=index\">个人中心</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"container-fluid\">\n        <div style=\"width:300px;\" class=\"center-block\">\n            <div class=\"form-inline\">\n                <div class=\"form-group\">\n                    <input type=\"text\" id=\"input\" class=\"form-control\" placeholder=\"输入搜索内容\" name=\"keyword\" style=\"width:130px;\"\n                           {<if $mode == keyword>}value='{<$smarty.get.keyword>}'{<else if $mode == bookId>}value='{<$smarty.get.bookId>}'{</if>}>\n                </div>\n                <div class=\"form-group\">\n                    <select name=\"type\" class=\"form-control\">\n                        <option value=\"name\" {<if $mode == keyword>}selected{</if>}>书名查询</option>\n                        <option value=\"num\" {<if $mode == bookId>}selected{</if>}>书号查询</option>\n                    </select>\n                </div>\n                <div class=\"form-group\">\n                    <button type=\"button\" id=\"research\" class=\"btn btn-primary\">搜索</button>\n                </div>\n            </div> \n        </div>\n        <table class=\"table table-bordered table-hover text-center\" style=\"margin-top:30px;\">\n            <thead>\n                <tr class=\"active\">\n                    <th class=\"text-center\">图书号</th>\n                    <th class=\"text-center\">图书名</th>\n                    <th class=\"text-center\">作者</th>\n                    <th class=\"text-center\" style=\"width: 90px;\">状态</th>\n                </tr>\n            </thead>\n            <tbody>\n                {<if empty($books)>}\n                    <tr>\n                        <td colspan=\"4\">无记录！</td>\n                    </tr>\n                {</if>}\n                {<foreach $books as $book>}\n                    <tr>\n                        <td>{<$book.id>}</td>\n                        <td>\n                            <a href=\"?p=Home&c=Book&a=detail&id={<$book.id>}\">{<$book.name>}</a>\n                        </td>\n                        <td>{<$book.author>}</td>\n                        {<if $book.user_id == \"\">}\n                        <td class=\"success\">在馆</td>\n                        {<else>}\n                        <td class=\"danger\">已借出</td>\n                        {</if>}\n                    </tr>\n                {</foreach>}\n            </tbody>\n        </table>\n\n        <!-- 分页 -->\n        {<$pageStr>}\n        \n    </div>\n</body>\n<script>\n    \n    $(function(){\n\n        //注册回车查找\n        $(\"#input\").keydown(function(event){\n            if(event.keyCode == 13){\n                $(\"#research\").click();\n            }\n        });\n        //查找\n        $(\"#research\").click(function(){\n            if($(\"#input\").val().length > 0){\n                if($(\"[name='type']\").val() == \"name\"){\n                    var mode = \"keyword\";\n                }else if($(\"[name='type']\").val() == \"num\"){\n                    var mode = \"bookId\";\n                }\n                location.href = \"?p=Home&c=Book&a=index&\"+ mode + \"=\" + $(\"#input\").val();\n            }else{\n                alert(\"请输入搜索条件\");\n            }\n        });\n    });\n\n</script>\n\n</html>"
  },
  {
    "path": "Home/View/Index/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\" style=\"height: 100%;\">\n\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n  <title>图书馆管理系统</title>\n  <!--jquery-->\n  <script src=\"./Resources/jquery.min.js\"></script>\n  <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n  <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n  <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n  <script src=\"./Resources/bootstrap.min.js\"></script>\n</head>\n\n<body style=\"background-image: url(./Resources/index.jpg);background-size:100% 100%;\">\n  <nav class=\"navbar navbar-default\">\n    <div class=\"container-fluid\">\n      <!-- Brand and toggle get grouped for better mobile display -->\n      <div class=\"navbar-header\">\n        <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\" aria-expanded=\"false\">\n          <span class=\"icon-bar\"></span>\n          <span class=\"icon-bar\"></span>\n          <span class=\"icon-bar\"></span>\n        </button>\n        <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n          <b>图书馆管理系统</b>\n        </a>\n      </div>\n\n      <!-- Collect the nav links, forms, and other content for toggling -->\n      <div class=\"collapse navbar-collapse\" id=\"nav\">\n        <ul class=\"nav navbar-nav\">\n          <li class=\"active\">\n            <a href=\"?p=Home&c=Index&a=index\">主页</a>\n          </li>\n          <li>\n            <a href=\"?p=Home&c=Book&a=index\">图书查询</a>\n          </li>\n          <li>\n            <a href=\"?p=Home&c=User&a=index\">个人中心</a>\n          </li>\n        </ul>\n        <ul class=\"nav navbar-nav navbar-right\">\n          <li>\n            <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n          </li>\n          <li>\n            <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n          </li>\n        </ul>\n      </div>\n      <!-- /.navbar-collapse -->\n    </div>\n    <!-- /.container-fluid -->\n  </nav>\n  <div class=\"container\">\n    <div class=\"center-block\" style=\"margin-top:50px;padding:20px;width:500px;background-color:rgba(255, 255, 255, 0.55);border-radius:30px;\">\n      <h3 class=\"text-center\">{<$userName>}同学，你好！</h3>\n      <h3 class=\"text-center\" style=\"margin-top:70px;\">当前共有{<$bookNum>}本图书</h3>\n      <h3 class=\"text-center\">你已借{<$borrowBookNum>}本书</h3>\n      <h3 class=\"text-center\">已超期{<$outDateBook>}本书</h3>\n      <h4 class=\"text-center\" style=\"margin-top:70px;\">上次登录时间：</h4>\n      <h4 class=\"text-center\">{<$smarty.session.last_login_time>}</h4>\n    </div>\n  </div>\n</body>\n\n</html>"
  },
  {
    "path": "Home/View/User/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n    <title>图书馆管理系统</title>\n    <!--jquery-->\n    <script src=\"./Resources/jquery.min.js\"></script>\n    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->\n    <link rel=\"stylesheet\" href=\"./Resources/bootstrap.min.css\">\n    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->\n    <script src=\"./Resources/bootstrap.min.js\"></script>\n    <style type=\"text/css\">\n        td {\n            vertical-align: middle !important;\n        }\n    </style>\n</head>\n\n<body>\n    <nav class=\"navbar navbar-default\">\n        <div class=\"container-fluid\">\n            <!-- Brand and toggle get grouped for better mobile display -->\n            <div class=\"navbar-header\">\n                <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#nav\"\n                    aria-expanded=\"false\">\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                    <span class=\"icon-bar\"></span>\n                </button>\n                <a class=\"navbar-brand\" href=\"JavaScript:void(0)\">\n                    <b>图书馆管理系统</b>\n                </a>\n            </div>\n\n            <!-- Collect the nav links, forms, and other content for toggling -->\n            <div class=\"collapse navbar-collapse\" id=\"nav\">\n                <ul class=\"nav navbar-nav\">\n                    <li>\n                        <a href=\"?p=Home&c=Index&a=index\">主页</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Home&c=Book&a=index\">图书查询</a>\n                    </li>\n                    <li class=\"active\">\n                        <a href=\"?p=Home&c=User&a=index\">个人中心</a>\n                    </li>\n                </ul>\n                <ul class=\"nav navbar-nav navbar-right\">\n                    <li>\n                        <a href=\"JavaScript:void(0)\" style=\"cursor:default\">{<$smarty.session.userId>}</a>\n                    </li>\n                    <li>\n                        <a href=\"?p=Common&c=Login&a=logout\">退出</a>\n                    </li>\n                </ul>\n            </div>\n            <!-- /.navbar-collapse -->\n        </div>\n        <!-- /.container-fluid -->\n    </nav>\n    <div class=\"text-center container\" style=\"width:65%;margin-top:40px;padding-top:10px;background-color: #f5f5f5;border-radius:20px;\">\n        <div class=\"h4\">\n            <b>用户信息</b>\n        </div>\n        <p>用户账号：{<$smarty.session.userId>}</p>\n        <p>用户姓名：{<$userInfo.name>}</p>\n        <p>用户班级：{<$userInfo.class>}</p>\n        <p>用户状态：{<if $userInfo.status == 1>}正常{<else>}<font color=\"red\">挂失</font>{</if>}</p>\n        <div style=\"width: 200px;margin:20px auto;overflow: hidden;display: flex;justify-content: space-between\">\n            <button class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#lost\">挂失账户</a>\n                <button class=\"btn btn-warning\" data-toggle=\"modal\" data-target=\"#pwd\">修改密码</a>\n        </div>\n    </div>\n    <div class=\"container text-center\" style=\"width: 65%;margin-top:30px;padding:0;\">\n        <div class=\"h4\">\n            <b>我的借阅信息</b>\n        </div>\n        <table class=\"table table-bordered table-hover\">\n            <thead>\n                <tr class=\"active\">\n                    <th class=\"text-center\">图书号</th>\n                    <th class=\"text-center\">图书名称</th>\n                    <th class=\"text-center\">借书时间</th>\n                    <th class=\"text-center\">应还时间</th>\n                    <th class=\"text-center\">操作</th>\n                </tr>\n            </thead>\n            <tbody>\n                {<if empty($borrowInfo)>}\n                    <tr>\n                        <td colspan=\"5\">无记录！</td>\n                    </tr>\n                {</if>}\n                {<foreach $borrowInfo as $one>}\n                    <tr {<if strtotime($one.back_date) < time()>}class=\"danger\"{</if>}>\n                        <td>{<$one.book_id>}</td>\n                        <td>{<$one.name>}</td>\n                        <td>{<$one.borrow_date>}</td>\n                        <td>{<$one.back_date>}</td>\n                        <td>\n                            <button class=\"btn btn-info btn-xs {<if strtotime($one.back_date) < time()>}disabled{</if>}\"\n                                    id=\"prolong\" bookId=\"{<$one.book_id>}\">续借\n                            </button>\n                        </td>\n                    </tr>\n                {</foreach>}\n            </tbody>\n        </table>\n    </div>\n\n    <div class=\"container-fluid text-center\">\n        <!-- 挂失用户模态框（Modal） -->\n        <div class=\"modal fade\" id=\"lost\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">\n            <div class=\"modal-dialog\" style=\"margin-top:150px;\">\n                <div class=\"modal-content\">\n                    <div class=\"modal-header\">\n                        <h4 class=\"modal-title\" id=\"myModalLabel\">\n                            挂失账户\n                        </h4>\n                    </div>\n                    <div class=\"modal-body\">\n                        <h4>确认要挂失账号为{<$smarty.session.userId>}的账户?</h3>\n                    </div>\n                    <div class=\"modal-footer\">\n                        <button type=\"button\" id=\"lostSubmit\" class=\"btn btn-primary\" data-dismiss=\"modal\">确认</button>\n                        <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">关闭</button>\n                    </div>\n                </div>\n                <!-- /.modal-content -->\n            </div>\n            <!-- /.modal -->\n        </div>\n\n        <!-- 修改密码模态框（Modal） -->\n        <div class=\"modal fade\" id=\"pwd\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">\n            <div class=\"modal-dialog\" style=\"margin-top:150px;\">\n                <div class=\"modal-content\">\n                    <form id=\"form\">\n                        <div class=\"modal-header\">\n                            <h4 class=\"modal-title\" id=\"myModalLabel\">\n                                修改密码\n                            </h4>\n                        </div>\n                        <div class=\"modal-body center-block\" style=\"width: 45%\">\n                            <div class=\"form-group\">\n                                <div class=\"input-group\">\n                                    <div class=\"input-group-addon\">原密码</div>\n                                    <input type=\"text\" class=\"form-control\" name=\"originPwd\" placeholder=\"请输入原密码\">\n                                </div>\n                            </div>\n                            <div class=\"form-group\">\n                                <div class=\"input-group\">\n                                    <div class=\"input-group-addon\">新密码</div>\n                                    <input type=\"password\" class=\"form-control\" name=\"newPwd\" placeholder=\"请输入新密码\">\n                                </div>\n                            </div>\n                            <div class=\"form-group\" style=\"margin-bottom:0\">\n                                <div class=\"input-group\">\n                                    <div class=\"input-group-addon\">确认密码</div>\n                                    <input type=\"password\" class=\"form-control\" name=\"confirmPwd\" placeholder=\"请输入确认密码\">\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"modal-footer\">\n                            <button type=\"button\" id=\"pwdSubmit\" class=\"btn btn-primary\">确认</button>\n                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">关闭</button>\n                        </div>\n                    </form>\n                </div>\n                <!-- /.modal-content -->\n            </div>\n            <!-- /.modal -->\n        </div>\n    </div>\n</body>\n\n<script>\n    \n    $(function(){\n\n        //挂失\n        $(\"#lostSubmit\").click(function(){\n            $.post({\n                url: \"?p=Home&c=User&a=lost\",\n                data: {},\n                success:function(data){\n                    alert(data.message);\n                    location.reload();\n                }\n            });\n        });\n\n        //注册回车改密码事件\n        $(\"[name='originPwd'],[name='newPwd'],[name='confirmPwd']\").keydown(function(event){\n            if(event.keyCode == 13){\n                $(\"#pwdSubmit\").click();\n            }\n        });\n        //修改密码\n        $(\"#pwdSubmit\").click(function(){\n            if($(\"[name='originPwd']\").val().length == 0 || $(\"[name='newPwd']\").val().length == 0 || $(\"[name='confirmPwd']\").val().length == 0){\n                alert(\"请将信息填写完整\");\n                return false;\n            }\n            if($(\"[name='newPwd']\").val() != $(\"[name='confirmPwd']\").val()){\n                alert(\"两次输入的密码不一致\");\n                return false;\n            }\n            $.post({\n                url:\"?p=Home&c=User&a=changePwd\",\n                data:$(\"#form\").serialize(),\n                success:function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        location.reload();\n                    }\n                }\n            });\n        });\n\n        //续借\n        $(\"#prolong\").click(function(){\n            $.post({\n                url:\"?p=Home&c=Borrow&a=prolong\",\n                data:{bookId:$(this).attr(\"bookId\")},\n                success:function(data){\n                    alert(data.message);\n                    if(data.code == 0){\n                        location.reload();\n                    }\n                }\n            });\n        });\n    });\n    \n</script>\n\n</html>"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "# 图书管理系统\n>这个图书管理系统是我学完PHP时写的一个练手项目，功能参考了自己学校的图书管理系统。为了锻炼自己的动手能力以及加深对代码的理解，前端和后端均由自己完成，前端使用了一些基本的框架(毕竟我主攻后端开发方向)，后端大部分要用到的功能都是自己从底层实现并封装，基本没有用到第三方框架。总体来说还是比较简陋的，在某些地方可能存在缺陷或者漏洞。\n\n### 基本功能\n+ 用户\n    + 查询图书状态(能够进行搜索)\n    + 管理自己的账户，如：修改密码、挂失等\n    + 对已借的图书进行续借操作\n+ 管理员\n    + 管理图书，增删改查\n    + 管理用户，如修改密码、挂失、删除等\n    + 借阅管理\n\n### 特点\n+ 数据库中的数据来自豆瓣图书Top250\n+ 前端页面使用`jQuery`+`BootStrap`实现，勉强能看(前端能力实在有限)\n+ 后端采用MVC的思想，参考`ThinkPHP`框架的结构和思路，自己实现并封装了一个简单的MVC框架(View层使用了Smarty模板引擎)\n+ 后端使用的数据库工具类、验证码类、分页类均由自己实现并封装\n+ 可通过配置文件(`Base/Conf.php`)对项目进行配置(数据库设置和默认路由设置)\n+ 前端大部分数据通过Ajax与后端进行交互，页面跳转较少\n\n### 部署注意事项\n1. `index.php`为整个项目的入口文件\n2. 确保你的PHP开启了`gd2`、`mysqli`扩展\n3. 将项目中的book.sql中的数据导入到数据库,**并在`Base/Conf.php`修改数据库连接信息(点击登录没反应可能就是没有设置正确的连接信息)**\n4. 默认管理员账号为`10086`，密码为`admin`\n5. 默认一般用户的密码为`123456`，初始的账号有`10000`、`10001`、`10002`、`10010`，其中`10010`默认被挂失\n\n### 部分截图\n#### 登陆界面\n![](https://img2018.cnblogs.com/blog/1556823/201901/1556823-20190127193126712-133882588.png)\n\n#### 图书管理\n![](https://img2018.cnblogs.com/blog/1556823/201901/1556823-20190127193136627-359174758.png)\n![](https://img2018.cnblogs.com/blog/1556823/201901/1556823-20190127193145620-32043274.png)\n\n#### 用户管理\n![](https://img2018.cnblogs.com/blog/1556823/201901/1556823-20190127193149631-864366552.png)\n![](https://img2018.cnblogs.com/blog/1556823/201901/1556823-20190127193153638-1859828350.png)\n\n#### 借阅管理\n![](https://img2018.cnblogs.com/blog/1556823/201901/1556823-20190127193156695-1693862812.png)\n"
  },
  {
    "path": "Tool/Db.class.php",
    "content": "<?php\nnamespace Tool;\nfinal Class Db{\n    //单例数据库类\n    private static $Db;\n    private $mysqli;\n    private $db_host;\n    private $db_user;\n    private $db_pwd;\n    private $db_name;\n    private $db_port;\n    private $charset;\n\n    //阻止克隆对象\n    private function __clone(){}\n\n    //阻止new对象\n    private function __construct(){\n        $this->db_host  =  $GLOBALS['conf']['db_host'];\n        $this->db_user  =  $GLOBALS['conf']['db_user'];\n        $this->db_pwd   =  $GLOBALS['conf']['db_pwd'];\n        $this->db_name  =  $GLOBALS['conf']['db_name'];\n        $this->db_port  =  $GLOBALS['conf']['db_port'];\n        $this->charset  =  $GLOBALS['conf']['charset'];\n        $this->connect();\n        $this->setCharSet();\n    }\n\n    private function connect(){\n        @$this->mysqli = new \\mysqli($this->db_host,$this->db_user,$this->db_pwd,$this->db_name,$this->db_port);\n        if($this->mysqli->connect_errno != 0){\n            echo \"<h2>MySql连接错误！</h2>\";\n            echo \"错误信息：\".$this->mysqli->connect_error;\n            die();\n        }\n    }\n\n    private function setCharSet(){\n        $this->mysqli->set_charset($this->charset);\n    }\n\n    //判断sql语句是否出错\n    private function isErr(){\n        if($this->mysqli->errno != 0){\n            echo \"<h2>Sql语句错误</h2>\";\n            echo \"错误信息：\".$this->mysqli->error;\n            die();\n        }\n    }\n\n    //初始化Db类只需执行该静态方法\n    public static function getInstance(){\n        if(!(self::$Db instanceof self)){\n            self::$Db = new self;\n        }\n        return self::$Db;\n    }\n\n    public function query($sql,$mode = 1){\n        //$mode解释： 1：关联数组  2：索引数组  3：混合数组\n        if(strtoupper(substr($sql,0,6)) != \"SELECT\"){\n            die(\"query函数只能接受SELECT语句！\");\n        }\n        @$result = $this->mysqli->query($sql);\n        $this->isErr();      //判断语句是否出错\n        $data = array();    //返回的结果数组\n        if($this->mysqli->affected_rows == 1){\n            //只有一行数据时直接返回一维数组\n            $data = $result->fetch_array($mode);\n        }else{\n            //有多行数据是返回二维数组\n            while($row = $result->fetch_array($mode)){\n                $data[] = $row;\n            }\n        }\n        return $data;\n    }\n\n    public function exec($sql){\n        if(strtoupper(substr($sql,0,6)) == \"SELECT\"){\n            die(\"exec函数只能接受非SELECT语句！\");\n        }\n        if(@!$this->mysqli->query($sql)){\n            $this->isErr();      //判断语句是否出错\n        }else{\n            return true;\n        }\n    }\n\n    public function rowCount($sql){\n        @$this->mysqli->query($sql);\n        $this->isErr();      //判断语句是否出错\n        return $this->mysqli->affected_rows;\n    }\n};"
  },
  {
    "path": "Tool/MySmarty.class.php",
    "content": "<?php\nnamespace Tool;\nrequire_once(ROOT.\"Tool\".DS.\"smarty-3.1.32\".DS.\"libs\".DS.\"Smarty.class.php\");\n\nfinal class MySmarty{\n    \n    private static $smarty;\n\n    //初始化smarty配置\n    private static function smartyInit(){\n        self::$smarty->clearCompiledTemplate();\n        self::$smarty->left_delimiter = \"{<\";\n        self::$smarty->right_delimiter = \">}\";\n        self::$smarty->setCompileDir(sys_get_temp_dir());\n        self::$smarty->setTemplateDir(VIEWPATH);\n    }\n\n    //获取smarty实例\n    public static function getInstance(){\n        if(!(self::$smarty instanceof \\smarty)){\n            self::$smarty = new \\smarty;\n            self::smartyInit();\n        }\n        return self::$smarty;\n    }\n}"
  },
  {
    "path": "Tool/Pager.class.php",
    "content": "<?php\nnamespace Tool;\n\n//Pager for bootstrap\nfinal class Pager{\n\n    private $currentPage;   //当前页数\n    private $total;         //总记录条数\n    private $each;          //每页条数\n    private $url;           //当前地址栏地址\n    private $parms;         //get参数数组\n\n    private $pageNum;       //总页数\n    private $pre;           //上一页链接\n    private $next;          //下一页链接\n    private $urlStr;        //url字符串\n    private $pageStr;       //分页结果字符串\n\n    public function __construct($currentPage,$total,$each,$url,array $parms=array()){\n        $this->currentPage  =  $currentPage;\n        $this->total        =  $total;\n        $this->each         =  $each;\n        $this->url          =  $url;\n        $this->parms        =  $parms;\n        $this->pageNum      =  ceil($total/$each);\n        $this->parmsParse();\n        $this->firstInit();\n        $this->middleInit();\n        $this->lastInit();\n    }\n\n    public function page(){\n        //页数为1时不输出分页\n        if($this->pageNum <= 1){\n            $this->pageStr = \"\";\n        }\n        return $this->pageStr;\n    }\n\n    //解析参数数组\n    private function parmsParse(){\n        $parmsStr =  \"\";\n        $url      =  $this->url;\n        $pre      =  $this->currentPage-1;\n        $next     =  $this->currentPage+1;\n\n        foreach($this->parms as $key=>$value){\n            $parmsStr .= \"{$key}={$value}&\";\n        }\n        if(strstr($url,\"?\")){\n            //url带问号说明有参数，后面加&方便参数连接\n            $url .= \"&\";\n        }else{\n            //url不带问号说明无参数，后面加?准备连接参数或页数\n            $url .= \"?\";\n        }\n        $this->urlStr = $url.$parmsStr.\"page=\";\n        $this->pre      = $url.$parmsStr.\"page={$pre}\";\n        $this->next     = $url.$parmsStr.\"page={$next}\";\n    }\n\n    //上一页\n    private function firstInit(){\n        if($this->currentPage == 1){\n            //在第一页时上一页失效\n            $disable = \"class='disabled'\";\n            $tag     = \"span\";\n            $link    = \"\";\n        }else{\n            //不在第一页时\n            $disable = \"\";\n            $tag     = \"a\";\n            $link    = \"href='{$this->pre}'\"; \n        }\n        $this->pageStr =\"<nav class='text-center'>\n                            <ul class='pagination'>\n                                <li {$disable}>\n                                    <{$tag} {$link} aria-label='Previous'>\n                                        <span aria-hidden='true'>&laquo;</span>\n                                    </{$tag}>\n                                </li>\";\n    }\n\n    //中间页码部分\n    private function middleInit(){\n        if($this->pageNum <= 5){\n            //页数小于5时\n            $start = 1;\n            $end   = $this->pageNum;\n        }else if($this->currentPage - 2 < 1){\n            //左边越界情况\n            $start = 1;\n            $end   = 5;\n        }else if($this->currentPage + 2 > $this->pageNum){\n            //右边越界情况\n            $start = $this->pageNum - 4;\n            $end   = $this->pageNum;\n        }else{\n            //正常情况\n            $start = $this->currentPage - 2;\n            $end   = $this->currentPage + 2;\n        }\n\n        //循环输出页码\n        for($i = $start;$i <= $end;$i++){\n            $active = \"\";\n            if($i == $this->currentPage){\n                $active = \"class='active'\";\n            }\n            $this->pageStr .=  \"<li {$active}>\n                                    <a href='{$this->urlStr}{$i}'>{$i}</a>\n                                </li>\";\n        }\n    }\n\n    //下一页\n    private function lastInit(){\n        if($this->currentPage == $this->pageNum){\n            //在最后页时下一页失效\n            $disable = \"class='disabled'\";\n            $tag     = \"span\";\n            $link    = \"\";\n        }else{\n            //不在最后页时\n            $disable = \"\";\n            $tag     = \"a\";\n            $link    = \"href='{$this->next}'\";\n        }\n        $this->pageStr .=      \"<li {$disable}>\n                                    <{$tag} {$link} aria-label='Next'>\n                                        <span aria-hidden='true'>&raquo;</span>\n                                    </{$tag}>\n                                </li>\n                            </ul>\n                         </nav>\";\n    }\n}"
  },
  {
    "path": "Tool/Verify.class.php",
    "content": "<?php\nnamespace Tool;\nfinal class Verify\n{\n    private $width;\n    private $height;\n    private $picRes;\n\n    public function __construct($width = 60, $height = 34){\n        $this->width = $width;\n        $this->height = $height;\n        $this->picInit();\n        $this->createPic();\n        $this->writeCode();\n        $this->writeNoise();\n        $this->outPutPic();\n    }\n\n    private function picInit(){\n        header(\"Content-Type:image/png\");\n    }\n\n    private function createPic(){\n        //创建画布\n        $this->picRes = imagecreatetruecolor($this->width, $this->height);\n        //给画布分配颜色\n        $color = imagecolorallocate($this->picRes, rand(150, 255), rand(150, 255), rand(150, 255));\n        //给画布上色\n        imagefill($this->picRes, 0, 0, $color);\n    }\n\n    private function writeCode(){\n        $fontDir = ROOT . \"Resources\" . DS . \"Verify.ttf\";\n        $codeLib = \"abcdefghjknmpqrstuvwxyzABCDEFGHIJKLNMPQRSTUVWXYZ123456789\";\n        $code = \"\";\n        for ($i = 0; $i < 4; $i++) {\n            //验证码分配颜色\n            $color = imagecolorallocate($this->picRes, rand(50, 150), rand(50, 150), rand(50, 150));\n            //生成随机单个验证码\n            $oneCode = $codeLib[rand(0,strlen($codeLib)-1)];\n            //绘制单个验证码\n            imagettftext($this->picRes,18,rand(-10,10),2+($i*14),25,$color,$fontDir,$oneCode);\n            //保存整个验证码并写入session\n            $code .= $oneCode;\n        }\n        $_SESSION[\"verifyCode\"] = $code;\n    }\n\n    private function writeNoise(){\n        for($i = 0; $i < 4; $i++){\n            $color = imagecolorallocate($this->picRes,rand(50, 150), rand(50, 150), rand(50, 150));\n            imageline($this->picRes,rand(0,60),rand(0,34),rand(0,60),rand(0,34),$color);\n        }\n    }\n\n    private function outPutPic(){\n        imagepng($this->picRes);\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/Autoloader.php",
    "content": "<?php\n/**\n * Smarty Autoloader\n *\n * @package    Smarty\n */\n\n/**\n * Smarty Autoloader\n *\n * @package    Smarty\n * @author     Uwe Tews\n *             Usage:\n *                  require_once '...path/Autoloader.php';\n *                  Smarty_Autoloader::register();\n *             or\n *                  include '...path/bootstrap.php';\n *\n *                  $smarty = new Smarty();\n */\nclass Smarty_Autoloader\n{\n   /**\n     * Filepath to Smarty root\n     *\n     * @var string\n     */\n    public static $SMARTY_DIR = null;\n\n    /**\n     * Filepath to Smarty internal plugins\n     *\n     * @var string\n     */\n    public static $SMARTY_SYSPLUGINS_DIR = null;\n\n    /**\n     * Array with Smarty core classes and their filename\n     *\n     * @var array\n     */\n    public static $rootClasses = array('smarty' => 'Smarty.class.php', 'smartybc' => 'SmartyBC.class.php',);\n\n    /**\n     * Registers Smarty_Autoloader backward compatible to older installations.\n     *\n     * @param bool $prepend Whether to prepend the autoloader or not.\n     */\n    public static function registerBC($prepend = false)\n    {\n        /**\n         * register the class autoloader\n         */\n        if (!defined('SMARTY_SPL_AUTOLOAD')) {\n            define('SMARTY_SPL_AUTOLOAD', 0);\n        }\n        if (SMARTY_SPL_AUTOLOAD &&\n            set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false\n        ) {\n            $registeredAutoLoadFunctions = spl_autoload_functions();\n            if (!isset($registeredAutoLoadFunctions[ 'spl_autoload' ])) {\n                spl_autoload_register();\n            }\n        } else {\n            self::register($prepend);\n        }\n    }\n\n    /**\n     * Registers Smarty_Autoloader as an SPL autoloader.\n     *\n     * @param bool $prepend Whether to prepend the autoloader or not.\n     */\n    public static function register($prepend = false)\n    {\n        self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR;\n        self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR :\n            self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR;\n        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {\n            spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);\n        } else {\n            spl_autoload_register(array(__CLASS__, 'autoload'));\n        }\n    }\n\n    /**\n     * Handles auto loading of classes.\n     *\n     * @param string $class A class name.\n     */\n    public static function autoload($class)\n    {\n        if ($class[ 0 ] !== 'S' && strpos($class, 'Smarty') !== 0) {\n            return;\n        }\n        $_class = strtolower($class);\n        if (isset(self::$rootClasses[ $_class ])) {\n            $file = self::$SMARTY_DIR . self::$rootClasses[ $_class ];\n            if (is_file($file)) {\n                include $file;\n            }\n        } else {\n            $file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php';\n            if (is_file($file)) {\n                include $file;\n            }\n        }\n        return;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/Smarty.class.php",
    "content": "<?php\n/**\n * Project:     Smarty: the PHP compiling template engine\n * File:        Smarty.class.php\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n * For questions, help, comments, discussion, etc., please join the\n * Smarty mailing list. Send a blank e-mail to\n * smarty-discussion-subscribe@googlegroups.com\n *\n * @link      http://www.smarty.net/\n * @copyright 2018 New Digital Group, Inc.\n * @copyright 2018 Uwe Tews\n * @author    Monte Ohrt <monte at ohrt dot com>\n * @author    Uwe Tews   <uwe dot tews at gmail dot com>\n * @author    Rodney Rehm\n * @package   Smarty\n * @version   3.1.32\n */\n/**\n * set SMARTY_DIR to absolute path to Smarty library files.\n * Sets SMARTY_DIR only if user application has not already defined it.\n */\nif (!defined('SMARTY_DIR')) {\n    /**\n     *\n     */\n    define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);\n}\n/**\n * set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins.\n * Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it.\n */\nif (!defined('SMARTY_SYSPLUGINS_DIR')) {\n    /**\n     *\n     */\n    define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR);\n}\nif (!defined('SMARTY_PLUGINS_DIR')) {\n    /**\n     *\n     */\n    define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DIRECTORY_SEPARATOR);\n}\nif (!defined('SMARTY_MBSTRING')) {\n    /**\n     *\n     */\n    define('SMARTY_MBSTRING', function_exists('mb_get_info'));\n}\nif (!defined('SMARTY_RESOURCE_CHAR_SET')) {\n    // UTF-8 can only be done properly when mbstring is available!\n    /**\n     * @deprecated in favor of Smarty::$_CHARSET\n     */\n    define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1');\n}\nif (!defined('SMARTY_RESOURCE_DATE_FORMAT')) {\n    /**\n     * @deprecated in favor of Smarty::$_DATE_FORMAT\n     */\n    define('SMARTY_RESOURCE_DATE_FORMAT', '%b %e, %Y');\n}\n/**\n * Load Smarty_Autoloader\n */\nif (!class_exists('Smarty_Autoloader')) {\n    include dirname(__FILE__) . '/bootstrap.php';\n}\n/**\n * Load always needed external class files\n */\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_extension_handler.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_variable.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_source.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_resource_base.php';\nrequire_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_resource_file.php';\n\n/**\n * This is the main Smarty class\n *\n * @package Smarty\n *\n * The following methods will be dynamically loaded by the extension handler when they are called.\n * They are located in a corresponding Smarty_Internal_Method_xxxx class\n *\n * @method int clearAllCache(int $exp_time = null, string $type = null)\n * @method int clearCache(string $template_name, string $cache_id = null, string $compile_id = null, int $exp_time = null, string $type = null)\n * @method int compileAllTemplates(string $extension = '.tpl', bool $force_compile = false, int $time_limit = 0, $max_errors = null)\n * @method int compileAllConfig(string $extension = '.conf', bool $force_compile = false, int $time_limit = 0, $max_errors = null)\n * @method int clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)\n */\nclass Smarty extends Smarty_Internal_TemplateBase\n{\n    /**\n     * smarty version\n     */\n    const SMARTY_VERSION = '3.1.32';\n    /**\n     * define variable scopes\n     */\n    const SCOPE_LOCAL    = 1;\n    const SCOPE_PARENT   = 2;\n    const SCOPE_TPL_ROOT = 4;\n    const SCOPE_ROOT     = 8;\n    const SCOPE_SMARTY   = 16;\n    const SCOPE_GLOBAL   = 32;\n    /**\n     * define caching modes\n     */\n    const CACHING_OFF              = 0;\n    const CACHING_LIFETIME_CURRENT = 1;\n    const CACHING_LIFETIME_SAVED   = 2;\n    /**\n     * define constant for clearing cache files be saved expiration dates\n     */\n    const CLEAR_EXPIRED = -1;\n    /**\n     * define compile check modes\n     */\n    const COMPILECHECK_OFF       = 0;\n    const COMPILECHECK_ON        = 1;\n    const COMPILECHECK_CACHEMISS = 2;\n    /**\n     * define debug modes\n     */\n    const DEBUG_OFF        = 0;\n    const DEBUG_ON         = 1;\n    const DEBUG_INDIVIDUAL = 2;\n    /**\n     * modes for handling of \"<?php ... ?>\" tags in templates.\n     */\n    const PHP_PASSTHRU = 0; //-> print tags as plain text\n    const PHP_QUOTE    = 1; //-> escape tags as entities\n    const PHP_REMOVE   = 2; //-> escape tags as entities\n    const PHP_ALLOW    = 3; //-> escape tags as entities\n    /**\n     * filter types\n     */\n    const FILTER_POST     = 'post';\n    const FILTER_PRE      = 'pre';\n    const FILTER_OUTPUT   = 'output';\n    const FILTER_VARIABLE = 'variable';\n    /**\n     * plugin types\n     */\n    const PLUGIN_FUNCTION         = 'function';\n    const PLUGIN_BLOCK            = 'block';\n    const PLUGIN_COMPILER         = 'compiler';\n    const PLUGIN_MODIFIER         = 'modifier';\n    const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler';\n    /**\n     * assigned global tpl vars\n     */\n    public static $global_tpl_vars = array();\n    /**\n     * Flag denoting if Multibyte String functions are available\n     */\n    public static $_MBSTRING = SMARTY_MBSTRING;\n    /**\n     * The character set to adhere to (e.g. \"UTF-8\")\n     */\n    public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET;\n    /**\n     * The date format to be used internally\n     * (accepts date() and strftime())\n     */\n    public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT;\n    /**\n     * Flag denoting if PCRE should run in UTF-8 mode\n     */\n    public static $_UTF8_MODIFIER = 'u';\n    /**\n     * Flag denoting if operating system is windows\n     */\n    public static $_IS_WINDOWS = false;\n    /**\n     * auto literal on delimiters with whitespace\n     *\n     * @var boolean\n     */\n    public $auto_literal = true;\n    /**\n     * display error on not assigned variables\n     *\n     * @var boolean\n     */\n    public $error_unassigned = false;\n    /**\n     * look up relative file path in include_path\n     *\n     * @var boolean\n     */\n    public $use_include_path = false;\n    /**\n     * flag if template_dir is normalized\n     *\n     * @var bool\n     */\n    public $_templateDirNormalized = false;\n    /**\n     * joined template directory string used in cache keys\n     *\n     * @var string\n     */\n    public $_joined_template_dir = null;\n    /**\n     * flag if config_dir is normalized\n     *\n     * @var bool\n     */\n    public $_configDirNormalized = false;\n    /**\n     * joined config directory string used in cache keys\n     *\n     * @var string\n     */\n    public $_joined_config_dir = null;\n    /**\n     * default template handler\n     *\n     * @var callable\n     */\n    public $default_template_handler_func = null;\n    /**\n     * default config handler\n     *\n     * @var callable\n     */\n    public $default_config_handler_func = null;\n    /**\n     * default plugin handler\n     *\n     * @var callable\n     */\n    public $default_plugin_handler_func = null;\n    /**\n     * flag if template_dir is normalized\n     *\n     * @var bool\n     */\n    public $_compileDirNormalized = false;\n    /**\n     * flag if plugins_dir is normalized\n     *\n     * @var bool\n     */\n    public $_pluginsDirNormalized = false;\n    /**\n     * flag if template_dir is normalized\n     *\n     * @var bool\n     */\n    public $_cacheDirNormalized = false;\n    /**\n     * force template compiling?\n     *\n     * @var boolean\n     */\n    public $force_compile = false;\n     /**\n     * use sub dirs for compiled/cached files?\n     *\n     * @var boolean\n     */\n    public $use_sub_dirs = false;\n    /**\n     * allow ambiguous resources (that are made unique by the resource handler)\n     *\n     * @var boolean\n     */\n    public $allow_ambiguous_resources = false;\n    /**\n     * merge compiled includes\n     *\n     * @var boolean\n     */\n    public $merge_compiled_includes = false;\n    /*\n    * flag for behaviour when extends: resource  and {extends} tag are used simultaneous\n    *   if false disable execution of {extends} in templates called by extends resource.\n    *   (behaviour as versions < 3.1.28)\n    *\n    * @var boolean\n    */\n    public $extends_recursion = true;\n    /**\n     * force cache file creation\n     *\n     * @var boolean\n     */\n    public $force_cache = false;\n    /**\n     * template left-delimiter\n     *\n     * @var string\n     */\n    public $left_delimiter = \"{\";\n    /**\n     * template right-delimiter\n     *\n     * @var string\n     */\n    public $right_delimiter = \"}\";\n    /**\n     * array of strings which shall be treated as literal by compiler\n     *\n     * @var array string\n     */\n    public $literals = array();\n    /**\n     * class name\n     * This should be instance of Smarty_Security.\n     *\n     * @var string\n     * @see Smarty_Security\n     */\n    public $security_class = 'Smarty_Security';\n    /**\n     * implementation of security class\n     *\n     * @var Smarty_Security\n     */\n    public $security_policy = null;\n    /**\n     * controls handling of PHP-blocks\n     *\n     * @var integer\n     */\n    public $php_handling = self::PHP_PASSTHRU;\n    /**\n     * controls if the php template file resource is allowed\n     *\n     * @var bool\n     */\n    public $allow_php_templates = false;\n    /**\n     * debug mode\n     * Setting this to true enables the debug-console.\n     *\n     * @var boolean\n     */\n    public $debugging = false;\n    /**\n     * This determines if debugging is enable-able from the browser.\n     * <ul>\n     *  <li>NONE => no debugging control allowed</li>\n     *  <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li>\n     * </ul>\n     *\n     * @var string\n     */\n    public $debugging_ctrl = 'NONE';\n    /**\n     * Name of debugging URL-param.\n     * Only used when $debugging_ctrl is set to 'URL'.\n     * The name of the URL-parameter that activates debugging.\n     *\n     * @var string\n     */\n    public $smarty_debug_id = 'SMARTY_DEBUG';\n    /**\n     * Path of debug template.\n     *\n     * @var string\n     */\n    public $debug_tpl = null;\n    /**\n     * When set, smarty uses this value as error_reporting-level.\n     *\n     * @var int\n     */\n    public $error_reporting = null;\n    /**\n     * Controls whether variables with the same name overwrite each other.\n     *\n     * @var boolean\n     */\n    public $config_overwrite = true;\n    /**\n     * Controls whether config values of on/true/yes and off/false/no get converted to boolean.\n     *\n     * @var boolean\n     */\n    public $config_booleanize = true;\n    /**\n     * Controls whether hidden config sections/vars are read from the file.\n     *\n     * @var boolean\n     */\n    public $config_read_hidden = false;\n    /**\n     * locking concurrent compiles\n     *\n     * @var boolean\n     */\n    public $compile_locking = true;\n    /**\n     * Controls whether cache resources should use locking mechanism\n     *\n     * @var boolean\n     */\n    public $cache_locking = false;\n    /**\n     * seconds to wait for acquiring a lock before ignoring the write lock\n     *\n     * @var float\n     */\n    public $locking_timeout = 10;\n    /**\n     * resource type used if none given\n     * Must be an valid key of $registered_resources.\n     *\n     * @var string\n     */\n    public $default_resource_type = 'file';\n    /**\n     * caching type\n     * Must be an element of $cache_resource_types.\n     *\n     * @var string\n     */\n    public $caching_type = 'file';\n    /**\n     * config type\n     *\n     * @var string\n     */\n    public $default_config_type = 'file';\n    /**\n     * check If-Modified-Since headers\n     *\n     * @var boolean\n     */\n    public $cache_modified_check = false;\n    /**\n     * registered plugins\n     *\n     * @var array\n     */\n    public $registered_plugins = array();\n    /**\n     * registered objects\n     *\n     * @var array\n     */\n    public $registered_objects = array();\n    /**\n     * registered classes\n     *\n     * @var array\n     */\n    public $registered_classes = array();\n    /**\n     * registered filters\n     *\n     * @var array\n     */\n    public $registered_filters = array();\n    /**\n     * registered resources\n     *\n     * @var array\n     */\n    public $registered_resources = array();\n    /**\n     * registered cache resources\n     *\n     * @var array\n     */\n    public $registered_cache_resources = array();\n    /**\n     * autoload filter\n     *\n     * @var array\n     */\n    public $autoload_filters = array();\n    /**\n     * default modifier\n     *\n     * @var array\n     */\n    public $default_modifiers = array();\n    /**\n     * autoescape variable output\n     *\n     * @var boolean\n     */\n    public $escape_html = false;\n    /**\n     * start time for execution time calculation\n     *\n     * @var int\n     */\n    public $start_time = 0;\n    /**\n     * required by the compiler for BC\n     *\n     * @var string\n     */\n    public $_current_file = null;\n    /**\n     * internal flag to enable parser debugging\n     *\n     * @var bool\n     */\n    public $_parserdebug = false;\n    /**\n     * This object type (Smarty = 1, template = 2, data = 4)\n     *\n     * @var int\n     */\n    public $_objType = 1;\n    /**\n     * Debug object\n     *\n     * @var Smarty_Internal_Debug\n     */\n    public $_debug = null;\n    /**\n     * template directory\n     *\n     * @var array\n     */\n    protected $template_dir = array('./templates/');\n    /**\n     * flags for normalized template directory entries\n     *\n     * @var array\n     */\n    protected $_processedTemplateDir = array();\n    /**\n     * config directory\n     *\n     * @var array\n     */\n    protected $config_dir = array('./configs/');\n    /**\n     * flags for normalized template directory entries\n     *\n     * @var array\n     */\n    protected $_processedConfigDir = array();\n    /**\n     * compile directory\n     *\n     * @var string\n     */\n    protected $compile_dir = './templates_c/';\n    /**\n     * plugins directory\n     *\n     * @var array\n     */\n    protected $plugins_dir = array();\n    /**\n     * cache directory\n     *\n     * @var string\n     */\n    protected $cache_dir = './cache/';\n    /**\n     * removed properties\n     *\n     * @var string[]\n     */\n    protected $obsoleteProperties = array('resource_caching', 'template_resource_caching', 'direct_access_security',\n                                          '_dir_perms', '_file_perms', 'plugin_search_order',\n                                          'inheritance_merge_compiled_includes', 'resource_cache_mode',);\n    /**\n     * List of private properties which will call getter/setter on a direct access\n     *\n     * @var string[]\n     */\n    protected $accessMap = array('template_dir' => 'TemplateDir', 'config_dir' => 'ConfigDir',\n                                 'plugins_dir'  => 'PluginsDir', 'compile_dir' => 'CompileDir',\n                                 'cache_dir'    => 'CacheDir',);\n\n    /**\n     * Initialize new Smarty object\n     */\n    public function __construct()\n    {\n        $this->_clearTemplateCache();\n        parent::__construct();\n        if (is_callable('mb_internal_encoding')) {\n            mb_internal_encoding(Smarty::$_CHARSET);\n        }\n        $this->start_time = microtime(true);\n        if (isset($_SERVER[ 'SCRIPT_NAME' ])) {\n            Smarty::$global_tpl_vars[ 'SCRIPT_NAME' ] = new Smarty_Variable($_SERVER[ 'SCRIPT_NAME' ]);\n        }\n        // Check if we're running on windows\n        Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';\n        // let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8\n        if (Smarty::$_CHARSET !== 'UTF-8') {\n            Smarty::$_UTF8_MODIFIER = '';\n        }\n    }\n\n    /**\n     * Enable error handler to mute expected messages\n     *\n     * @return boolean\n     * @deprecated\n     */\n    public static function muteExpectedErrors()\n    {\n        return Smarty_Internal_ErrorHandler::muteExpectedErrors();\n    }\n\n    /**\n     * Disable error handler muting expected messages\n     *\n     * @deprecated\n     */\n    public static function unmuteExpectedErrors()\n    {\n        restore_error_handler();\n    }\n\n    /**\n     * Check if a template resource exists\n     *\n     * @param  string $resource_name template name\n     *\n     * @return bool status\n     * @throws \\SmartyException\n     */\n    public function templateExists($resource_name)\n    {\n        // create source object\n        $source = Smarty_Template_Source::load(null, $this, $resource_name);\n        return $source->exists;\n    }\n\n    /**\n     * Loads security class and enables security\n     *\n     * @param  string|Smarty_Security $security_class if a string is used, it must be class-name\n     *\n     * @return Smarty                 current Smarty instance for chaining\n     * @throws SmartyException        when an invalid class name is provided\n     */\n    public function enableSecurity($security_class = null)\n    {\n        Smarty_Security::enableSecurity($this, $security_class);\n        return $this;\n    }\n\n    /**\n     * Disable security\n     *\n     * @return Smarty current Smarty instance for chaining\n     */\n    public function disableSecurity()\n    {\n        $this->security_policy = null;\n        return $this;\n    }\n\n    /**\n     * Add template directory(s)\n     *\n     * @param  string|array $template_dir directory(s) of template sources\n     * @param  string       $key          of the array element to assign the template dir to\n     * @param bool          $isConfig     true for config_dir\n     *\n     * @return Smarty          current Smarty instance for chaining\n     */\n    public function addTemplateDir($template_dir, $key = null, $isConfig = false)\n    {\n        if ($isConfig) {\n            $processed = &$this->_processedConfigDir;\n            $dir = &$this->config_dir;\n            $this->_configDirNormalized = false;\n        } else {\n            $processed = &$this->_processedTemplateDir;\n            $dir = &$this->template_dir;\n            $this->_templateDirNormalized = false;\n        }\n        if (is_array($template_dir)) {\n            foreach ($template_dir as $k => $v) {\n                if (is_int($k)) {\n                    // indexes are not merged but appended\n                    $dir[] = $v;\n                } else {\n                    // string indexes are overridden\n                    $dir[ $k ] = $v;\n                    unset($processed[ $key ]);\n                }\n            }\n        } else {\n            if ($key !== null) {\n                // override directory at specified index\n                $dir[ $key ] = $template_dir;\n                unset($processed[ $key ]);\n            } else {\n                // append new directory\n                $dir[] = $template_dir;\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * Get template directories\n     *\n     * @param mixed $index    index of directory to get, null to get all\n     * @param bool  $isConfig true for config_dir\n     *\n     * @return array list of template directories, or directory of $index\n     */\n    public function getTemplateDir($index = null, $isConfig = false)\n    {\n        if ($isConfig) {\n            $dir = &$this->config_dir;\n        } else {\n            $dir = &$this->template_dir;\n        }\n        if ($isConfig ? !$this->_configDirNormalized : !$this->_templateDirNormalized) {\n            $this->_normalizeTemplateConfig($isConfig);\n        }\n        if ($index !== null) {\n            return isset($dir[ $index ]) ? $dir[ $index ] : null;\n        }\n        return $dir;\n    }\n\n    /**\n     * Set template directory\n     *\n     * @param  string|array $template_dir directory(s) of template sources\n     * @param bool          $isConfig     true for config_dir\n     *\n     * @return \\Smarty current Smarty instance for chaining\n     */\n    public function setTemplateDir($template_dir, $isConfig = false)\n    {\n        if ($isConfig) {\n            $this->config_dir = array();\n            $this->_processedConfigDir = array();\n        } else {\n            $this->template_dir = array();\n            $this->_processedTemplateDir = array();\n        }\n        $this->addTemplateDir($template_dir, null, $isConfig);\n        return $this;\n    }\n\n    /**\n     * Add config directory(s)\n     *\n     * @param string|array $config_dir directory(s) of config sources\n     * @param mixed        $key        key of the array element to assign the config dir to\n     *\n     * @return Smarty current Smarty instance for chaining\n     */\n    public function addConfigDir($config_dir, $key = null)\n    {\n        return $this->addTemplateDir($config_dir, $key, true);\n    }\n\n    /**\n     * Get config directory\n     *\n     * @param mixed $index index of directory to get, null to get all\n     *\n     * @return array configuration directory\n     */\n    public function getConfigDir($index = null)\n    {\n        return $this->getTemplateDir($index, true);\n    }\n\n    /**\n     * Set config directory\n     *\n     * @param $config_dir\n     *\n     * @return Smarty       current Smarty instance for chaining\n     */\n    public function setConfigDir($config_dir)\n    {\n        return $this->setTemplateDir($config_dir, true);\n    }\n\n    /**\n     * Adds directory of plugin files\n     *\n     * @param null|array|string $plugins_dir\n     *\n     * @return Smarty current Smarty instance for chaining\n     */\n    public function addPluginsDir($plugins_dir)\n    {\n        if (empty($this->plugins_dir)) {\n            $this->plugins_dir[] = SMARTY_PLUGINS_DIR;\n        }\n        $this->plugins_dir = array_merge($this->plugins_dir, (array)$plugins_dir);\n        $this->_pluginsDirNormalized = false;\n        return $this;\n    }\n\n    /**\n     * Get plugin directories\n     *\n     * @return array list of plugin directories\n     */\n    public function getPluginsDir()\n    {\n        if (empty($this->plugins_dir)) {\n            $this->plugins_dir[] = SMARTY_PLUGINS_DIR;\n            $this->_pluginsDirNormalized = false;\n        }\n        if (!$this->_pluginsDirNormalized) {\n            if (!is_array($this->plugins_dir)) {\n                $this->plugins_dir = (array)$this->plugins_dir;\n            }\n            foreach ($this->plugins_dir as $k => $v) {\n                $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v, \"/\\\\\") . DIRECTORY_SEPARATOR, true);\n            }\n            $this->_cache[ 'plugin_files' ] = array();\n            $this->_pluginsDirNormalized = true;\n        }\n        return $this->plugins_dir;\n    }\n\n    /**\n     * Set plugins directory\n     *\n     * @param  string|array $plugins_dir directory(s) of plugins\n     *\n     * @return Smarty       current Smarty instance for chaining\n     */\n    public function setPluginsDir($plugins_dir)\n    {\n        $this->plugins_dir = (array)$plugins_dir;\n        $this->_pluginsDirNormalized = false;\n        return $this;\n    }\n\n    /**\n     * Get compiled directory\n     *\n     * @return string path to compiled templates\n     */\n    public function getCompileDir()\n    {\n        if (!$this->_compileDirNormalized) {\n            $this->_normalizeDir('compile_dir', $this->compile_dir);\n            $this->_compileDirNormalized = true;\n        }\n        return $this->compile_dir;\n    }\n\n    /**\n     *\n     * @param  string $compile_dir directory to store compiled templates in\n     *\n     * @return Smarty current Smarty instance for chaining\n     */\n    public function setCompileDir($compile_dir)\n    {\n        $this->_normalizeDir('compile_dir', $compile_dir);\n        $this->_compileDirNormalized = true;\n        return $this;\n    }\n\n    /**\n     * Get cache directory\n     *\n     * @return string path of cache directory\n     */\n    public function getCacheDir()\n    {\n        if (!$this->_cacheDirNormalized) {\n            $this->_normalizeDir('cache_dir', $this->cache_dir);\n            $this->_cacheDirNormalized = true;\n        }\n        return $this->cache_dir;\n    }\n\n    /**\n     * Set cache directory\n     *\n     * @param  string $cache_dir directory to store cached templates in\n     *\n     * @return Smarty current Smarty instance for chaining\n     */\n    public function setCacheDir($cache_dir)\n    {\n        $this->_normalizeDir('cache_dir', $cache_dir);\n        $this->_cacheDirNormalized = true;\n        return $this;\n    }\n\n    /**\n     * creates a template object\n     *\n     * @param  string  $template   the resource handle of the template file\n     * @param  mixed   $cache_id   cache id to be used with this template\n     * @param  mixed   $compile_id compile id to be used with this template\n     * @param  object  $parent     next higher level of Smarty variables\n     * @param  boolean $do_clone   flag is Smarty object shall be cloned\n     *\n     * @return \\Smarty_Internal_Template template object\n     * @throws \\SmartyException\n     */\n    public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)\n    {\n        if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) {\n            $parent = $cache_id;\n            $cache_id = null;\n        }\n        if ($parent !== null && is_array($parent)) {\n            $data = $parent;\n            $parent = null;\n        } else {\n            $data = null;\n        }\n        if (!$this->_templateDirNormalized) {\n            $this->_normalizeTemplateConfig(false);\n        }\n        $_templateId = $this->_getTemplateId($template, $cache_id, $compile_id);\n        $tpl = null;\n        if ($this->caching && isset(Smarty_Internal_Template::$isCacheTplObj[ $_templateId ])) {\n            $tpl = $do_clone ? clone Smarty_Internal_Template::$isCacheTplObj[ $_templateId ] :\n                Smarty_Internal_Template::$isCacheTplObj[ $_templateId ];\n            $tpl->inheritance = null;\n            $tpl->tpl_vars = $tpl->config_vars = array();\n        } else if (!$do_clone && isset(Smarty_Internal_Template::$tplObjCache[ $_templateId ])) {\n            $tpl = clone Smarty_Internal_Template::$tplObjCache[ $_templateId ];\n            $tpl->inheritance = null;\n            $tpl->tpl_vars = $tpl->config_vars = array();\n        } else {\n            /* @var Smarty_Internal_Template $tpl */\n            $tpl = new $this->template_class($template, $this, null, $cache_id, $compile_id, null, null);\n            $tpl->templateId = $_templateId;\n        }\n        if ($do_clone) {\n            $tpl->smarty = clone $tpl->smarty;\n        }\n        $tpl->parent = $parent ? $parent : $this;\n        // fill data if present\n        if (!empty($data) && is_array($data)) {\n            // set up variable values\n            foreach ($data as $_key => $_val) {\n                $tpl->tpl_vars[ $_key ] = new Smarty_Variable($_val);\n            }\n        }\n        if ($this->debugging || $this->debugging_ctrl === 'URL') {\n            $tpl->smarty->_debug = new Smarty_Internal_Debug();\n            // check URL debugging control\n            if (!$this->debugging && $this->debugging_ctrl === 'URL') {\n                $tpl->smarty->_debug->debugUrl($tpl->smarty);\n            }\n        }\n        return $tpl;\n    }\n\n    /**\n     * Takes unknown classes and loads plugin files for them\n     * class name format: Smarty_PluginType_PluginName\n     * plugin filename format: plugintype.pluginname.php\n     *\n     * @param  string $plugin_name class plugin name to load\n     * @param  bool   $check       check if already loaded\n     *\n     * @throws SmartyException\n     * @return string |boolean filepath of loaded file or false\n     */\n    public function loadPlugin($plugin_name, $check = true)\n    {\n        return $this->ext->loadPlugin->loadPlugin($this, $plugin_name, $check);\n    }\n\n    /**\n     * Get unique template id\n     *\n     * @param string                    $template_name\n     * @param null|mixed                $cache_id\n     * @param null|mixed                $compile_id\n     * @param null                      $caching\n     * @param \\Smarty_Internal_Template $template\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function _getTemplateId($template_name,\n                                   $cache_id = null,\n                                   $compile_id = null,\n                                   $caching = null,\n                                   Smarty_Internal_Template $template = null)\n    {\n        $template_name = (strpos($template_name, ':') === false) ? \"{$this->default_resource_type}:{$template_name}\" :\n            $template_name;\n        $cache_id = $cache_id === null ? $this->cache_id : $cache_id;\n        $compile_id = $compile_id === null ? $this->compile_id : $compile_id;\n        $caching = (int)($caching === null ? $this->caching : $caching);\n        if ((isset($template) && strpos($template_name, ':.') !== false) || $this->allow_ambiguous_resources) {\n            $_templateId =\n                Smarty_Resource::getUniqueTemplateName((isset($template) ? $template : $this), $template_name) .\n                \"#{$cache_id}#{$compile_id}#{$caching}\";\n        } else {\n            $_templateId = $this->_joined_template_dir . \"#{$template_name}#{$cache_id}#{$compile_id}#{$caching}\";\n        }\n        if (isset($_templateId[ 150 ])) {\n            $_templateId = sha1($_templateId);\n        }\n        return $_templateId;\n    }\n\n    /**\n     * Normalize path\n     *  - remove /./ and /../\n     *  - make it absolute if required\n     *\n     * @param string $path      file path\n     * @param bool   $realpath  if true - convert to absolute\n     *                          false - convert to relative\n     *                          null - keep as it is but remove /./ /../\n     *\n     * @return string\n     */\n    public function _realpath($path, $realpath = null)\n    {\n        static $nds = null;\n        static $sepDotsep = null;\n        static $sepDot = null;\n        static $sepSep =null;\n        if (!isset($nds)) {\n            $nds = array('/' => '\\\\', '\\\\' => '/');\n            $sepDotsep = DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR;\n            $sepDot = DIRECTORY_SEPARATOR . '.';\n            $sepSep = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR;\n        }\n        // normalize DIRECTORY_SEPARATOR\n        $path = str_replace(array($nds[DIRECTORY_SEPARATOR], $sepDotsep), DIRECTORY_SEPARATOR, $path);\n        if (strpos($path,$sepDot) === false && (($realpath === false && $path[0] === '.') || $realpath === null) && $path[0] !== '\\\\') {\n            return $path;\n        }\n        preg_match('%^(?<root>(?:[[:alpha:]]:[\\\\\\\\]|/|[\\\\\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\\\\\])?)(?<path>(.*))$%u',\n                   $path,\n                   $parts);\n        $path = $parts[ 'path' ];\n        if ($parts[ 'root' ] === '\\\\') {\n            $parts[ 'root' ] = substr(getcwd(), 0, 2) . $parts[ 'root' ];\n        } else {\n            if ($realpath !== null && !$parts[ 'root' ]) {\n                $path = getcwd() . DIRECTORY_SEPARATOR . $path;\n            }\n        }\n       // remove noop 'DIRECTORY_SEPARATOR DIRECTORY_SEPARATOR' and 'DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR' patterns\n        $path = str_replace(array($sepDotsep,$sepSep), DIRECTORY_SEPARATOR, $path);\n        // resolve '..DIRECTORY_SEPARATOR' pattern, smallest first\n        if (strpos($path, '..' . DIRECTORY_SEPARATOR) !== false &&\n            preg_match_all('#[\\\\\\\\/]([.][.][\\\\\\\\/])+#u', $path, $match)\n        ) {\n            $counts = array();\n            foreach ($match[ 0 ] as $m) {\n                $counts[] = (int)((strlen($m) - 1) / 3);\n            }\n            sort($counts);\n            foreach ($counts as $count) {\n                $path = preg_replace('#([\\\\\\\\/]+[^\\\\\\\\/]+){' . $count .\n                                     '}[\\\\\\\\/]+([.][.][\\\\\\\\/]+){' . $count . '}#u',\n                                     DIRECTORY_SEPARATOR,\n                                     $path);\n            }\n        }\n        return $realpath !== false ? $parts[ 'root' ] . $path : str_ireplace(getcwd(), '.', $parts[ 'root' ] . $path);\n    }\n\n    /**\n     * Empty template objects cache\n     */\n    public function _clearTemplateCache()\n    {\n        Smarty_Internal_Template::$isCacheTplObj = array();\n        Smarty_Internal_Template::$tplObjCache = array();\n    }\n\n    /**\n     * @param boolean $use_sub_dirs\n     */\n    public function setUseSubDirs($use_sub_dirs)\n    {\n        $this->use_sub_dirs = $use_sub_dirs;\n    }\n\n    /**\n     * @param int $error_reporting\n     */\n    public function setErrorReporting($error_reporting)\n    {\n        $this->error_reporting = $error_reporting;\n    }\n\n    /**\n     * @param boolean $escape_html\n     */\n    public function setEscapeHtml($escape_html)\n    {\n        $this->escape_html = $escape_html;\n    }\n\n    /**\n     * Return auto_literal flag\n     *\n     * @return boolean\n     */\n    public function getAutoLiteral()\n    {\n        return $this->auto_literal;\n    }\n\n    /**\n     * Set auto_literal flag\n     *\n     * @param boolean $auto_literal\n     */\n    public function setAutoLiteral($auto_literal = true)\n    {\n        $this->auto_literal = $auto_literal;\n    }\n\n    /**\n     * @param boolean $force_compile\n     */\n    public function setForceCompile($force_compile)\n    {\n        $this->force_compile = $force_compile;\n    }\n\n    /**\n     * @param boolean $merge_compiled_includes\n     */\n    public function setMergeCompiledIncludes($merge_compiled_includes)\n    {\n        $this->merge_compiled_includes = $merge_compiled_includes;\n    }\n\n    /**\n     * Get left delimiter\n     *\n     * @return string\n     */\n    public function getLeftDelimiter()\n    {\n        return $this->left_delimiter;\n    }\n\n    /**\n     * Set left delimiter\n     *\n     * @param string $left_delimiter\n     */\n    public function setLeftDelimiter($left_delimiter)\n    {\n        $this->left_delimiter = $left_delimiter;\n    }\n\n    /**\n     * Get right delimiter\n     *\n     * @return string $right_delimiter\n     */\n    public function getRightDelimiter()\n    {\n        return $this->right_delimiter;\n    }\n\n    /**\n     * Set right delimiter\n     *\n     * @param string\n     */\n    public function setRightDelimiter($right_delimiter)\n    {\n        $this->right_delimiter = $right_delimiter;\n    }\n\n    /**\n     * @param boolean $debugging\n     */\n    public function setDebugging($debugging)\n    {\n        $this->debugging = $debugging;\n    }\n\n    /**\n     * @param boolean $config_overwrite\n     */\n    public function setConfigOverwrite($config_overwrite)\n    {\n        $this->config_overwrite = $config_overwrite;\n    }\n\n    /**\n     * @param boolean $config_booleanize\n     */\n    public function setConfigBooleanize($config_booleanize)\n    {\n        $this->config_booleanize = $config_booleanize;\n    }\n\n    /**\n     * @param boolean $config_read_hidden\n     */\n    public function setConfigReadHidden($config_read_hidden)\n    {\n        $this->config_read_hidden = $config_read_hidden;\n    }\n\n    /**\n     * @param boolean $compile_locking\n     */\n    public function setCompileLocking($compile_locking)\n    {\n        $this->compile_locking = $compile_locking;\n    }\n\n    /**\n     * @param string $default_resource_type\n     */\n    public function setDefaultResourceType($default_resource_type)\n    {\n        $this->default_resource_type = $default_resource_type;\n    }\n\n    /**\n     * @param string $caching_type\n     */\n    public function setCachingType($caching_type)\n    {\n        $this->caching_type = $caching_type;\n    }\n\n    /**\n     * Test install\n     *\n     * @param null $errors\n     */\n    public function testInstall(&$errors = null)\n    {\n        Smarty_Internal_TestInstall::testInstall($this, $errors);\n    }\n\n    /**\n     * Get Smarty object\n     *\n     * @return Smarty\n     */\n    public function _getSmartyObj()\n    {\n        return $this;\n    }\n\n    /**\n     * <<magic>> Generic getter.\n     * Calls the appropriate getter function.\n     * Issues an E_USER_NOTICE if no valid getter is found.\n     *\n     * @param  string $name property name\n     *\n     * @return mixed\n     * @throws \\SmartyException\n     */\n    public function __get($name)\n    {\n        if (isset($this->accessMap[ $name ])) {\n            $method = 'get' . $this->accessMap[ $name ];\n            return $this->{$method}();\n        } else if (isset($this->_cache[ $name ])) {\n            return $this->_cache[ $name ];\n        } else if (in_array($name, $this->obsoleteProperties)) {\n            return null;\n        } else {\n            trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);\n        }\n        return null;\n    }\n\n    /**\n     * <<magic>> Generic setter.\n     * Calls the appropriate setter function.\n     * Issues an E_USER_NOTICE if no valid setter is found.\n     *\n     * @param string $name  property name\n     * @param mixed  $value parameter passed to setter\n     *\n     * @throws \\SmartyException\n     */\n    public function __set($name, $value)\n    {\n        if (isset($this->accessMap[ $name ])) {\n            $method = 'set' . $this->accessMap[ $name ];\n            $this->{$method}($value);\n        } else if (in_array($name, $this->obsoleteProperties)) {\n            return;\n        } else {\n            if (is_object($value) && method_exists($value, $name)) {\n                $this->$name = $value;\n            } else {\n                trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);\n            }\n        }\n    }\n\n    /**\n     * Normalize and set directory string\n     *\n     * @param string $dirName cache_dir or compile_dir\n     * @param string $dir     filepath of folder\n     */\n    private function _normalizeDir($dirName, $dir)\n    {\n        $this->{$dirName} = $this->_realpath(rtrim($dir, \"/\\\\\") . DIRECTORY_SEPARATOR, true);\n        if (class_exists('Smarty_Internal_ErrorHandler', false)) {\n            if (!isset(Smarty_Internal_ErrorHandler::$mutedDirectories[ $this->{$dirName} ])) {\n                Smarty_Internal_ErrorHandler::$mutedDirectories[ $this->{$dirName} ] = null;\n            }\n        }\n    }\n\n    /**\n     * Normalize template_dir or config_dir\n     *\n     * @param bool $isConfig true for config_dir\n     *\n     */\n    private function _normalizeTemplateConfig($isConfig)\n    {\n        if ($isConfig) {\n            $processed = &$this->_processedConfigDir;\n            $dir = &$this->config_dir;\n        } else {\n            $processed = &$this->_processedTemplateDir;\n            $dir = &$this->template_dir;\n        }\n        if (!is_array($dir)) {\n            $dir = (array)$dir;\n        }\n        foreach ($dir as $k => $v) {\n            if (!isset($processed[ $k ])) {\n                $dir[ $k ] = $v = $this->_realpath(rtrim($v, \"/\\\\\") . DIRECTORY_SEPARATOR, true);\n                $processed[ $k ] = true;\n            }\n        }\n        $isConfig ? $this->_configDirNormalized = true : $this->_templateDirNormalized = true;\n        $isConfig ? $this->_joined_config_dir = join('#', $this->config_dir) :\n            $this->_joined_template_dir = join('#', $this->template_dir);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/SmartyBC.class.php",
    "content": "<?php\n/**\n * Project:     Smarty: the PHP compiling template engine\n * File:        SmartyBC.class.php\n * SVN:         $Id: $\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n * For questions, help, comments, discussion, etc., please join the\n * Smarty mailing list. Send a blank e-mail to\n * smarty-discussion-subscribe@googlegroups.com\n *\n * @link      http://www.smarty.net/\n * @copyright 2008 New Digital Group, Inc.\n * @author    Monte Ohrt <monte at ohrt dot com>\n * @author    Uwe Tews\n * @author    Rodney Rehm\n * @package   Smarty\n */\n/**\n * @ignore\n */\nrequire_once(dirname(__FILE__) . '/Smarty.class.php');\n\n/**\n * Smarty Backward Compatibility Wrapper Class\n *\n * @package Smarty\n */\nclass SmartyBC extends Smarty\n{\n    /**\n     * Smarty 2 BC\n     *\n     * @var string\n     */\n    public $_version = self::SMARTY_VERSION;\n\n    /**\n     * This is an array of directories where trusted php scripts reside.\n     *\n     * @var array\n     */\n    public $trusted_dir = array();\n\n    /**\n     * Initialize new SmartyBC object\n     *\n     */\n    public function __construct()\n    {\n        parent::__construct();\n    }\n\n    /**\n     * wrapper for assign_by_ref\n     *\n     * @param string $tpl_var the template variable name\n     * @param mixed  &$value  the referenced value to assign\n     */\n    public function assign_by_ref($tpl_var, &$value)\n    {\n        $this->assignByRef($tpl_var, $value);\n    }\n\n    /**\n     * wrapper for append_by_ref\n     *\n     * @param string  $tpl_var the template variable name\n     * @param mixed   &$value  the referenced value to append\n     * @param boolean $merge   flag if array elements shall be merged\n     */\n    public function append_by_ref($tpl_var, &$value, $merge = false)\n    {\n        $this->appendByRef($tpl_var, $value, $merge);\n    }\n\n    /**\n     * clear the given assigned template variable.\n     *\n     * @param string $tpl_var the template variable to clear\n     */\n    public function clear_assign($tpl_var)\n    {\n        $this->clearAssign($tpl_var);\n    }\n\n    /**\n     * Registers custom function to be used in templates\n     *\n     * @param string $function      the name of the template function\n     * @param string $function_impl the name of the PHP function to register\n     * @param bool   $cacheable\n     * @param mixed  $cache_attrs\n     *\n     * @throws \\SmartyException\n     */\n    public function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null)\n    {\n        $this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs);\n    }\n\n    /**\n     * Unregister custom function\n     *\n     * @param string $function name of template function\n     */\n    public function unregister_function($function)\n    {\n        $this->unregisterPlugin('function', $function);\n    }\n\n    /**\n     * Registers object to be used in templates\n     *\n     * @param string  $object        name of template object\n     * @param object  $object_impl   the referenced PHP object to register\n     * @param array   $allowed       list of allowed methods (empty = all)\n     * @param boolean $smarty_args   smarty argument format, else traditional\n     * @param array   $block_methods list of methods that are block format\n     *\n     * @throws SmartyException\n     * @internal param array $block_functs list of methods that are block format\n     */\n    public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true,\n                                    $block_methods = array())\n    {\n        settype($allowed, 'array');\n        settype($smarty_args, 'boolean');\n        $this->registerObject($object, $object_impl, $allowed, $smarty_args, $block_methods);\n    }\n\n    /**\n     * Unregister object\n     *\n     * @param string $object name of template object\n     */\n    public function unregister_object($object)\n    {\n        $this->unregisterObject($object);\n    }\n\n    /**\n     * Registers block function to be used in templates\n     *\n     * @param string $block      name of template block\n     * @param string $block_impl PHP function to register\n     * @param bool   $cacheable\n     * @param mixed  $cache_attrs\n     *\n     * @throws \\SmartyException\n     */\n    public function register_block($block, $block_impl, $cacheable = true, $cache_attrs = null)\n    {\n        $this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs);\n    }\n\n    /**\n     * Unregister block function\n     *\n     * @param string $block name of template function\n     */\n    public function unregister_block($block)\n    {\n        $this->unregisterPlugin('block', $block);\n    }\n\n    /**\n     * Registers compiler function\n     *\n     * @param string $function      name of template function\n     * @param string $function_impl name of PHP function to register\n     * @param bool   $cacheable\n     *\n     * @throws \\SmartyException\n     */\n    public function register_compiler_function($function, $function_impl, $cacheable = true)\n    {\n        $this->registerPlugin('compiler', $function, $function_impl, $cacheable);\n    }\n\n    /**\n     * Unregister compiler function\n     *\n     * @param string $function name of template function\n     */\n    public function unregister_compiler_function($function)\n    {\n        $this->unregisterPlugin('compiler', $function);\n    }\n\n    /**\n     * Registers modifier to be used in templates\n     *\n     * @param string $modifier      name of template modifier\n     * @param string $modifier_impl name of PHP function to register\n     *\n     * @throws \\SmartyException\n     */\n    public function register_modifier($modifier, $modifier_impl)\n    {\n        $this->registerPlugin('modifier', $modifier, $modifier_impl);\n    }\n\n    /**\n     * Unregister modifier\n     *\n     * @param string $modifier name of template modifier\n     */\n    public function unregister_modifier($modifier)\n    {\n        $this->unregisterPlugin('modifier', $modifier);\n    }\n\n    /**\n     * Registers a resource to fetch a template\n     *\n     * @param string $type      name of resource\n     * @param array  $functions array of functions to handle resource\n     */\n    public function register_resource($type, $functions)\n    {\n        $this->registerResource($type, $functions);\n    }\n\n    /**\n     * Unregister a resource\n     *\n     * @param string $type name of resource\n     */\n    public function unregister_resource($type)\n    {\n        $this->unregisterResource($type);\n    }\n\n    /**\n     * Registers a prefilter function to apply\n     * to a template before compiling\n     *\n     * @param callable $function\n     *\n     * @throws \\SmartyException\n     */\n    public function register_prefilter($function)\n    {\n        $this->registerFilter('pre', $function);\n    }\n\n    /**\n     * Unregister a prefilter function\n     *\n     * @param callable $function\n     */\n    public function unregister_prefilter($function)\n    {\n        $this->unregisterFilter('pre', $function);\n    }\n\n    /**\n     * Registers a postfilter function to apply\n     * to a compiled template after compilation\n     *\n     * @param callable $function\n     *\n     * @throws \\SmartyException\n     */\n    public function register_postfilter($function)\n    {\n        $this->registerFilter('post', $function);\n    }\n\n    /**\n     * Unregister a postfilter function\n     *\n     * @param callable $function\n     */\n    public function unregister_postfilter($function)\n    {\n        $this->unregisterFilter('post', $function);\n    }\n\n    /**\n     * Registers an output filter function to apply\n     * to a template output\n     *\n     * @param callable $function\n     *\n     * @throws \\SmartyException\n     */\n    public function register_outputfilter($function)\n    {\n        $this->registerFilter('output', $function);\n    }\n\n    /**\n     * Unregister an outputfilter function\n     *\n     * @param callable $function\n     */\n    public function unregister_outputfilter($function)\n    {\n        $this->unregisterFilter('output', $function);\n    }\n\n    /**\n     * load a filter of specified type and name\n     *\n     * @param string $type filter type\n     * @param string $name filter name\n     *\n     * @throws \\SmartyException\n     */\n    public function load_filter($type, $name)\n    {\n        $this->loadFilter($type, $name);\n    }\n\n    /**\n     * clear cached content for the given template and cache id\n     *\n     * @param  string $tpl_file   name of template file\n     * @param  string $cache_id   name of cache_id\n     * @param  string $compile_id name of compile_id\n     * @param  string $exp_time   expiration time\n     *\n     * @return boolean\n     */\n    public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)\n    {\n        return $this->clearCache($tpl_file, $cache_id, $compile_id, $exp_time);\n    }\n\n    /**\n     * clear the entire contents of cache (all templates)\n     *\n     * @param  string $exp_time expire time\n     *\n     * @return boolean\n     */\n    public function clear_all_cache($exp_time = null)\n    {\n        return $this->clearCache(null, null, null, $exp_time);\n    }\n\n    /**\n     * test to see if valid cache exists for this template\n     *\n     * @param  string $tpl_file name of template file\n     * @param  string $cache_id\n     * @param  string $compile_id\n     *\n     * @return bool\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function is_cached($tpl_file, $cache_id = null, $compile_id = null)\n    {\n        return $this->isCached($tpl_file, $cache_id, $compile_id);\n    }\n\n    /**\n     * clear all the assigned template variables.\n     */\n    public function clear_all_assign()\n    {\n        $this->clearAllAssign();\n    }\n\n    /**\n     * clears compiled version of specified template resource,\n     * or all compiled template files if one is not specified.\n     * This function is for advanced use only, not normally needed.\n     *\n     * @param  string $tpl_file\n     * @param  string $compile_id\n     * @param  string $exp_time\n     *\n     * @return boolean results of {@link smarty_core_rm_auto()}\n     */\n    public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)\n    {\n        return $this->clearCompiledTemplate($tpl_file, $compile_id, $exp_time);\n    }\n\n    /**\n     * Checks whether requested template exists.\n     *\n     * @param  string $tpl_file\n     *\n     * @return bool\n     * @throws \\SmartyException\n     */\n    public function template_exists($tpl_file)\n    {\n        return $this->templateExists($tpl_file);\n    }\n\n    /**\n     * Returns an array containing template variables\n     *\n     * @param  string $name\n     *\n     * @return array\n     */\n    public function get_template_vars($name = null)\n    {\n        return $this->getTemplateVars($name);\n    }\n\n    /**\n     * Returns an array containing config variables\n     *\n     * @param  string $name\n     *\n     * @return array\n     */\n    public function get_config_vars($name = null)\n    {\n        return $this->getConfigVars($name);\n    }\n\n    /**\n     * load configuration values\n     *\n     * @param string $file\n     * @param string $section\n     * @param string $scope\n     */\n    public function config_load($file, $section = null, $scope = 'global')\n    {\n        $this->ConfigLoad($file, $section, $scope);\n    }\n\n    /**\n     * return a reference to a registered object\n     *\n     * @param  string $name\n     *\n     * @return object\n     */\n    public function get_registered_object($name)\n    {\n        return $this->getRegisteredObject($name);\n    }\n\n    /**\n     * clear configuration values\n     *\n     * @param string $var\n     */\n    public function clear_config($var = null)\n    {\n        $this->clearConfig($var);\n    }\n\n    /**\n     * trigger Smarty error\n     *\n     * @param string  $error_msg\n     * @param integer $error_type\n     */\n    public function trigger_error($error_msg, $error_type = E_USER_WARNING)\n    {\n        trigger_error(\"Smarty error: $error_msg\", $error_type);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/bootstrap.php",
    "content": "<?php\n/*\n * This file is part of the Smarty package.\n *\n * (c) Sebastian Bergmann <sebastian@phpunit.de>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/*\n * Load and register Smarty Autoloader\n */\nif (!class_exists('Smarty_Autoloader')) {\n    require dirname(__FILE__) . '/Autoloader.php';\n}\nSmarty_Autoloader::register(true);\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/debug.tpl",
    "content": "{capture name='_smarty_debug' assign=debug_output}\n    <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n    <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n    <head>\n        <title>Smarty Debug Console</title>\n        <style type=\"text/css\">\n            {literal}\n            body, h1, h2, h3, td, th, p {\n                font-family: sans-serif;\n                font-weight: normal;\n                font-size: 0.9em;\n                margin: 1px;\n                padding: 0;\n            }\n\n            h1 {\n                margin: 0;\n                text-align: left;\n                padding: 2px;\n                background-color: #f0c040;\n                color: black;\n                font-weight: bold;\n                font-size: 1.2em;\n            }\n\n            h2 {\n                background-color: #9B410E;\n                color: white;\n                text-align: left;\n                font-weight: bold;\n                padding: 2px;\n                border-top: 1px solid black;\n            }\n            h3 {\n                text-align: left;\n                font-weight: bold;\n                color: black;\n                font-size: 0.7em;\n                padding: 2px;\n            }\n\n            body {\n                background: black;\n            }\n\n            p, table, div {\n                background: #f0ead8;\n            }\n\n            p {\n                margin: 0;\n                font-style: italic;\n                text-align: center;\n            }\n\n            table {\n                width: 100%;\n            }\n\n            th, td {\n                font-family: monospace;\n                vertical-align: top;\n                text-align: left;\n            }\n\n            td {\n                color: green;\n            }\n\n            .odd {\n                background-color: #eeeeee;\n            }\n\n            .even {\n                background-color: #fafafa;\n            }\n\n            .exectime {\n                font-size: 0.8em;\n                font-style: italic;\n            }\n\n            #bold div {\n                color: black;\n                font-weight: bold;\n            }\n            #blue h3 {\n                color: blue;\n            }\n            #normal div {\n                color: black;\n                font-weight: normal;\n            }\n            #table_assigned_vars th {\n                color: blue;\n                font-weight: bold;\n            }\n\n            #table_config_vars th {\n                color: maroon;\n            }\n\n            {/literal}\n        </style>\n    </head>\n    <body>\n\n    <h1>Smarty {Smarty::SMARTY_VERSION} Debug Console\n        -  {if isset($template_name)}{$template_name|debug_print_var nofilter} {/if}{if !empty($template_data)}Total Time {$execution_time|string_format:\"%.5f\"}{/if}</h1>\n\n    {if !empty($template_data)}\n        <h2>included templates &amp; config files (load time in seconds)</h2>\n        <div>\n            {foreach $template_data as $template}\n                <font color=brown>{$template.name}</font>\n                <br>&nbsp;&nbsp;<span class=\"exectime\">\n                (compile {$template['compile_time']|string_format:\"%.5f\"}) (render {$template['render_time']|string_format:\"%.5f\"}) (cache {$template['cache_time']|string_format:\"%.5f\"})\n                 </span>\n                <br>\n            {/foreach}\n        </div>\n    {/if}\n\n    <h2>assigned template variables</h2>\n\n    <table id=\"table_assigned_vars\">\n        {foreach $assigned_vars as $vars}\n            <tr class=\"{if $vars@iteration % 2 eq 0}odd{else}even{/if}\">\n                <td><h3><font color=blue>${$vars@key}</font></h3>\n                    {if isset($vars['nocache'])}<b>Nocache</b></br>{/if}\n                    {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var nofilter}{/if}\n                </td>\n                <td><h3>Value</h3>{$vars['value']|debug_print_var:10:80 nofilter}</td>\n                <td>{if isset($vars['attributes'])}<h3>Attributes</h3>{$vars['attributes']|debug_print_var nofilter} {/if}</td>\n         {/foreach}\n    </table>\n\n    <h2>assigned config file variables</h2>\n\n    <table id=\"table_config_vars\">\n        {foreach $config_vars as $vars}\n            <tr class=\"{if $vars@iteration % 2 eq 0}odd{else}even{/if}\">\n                <td><h3><font color=blue>#{$vars@key}#</font></h3>\n                    {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var nofilter}{/if}\n                </td>\n                <td>{$vars['value']|debug_print_var:10:80 nofilter}</td>\n            </tr>\n        {/foreach}\n\n    </table>\n    </body>\n    </html>\n{/capture}\n<script type=\"text/javascript\">\n    {$id = '__Smarty__'}\n    {if $display_mode}{$id = \"$offset$template_name\"|md5}{/if}\n    _smarty_console = window.open(\"\", \"console{$id}\", \"width=1024,height=600,left={$offset},top={$offset},resizable,scrollbars=yes\");\n    _smarty_console.document.write(\"{$debug_output|escape:'javascript' nofilter}\");\n    _smarty_console.document.close();\n</script>\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/block.textformat.php",
    "content": "<?php\n/**\n * Smarty plugin to format text blocks\n *\n * @package    Smarty\n * @subpackage PluginsBlock\n */\n/**\n * Smarty {textformat}{/textformat} block plugin\n * Type:     block function\n * Name:     textformat\n * Purpose:  format text a certain way with preset styles\n *           or custom wrap/indent settings\n * Params:\n *\n * - style         - string (email)\n * - indent        - integer (0)\n * - wrap          - integer (80)\n * - wrap_char     - string (\"\\n\")\n * - indent_char   - string (\" \")\n * - wrap_boundary - boolean (true)\n *\n *\n * @link   http://www.smarty.net/manual/en/language.function.textformat.php {textformat}\n *         (Smarty online manual)\n *\n * @param array                    $params   parameters\n * @param string                   $content  contents of the block\n * @param Smarty_Internal_Template $template template object\n * @param boolean                  &$repeat  repeat flag\n *\n * @return string content re-formatted\n * @author Monte Ohrt <monte at ohrt dot com>\n * @throws \\SmartyException\n */\nfunction smarty_block_textformat($params, $content, Smarty_Internal_Template $template, &$repeat)\n{\n    if (is_null($content)) {\n        return;\n    }\n    if (Smarty::$_MBSTRING) {\n        $template->_checkPlugins(array(array('function' => 'smarty_modifier_mb_wordwrap',\n                                             'file' => SMARTY_PLUGINS_DIR . 'modifier.mb_wordwrap.php')));\n    }\n\n    $style = null;\n    $indent = 0;\n    $indent_first = 0;\n    $indent_char = ' ';\n    $wrap = 80;\n    $wrap_char = \"\\n\";\n    $wrap_cut = false;\n    $assign = null;\n\n    foreach ($params as $_key => $_val) {\n        switch ($_key) {\n            case 'style':\n            case 'indent_char':\n            case 'wrap_char':\n            case 'assign':\n                $$_key = (string) $_val;\n                break;\n\n            case 'indent':\n            case 'indent_first':\n            case 'wrap':\n                $$_key = (int) $_val;\n                break;\n\n            case 'wrap_cut':\n                $$_key = (bool) $_val;\n                break;\n\n            default:\n                trigger_error(\"textformat: unknown attribute '{$_key}'\");\n        }\n    }\n\n    if ($style === 'email') {\n        $wrap = 72;\n    }\n    // split into paragraphs\n    $_paragraphs = preg_split('![\\r\\n]{2}!', $content);\n\n    foreach ($_paragraphs as &$_paragraph) {\n        if (!$_paragraph) {\n            continue;\n        }\n        // convert mult. spaces & special chars to single space\n        $_paragraph =\n            preg_replace(array('!\\s+!' . Smarty::$_UTF8_MODIFIER,\n                               '!(^\\s+)|(\\s+$)!' . Smarty::$_UTF8_MODIFIER),\n                         array(' ',\n                               ''), $_paragraph);\n        // indent first line\n        if ($indent_first > 0) {\n            $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph;\n        }\n        // wordwrap sentences\n        if (Smarty::$_MBSTRING) {\n            $_paragraph = smarty_modifier_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);\n        } else {\n            $_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);\n        }\n        // indent lines\n        if ($indent > 0) {\n            $_paragraph = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraph);\n        }\n    }\n    $_output = implode($wrap_char . $wrap_char, $_paragraphs);\n\n    if ($assign) {\n        $template->assign($assign, $_output);\n    } else {\n        return $_output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.counter.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {counter} function plugin\n * Type:     function\n * Name:     counter\n * Purpose:  print out a counter value\n *\n * @author Monte Ohrt <monte at ohrt dot com>\n * @link   http://www.smarty.net/manual/en/language.function.counter.php {counter}\n *         (Smarty online manual)\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @return string|null\n */\nfunction smarty_function_counter($params, $template)\n{\n    static $counters = array();\n\n    $name = (isset($params[ 'name' ])) ? $params[ 'name' ] : 'default';\n    if (!isset($counters[ $name ])) {\n        $counters[ $name ] = array('start' => 1, 'skip' => 1, 'direction' => 'up', 'count' => 1);\n    }\n    $counter =& $counters[ $name ];\n\n    if (isset($params[ 'start' ])) {\n        $counter[ 'start' ] = $counter[ 'count' ] = (int) $params[ 'start' ];\n    }\n\n    if (!empty($params[ 'assign' ])) {\n        $counter[ 'assign' ] = $params[ 'assign' ];\n    }\n\n    if (isset($counter[ 'assign' ])) {\n        $template->assign($counter[ 'assign' ], $counter[ 'count' ]);\n    }\n\n    if (isset($params[ 'print' ])) {\n        $print = (bool) $params[ 'print' ];\n    } else {\n        $print = empty($counter[ 'assign' ]);\n    }\n\n    if ($print) {\n        $retval = $counter[ 'count' ];\n    } else {\n        $retval = null;\n    }\n\n    if (isset($params[ 'skip' ])) {\n        $counter[ 'skip' ] = $params[ 'skip' ];\n    }\n\n    if (isset($params[ 'direction' ])) {\n        $counter[ 'direction' ] = $params[ 'direction' ];\n    }\n\n    if ($counter[ 'direction' ] === 'down') {\n        $counter[ 'count' ] -= $counter[ 'skip' ];\n    } else {\n        $counter[ 'count' ] += $counter[ 'skip' ];\n    }\n\n    return $retval;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.cycle.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {cycle} function plugin\n * Type:     function\n * Name:     cycle\n * Date:     May 3, 2002\n * Purpose:  cycle through given values\n * Params:\n *\n * - name      - name of cycle (optional)\n * - values    - comma separated list of values to cycle, or an array of values to cycle\n *               (this can be left out for subsequent calls)\n * - reset     - boolean - resets given var to true\n * - print     - boolean - print var or not. default is true\n * - advance   - boolean - whether or not to advance the cycle\n * - delimiter - the value delimiter, default is \",\"\n * - assign    - boolean, assigns to template var instead of printed.\n *\n * Examples:\n *\n * {cycle values=\"#eeeeee,#d0d0d0d\"}\n * {cycle name=row values=\"one,two,three\" reset=true}\n * {cycle name=row}\n *\n *\n * @link     http://www.smarty.net/manual/en/language.function.cycle.php {cycle}\n *           (Smarty online manual)\n * @author   Monte Ohrt <monte at ohrt dot com>\n * @author   credit to Mark Priatel <mpriatel@rogers.com>\n * @author   credit to Gerard <gerard@interfold.com>\n * @author   credit to Jason Sweat <jsweat_php@yahoo.com>\n * @version  1.3\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @return string|null\n */\n\nfunction smarty_function_cycle($params, $template)\n{\n    static $cycle_vars;\n\n    $name = (empty($params[ 'name' ])) ? 'default' : $params[ 'name' ];\n    $print = (isset($params[ 'print' ])) ? (bool) $params[ 'print' ] : true;\n    $advance = (isset($params[ 'advance' ])) ? (bool) $params[ 'advance' ] : true;\n    $reset = (isset($params[ 'reset' ])) ? (bool) $params[ 'reset' ] : false;\n\n    if (!isset($params[ 'values' ])) {\n        if (!isset($cycle_vars[ $name ][ 'values' ])) {\n            trigger_error('cycle: missing \\'values\\' parameter');\n\n            return;\n        }\n    } else {\n        if (isset($cycle_vars[ $name ][ 'values' ]) && $cycle_vars[ $name ][ 'values' ] !== $params[ 'values' ]) {\n            $cycle_vars[ $name ][ 'index' ] = 0;\n        }\n        $cycle_vars[ $name ][ 'values' ] = $params[ 'values' ];\n    }\n\n    if (isset($params[ 'delimiter' ])) {\n        $cycle_vars[ $name ][ 'delimiter' ] = $params[ 'delimiter' ];\n    } elseif (!isset($cycle_vars[ $name ][ 'delimiter' ])) {\n        $cycle_vars[ $name ][ 'delimiter' ] = ',';\n    }\n\n    if (is_array($cycle_vars[ $name ][ 'values' ])) {\n        $cycle_array = $cycle_vars[ $name ][ 'values' ];\n    } else {\n        $cycle_array = explode($cycle_vars[ $name ][ 'delimiter' ], $cycle_vars[ $name ][ 'values' ]);\n    }\n\n    if (!isset($cycle_vars[ $name ][ 'index' ]) || $reset) {\n        $cycle_vars[ $name ][ 'index' ] = 0;\n    }\n\n    if (isset($params[ 'assign' ])) {\n        $print = false;\n        $template->assign($params[ 'assign' ], $cycle_array[ $cycle_vars[ $name ][ 'index' ] ]);\n    }\n\n    if ($print) {\n        $retval = $cycle_array[ $cycle_vars[ $name ][ 'index' ] ];\n    } else {\n        $retval = null;\n    }\n\n    if ($advance) {\n        if ($cycle_vars[ $name ][ 'index' ] >= count($cycle_array) - 1) {\n            $cycle_vars[ $name ][ 'index' ] = 0;\n        } else {\n            $cycle_vars[ $name ][ 'index' ] ++;\n        }\n    }\n\n    return $retval;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.fetch.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {fetch} plugin\n * Type:     function\n * Name:     fetch\n * Purpose:  fetch file, web or ftp data and display results\n *\n * @link   http://www.smarty.net/manual/en/language.function.fetch.php {fetch}\n *         (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @throws SmartyException\n * @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable\n */\nfunction smarty_function_fetch($params, $template)\n{\n    if (empty($params[ 'file' ])) {\n        trigger_error('[plugin] fetch parameter \\'file\\' cannot be empty', E_USER_NOTICE);\n\n        return;\n    }\n\n    // strip file protocol\n    if (stripos($params[ 'file' ], 'file://') === 0) {\n        $params[ 'file' ] = substr($params[ 'file' ], 7);\n    }\n\n    $protocol = strpos($params[ 'file' ], '://');\n    if ($protocol !== false) {\n        $protocol = strtolower(substr($params[ 'file' ], 0, $protocol));\n    }\n\n    if (isset($template->smarty->security_policy)) {\n        if ($protocol) {\n            // remote resource (or php stream, …)\n            if (!$template->smarty->security_policy->isTrustedUri($params[ 'file' ])) {\n                return;\n            }\n        } else {\n            // local file\n            if (!$template->smarty->security_policy->isTrustedResourceDir($params[ 'file' ])) {\n                return;\n            }\n        }\n    }\n\n    $content = '';\n    if ($protocol === 'http') {\n        // http fetch\n        if ($uri_parts = parse_url($params[ 'file' ])) {\n            // set defaults\n            $host = $server_name = $uri_parts[ 'host' ];\n            $timeout = 30;\n            $accept = 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';\n            $agent = 'Smarty Template Engine ' . Smarty::SMARTY_VERSION;\n            $referer = '';\n            $uri = !empty($uri_parts[ 'path' ]) ? $uri_parts[ 'path' ] : '/';\n            $uri .= !empty($uri_parts[ 'query' ]) ? '?' . $uri_parts[ 'query' ] : '';\n            $_is_proxy = false;\n            if (empty($uri_parts[ 'port' ])) {\n                $port = 80;\n            } else {\n                $port = $uri_parts[ 'port' ];\n            }\n            if (!empty($uri_parts[ 'user' ])) {\n                $user = $uri_parts[ 'user' ];\n            }\n            if (!empty($uri_parts[ 'pass' ])) {\n                $pass = $uri_parts[ 'pass' ];\n            }\n            // loop through parameters, setup headers\n            foreach ($params as $param_key => $param_value) {\n                switch ($param_key) {\n                    case 'file':\n                    case 'assign':\n                    case 'assign_headers':\n                        break;\n                    case 'user':\n                        if (!empty($param_value)) {\n                            $user = $param_value;\n                        }\n                        break;\n                    case 'pass':\n                        if (!empty($param_value)) {\n                            $pass = $param_value;\n                        }\n                        break;\n                    case 'accept':\n                        if (!empty($param_value)) {\n                            $accept = $param_value;\n                        }\n                        break;\n                    case 'header':\n                        if (!empty($param_value)) {\n                            if (!preg_match('![\\w\\d-]+: .+!', $param_value)) {\n                                trigger_error(\"[plugin] invalid header format '{$param_value}'\", E_USER_NOTICE);\n\n                                return;\n                            } else {\n                                $extra_headers[] = $param_value;\n                            }\n                        }\n                        break;\n                    case 'proxy_host':\n                        if (!empty($param_value)) {\n                            $proxy_host = $param_value;\n                        }\n                        break;\n                    case 'proxy_port':\n                        if (!preg_match('!\\D!', $param_value)) {\n                            $proxy_port = (int) $param_value;\n                        } else {\n                            trigger_error(\"[plugin] invalid value for attribute '{$param_key }'\", E_USER_NOTICE);\n\n                            return;\n                        }\n                        break;\n                    case 'agent':\n                        if (!empty($param_value)) {\n                            $agent = $param_value;\n                        }\n                        break;\n                    case 'referer':\n                        if (!empty($param_value)) {\n                            $referer = $param_value;\n                        }\n                        break;\n                    case 'timeout':\n                        if (!preg_match('!\\D!', $param_value)) {\n                            $timeout = (int) $param_value;\n                        } else {\n                            trigger_error(\"[plugin] invalid value for attribute '{$param_key}'\", E_USER_NOTICE);\n\n                            return;\n                        }\n                        break;\n                    default:\n                        trigger_error(\"[plugin] unrecognized attribute '{$param_key}'\", E_USER_NOTICE);\n\n                        return;\n                }\n            }\n            if (!empty($proxy_host) && !empty($proxy_port)) {\n                $_is_proxy = true;\n                $fp = fsockopen($proxy_host, $proxy_port, $errno, $errstr, $timeout);\n            } else {\n                $fp = fsockopen($server_name, $port, $errno, $errstr, $timeout);\n            }\n\n            if (!$fp) {\n                trigger_error(\"[plugin] unable to fetch: $errstr ($errno)\", E_USER_NOTICE);\n\n                return;\n            } else {\n                if ($_is_proxy) {\n                    fputs($fp, 'GET ' . $params[ 'file' ] . \" HTTP/1.0\\r\\n\");\n                } else {\n                    fputs($fp, \"GET $uri HTTP/1.0\\r\\n\");\n                }\n                if (!empty($host)) {\n                    fputs($fp, \"Host: $host\\r\\n\");\n                }\n                if (!empty($accept)) {\n                    fputs($fp, \"Accept: $accept\\r\\n\");\n                }\n                if (!empty($agent)) {\n                    fputs($fp, \"User-Agent: $agent\\r\\n\");\n                }\n                if (!empty($referer)) {\n                    fputs($fp, \"Referer: $referer\\r\\n\");\n                }\n                if (isset($extra_headers) && is_array($extra_headers)) {\n                    foreach ($extra_headers as $curr_header) {\n                        fputs($fp, $curr_header . \"\\r\\n\");\n                    }\n                }\n                if (!empty($user) && !empty($pass)) {\n                    fputs($fp, 'Authorization: BASIC ' . base64_encode(\"$user:$pass\") . \"\\r\\n\");\n                }\n\n                fputs($fp, \"\\r\\n\");\n                while (!feof($fp)) {\n                    $content .= fgets($fp, 4096);\n                }\n                fclose($fp);\n                $csplit = preg_split(\"!\\r\\n\\r\\n!\", $content, 2);\n\n                $content = $csplit[ 1 ];\n\n                if (!empty($params[ 'assign_headers' ])) {\n                    $template->assign($params[ 'assign_headers' ], preg_split(\"!\\r\\n!\", $csplit[ 0 ]));\n                }\n            }\n        } else {\n            trigger_error(\"[plugin fetch] unable to parse URL, check syntax\", E_USER_NOTICE);\n\n            return;\n        }\n    } else {\n        $content = @file_get_contents($params[ 'file' ]);\n        if ($content === false) {\n            throw new SmartyException(\"{fetch} cannot read resource '\" . $params[ 'file' ] . \"'\");\n        }\n    }\n\n    if (!empty($params[ 'assign' ])) {\n        $template->assign($params[ 'assign' ], $content);\n    } else {\n        return $content;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.html_checkboxes.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n/**\n * Smarty {html_checkboxes} function plugin\n * File:       function.html_checkboxes.php\n * Type:       function\n * Name:       html_checkboxes\n * Date:       24.Feb.2003\n * Purpose:    Prints out a list of checkbox input types\n * Examples:\n *\n * {html_checkboxes values=$ids output=$names}\n * {html_checkboxes values=$ids name='box' separator='<br>' output=$names}\n * {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}\n *\n * Params:\n *\n * - name       (optional) - string default \"checkbox\"\n * - values     (required) - array\n * - options    (optional) - associative array\n * - checked    (optional) - array default not set\n * - separator  (optional) - ie <br> or &nbsp;\n * - output     (optional) - the output next to each checkbox\n * - assign     (optional) - assign the output as an array to this variable\n * - escape     (optional) - escape the content (not value), defaults to true\n *\n *\n * @link       http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}\n *             (Smarty online manual)\n * @author     Christopher Kvarme <christopher.kvarme@flashjab.com>\n * @author     credits to Monte Ohrt <monte at ohrt dot com>\n * @version    1.0\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @return string\n * @uses       smarty_function_escape_special_chars()\n * @throws \\SmartyException\n */\nfunction smarty_function_html_checkboxes($params, Smarty_Internal_Template $template)\n{\n    $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars',\n                                         'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php')));\n\n    $name = 'checkbox';\n    $values = null;\n    $options = null;\n    $selected = array();\n    $separator = '';\n    $escape = true;\n    $labels = true;\n    $label_ids = false;\n    $output = null;\n\n    $extra = '';\n\n    foreach ($params as $_key => $_val) {\n        switch ($_key) {\n            case 'name':\n            case 'separator':\n                $$_key = (string) $_val;\n                break;\n\n            case 'escape':\n            case 'labels':\n            case 'label_ids':\n                $$_key = (bool) $_val;\n                break;\n\n            case 'options':\n                $$_key = (array) $_val;\n                break;\n\n            case 'values':\n            case 'output':\n                $$_key = array_values((array) $_val);\n                break;\n\n            case 'checked':\n            case 'selected':\n                if (is_array($_val)) {\n                    $selected = array();\n                    foreach ($_val as $_sel) {\n                        if (is_object($_sel)) {\n                            if (method_exists($_sel, '__toString')) {\n                                $_sel = smarty_function_escape_special_chars((string) $_sel->__toString());\n                            } else {\n                                trigger_error('html_checkboxes: selected attribute contains an object of class \\'' .\n                                              get_class($_sel) . '\\' without __toString() method', E_USER_NOTICE);\n                                continue;\n                            }\n                        } else {\n                            $_sel = smarty_function_escape_special_chars((string) $_sel);\n                        }\n                        $selected[ $_sel ] = true;\n                    }\n                } elseif (is_object($_val)) {\n                    if (method_exists($_val, '__toString')) {\n                        $selected = smarty_function_escape_special_chars((string) $_val->__toString());\n                    } else {\n                        trigger_error('html_checkboxes: selected attribute is an object of class \\'' . get_class($_val) .\n                                      '\\' without __toString() method', E_USER_NOTICE);\n                    }\n                } else {\n                    $selected = smarty_function_escape_special_chars((string) $_val);\n                }\n                break;\n\n            case 'checkboxes':\n                trigger_error('html_checkboxes: the use of the \"checkboxes\" attribute is deprecated, use \"options\" instead',\n                              E_USER_WARNING);\n                $options = (array) $_val;\n                break;\n\n            case 'assign':\n                break;\n\n            case 'strict':\n                break;\n\n            case 'disabled':\n            case 'readonly':\n                if (!empty($params[ 'strict' ])) {\n                    if (!is_scalar($_val)) {\n                        trigger_error(\"html_options: {$_key} attribute must be a scalar, only boolean true or string '{$_key}' will actually add the attribute\",\n                                      E_USER_NOTICE);\n                    }\n\n                    if ($_val === true || $_val === $_key) {\n                        $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_key) . '\"';\n                    }\n\n                    break;\n                }\n            // omit break; to fall through!\n\n            default:\n                if (!is_array($_val)) {\n                    $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_val) . '\"';\n                } else {\n                    trigger_error(\"html_checkboxes: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    if (!isset($options) && !isset($values)) {\n        return '';\n    } /* raise error here? */\n\n    $_html_result = array();\n\n    if (isset($options)) {\n        foreach ($options as $_key => $_val) {\n            $_html_result[] =\n                smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels,\n                                                       $label_ids, $escape);\n        }\n    } else {\n        foreach ($values as $_i => $_key) {\n            $_val = isset($output[ $_i ]) ? $output[ $_i ] : '';\n            $_html_result[] =\n                smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels,\n                                                       $label_ids, $escape);\n        }\n    }\n\n    if (!empty($params[ 'assign' ])) {\n        $template->assign($params[ 'assign' ], $_html_result);\n    } else {\n        return implode(\"\\n\", $_html_result);\n    }\n}\n/**\n * @param      $name\n * @param      $value\n * @param      $output\n * @param      $selected\n * @param      $extra\n * @param      $separator\n * @param      $labels\n * @param      $label_ids\n * @param bool $escape\n *\n * @return string\n */\nfunction smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels,\n                                                   $label_ids, $escape = true)\n{\n    $_output = '';\n\n    if (is_object($value)) {\n        if (method_exists($value, '__toString')) {\n            $value = (string) $value->__toString();\n        } else {\n            trigger_error('html_options: value is an object of class \\'' . get_class($value) .\n                          '\\' without __toString() method', E_USER_NOTICE);\n\n            return '';\n        }\n    } else {\n        $value = (string) $value;\n    }\n\n    if (is_object($output)) {\n        if (method_exists($output, '__toString')) {\n            $output = (string) $output->__toString();\n        } else {\n            trigger_error('html_options: output is an object of class \\'' . get_class($output) .\n                          '\\' without __toString() method', E_USER_NOTICE);\n\n            return '';\n        }\n    } else {\n        $output = (string) $output;\n    }\n\n    if ($labels) {\n        if ($label_ids) {\n            $_id = smarty_function_escape_special_chars(preg_replace('![^\\w\\-\\.]!' . Smarty::$_UTF8_MODIFIER, '_',\n                                                                     $name . '_' . $value));\n            $_output .= '<label for=\"' . $_id . '\">';\n        } else {\n            $_output .= '<label>';\n        }\n    }\n\n    $name = smarty_function_escape_special_chars($name);\n    $value = smarty_function_escape_special_chars($value);\n    if ($escape) {\n        $output = smarty_function_escape_special_chars($output);\n    }\n\n    $_output .= '<input type=\"checkbox\" name=\"' . $name . '[]\" value=\"' . $value . '\"';\n\n    if ($labels && $label_ids) {\n        $_output .= ' id=\"' . $_id . '\"';\n    }\n\n    if (is_array($selected)) {\n        if (isset($selected[ $value ])) {\n            $_output .= ' checked=\"checked\"';\n        }\n    } elseif ($value === $selected) {\n        $_output .= ' checked=\"checked\"';\n    }\n\n    $_output .= $extra . ' />' . $output;\n    if ($labels) {\n        $_output .= '</label>';\n    }\n\n    $_output .= $separator;\n\n    return $_output;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.html_image.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {html_image} function plugin\n * Type:     function\n * Name:     html_image\n * Date:     Feb 24, 2003\n * Purpose:  format HTML tags for the image\n * Examples: {html_image file=\"/images/masthead.gif\"}\n * Output:   <img src=\"/images/masthead.gif\" width=400 height=23>\n * Params:\n *\n * - file        - (required) - file (and path) of image\n * - height      - (optional) - image height (default actual height)\n * - width       - (optional) - image width (default actual width)\n * - basedir     - (optional) - base directory for absolute paths, default is environment variable DOCUMENT_ROOT\n * - path_prefix - prefix for path output (optional, default empty)\n *\n *\n * @link    http://www.smarty.net/manual/en/language.function.html.image.php {html_image}\n *          (Smarty online manual)\n * @author  Monte Ohrt <monte at ohrt dot com>\n * @author  credits to Duda <duda@big.hu>\n * @version 1.0\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @throws SmartyException\n * @return string\n * @uses    smarty_function_escape_special_chars()\n */\nfunction smarty_function_html_image($params, Smarty_Internal_Template $template)\n{\n    $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars',\n                                         'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php')));\n\n    $alt = '';\n    $file = '';\n    $height = '';\n    $width = '';\n    $extra = '';\n    $prefix = '';\n    $suffix = '';\n    $path_prefix = '';\n    $basedir = isset($_SERVER[ 'DOCUMENT_ROOT' ]) ? $_SERVER[ 'DOCUMENT_ROOT' ] : '';\n    foreach ($params as $_key => $_val) {\n        switch ($_key) {\n            case 'file':\n            case 'height':\n            case 'width':\n            case 'dpi':\n            case 'path_prefix':\n            case 'basedir':\n                $$_key = $_val;\n                break;\n\n            case 'alt':\n                if (!is_array($_val)) {\n                    $$_key = smarty_function_escape_special_chars($_val);\n                } else {\n                    throw new SmartyException (\"html_image: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n\n            case 'link':\n            case 'href':\n                $prefix = '<a href=\"' . $_val . '\">';\n                $suffix = '</a>';\n                break;\n\n            default:\n                if (!is_array($_val)) {\n                    $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_val) . '\"';\n                } else {\n                    throw new SmartyException (\"html_image: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    if (empty($file)) {\n        trigger_error('html_image: missing \\'file\\' parameter', E_USER_NOTICE);\n\n        return;\n    }\n\n    if ($file[ 0 ] === '/') {\n        $_image_path = $basedir . $file;\n    } else {\n        $_image_path = $file;\n    }\n\n    // strip file protocol\n    if (stripos($params[ 'file' ], 'file://') === 0) {\n        $params[ 'file' ] = substr($params[ 'file' ], 7);\n    }\n\n    $protocol = strpos($params[ 'file' ], '://');\n    if ($protocol !== false) {\n        $protocol = strtolower(substr($params[ 'file' ], 0, $protocol));\n    }\n\n    if (isset($template->smarty->security_policy)) {\n        if ($protocol) {\n            // remote resource (or php stream, …)\n            if (!$template->smarty->security_policy->isTrustedUri($params[ 'file' ])) {\n                return;\n            }\n        } else {\n            // local file\n            if (!$template->smarty->security_policy->isTrustedResourceDir($_image_path)) {\n                return;\n            }\n        }\n    }\n\n    if (!isset($params[ 'width' ]) || !isset($params[ 'height' ])) {\n        // FIXME: (rodneyrehm) getimagesize() loads the complete file off a remote resource, use custom [jpg,png,gif]header reader!\n        if (!$_image_data = @getimagesize($_image_path)) {\n            if (!file_exists($_image_path)) {\n                trigger_error(\"html_image: unable to find '{$_image_path}'\", E_USER_NOTICE);\n\n                return;\n            } elseif (!is_readable($_image_path)) {\n                trigger_error(\"html_image: unable to read '{$_image_path}'\", E_USER_NOTICE);\n\n                return;\n            } else {\n                trigger_error(\"html_image: '{$_image_path}' is not a valid image file\", E_USER_NOTICE);\n\n                return;\n            }\n        }\n\n        if (!isset($params[ 'width' ])) {\n            $width = $_image_data[ 0 ];\n        }\n        if (!isset($params[ 'height' ])) {\n            $height = $_image_data[ 1 ];\n        }\n    }\n\n    if (isset($params[ 'dpi' ])) {\n        if (strstr($_SERVER[ 'HTTP_USER_AGENT' ], 'Mac')) {\n            // FIXME: (rodneyrehm) wrong dpi assumption\n            // don't know who thought this up… even if it was true in 1998, it's definitely wrong in 2011.\n            $dpi_default = 72;\n        } else {\n            $dpi_default = 96;\n        }\n        $_resize = $dpi_default / $params[ 'dpi' ];\n        $width = round($width * $_resize);\n        $height = round($height * $_resize);\n    }\n\n    return $prefix . '<img src=\"' . $path_prefix . $file . '\" alt=\"' . $alt . '\" width=\"' . $width . '\" height=\"' .\n           $height . '\"' . $extra . ' />' . $suffix;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.html_options.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n/**\n * Smarty {html_options} function plugin\n * Type:     function\n * Name:     html_options\n * Purpose:  Prints the list of <option> tags generated from\n *           the passed parameters\n * Params:\n *\n * - name       (optional) - string default \"select\"\n * - values     (required) - if no options supplied) - array\n * - options    (required) - if no values supplied) - associative array\n * - selected   (optional) - string default not set\n * - output     (required) - if not options supplied) - array\n * - id         (optional) - string default not set\n * - class      (optional) - string default not set\n *\n *\n * @link     http://www.smarty.net/manual/en/language.function.html.options.php {html_image}\n *           (Smarty online manual)\n * @author   Monte Ohrt <monte at ohrt dot com>\n * @author   Ralf Strehle (minor optimization) <ralf dot strehle at yahoo dot de>\n *\n * @param array                     $params parameters\n *\n * @param \\Smarty_Internal_Template $template\n *\n * @return string\n * @uses     smarty_function_escape_special_chars()\n * @throws \\SmartyException\n */\nfunction smarty_function_html_options($params, Smarty_Internal_Template $template)\n{\n    $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars',\n                                         'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php')));\n\n    $name = null;\n    $values = null;\n    $options = null;\n    $selected = null;\n    $output = null;\n    $id = null;\n    $class = null;\n\n    $extra = '';\n\n    foreach ($params as $_key => $_val) {\n        switch ($_key) {\n            case 'name':\n            case 'class':\n            case 'id':\n                $$_key = (string) $_val;\n                break;\n\n            case 'options':\n                $options = (array) $_val;\n                break;\n\n            case 'values':\n            case 'output':\n                $$_key = array_values((array) $_val);\n                break;\n\n            case 'selected':\n                if (is_array($_val)) {\n                    $selected = array();\n                    foreach ($_val as $_sel) {\n                        if (is_object($_sel)) {\n                            if (method_exists($_sel, '__toString')) {\n                                $_sel = smarty_function_escape_special_chars((string) $_sel->__toString());\n                            } else {\n                                trigger_error('html_options: selected attribute contains an object of class \\'' .\n                                              get_class($_sel) . '\\' without __toString() method', E_USER_NOTICE);\n                                continue;\n                            }\n                        } else {\n                            $_sel = smarty_function_escape_special_chars((string) $_sel);\n                        }\n                        $selected[ $_sel ] = true;\n                    }\n                } elseif (is_object($_val)) {\n                    if (method_exists($_val, '__toString')) {\n                        $selected = smarty_function_escape_special_chars((string) $_val->__toString());\n                    } else {\n                        trigger_error('html_options: selected attribute is an object of class \\'' . get_class($_val) .\n                                      '\\' without __toString() method', E_USER_NOTICE);\n                    }\n                } else {\n                    $selected = smarty_function_escape_special_chars((string) $_val);\n                }\n                break;\n\n            case 'strict':\n                break;\n\n            case 'disabled':\n            case 'readonly':\n                if (!empty($params[ 'strict' ])) {\n                    if (!is_scalar($_val)) {\n                        trigger_error(\"html_options: {$_key} attribute must be a scalar, only boolean true or string '{$_key}' will actually add the attribute\",\n                                      E_USER_NOTICE);\n                    }\n\n                    if ($_val === true || $_val === $_key) {\n                        $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_key) . '\"';\n                    }\n\n                    break;\n                }\n            // omit break; to fall through!\n\n            default:\n                if (!is_array($_val)) {\n                    $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_val) . '\"';\n                } else {\n                    trigger_error(\"html_options: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    if (!isset($options) && !isset($values)) {\n        /* raise error here? */\n\n        return '';\n    }\n\n    $_html_result = '';\n    $_idx = 0;\n\n    if (isset($options)) {\n        foreach ($options as $_key => $_val) {\n            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx);\n        }\n    } else {\n        foreach ($values as $_i => $_key) {\n            $_val = isset($output[ $_i ]) ? $output[ $_i ] : '';\n            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx);\n        }\n    }\n\n    if (!empty($name)) {\n        $_html_class = !empty($class) ? ' class=\"' . $class . '\"' : '';\n        $_html_id = !empty($id) ? ' id=\"' . $id . '\"' : '';\n        $_html_result =\n            '<select name=\"' . $name . '\"' . $_html_class . $_html_id . $extra . '>' . \"\\n\" . $_html_result .\n            '</select>' . \"\\n\";\n    }\n\n    return $_html_result;\n}\n/**\n * @param $key\n * @param $value\n * @param $selected\n * @param $id\n * @param $class\n * @param $idx\n *\n * @return string\n */\nfunction smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)\n{\n    if (!is_array($value)) {\n        $_key = smarty_function_escape_special_chars($key);\n        $_html_result = '<option value=\"' . $_key . '\"';\n        if (is_array($selected)) {\n            if (isset($selected[ $_key ])) {\n                $_html_result .= ' selected=\"selected\"';\n            }\n        } elseif ($_key === $selected) {\n            $_html_result .= ' selected=\"selected\"';\n        }\n        $_html_class = !empty($class) ? ' class=\"' . $class . ' option\"' : '';\n        $_html_id = !empty($id) ? ' id=\"' . $id . '-' . $idx . '\"' : '';\n        if (is_object($value)) {\n            if (method_exists($value, '__toString')) {\n                $value = smarty_function_escape_special_chars((string) $value->__toString());\n            } else {\n                trigger_error('html_options: value is an object of class \\'' . get_class($value) .\n                              '\\' without __toString() method', E_USER_NOTICE);\n\n                return '';\n            }\n        } else {\n            $value = smarty_function_escape_special_chars((string) $value);\n        }\n        $_html_result .= $_html_class . $_html_id . '>' . $value . '</option>' . \"\\n\";\n        $idx ++;\n    } else {\n        $_idx = 0;\n        $_html_result =\n            smarty_function_html_options_optgroup($key, $value, $selected, !empty($id) ? ($id . '-' . $idx) : null,\n                                                  $class, $_idx);\n        $idx ++;\n    }\n\n    return $_html_result;\n}\n/**\n * @param $key\n * @param $values\n * @param $selected\n * @param $id\n * @param $class\n * @param $idx\n *\n * @return string\n */\nfunction smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx)\n{\n    $optgroup_html = '<optgroup label=\"' . smarty_function_escape_special_chars($key) . '\">' . \"\\n\";\n    foreach ($values as $key => $value) {\n        $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, $idx);\n    }\n    $optgroup_html .= \"</optgroup>\\n\";\n\n    return $optgroup_html;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.html_radios.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n/**\n * Smarty {html_radios} function plugin\n * File:       function.html_radios.php\n * Type:       function\n * Name:       html_radios\n * Date:       24.Feb.2003\n * Purpose:    Prints out a list of radio input types\n * Params:\n *\n * - name       (optional) - string default \"radio\"\n * - values     (required) - array\n * - options    (required) - associative array\n * - checked    (optional) - array default not set\n * - separator  (optional) - ie <br> or &nbsp;\n * - output     (optional) - the output next to each radio button\n * - assign     (optional) - assign the output as an array to this variable\n * - escape     (optional) - escape the content (not value), defaults to true\n *\n * Examples:\n *\n * {html_radios values=$ids output=$names}\n * {html_radios values=$ids name='box' separator='<br>' output=$names}\n * {html_radios values=$ids checked=$checked separator='<br>' output=$names}\n *\n *\n * @link    http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios}\n *          (Smarty online manual)\n * @author  Christopher Kvarme <christopher.kvarme@flashjab.com>\n * @author  credits to Monte Ohrt <monte at ohrt dot com>\n * @version 1.0\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @return string\n * @uses    smarty_function_escape_special_chars()\n * @throws \\SmartyException\n */\nfunction smarty_function_html_radios($params, Smarty_Internal_Template $template)\n{\n    $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars',\n                                         'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php')));\n\n    $name = 'radio';\n    $values = null;\n    $options = null;\n    $selected = null;\n    $separator = '';\n    $escape = true;\n    $labels = true;\n    $label_ids = false;\n    $output = null;\n    $extra = '';\n\n    foreach ($params as $_key => $_val) {\n        switch ($_key) {\n            case 'name':\n            case 'separator':\n                $$_key = (string) $_val;\n                break;\n\n            case 'checked':\n            case 'selected':\n                if (is_array($_val)) {\n                    trigger_error('html_radios: the \"' . $_key . '\" attribute cannot be an array', E_USER_WARNING);\n                } elseif (is_object($_val)) {\n                    if (method_exists($_val, '__toString')) {\n                        $selected = smarty_function_escape_special_chars((string) $_val->__toString());\n                    } else {\n                        trigger_error('html_radios: selected attribute is an object of class \\'' . get_class($_val) .\n                                      '\\' without __toString() method', E_USER_NOTICE);\n                    }\n                } else {\n                    $selected = (string) $_val;\n                }\n                break;\n\n            case 'escape':\n            case 'labels':\n            case 'label_ids':\n                $$_key = (bool) $_val;\n                break;\n\n            case 'options':\n                $$_key = (array) $_val;\n                break;\n\n            case 'values':\n            case 'output':\n                $$_key = array_values((array) $_val);\n                break;\n\n            case 'radios':\n                trigger_error('html_radios: the use of the \"radios\" attribute is deprecated, use \"options\" instead',\n                              E_USER_WARNING);\n                $options = (array) $_val;\n                break;\n\n            case 'assign':\n                break;\n\n            case 'strict':\n                break;\n\n            case 'disabled':\n            case 'readonly':\n                if (!empty($params[ 'strict' ])) {\n                    if (!is_scalar($_val)) {\n                        trigger_error(\"html_options: {$_key} attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute\",\n                                      E_USER_NOTICE);\n                    }\n\n                    if ($_val === true || $_val === $_key) {\n                        $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_key) . '\"';\n                    }\n\n                    break;\n                }\n            // omit break; to fall through!\n\n            default:\n                if (!is_array($_val)) {\n                    $extra .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_val) . '\"';\n                } else {\n                    trigger_error(\"html_radios: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    if (!isset($options) && !isset($values)) {\n        /* raise error here? */\n\n        return '';\n    }\n\n    $_html_result = array();\n\n    if (isset($options)) {\n        foreach ($options as $_key => $_val) {\n            $_html_result[] =\n                smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels,\n                                                   $label_ids, $escape);\n        }\n    } else {\n        foreach ($values as $_i => $_key) {\n            $_val = isset($output[ $_i ]) ? $output[ $_i ] : '';\n            $_html_result[] =\n                smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels,\n                                                   $label_ids, $escape);\n        }\n    }\n\n    if (!empty($params[ 'assign' ])) {\n        $template->assign($params[ 'assign' ], $_html_result);\n    } else {\n        return implode(\"\\n\", $_html_result);\n    }\n}\n/**\n * @param $name\n * @param $value\n * @param $output\n * @param $selected\n * @param $extra\n * @param $separator\n * @param $labels\n * @param $label_ids\n * @param $escape\n *\n * @return string\n */\nfunction smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids,\n                                               $escape)\n{\n    $_output = '';\n\n    if (is_object($value)) {\n        if (method_exists($value, '__toString')) {\n            $value = (string) $value->__toString();\n        } else {\n            trigger_error('html_options: value is an object of class \\'' . get_class($value) .\n                          '\\' without __toString() method', E_USER_NOTICE);\n\n            return '';\n        }\n    } else {\n        $value = (string) $value;\n    }\n\n    if (is_object($output)) {\n        if (method_exists($output, '__toString')) {\n            $output = (string) $output->__toString();\n        } else {\n            trigger_error('html_options: output is an object of class \\'' . get_class($output) .\n                         '\\' without __toString() method', E_USER_NOTICE);\n\n            return '';\n        }\n    } else {\n        $output = (string) $output;\n    }\n\n    if ($labels) {\n        if ($label_ids) {\n            $_id = smarty_function_escape_special_chars(preg_replace('![^\\w\\-\\.]!' . Smarty::$_UTF8_MODIFIER, '_',\n                                                                     $name . '_' . $value));\n            $_output .= '<label for=\"' . $_id . '\">';\n        } else {\n            $_output .= '<label>';\n        }\n    }\n\n    $name = smarty_function_escape_special_chars($name);\n    $value = smarty_function_escape_special_chars($value);\n    if ($escape) {\n        $output = smarty_function_escape_special_chars($output);\n    }\n\n    $_output .= '<input type=\"radio\" name=\"' . $name . '\" value=\"' . $value . '\"';\n\n    if ($labels && $label_ids) {\n        $_output .= ' id=\"' . $_id . '\"';\n    }\n\n    if ($value === $selected) {\n        $_output .= ' checked=\"checked\"';\n    }\n\n    $_output .= $extra . ' />' . $output;\n    if ($labels) {\n        $_output .= '</label>';\n    }\n\n    $_output .= $separator;\n\n    return $_output;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.html_select_date.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n/**\n * Smarty {html_select_date} plugin\n * Type:     function\n * Name:     html_select_date\n * Purpose:  Prints the dropdowns for date selection.\n * ChangeLog:\n *\n *            - 1.0 initial release\n *            - 1.1 added support for +/- N syntax for begin\n *              and end year values. (Monte)\n *            - 1.2 added support for yyyy-mm-dd syntax for\n *              time value. (Jan Rosier)\n *            - 1.3 added support for choosing format for\n *              month values (Gary Loescher)\n *            - 1.3.1 added support for choosing format for\n *              day values (Marcus Bointon)\n *            - 1.3.2 support negative timestamps, force year\n *              dropdown to include given date unless explicitly set (Monte)\n *            - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that\n *              of 0000-00-00 dates (cybot, boots)\n *            - 2.0 complete rewrite for performance,\n *              added attributes month_names, *_id\n *\n *\n * @link     http://www.smarty.net/manual/en/language.function.html.select.date.php {html_select_date}\n *           (Smarty online manual)\n * @version  2.0\n * @author   Andrei Zmievski\n * @author   Monte Ohrt <monte at ohrt dot com>\n * @author   Rodney Rehm\n *\n * @param array                     $params parameters\n *\n * @param \\Smarty_Internal_Template $template\n *\n * @return string\n * @throws \\SmartyException\n */\nfunction smarty_function_html_select_date($params, Smarty_Internal_Template $template)\n{\n    $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars',\n                                         'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php')));\n    // generate timestamps used for month names only\n    static $_month_timestamps = null;\n    static $_current_year = null;\n    if ($_month_timestamps === null) {\n        $_current_year = date('Y');\n        $_month_timestamps = array();\n        for ($i = 1; $i <= 12; $i ++) {\n            $_month_timestamps[ $i ] = mktime(0, 0, 0, $i, 1, 2000);\n        }\n    }\n\n    /* Default values. */\n    $prefix = 'Date_';\n    $start_year = null;\n    $end_year = null;\n    $display_days = true;\n    $display_months = true;\n    $display_years = true;\n    $month_format = '%B';\n    /* Write months as numbers by default  GL */\n    $month_value_format = '%m';\n    $day_format = '%02d';\n    /* Write day values using this format MB */\n    $day_value_format = '%d';\n    $year_as_text = false;\n    /* Display years in reverse order? Ie. 2000,1999,.... */\n    $reverse_years = false;\n    /* Should the select boxes be part of an array when returned from PHP?\n       e.g. setting it to \"birthday\", would create \"birthday[Day]\",\n       \"birthday[Month]\" & \"birthday[Year]\". Can be combined with prefix */\n    $field_array = null;\n    /* <select size>'s of the different <select> tags.\n       If not set, uses default dropdown. */\n    $day_size = null;\n    $month_size = null;\n    $year_size = null;\n    /* Unparsed attributes common to *ALL* the <select>/<input> tags.\n       An example might be in the template: all_extra ='class =\"foo\"'. */\n    $all_extra = null;\n    /* Separate attributes for the tags. */\n    $day_extra = null;\n    $month_extra = null;\n    $year_extra = null;\n    /* Order in which to display the fields.\n       \"D\" -> day, \"M\" -> month, \"Y\" -> year. */\n    $field_order = 'MDY';\n    /* String printed between the different fields. */\n    $field_separator = \"\\n\";\n    $option_separator = \"\\n\";\n    $time = null;\n    // $all_empty = null;\n    // $day_empty = null;\n    // $month_empty = null;\n    // $year_empty = null;\n    $extra_attrs = '';\n    $all_id = null;\n    $day_id = null;\n    $month_id = null;\n    $year_id = null;\n\n    foreach ($params as $_key => $_value) {\n        switch ($_key) {\n            case 'time':\n                if (!is_array($_value) && $_value !== null) {\n                    $template->_checkPlugins(array(array('function' => 'smarty_make_timestamp',\n                                                         'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php')));\n                    $time = smarty_make_timestamp($_value);\n                }\n                break;\n\n            case 'month_names':\n                if (is_array($_value) && count($_value) === 12) {\n                    $$_key = $_value;\n                } else {\n                    trigger_error('html_select_date: month_names must be an array of 12 strings', E_USER_NOTICE);\n                }\n                break;\n\n            case 'prefix':\n            case 'field_array':\n            case 'start_year':\n            case 'end_year':\n            case 'day_format':\n            case 'day_value_format':\n            case 'month_format':\n            case 'month_value_format':\n            case 'day_size':\n            case 'month_size':\n            case 'year_size':\n            case 'all_extra':\n            case 'day_extra':\n            case 'month_extra':\n            case 'year_extra':\n            case 'field_order':\n            case 'field_separator':\n            case 'option_separator':\n            case 'all_empty':\n            case 'month_empty':\n            case 'day_empty':\n            case 'year_empty':\n            case 'all_id':\n            case 'month_id':\n            case 'day_id':\n            case 'year_id':\n                $$_key = (string) $_value;\n                break;\n\n            case 'display_days':\n            case 'display_months':\n            case 'display_years':\n            case 'year_as_text':\n            case 'reverse_years':\n                $$_key = (bool) $_value;\n                break;\n\n            default:\n                if (!is_array($_value)) {\n                    $extra_attrs .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_value) . '\"';\n                } else {\n                    trigger_error(\"html_select_date: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    // Note: date() is faster than strftime()\n    // Note: explode(date()) is faster than date() date() date()\n    if (isset($params[ 'time' ]) && is_array($params[ 'time' ])) {\n        if (isset($params[ 'time' ][ $prefix . 'Year' ])) {\n            // $_REQUEST[$field_array] given\n            foreach (array('Y' => 'Year',\n                           'm' => 'Month',\n                           'd' => 'Day') as $_elementKey => $_elementName) {\n                $_variableName = '_' . strtolower($_elementName);\n                $$_variableName =\n                    isset($params[ 'time' ][ $prefix . $_elementName ]) ? $params[ 'time' ][ $prefix . $_elementName ] :\n                        date($_elementKey);\n            }\n        } elseif (isset($params[ 'time' ][ $field_array ][ $prefix . 'Year' ])) {\n            // $_REQUEST given\n            foreach (array('Y' => 'Year',\n                           'm' => 'Month',\n                           'd' => 'Day') as $_elementKey => $_elementName) {\n                $_variableName = '_' . strtolower($_elementName);\n                $$_variableName = isset($params[ 'time' ][ $field_array ][ $prefix . $_elementName ]) ?\n                    $params[ 'time' ][ $field_array ][ $prefix . $_elementName ] : date($_elementKey);\n            }\n        } else {\n            // no date found, use NOW\n            list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));\n        }\n    } elseif ($time === null) {\n        if (array_key_exists('time', $params)) {\n            $_year = $_month = $_day = $time = null;\n        } else {\n            list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));\n        }\n    } else {\n        list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d', $time));\n    }\n\n    // make syntax \"+N\" or \"-N\" work with $start_year and $end_year\n    // Note preg_match('!^(\\+|\\-)\\s*(\\d+)$!', $end_year, $match) is slower than trim+substr\n    foreach (array('start',\n                   'end') as $key) {\n        $key .= '_year';\n        $t = $$key;\n        if ($t === null) {\n            $$key = (int) $_current_year;\n        } elseif ($t[ 0 ] === '+') {\n            $$key = (int) ($_current_year + (int) trim(substr($t, 1)));\n        } elseif ($t[ 0 ] === '-') {\n            $$key = (int) ($_current_year - (int) trim(substr($t, 1)));\n        } else {\n            $$key = (int) $$key;\n        }\n    }\n\n    // flip for ascending or descending\n    if (($start_year > $end_year && !$reverse_years) || ($start_year < $end_year && $reverse_years)) {\n        $t = $end_year;\n        $end_year = $start_year;\n        $start_year = $t;\n    }\n\n    // generate year <select> or <input>\n    if ($display_years) {\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Year]') : ($prefix . 'Year');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($year_extra) {\n            $_extra .= ' ' . $year_extra;\n        }\n\n        if ($year_as_text) {\n            $_html_years =\n                '<input type=\"text\" name=\"' . $_name . '\" value=\"' . $_year . '\" size=\"4\" maxlength=\"4\"' . $_extra .\n                $extra_attrs . ' />';\n        } else {\n            $_html_years = '<select name=\"' . $_name . '\"';\n            if ($year_id !== null || $all_id !== null) {\n                $_html_years .= ' id=\"' . smarty_function_escape_special_chars($year_id !== null ?\n                                                                                   ($year_id ? $year_id : $_name) :\n                                                                                   ($all_id ? ($all_id . $_name) :\n                                                                                       $_name)) . '\"';\n            }\n            if ($year_size) {\n                $_html_years .= ' size=\"' . $year_size . '\"';\n            }\n            $_html_years .= $_extra . $extra_attrs . '>' . $option_separator;\n\n            if (isset($year_empty) || isset($all_empty)) {\n                $_html_years .= '<option value=\"\">' . (isset($year_empty) ? $year_empty : $all_empty) . '</option>' .\n                                $option_separator;\n            }\n\n            $op = $start_year > $end_year ? - 1 : 1;\n            for ($i = $start_year; $op > 0 ? $i <= $end_year : $i >= $end_year; $i += $op) {\n                $_html_years .= '<option value=\"' . $i . '\"' . ($_year == $i ? ' selected=\"selected\"' : '') . '>' . $i .\n                                '</option>' . $option_separator;\n            }\n\n            $_html_years .= '</select>';\n        }\n    }\n\n    // generate month <select> or <input>\n    if ($display_months) {\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Month]') : ($prefix . 'Month');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($month_extra) {\n            $_extra .= ' ' . $month_extra;\n        }\n\n        $_html_months = '<select name=\"' . $_name . '\"';\n        if ($month_id !== null || $all_id !== null) {\n            $_html_months .= ' id=\"' . smarty_function_escape_special_chars($month_id !== null ?\n                                                                                ($month_id ? $month_id : $_name) :\n                                                                                ($all_id ? ($all_id . $_name) :\n                                                                                    $_name)) . '\"';\n        }\n        if ($month_size) {\n            $_html_months .= ' size=\"' . $month_size . '\"';\n        }\n        $_html_months .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($month_empty) || isset($all_empty)) {\n            $_html_months .= '<option value=\"\">' . (isset($month_empty) ? $month_empty : $all_empty) . '</option>' .\n                             $option_separator;\n        }\n\n        for ($i = 1; $i <= 12; $i ++) {\n            $_val = sprintf('%02d', $i);\n            $_text = isset($month_names) ? smarty_function_escape_special_chars($month_names[ $i ]) :\n                ($month_format === '%m' ? $_val : strftime($month_format, $_month_timestamps[ $i ]));\n            $_value = $month_value_format === '%m' ? $_val : strftime($month_value_format, $_month_timestamps[ $i ]);\n            $_html_months .= '<option value=\"' . $_value . '\"' . ($_val == $_month ? ' selected=\"selected\"' : '') .\n                             '>' . $_text . '</option>' . $option_separator;\n        }\n\n        $_html_months .= '</select>';\n    }\n\n    // generate day <select> or <input>\n    if ($display_days) {\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Day]') : ($prefix . 'Day');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($day_extra) {\n            $_extra .= ' ' . $day_extra;\n        }\n\n        $_html_days = '<select name=\"' . $_name . '\"';\n        if ($day_id !== null || $all_id !== null) {\n            $_html_days .= ' id=\"' .\n                           smarty_function_escape_special_chars($day_id !== null ? ($day_id ? $day_id : $_name) :\n                                                                    ($all_id ? ($all_id . $_name) : $_name)) . '\"';\n        }\n        if ($day_size) {\n            $_html_days .= ' size=\"' . $day_size . '\"';\n        }\n        $_html_days .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($day_empty) || isset($all_empty)) {\n            $_html_days .= '<option value=\"\">' . (isset($day_empty) ? $day_empty : $all_empty) . '</option>' .\n                           $option_separator;\n        }\n\n        for ($i = 1; $i <= 31; $i ++) {\n            $_val = sprintf('%02d', $i);\n            $_text = $day_format === '%02d' ? $_val : sprintf($day_format, $i);\n            $_value = $day_value_format === '%02d' ? $_val : sprintf($day_value_format, $i);\n            $_html_days .= '<option value=\"' . $_value . '\"' . ($_val == $_day ? ' selected=\"selected\"' : '') . '>' .\n                           $_text . '</option>' . $option_separator;\n        }\n\n        $_html_days .= '</select>';\n    }\n\n    // order the fields for output\n    $_html = '';\n    for ($i = 0; $i <= 2; $i ++) {\n        switch ($field_order[ $i ]) {\n            case 'Y':\n            case 'y':\n                if (isset($_html_years)) {\n                    if ($_html) {\n                        $_html .= $field_separator;\n                    }\n                    $_html .= $_html_years;\n                }\n                break;\n\n            case 'm':\n            case 'M':\n                if (isset($_html_months)) {\n                    if ($_html) {\n                        $_html .= $field_separator;\n                    }\n                    $_html .= $_html_months;\n                }\n                break;\n\n            case 'd':\n            case 'D':\n                if (isset($_html_days)) {\n                    if ($_html) {\n                        $_html .= $field_separator;\n                    }\n                    $_html .= $_html_days;\n                }\n                break;\n        }\n    }\n\n    return $_html;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.html_select_time.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n/**\n * Smarty {html_select_time} function plugin\n * Type:     function\n * Name:     html_select_time\n * Purpose:  Prints the dropdowns for time selection\n *\n * @link     http://www.smarty.net/manual/en/language.function.html.select.time.php {html_select_time}\n *           (Smarty online manual)\n * @author   Roberto Berto <roberto@berto.net>\n * @author   Monte Ohrt <monte AT ohrt DOT com>\n *\n * @param array                     $params parameters\n *\n * @param \\Smarty_Internal_Template $template\n *\n * @return string\n * @uses     smarty_make_timestamp()\n * @throws \\SmartyException\n */\nfunction smarty_function_html_select_time($params, Smarty_Internal_Template $template)\n{\n    $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars',\n                                         'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php')));\n    $prefix = 'Time_';\n    $field_array = null;\n    $field_separator = \"\\n\";\n    $option_separator = \"\\n\";\n    $time = null;\n\n    $display_hours = true;\n    $display_minutes = true;\n    $display_seconds = true;\n    $display_meridian = true;\n\n    $hour_format = '%02d';\n    $hour_value_format = '%02d';\n    $minute_format = '%02d';\n    $minute_value_format = '%02d';\n    $second_format = '%02d';\n    $second_value_format = '%02d';\n\n    $hour_size = null;\n    $minute_size = null;\n    $second_size = null;\n    $meridian_size = null;\n\n    $all_empty = null;\n    $hour_empty = null;\n    $minute_empty = null;\n    $second_empty = null;\n    $meridian_empty = null;\n\n    $all_id = null;\n    $hour_id = null;\n    $minute_id = null;\n    $second_id = null;\n    $meridian_id = null;\n\n    $use_24_hours = true;\n    $minute_interval = 1;\n    $second_interval = 1;\n\n    $extra_attrs = '';\n    $all_extra = null;\n    $hour_extra = null;\n    $minute_extra = null;\n    $second_extra = null;\n    $meridian_extra = null;\n\n    foreach ($params as $_key => $_value) {\n        switch ($_key) {\n            case 'time':\n                if (!is_array($_value) && $_value !== null) {\n                    $template->_checkPlugins(array(array('function' => 'smarty_make_timestamp',\n                                                         'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php')));\n                    $time = smarty_make_timestamp($_value);\n                }\n                break;\n\n            case 'prefix':\n            case 'field_array':\n\n            case 'field_separator':\n            case 'option_separator':\n\n            case 'all_extra':\n            case 'hour_extra':\n            case 'minute_extra':\n            case 'second_extra':\n            case 'meridian_extra':\n\n            case 'all_empty':\n            case 'hour_empty':\n            case 'minute_empty':\n            case 'second_empty':\n            case 'meridian_empty':\n\n            case 'all_id':\n            case 'hour_id':\n            case 'minute_id':\n            case 'second_id':\n            case 'meridian_id':\n\n            case 'hour_format':\n            case 'hour_value_format':\n            case 'minute_format':\n            case 'minute_value_format':\n            case 'second_format':\n            case 'second_value_format':\n                $$_key = (string) $_value;\n                break;\n\n            case 'display_hours':\n            case 'display_minutes':\n            case 'display_seconds':\n            case 'display_meridian':\n            case 'use_24_hours':\n                $$_key = (bool) $_value;\n                break;\n\n            case 'minute_interval':\n            case 'second_interval':\n\n            case 'hour_size':\n            case 'minute_size':\n            case 'second_size':\n            case 'meridian_size':\n                $$_key = (int) $_value;\n                break;\n\n            default:\n                if (!is_array($_value)) {\n                    $extra_attrs .= ' ' . $_key . '=\"' . smarty_function_escape_special_chars($_value) . '\"';\n                } else {\n                    trigger_error(\"html_select_date: extra attribute '{$_key}' cannot be an array\", E_USER_NOTICE);\n                }\n                break;\n        }\n    }\n\n    if (isset($params[ 'time' ]) && is_array($params[ 'time' ])) {\n        if (isset($params[ 'time' ][ $prefix . 'Hour' ])) {\n            // $_REQUEST[$field_array] given\n            foreach (array('H' => 'Hour',\n                           'i' => 'Minute',\n                           's' => 'Second') as $_elementKey => $_elementName) {\n                $_variableName = '_' . strtolower($_elementName);\n                $$_variableName =\n                    isset($params[ 'time' ][ $prefix . $_elementName ]) ? $params[ 'time' ][ $prefix . $_elementName ] :\n                        date($_elementKey);\n            }\n            $_meridian =\n                isset($params[ 'time' ][ $prefix . 'Meridian' ]) ? (' ' . $params[ 'time' ][ $prefix . 'Meridian' ]) :\n                    '';\n            $time = strtotime($_hour . ':' . $_minute . ':' . $_second . $_meridian);\n            list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));\n        } elseif (isset($params[ 'time' ][ $field_array ][ $prefix . 'Hour' ])) {\n            // $_REQUEST given\n            foreach (array('H' => 'Hour',\n                           'i' => 'Minute',\n                           's' => 'Second') as $_elementKey => $_elementName) {\n                $_variableName = '_' . strtolower($_elementName);\n                $$_variableName = isset($params[ 'time' ][ $field_array ][ $prefix . $_elementName ]) ?\n                    $params[ 'time' ][ $field_array ][ $prefix . $_elementName ] : date($_elementKey);\n            }\n            $_meridian = isset($params[ 'time' ][ $field_array ][ $prefix . 'Meridian' ]) ?\n                (' ' . $params[ 'time' ][ $field_array ][ $prefix . 'Meridian' ]) : '';\n            $time = strtotime($_hour . ':' . $_minute . ':' . $_second . $_meridian);\n            list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));\n        } else {\n            // no date found, use NOW\n            list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));\n        }\n    } elseif ($time === null) {\n        if (array_key_exists('time', $params)) {\n            $_hour = $_minute = $_second = $time = null;\n        } else {\n            list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s'));\n        }\n    } else {\n        list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));\n    }\n\n    // generate hour <select>\n    if ($display_hours) {\n        $_html_hours = '';\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Hour]') : ($prefix . 'Hour');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($hour_extra) {\n            $_extra .= ' ' . $hour_extra;\n        }\n\n        $_html_hours = '<select name=\"' . $_name . '\"';\n        if ($hour_id !== null || $all_id !== null) {\n            $_html_hours .= ' id=\"' .\n                            smarty_function_escape_special_chars($hour_id !== null ? ($hour_id ? $hour_id : $_name) :\n                                                                     ($all_id ? ($all_id . $_name) : $_name)) . '\"';\n        }\n        if ($hour_size) {\n            $_html_hours .= ' size=\"' . $hour_size . '\"';\n        }\n        $_html_hours .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($hour_empty) || isset($all_empty)) {\n            $_html_hours .= '<option value=\"\">' . (isset($hour_empty) ? $hour_empty : $all_empty) . '</option>' .\n                            $option_separator;\n        }\n\n        $start = $use_24_hours ? 0 : 1;\n        $end = $use_24_hours ? 23 : 12;\n        for ($i = $start; $i <= $end; $i ++) {\n            $_val = sprintf('%02d', $i);\n            $_text = $hour_format === '%02d' ? $_val : sprintf($hour_format, $i);\n            $_value = $hour_value_format === '%02d' ? $_val : sprintf($hour_value_format, $i);\n\n            if (!$use_24_hours) {\n                $_hour12 = $_hour == 0 ? 12 : ($_hour <= 12 ? $_hour : $_hour - 12);\n            }\n\n            $selected = $_hour !== null ? ($use_24_hours ? $_hour == $_val : $_hour12 == $_val) : null;\n            $_html_hours .= '<option value=\"' . $_value . '\"' . ($selected ? ' selected=\"selected\"' : '') . '>' .\n                            $_text . '</option>' . $option_separator;\n        }\n\n        $_html_hours .= '</select>';\n    }\n\n    // generate minute <select>\n    if ($display_minutes) {\n        $_html_minutes = '';\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Minute]') : ($prefix . 'Minute');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($minute_extra) {\n            $_extra .= ' ' . $minute_extra;\n        }\n\n        $_html_minutes = '<select name=\"' . $_name . '\"';\n        if ($minute_id !== null || $all_id !== null) {\n            $_html_minutes .= ' id=\"' . smarty_function_escape_special_chars($minute_id !== null ?\n                                                                                 ($minute_id ? $minute_id : $_name) :\n                                                                                 ($all_id ? ($all_id . $_name) :\n                                                                                     $_name)) . '\"';\n        }\n        if ($minute_size) {\n            $_html_minutes .= ' size=\"' . $minute_size . '\"';\n        }\n        $_html_minutes .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($minute_empty) || isset($all_empty)) {\n            $_html_minutes .= '<option value=\"\">' . (isset($minute_empty) ? $minute_empty : $all_empty) . '</option>' .\n                              $option_separator;\n        }\n\n        $selected = $_minute !== null ? ($_minute - $_minute % $minute_interval) : null;\n        for ($i = 0; $i <= 59; $i += $minute_interval) {\n            $_val = sprintf('%02d', $i);\n            $_text = $minute_format === '%02d' ? $_val : sprintf($minute_format, $i);\n            $_value = $minute_value_format === '%02d' ? $_val : sprintf($minute_value_format, $i);\n            $_html_minutes .= '<option value=\"' . $_value . '\"' . ($selected === $i ? ' selected=\"selected\"' : '') .\n                              '>' . $_text . '</option>' . $option_separator;\n        }\n\n        $_html_minutes .= '</select>';\n    }\n\n    // generate second <select>\n    if ($display_seconds) {\n        $_html_seconds = '';\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Second]') : ($prefix . 'Second');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($second_extra) {\n            $_extra .= ' ' . $second_extra;\n        }\n\n        $_html_seconds = '<select name=\"' . $_name . '\"';\n        if ($second_id !== null || $all_id !== null) {\n            $_html_seconds .= ' id=\"' . smarty_function_escape_special_chars($second_id !== null ?\n                                                                                 ($second_id ? $second_id : $_name) :\n                                                                                 ($all_id ? ($all_id . $_name) :\n                                                                                     $_name)) . '\"';\n        }\n        if ($second_size) {\n            $_html_seconds .= ' size=\"' . $second_size . '\"';\n        }\n        $_html_seconds .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($second_empty) || isset($all_empty)) {\n            $_html_seconds .= '<option value=\"\">' . (isset($second_empty) ? $second_empty : $all_empty) . '</option>' .\n                              $option_separator;\n        }\n\n        $selected = $_second !== null ? ($_second - $_second % $second_interval) : null;\n        for ($i = 0; $i <= 59; $i += $second_interval) {\n            $_val = sprintf('%02d', $i);\n            $_text = $second_format === '%02d' ? $_val : sprintf($second_format, $i);\n            $_value = $second_value_format === '%02d' ? $_val : sprintf($second_value_format, $i);\n            $_html_seconds .= '<option value=\"' . $_value . '\"' . ($selected === $i ? ' selected=\"selected\"' : '') .\n                              '>' . $_text . '</option>' . $option_separator;\n        }\n\n        $_html_seconds .= '</select>';\n    }\n\n    // generate meridian <select>\n    if ($display_meridian && !$use_24_hours) {\n        $_html_meridian = '';\n        $_extra = '';\n        $_name = $field_array ? ($field_array . '[' . $prefix . 'Meridian]') : ($prefix . 'Meridian');\n        if ($all_extra) {\n            $_extra .= ' ' . $all_extra;\n        }\n        if ($meridian_extra) {\n            $_extra .= ' ' . $meridian_extra;\n        }\n\n        $_html_meridian = '<select name=\"' . $_name . '\"';\n        if ($meridian_id !== null || $all_id !== null) {\n            $_html_meridian .= ' id=\"' . smarty_function_escape_special_chars($meridian_id !== null ?\n                                                                                  ($meridian_id ? $meridian_id :\n                                                                                      $_name) :\n                                                                                  ($all_id ? ($all_id . $_name) :\n                                                                                      $_name)) . '\"';\n        }\n        if ($meridian_size) {\n            $_html_meridian .= ' size=\"' . $meridian_size . '\"';\n        }\n        $_html_meridian .= $_extra . $extra_attrs . '>' . $option_separator;\n\n        if (isset($meridian_empty) || isset($all_empty)) {\n            $_html_meridian .= '<option value=\"\">' . (isset($meridian_empty) ? $meridian_empty : $all_empty) .\n                               '</option>' . $option_separator;\n        }\n\n        $_html_meridian .= '<option value=\"am\"' . ($_hour > 0 && $_hour < 12 ? ' selected=\"selected\"' : '') .\n                           '>AM</option>' . $option_separator . '<option value=\"pm\"' .\n                           ($_hour < 12 ? '' : ' selected=\"selected\"') . '>PM</option>' . $option_separator .\n                           '</select>';\n    }\n\n    $_html = '';\n    foreach (array('_html_hours',\n                   '_html_minutes',\n                   '_html_seconds',\n                   '_html_meridian') as $k) {\n        if (isset($$k)) {\n            if ($_html) {\n                $_html .= $field_separator;\n            }\n            $_html .= $$k;\n        }\n    }\n\n    return $_html;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.html_table.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {html_table} function plugin\n * Type:     function\n * Name:     html_table\n * Date:     Feb 17, 2003\n * Purpose:  make an html table from an array of data\n * Params:\n *\n * - loop       - array to loop through\n * - cols       - number of columns, comma separated list of column names\n *                or array of column names\n * - rows       - number of rows\n * - table_attr - table attributes\n * - th_attr    - table heading attributes (arrays are cycled)\n * - tr_attr    - table row attributes (arrays are cycled)\n * - td_attr    - table cell attributes (arrays are cycled)\n * - trailpad   - value to pad trailing cells with\n * - caption    - text for caption element\n * - vdir       - vertical direction (default: \"down\", means top-to-bottom)\n * - hdir       - horizontal direction (default: \"right\", means left-to-right)\n * - inner      - inner loop (default \"cols\": print $loop line by line,\n *                $loop will be printed column by column otherwise)\n *\n * Examples:\n *\n * {table loop=$data}\n * {table loop=$data cols=4 tr_attr='\"bgcolor=red\"'}\n * {table loop=$data cols=\"first,second,third\" tr_attr=$colors}\n *\n *\n * @author   Monte Ohrt <monte at ohrt dot com>\n * @author   credit to Messju Mohr <messju at lammfellpuschen dot de>\n * @author   credit to boots <boots dot smarty at yahoo dot com>\n * @version  1.1\n * @link     http://www.smarty.net/manual/en/language.function.html.table.php {html_table}\n *           (Smarty online manual)\n *\n * @param array $params parameters\n *\n * @return string\n */\nfunction smarty_function_html_table($params)\n{\n    $table_attr = 'border=\"1\"';\n    $tr_attr = '';\n    $th_attr = '';\n    $td_attr = '';\n    $cols = $cols_count = 3;\n    $rows = 3;\n    $trailpad = '&nbsp;';\n    $vdir = 'down';\n    $hdir = 'right';\n    $inner = 'cols';\n    $caption = '';\n    $loop = null;\n\n    if (!isset($params[ 'loop' ])) {\n        trigger_error(\"html_table: missing 'loop' parameter\", E_USER_WARNING);\n\n        return;\n    }\n\n    foreach ($params as $_key => $_value) {\n        switch ($_key) {\n            case 'loop':\n                $$_key = (array) $_value;\n                break;\n\n            case 'cols':\n                if (is_array($_value) && !empty($_value)) {\n                    $cols = $_value;\n                    $cols_count = count($_value);\n                } elseif (!is_numeric($_value) && is_string($_value) && !empty($_value)) {\n                    $cols = explode(',', $_value);\n                    $cols_count = count($cols);\n                } elseif (!empty($_value)) {\n                    $cols_count = (int) $_value;\n                } else {\n                    $cols_count = $cols;\n                }\n                break;\n\n            case 'rows':\n                $$_key = (int) $_value;\n                break;\n\n            case 'table_attr':\n            case 'trailpad':\n            case 'hdir':\n            case 'vdir':\n            case 'inner':\n            case 'caption':\n                $$_key = (string) $_value;\n                break;\n\n            case 'tr_attr':\n            case 'td_attr':\n            case 'th_attr':\n                $$_key = $_value;\n                break;\n        }\n    }\n\n    $loop_count = count($loop);\n    if (empty($params[ 'rows' ])) {\n        /* no rows specified */\n        $rows = ceil($loop_count / $cols_count);\n    } elseif (empty($params[ 'cols' ])) {\n        if (!empty($params[ 'rows' ])) {\n            /* no cols specified, but rows */\n            $cols_count = ceil($loop_count / $rows);\n        }\n    }\n\n    $output = \"<table $table_attr>\\n\";\n\n    if (!empty($caption)) {\n        $output .= '<caption>' . $caption . \"</caption>\\n\";\n    }\n\n    if (is_array($cols)) {\n        $cols = ($hdir === 'right') ? $cols : array_reverse($cols);\n        $output .= \"<thead><tr>\\n\";\n\n        for ($r = 0; $r < $cols_count; $r ++) {\n            $output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>';\n            $output .= $cols[ $r ];\n            $output .= \"</th>\\n\";\n        }\n        $output .= \"</tr></thead>\\n\";\n    }\n\n    $output .= \"<tbody>\\n\";\n    for ($r = 0; $r < $rows; $r ++) {\n        $output .= \"<tr\" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . \">\\n\";\n        $rx = ($vdir === 'down') ? $r * $cols_count : ($rows - 1 - $r) * $cols_count;\n\n        for ($c = 0; $c < $cols_count; $c ++) {\n            $x = ($hdir === 'right') ? $rx + $c : $rx + $cols_count - 1 - $c;\n            if ($inner !== 'cols') {\n                /* shuffle x to loop over rows*/\n                $x = floor($x / $cols_count) + ($x % $cols_count) * $rows;\n            }\n\n            if ($x < $loop_count) {\n                $output .= \"<td\" . smarty_function_html_table_cycle('td', $td_attr, $c) . \">\" . $loop[ $x ] . \"</td>\\n\";\n            } else {\n                $output .= \"<td\" . smarty_function_html_table_cycle('td', $td_attr, $c) . \">$trailpad</td>\\n\";\n            }\n        }\n        $output .= \"</tr>\\n\";\n    }\n    $output .= \"</tbody>\\n\";\n    $output .= \"</table>\\n\";\n\n    return $output;\n}\n/**\n * @param $name\n * @param $var\n * @param $no\n *\n * @return string\n */\nfunction smarty_function_html_table_cycle($name, $var, $no)\n{\n    if (!is_array($var)) {\n        $ret = $var;\n    } else {\n        $ret = $var[ $no % count($var) ];\n    }\n\n    return ($ret) ? ' ' . $ret : '';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.mailto.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {mailto} function plugin\n * Type:     function\n * Name:     mailto\n * Date:     May 21, 2002\n * Purpose:  automate mailto address link creation, and optionally encode them.\n * Params:\n *\n * - address    - (required) - e-mail address\n * - text       - (optional) - text to display, default is address\n * - encode     - (optional) - can be one of:\n *                             * none : no encoding (default)\n *                             * javascript : encode with javascript\n *                             * javascript_charcode : encode with javascript charcode\n *                             * hex : encode with hexadecimal (no javascript)\n * - cc         - (optional) - address(es) to carbon copy\n * - bcc        - (optional) - address(es) to blind carbon copy\n * - subject    - (optional) - e-mail subject\n * - newsgroups - (optional) - newsgroup(s) to post to\n * - followupto - (optional) - address(es) to follow up to\n * - extra      - (optional) - extra tags for the href link\n *\n * Examples:\n *\n * {mailto address=\"me@domain.com\"}\n * {mailto address=\"me@domain.com\" encode=\"javascript\"}\n * {mailto address=\"me@domain.com\" encode=\"hex\"}\n * {mailto address=\"me@domain.com\" subject=\"Hello to you!\"}\n * {mailto address=\"me@domain.com\" cc=\"you@domain.com,they@domain.com\"}\n * {mailto address=\"me@domain.com\" extra='class=\"mailto\"'}\n *\n *\n * @link     http://www.smarty.net/manual/en/language.function.mailto.php {mailto}\n *           (Smarty online manual)\n * @version  1.2\n * @author   Monte Ohrt <monte at ohrt dot com>\n * @author   credits to Jason Sweat (added cc, bcc and subject functionality)\n *\n * @param array $params parameters\n *\n * @return string\n */\nfunction smarty_function_mailto($params)\n{\n    static $_allowed_encoding =\n        array('javascript' => true, 'javascript_charcode' => true, 'hex' => true, 'none' => true);\n    $extra = '';\n\n    if (empty($params[ 'address' ])) {\n        trigger_error(\"mailto: missing 'address' parameter\", E_USER_WARNING);\n\n        return;\n    } else {\n        $address = $params[ 'address' ];\n    }\n\n    $text = $address;\n    // netscape and mozilla do not decode %40 (@) in BCC field (bug?)\n    // so, don't encode it.\n    $search = array('%40', '%2C');\n    $replace = array('@', ',');\n    $mail_parms = array();\n    foreach ($params as $var => $value) {\n        switch ($var) {\n            case 'cc':\n            case 'bcc':\n            case 'followupto':\n                if (!empty($value)) {\n                    $mail_parms[] = $var . '=' . str_replace($search, $replace, rawurlencode($value));\n                }\n                break;\n\n            case 'subject':\n            case 'newsgroups':\n                $mail_parms[] = $var . '=' . rawurlencode($value);\n                break;\n\n            case 'extra':\n            case 'text':\n                $$var = $value;\n\n            default:\n        }\n    }\n\n    if ($mail_parms) {\n        $address .= '?' . join('&', $mail_parms);\n    }\n\n    $encode = (empty($params[ 'encode' ])) ? 'none' : $params[ 'encode' ];\n    if (!isset($_allowed_encoding[ $encode ])) {\n        trigger_error(\"mailto: 'encode' parameter must be none, javascript, javascript_charcode or hex\",\n                      E_USER_WARNING);\n\n        return;\n    }\n    // FIXME: (rodneyrehm) document.write() excues me what? 1998 has passed!\n    if ($encode === 'javascript') {\n        $string = 'document.write(\\'<a href=\"mailto:' . $address . '\" ' . $extra . '>' . $text . '</a>\\');';\n\n        $js_encode = '';\n        for ($x = 0, $_length = strlen($string); $x < $_length; $x ++) {\n            $js_encode .= '%' . bin2hex($string[ $x ]);\n        }\n\n        return '<script type=\"text/javascript\">eval(unescape(\\'' . $js_encode . '\\'))</script>';\n    } elseif ($encode === 'javascript_charcode') {\n        $string = '<a href=\"mailto:' . $address . '\" ' . $extra . '>' . $text . '</a>';\n\n        for ($x = 0, $y = strlen($string); $x < $y; $x ++) {\n            $ord[] = ord($string[ $x ]);\n        }\n\n        $_ret = \"<script type=\\\"text/javascript\\\" language=\\\"javascript\\\">\\n\" . \"{document.write(String.fromCharCode(\" .\n                implode(',', $ord) . \"))\" . \"}\\n\" . \"</script>\\n\";\n\n        return $_ret;\n    } elseif ($encode === 'hex') {\n        preg_match('!^(.*)(\\?.*)$!', $address, $match);\n        if (!empty($match[ 2 ])) {\n            trigger_error(\"mailto: hex encoding does not work with extra attributes. Try javascript.\", E_USER_WARNING);\n\n            return;\n        }\n        $address_encode = '';\n        for ($x = 0, $_length = strlen($address); $x < $_length; $x ++) {\n            if (preg_match('!\\w!' . Smarty::$_UTF8_MODIFIER, $address[ $x ])) {\n                $address_encode .= '%' . bin2hex($address[ $x ]);\n            } else {\n                $address_encode .= $address[ $x ];\n            }\n        }\n        $text_encode = '';\n        for ($x = 0, $_length = strlen($text); $x < $_length; $x ++) {\n            $text_encode .= '&#x' . bin2hex($text[ $x ]) . ';';\n        }\n\n        $mailto = \"&#109;&#97;&#105;&#108;&#116;&#111;&#58;\";\n\n        return '<a href=\"' . $mailto . $address_encode . '\" ' . $extra . '>' . $text_encode . '</a>';\n    } else {\n        // no encoding\n        return '<a href=\"mailto:' . $address . '\" ' . $extra . '>' . $text . '</a>';\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/function.math.php",
    "content": "<?php\n/**\n * Smarty plugin\n * This plugin is only for Smarty2 BC\n *\n * @package    Smarty\n * @subpackage PluginsFunction\n */\n\n/**\n * Smarty {math} function plugin\n * Type:     function\n * Name:     math\n * Purpose:  handle math computations in template\n *\n * @link     http://www.smarty.net/manual/en/language.function.math.php {math}\n *           (Smarty online manual)\n * @author   Monte Ohrt <monte at ohrt dot com>\n *\n * @param array                    $params   parameters\n * @param Smarty_Internal_Template $template template object\n *\n * @return string|null\n */\nfunction smarty_function_math($params, $template)\n{\n    static $_allowed_funcs =\n        array('int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true,\n              'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true, 'rand' => true,\n              'round' => true, 'sin' => true, 'sqrt' => true, 'srand' => true, 'tan' => true);\n    // be sure equation parameter is present\n    if (empty($params[ 'equation' ])) {\n        trigger_error(\"math: missing equation parameter\", E_USER_WARNING);\n\n        return;\n    }\n\n    $equation = $params[ 'equation' ];\n\n    // make sure parenthesis are balanced\n    if (substr_count($equation, '(') !== substr_count($equation, ')')) {\n        trigger_error(\"math: unbalanced parenthesis\", E_USER_WARNING);\n\n        return;\n    }\n\n    // disallow backticks\n    if (strpos($equation, '`') !== false) {\n        trigger_error(\"math: backtick character not allowed in equation\", E_USER_WARNING);\n\n        return;\n    }\n\n    // also disallow dollar signs\n    if (strpos($equation, '$') !== false) {\n        trigger_error(\"math: dollar signs not allowed in equation\", E_USER_WARNING);\n\n        return;\n    }\n\n    foreach ($params as $key => $val) {\n        if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') {\n            // make sure value is not empty\n            if (strlen($val) === 0) {\n                trigger_error(\"math: parameter '{$key}' is empty\", E_USER_WARNING);\n\n                return;\n            }\n            if (!is_numeric($val)) {\n                trigger_error(\"math: parameter '{$key}' is not numeric\", E_USER_WARNING);\n\n                return;\n            }\n        }\n    }\n\n    // match all vars in equation, make sure all are passed\n    preg_match_all('!(?:0x[a-fA-F0-9]+)|([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)!', $equation, $match);\n\n    foreach ($match[ 1 ] as $curr_var) {\n        if ($curr_var && !isset($params[ $curr_var ]) && !isset($_allowed_funcs[ $curr_var ])) {\n            trigger_error(\"math: function call '{$curr_var}' not allowed, or missing parameter '{$curr_var}'\", E_USER_WARNING);\n\n            return;\n        }\n    }\n\n    foreach ($params as $key => $val) {\n        if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') {\n            $equation = preg_replace(\"/\\b$key\\b/\", \" \\$params['$key'] \", $equation);\n        }\n    }\n    $smarty_math_result = null;\n    eval(\"\\$smarty_math_result = \" . $equation . \";\");\n\n    if (empty($params[ 'format' ])) {\n        if (empty($params[ 'assign' ])) {\n            return $smarty_math_result;\n        } else {\n            $template->assign($params[ 'assign' ], $smarty_math_result);\n        }\n    } else {\n        if (empty($params[ 'assign' ])) {\n            printf($params[ 'format' ], $smarty_math_result);\n        } else {\n            $template->assign($params[ 'assign' ], sprintf($params[ 'format' ], $smarty_math_result));\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifier.capitalize.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty capitalize modifier plugin\n * Type:     modifier\n * Name:     capitalize\n * Purpose:  capitalize words in the string\n * {@internal {$string|capitalize:true:true} is the fastest option for MBString enabled systems }}\n *\n * @param string  $string    string to capitalize\n * @param boolean $uc_digits also capitalize \"x123\" to \"X123\"\n * @param boolean $lc_rest   capitalize first letters, lowercase all following letters \"aAa\" to \"Aaa\"\n *\n * @return string capitalized string\n * @author Monte Ohrt <monte at ohrt dot com>\n * @author Rodney Rehm\n */\nfunction smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false)\n{\n    if (Smarty::$_MBSTRING) {\n        if ($lc_rest) {\n            // uppercase (including hyphenated words)\n            $upper_string = mb_convert_case($string, MB_CASE_TITLE, Smarty::$_CHARSET);\n        } else {\n            // uppercase word breaks\n            $upper_string = preg_replace_callback(\"!(^|[^\\p{L}'])([\\p{Ll}])!S\" . Smarty::$_UTF8_MODIFIER,\n                                                  'smarty_mod_cap_mbconvert_cb', $string);\n        }\n        // check uc_digits case\n        if (!$uc_digits) {\n            if (preg_match_all(\"!\\b([\\p{L}]*[\\p{N}]+[\\p{L}]*)\\b!\" . Smarty::$_UTF8_MODIFIER, $string, $matches,\n                               PREG_OFFSET_CAPTURE)) {\n                foreach ($matches[ 1 ] as $match) {\n                    $upper_string =\n                        substr_replace($upper_string, mb_strtolower($match[ 0 ], Smarty::$_CHARSET), $match[ 1 ],\n                                       strlen($match[ 0 ]));\n                }\n            }\n        }\n        $upper_string =\n            preg_replace_callback(\"!((^|\\s)['\\\"])(\\w)!\" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_mbconvert2_cb',\n                                  $upper_string);\n        return $upper_string;\n    }\n\n    // lowercase first\n    if ($lc_rest) {\n        $string = strtolower($string);\n    }\n    // uppercase (including hyphenated words)\n    $upper_string =\n        preg_replace_callback(\"!(^|[^\\p{L}'])([\\p{Ll}])!S\" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst_cb',\n                              $string);\n    // check uc_digits case\n    if (!$uc_digits) {\n        if (preg_match_all(\"!\\b([\\p{L}]*[\\p{N}]+[\\p{L}]*)\\b!\" . Smarty::$_UTF8_MODIFIER, $string, $matches,\n                           PREG_OFFSET_CAPTURE)) {\n            foreach ($matches[ 1 ] as $match) {\n                $upper_string =\n                    substr_replace($upper_string, strtolower($match[ 0 ]), $match[ 1 ], strlen($match[ 0 ]));\n            }\n        }\n    }\n    $upper_string = preg_replace_callback(\"!((^|\\s)['\\\"])(\\w)!\" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst2_cb',\n                                          $upper_string);\n    return $upper_string;\n}\n\n/*\n *\n * Bug: create_function() use exhausts memory when used in long loops\n * Fix: use declared functions for callbacks instead of using create_function()\n * Note: This can be fixed using anonymous functions instead, but that requires PHP >= 5.3\n *\n * @author Kyle Renfrow\n */\n/**\n * @param $matches\n *\n * @return string\n */\nfunction smarty_mod_cap_mbconvert_cb($matches)\n{\n    return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 2 ]), MB_CASE_UPPER, Smarty::$_CHARSET);\n}\n/**\n * @param $matches\n *\n * @return string\n */\nfunction smarty_mod_cap_mbconvert2_cb($matches)\n{\n    return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 3 ]), MB_CASE_UPPER, Smarty::$_CHARSET);\n}\n/**\n * @param $matches\n *\n * @return string\n */\nfunction smarty_mod_cap_ucfirst_cb($matches)\n{\n    return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 2 ]));\n}\n/**\n * @param $matches\n *\n * @return string\n */\nfunction smarty_mod_cap_ucfirst2_cb($matches)\n{\n    return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 3 ]));\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifier.date_format.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty date_format modifier plugin\n * Type:     modifier\n * Name:     date_format\n * Purpose:  format datestamps via strftime\n * Input:\n *          - string: input date string\n *          - format: strftime format for output\n *          - default_date: default date if $string is empty\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param string $string       input date string\n * @param string $format       strftime format for output\n * @param string $default_date default date if $string is empty\n * @param string $formatter    either 'strftime' or 'auto'\n *\n * @return string |void\n * @uses   smarty_make_timestamp()\n */\nfunction smarty_modifier_date_format($string, $format = null, $default_date = '', $formatter = 'auto')\n{\n    if ($format === null) {\n        $format = Smarty::$_DATE_FORMAT;\n    }\n    /**\n     * require_once the {@link shared.make_timestamp.php} plugin\n     */\n    static $is_loaded = false;\n    if (!$is_loaded) {\n        if (!is_callable('smarty_make_timestamp')) {\n            require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');\n        }\n        $is_loaded = true;\n    }\n    if ($string !== '' && $string !== '0000-00-00' && $string !== '0000-00-00 00:00:00') {\n        $timestamp = smarty_make_timestamp($string);\n    } elseif ($default_date !== '') {\n        $timestamp = smarty_make_timestamp($default_date);\n    } else {\n        return;\n    }\n    if ($formatter === 'strftime' || ($formatter === 'auto' && strpos($format, '%') !== false)) {\n        if (Smarty::$_IS_WINDOWS) {\n            $_win_from = array('%D',\n                               '%h',\n                               '%n',\n                               '%r',\n                               '%R',\n                               '%t',\n                               '%T');\n            $_win_to = array('%m/%d/%y',\n                             '%b',\n                             \"\\n\",\n                             '%I:%M:%S %p',\n                             '%H:%M',\n                             \"\\t\",\n                             '%H:%M:%S');\n            if (strpos($format, '%e') !== false) {\n                $_win_from[] = '%e';\n                $_win_to[] = sprintf('%\\' 2d', date('j', $timestamp));\n            }\n            if (strpos($format, '%l') !== false) {\n                $_win_from[] = '%l';\n                $_win_to[] = sprintf('%\\' 2d', date('h', $timestamp));\n            }\n            $format = str_replace($_win_from, $_win_to, $format);\n        }\n\n        return strftime($format, $timestamp);\n    } else {\n        return date($format, $timestamp);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifier.debug_print_var.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage Debug\n */\n\n/**\n * Smarty debug_print_var modifier plugin\n * Type:     modifier\n * Name:     debug_print_var\n * Purpose:  formats variable contents for display in the console\n *\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param array|object $var     variable to be formatted\n * @param int          $max     maximum recursion depth if $var is an array or object\n * @param int          $length  maximum string length if $var is a string\n * @param int          $depth   actual recursion depth\n * @param array        $objects processed objects in actual depth to prevent recursive object processing\n *\n * @return string\n */\nfunction smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = 0, $objects = array())\n{\n    $_replace = array(\"\\n\" => '\\n', \"\\r\" => '\\r', \"\\t\" => '\\t');\n    switch (gettype($var)) {\n        case 'array' :\n            $results = '<b>Array (' . count($var) . ')</b>';\n            if ($depth === $max) {\n                break;\n            }\n            foreach ($var as $curr_key => $curr_val) {\n                $results .= '<br>' . str_repeat('&nbsp;', $depth * 2) . '<b>' . strtr($curr_key, $_replace) .\n                            '</b> =&gt; ' .\n                            smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects);\n                $depth --;\n            }\n            break;\n\n        case 'object' :\n            $object_vars = get_object_vars($var);\n            $results = '<b>' . get_class($var) . ' Object (' . count($object_vars) . ')</b>';\n            if (in_array($var, $objects)) {\n                $results .= ' called recursive';\n                break;\n            }\n            if ($depth === $max) {\n                break;\n            }\n            $objects[] = $var;\n            foreach ($object_vars as $curr_key => $curr_val) {\n                $results .= '<br>' . str_repeat('&nbsp;', $depth * 2) . '<b> -&gt;' . strtr($curr_key, $_replace) .\n                            '</b> = ' . smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects);\n                $depth --;\n            }\n            break;\n\n        case 'boolean' :\n        case 'NULL' :\n        case 'resource' :\n            if (true === $var) {\n                $results = 'true';\n            } elseif (false === $var) {\n                $results = 'false';\n            } elseif (null === $var) {\n                $results = 'null';\n            } else {\n                $results = htmlspecialchars((string) $var);\n            }\n            $results = '<i>' . $results . '</i>';\n            break;\n\n        case 'integer' :\n        case 'float' :\n            $results = htmlspecialchars((string) $var);\n            break;\n\n        case 'string' :\n            $results = strtr($var, $_replace);\n            if (Smarty::$_MBSTRING) {\n                if (mb_strlen($var, Smarty::$_CHARSET) > $length) {\n                    $results = mb_substr($var, 0, $length - 3, Smarty::$_CHARSET) . '...';\n                }\n            } else {\n                if (isset($var[ $length ])) {\n                    $results = substr($var, 0, $length - 3) . '...';\n                }\n            }\n\n            $results = htmlspecialchars('\"' . $results . '\"', ENT_QUOTES, Smarty::$_CHARSET);\n            break;\n\n        case 'unknown type' :\n        default :\n            $results = strtr((string) $var, $_replace);\n            if (Smarty::$_MBSTRING) {\n                if (mb_strlen($results, Smarty::$_CHARSET) > $length) {\n                    $results = mb_substr($results, 0, $length - 3, Smarty::$_CHARSET) . '...';\n                }\n            } else {\n                if (strlen($results) > $length) {\n                    $results = substr($results, 0, $length - 3) . '...';\n                }\n            }\n\n            $results = htmlspecialchars($results, ENT_QUOTES, Smarty::$_CHARSET);\n    }\n\n    return $results;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifier.escape.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty escape modifier plugin\n * Type:     modifier\n * Name:     escape\n * Purpose:  escape string for output\n *\n * @link   http://www.smarty.net/docs/en/language.modifier.escape\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param string  $string        input string\n * @param string  $esc_type      escape type\n * @param string  $char_set      character set, used for htmlspecialchars() or htmlentities()\n * @param boolean $double_encode encode already encoded entitites again, used for htmlspecialchars() or htmlentities()\n *\n * @return string escaped input string\n */\nfunction smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true)\n{\n    static $_double_encode = null;\n    static $is_loaded_1 = false;\n    static $is_loaded_2 = false;\n    if ($_double_encode === null) {\n        $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');\n    }\n\n    if (!$char_set) {\n        $char_set = Smarty::$_CHARSET;\n    }\n\n    switch ($esc_type) {\n        case 'html':\n            if ($_double_encode) {\n                // php >=5.3.2 - go native\n                return htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);\n            } else {\n                if ($double_encode) {\n                    // php <5.2.3 - only handle double encoding\n                    return htmlspecialchars($string, ENT_QUOTES, $char_set);\n                } else {\n                    // php <5.2.3 - prevent double encoding\n                    $string = preg_replace('!&(#?\\w+);!', '%%%SMARTY_START%%%\\\\1%%%SMARTY_END%%%', $string);\n                    $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n                    $string = str_replace(array('%%%SMARTY_START%%%',\n                                                '%%%SMARTY_END%%%'), array('&',\n                                                                           ';'), $string);\n\n                    return $string;\n                }\n            }\n\n        case 'htmlall':\n            if (Smarty::$_MBSTRING) {\n                // mb_convert_encoding ignores htmlspecialchars()\n                if ($_double_encode) {\n                    // php >=5.3.2 - go native\n                    $string = htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);\n                } else {\n                    if ($double_encode) {\n                        // php <5.2.3 - only handle double encoding\n                        $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n                    } else {\n                        // php <5.2.3 - prevent double encoding\n                        $string = preg_replace('!&(#?\\w+);!', '%%%SMARTY_START%%%\\\\1%%%SMARTY_END%%%', $string);\n                        $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n                        $string =\n                            str_replace(array('%%%SMARTY_START%%%',\n                                              '%%%SMARTY_END%%%'), array('&',\n                                                                         ';'), $string);\n\n                        return $string;\n                    }\n                }\n\n                // htmlentities() won't convert everything, so use mb_convert_encoding\n                return mb_convert_encoding($string, 'HTML-ENTITIES', $char_set);\n            }\n\n            // no MBString fallback\n            if ($_double_encode) {\n                return htmlentities($string, ENT_QUOTES, $char_set, $double_encode);\n            } else {\n                if ($double_encode) {\n                    return htmlentities($string, ENT_QUOTES, $char_set);\n                } else {\n                    $string = preg_replace('!&(#?\\w+);!', '%%%SMARTY_START%%%\\\\1%%%SMARTY_END%%%', $string);\n                    $string = htmlentities($string, ENT_QUOTES, $char_set);\n                    $string = str_replace(array('%%%SMARTY_START%%%',\n                                                '%%%SMARTY_END%%%'), array('&',\n                                                                           ';'), $string);\n\n                    return $string;\n                }\n            }\n\n        case 'url':\n            return rawurlencode($string);\n\n        case 'urlpathinfo':\n            return str_replace('%2F', '/', rawurlencode($string));\n\n        case 'quotes':\n            // escape unescaped single quotes\n            return preg_replace(\"%(?<!\\\\\\\\)'%\", \"\\\\'\", $string);\n\n        case 'hex':\n            // escape every byte into hex\n            // Note that the UTF-8 encoded character ä will be represented as %c3%a4\n            $return = '';\n            $_length = strlen($string);\n            for ($x = 0; $x < $_length; $x ++) {\n                $return .= '%' . bin2hex($string[ $x ]);\n            }\n\n            return $return;\n\n        case 'hexentity':\n            $return = '';\n            if (Smarty::$_MBSTRING) {\n                if (!$is_loaded_1) {\n                    if (!is_callable('smarty_mb_to_unicode')) {\n                        require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');\n                    }\n                    $is_loaded_1 = true;\n                }\n                $return = '';\n                foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {\n                    $return .= '&#x' . strtoupper(dechex($unicode)) . ';';\n                }\n\n                return $return;\n            }\n            // no MBString fallback\n            $_length = strlen($string);\n            for ($x = 0; $x < $_length; $x ++) {\n                $return .= '&#x' . bin2hex($string[ $x ]) . ';';\n            }\n\n            return $return;\n\n        case 'decentity':\n            $return = '';\n            if (Smarty::$_MBSTRING) {\n                if (!$is_loaded_1) {\n                    if (!is_callable('smarty_mb_to_unicode')) {\n                        require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');\n                    }\n                    $is_loaded_1 = true;\n                }\n                $return = '';\n                foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {\n                    $return .= '&#' . $unicode . ';';\n                }\n\n                return $return;\n            }\n            // no MBString fallback\n            $_length = strlen($string);\n            for ($x = 0; $x < $_length; $x ++) {\n                $return .= '&#' . ord($string[ $x ]) . ';';\n            }\n\n            return $return;\n\n        case 'javascript':\n            // escape quotes and backslashes, newlines, etc.\n            return strtr($string, array('\\\\' => '\\\\\\\\',\n                                        \"'\" => \"\\\\'\",\n                                        '\"' => '\\\\\"',\n                                        \"\\r\" => '\\\\r',\n                                        \"\\n\" => '\\\\n',\n                                        '</' => '<\\/'));\n\n        case 'mail':\n            if (Smarty::$_MBSTRING) {\n                if (!$is_loaded_2) {\n                    if (!is_callable('smarty_mb_str_replace')) {\n                        require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');\n                    }\n                    $is_loaded_2 = true;\n                }\n                return smarty_mb_str_replace(array('@',\n                                                   '.'), array(' [AT] ',\n                                                               ' [DOT] '), $string);\n            }\n            // no MBString fallback\n            return str_replace(array('@',\n                                     '.'), array(' [AT] ',\n                                                 ' [DOT] '), $string);\n\n        case 'nonstd':\n            // escape non-standard chars, such as ms document quotes\n            $return = '';\n            if (Smarty::$_MBSTRING) {\n                if (!$is_loaded_1) {\n                    if (!is_callable('smarty_mb_to_unicode')) {\n                        require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');\n                    }\n                    $is_loaded_1 = true;\n                }\n                foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {\n                    if ($unicode >= 126) {\n                        $return .= '&#' . $unicode . ';';\n                    } else {\n                        $return .= chr($unicode);\n                    }\n                }\n\n                return $return;\n            }\n\n            $_length = strlen($string);\n            for ($_i = 0; $_i < $_length; $_i ++) {\n                $_ord = ord(substr($string, $_i, 1));\n                // non-standard char, escape it\n                if ($_ord >= 126) {\n                    $return .= '&#' . $_ord . ';';\n                } else {\n                    $return .= substr($string, $_i, 1);\n                }\n            }\n\n            return $return;\n\n        default:\n            return $string;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifier.mb_wordwrap.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n/**\n * Smarty wordwrap modifier plugin\n * Type:     modifier\n * Name:     mb_wordwrap\n * Purpose:  Wrap a string to a given number of characters\n *\n\n * @link   http://php.net/manual/en/function.wordwrap.php for similarity\n *\n * @param  string  $str   the string to wrap\n * @param  int     $width the width of the output\n * @param  string  $break the character used to break the line\n * @param  boolean $cut   ignored parameter, just for the sake of\n *\n * @return string  wrapped string\n * @author Rodney Rehm\n */\nfunction smarty_modifier_mb_wordwrap($str, $width = 75, $break = \"\\n\", $cut = false)\n{\n    // break words into tokens using white space as a delimiter\n    $tokens = preg_split('!(\\s)!S' . Smarty::$_UTF8_MODIFIER, $str, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);\n    $length = 0;\n    $t = '';\n    $_previous = false;\n    $_space = false;\n\n    foreach ($tokens as $_token) {\n        $token_length = mb_strlen($_token, Smarty::$_CHARSET);\n        $_tokens = array($_token);\n        if ($token_length > $width) {\n            if ($cut) {\n                $_tokens = preg_split('!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER,\n                                      $_token,\n                                      -1,\n                                      PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);\n            }\n        }\n\n        foreach ($_tokens as $token) {\n            $_space = !!preg_match('!^\\s$!S' . Smarty::$_UTF8_MODIFIER, $token);\n            $token_length = mb_strlen($token, Smarty::$_CHARSET);\n            $length += $token_length;\n\n            if ($length > $width) {\n                // remove space before inserted break\n                if ($_previous) {\n                    $t = mb_substr($t, 0, -1, Smarty::$_CHARSET);\n                }\n\n                if (!$_space) {\n                    // add the break before the token\n                    if (!empty($t)) {\n                        $t .= $break;\n                    }\n                    $length = $token_length;\n                }\n            } else if ($token === \"\\n\") {\n                // hard break must reset counters\n                $length = 0;\n            }\n            $_previous = $_space;\n            // add the token\n            $t .= $token;\n        }\n    }\n\n    return $t;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifier.regex_replace.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty regex_replace modifier plugin\n * Type:     modifier\n * Name:     regex_replace\n * Purpose:  regular expression search/replace\n *\n * @link    http://smarty.php.net/manual/en/language.modifier.regex.replace.php\n *          regex_replace (Smarty online manual)\n * @author  Monte Ohrt <monte at ohrt dot com>\n *\n * @param string       $string  input string\n * @param string|array $search  regular expression(s) to search for\n * @param string|array $replace string(s) that should be replaced\n * @param int          $limit   the maximum number of replacements\n *\n * @return string\n */\nfunction smarty_modifier_regex_replace($string, $search, $replace, $limit = - 1)\n{\n    if (is_array($search)) {\n        foreach ($search as $idx => $s) {\n            $search[ $idx ] = _smarty_regex_replace_check($s);\n        }\n    } else {\n        $search = _smarty_regex_replace_check($search);\n    }\n\n    return preg_replace($search, $replace, $string, $limit);\n}\n\n/**\n * @param  string $search string(s) that should be replaced\n *\n * @return string\n * @ignore\n */\nfunction _smarty_regex_replace_check($search)\n{\n    // null-byte injection detection\n    // anything behind the first null-byte is ignored\n    if (($pos = strpos($search, \"\\0\")) !== false) {\n        $search = substr($search, 0, $pos);\n    }\n    // remove eval-modifier from $search\n    if (preg_match('!([a-zA-Z\\s]+)$!s', $search, $match) && (strpos($match[ 1 ], 'e') !== false)) {\n        $search = substr($search, 0, - strlen($match[ 1 ])) . preg_replace('![e\\s]+!', '', $match[ 1 ]);\n    }\n\n    return $search;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifier.replace.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty replace modifier plugin\n * Type:     modifier\n * Name:     replace\n * Purpose:  simple search/replace\n *\n * @link   http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n * @author Uwe Tews\n *\n * @param string $string  input string\n * @param string $search  text to search for\n * @param string $replace replacement text\n *\n * @return string\n */\nfunction smarty_modifier_replace($string, $search, $replace)\n{\n    static $is_loaded = false;\n    if (Smarty::$_MBSTRING) {\n        if (!$is_loaded) {\n            if (!is_callable('smarty_mb_str_replace')) {\n                require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');\n            }\n            $is_loaded = true;\n        }\n         return smarty_mb_str_replace($search, $replace, $string);\n    }\n\n    return str_replace($search, $replace, $string);\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifier.spacify.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty spacify modifier plugin\n * Type:     modifier\n * Name:     spacify\n * Purpose:  add spaces between characters in a string\n *\n * @link   http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param string $string       input string\n * @param string $spacify_char string to insert between characters.\n *\n * @return string\n */\nfunction smarty_modifier_spacify($string, $spacify_char = ' ')\n{\n    // well… what about charsets besides latin and UTF-8?\n    return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, - 1, PREG_SPLIT_NO_EMPTY));\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifier.truncate.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifier\n */\n\n/**\n * Smarty truncate modifier plugin\n * Type:     modifier\n * Name:     truncate\n * Purpose:  Truncate a string to a certain length if necessary,\n *               optionally splitting in the middle of a word, and\n *               appending the $etc string or inserting $etc into the middle.\n *\n * @link   http://smarty.php.net/manual/en/language.modifier.truncate.php truncate (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n *\n * @param string  $string      input string\n * @param integer $length      length of truncated text\n * @param string  $etc         end string\n * @param boolean $break_words truncate at word boundary\n * @param boolean $middle      truncate in the middle of text\n *\n * @return string truncated string\n */\nfunction smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false)\n{\n    if ($length === 0) {\n        return '';\n    }\n\n    if (Smarty::$_MBSTRING) {\n        if (mb_strlen($string, Smarty::$_CHARSET) > $length) {\n            $length -= min($length, mb_strlen($etc, Smarty::$_CHARSET));\n            if (!$break_words && !$middle) {\n                $string = preg_replace('/\\s+?(\\S+)?$/' . Smarty::$_UTF8_MODIFIER, '',\n                                       mb_substr($string, 0, $length + 1, Smarty::$_CHARSET));\n            }\n            if (!$middle) {\n                return mb_substr($string, 0, $length, Smarty::$_CHARSET) . $etc;\n            }\n\n            return mb_substr($string, 0, $length / 2, Smarty::$_CHARSET) . $etc .\n                   mb_substr($string, - $length / 2, $length, Smarty::$_CHARSET);\n        }\n\n        return $string;\n    }\n\n    // no MBString fallback\n    if (isset($string[ $length ])) {\n        $length -= min($length, strlen($etc));\n        if (!$break_words && !$middle) {\n            $string = preg_replace('/\\s+?(\\S+)?$/', '', substr($string, 0, $length + 1));\n        }\n        if (!$middle) {\n            return substr($string, 0, $length) . $etc;\n        }\n\n        return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2);\n    }\n\n    return $string;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.cat.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty cat modifier plugin\n * Type:     modifier\n * Name:     cat\n * Date:     Feb 24, 2003\n * Purpose:  catenate a value to a variable\n * Input:    string to catenate\n * Example:  {$var|cat:\"foo\"}\n *\n * @link     http://smarty.php.net/manual/en/language.modifier.cat.php cat\n *           (Smarty online manual)\n * @author   Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_cat($params)\n{\n    return '(' . implode(').(', $params) . ')';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.count_characters.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty count_characters modifier plugin\n * Type:     modifier\n * Name:     count_characters\n * Purpose:  count the number of characters in a text\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_count_characters($params)\n{\n    if (!isset($params[ 1 ]) || $params[ 1 ] !== 'true') {\n        return 'preg_match_all(\\'/[^\\s]/' . Smarty::$_UTF8_MODIFIER . '\\',' . $params[ 0 ] . ', $tmp)';\n    }\n    if (Smarty::$_MBSTRING) {\n        return 'mb_strlen(' . $params[ 0 ] . ', \\'' . addslashes(Smarty::$_CHARSET) . '\\')';\n    }\n    // no MBString fallback\n    return 'strlen(' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.count_paragraphs.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty count_paragraphs modifier plugin\n * Type:     modifier\n * Name:     count_paragraphs\n * Purpose:  count the number of paragraphs in a text\n *\n * @link    http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php\n *          count_paragraphs (Smarty online manual)\n * @author  Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_count_paragraphs($params)\n{\n    // count \\r or \\n characters\n    return '(preg_match_all(\\'#[\\r\\n]+#\\', ' . $params[ 0 ] . ', $tmp)+1)';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.count_sentences.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty count_sentences modifier plugin\n * Type:     modifier\n * Name:     count_sentences\n * Purpose:  count the number of sentences in a text\n *\n * @link    http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php\n *          count_sentences (Smarty online manual)\n * @author  Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_count_sentences($params)\n{\n    // find periods, question marks, exclamation marks with a word before but not after.\n    return 'preg_match_all(\"#\\w[\\.\\?\\!](\\W|$)#S' . Smarty::$_UTF8_MODIFIER . '\", ' . $params[ 0 ] . ', $tmp)';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.count_words.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty count_words modifier plugin\n * Type:     modifier\n * Name:     count_words\n * Purpose:  count the number of words in a text\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_count_words($params)\n{\n    if (Smarty::$_MBSTRING) {\n        // return 'preg_match_all(\\'#[\\w\\pL]+#' . Smarty::$_UTF8_MODIFIER . '\\', ' . $params[0] . ', $tmp)';\n        // expression taken from http://de.php.net/manual/en/function.str-word-count.php#85592\n        return 'preg_match_all(\\'/\\p{L}[\\p{L}\\p{Mn}\\p{Pd}\\\\\\'\\x{2019}]*/' . Smarty::$_UTF8_MODIFIER . '\\', ' .\n               $params[ 0 ] . ', $tmp)';\n    }\n    // no MBString fallback\n    return 'str_word_count(' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.default.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty default modifier plugin\n * Type:     modifier\n * Name:     default\n * Purpose:  designate default value for empty variables\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.default.php default (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_default($params)\n{\n    $output = $params[ 0 ];\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = \"''\";\n    }\n\n    array_shift($params);\n    foreach ($params as $param) {\n        $output = '(($tmp = @' . $output . ')===null||$tmp===\\'\\' ? ' . $param . ' : $tmp)';\n    }\n\n    return $output;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.escape.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n/**\n * Smarty escape modifier plugin\n * Type:     modifier\n * Name:     escape\n * Purpose:  escape string for output\n *\n * @link   http://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual)\n * @author Rodney Rehm\n *\n * @param array                                 $params parameters\n * @param  Smarty_Internal_TemplateCompilerBase $compiler\n *\n * @return string with compiled code\n * @throws \\SmartyException\n */\nfunction smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompilerBase $compiler)\n{\n    static $_double_encode = null;\n    static $is_loaded = false;\n    $compiler->template->_checkPlugins(array(array('function' => 'smarty_literal_compiler_param',\n                                         'file' => SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php')));\n    if ($_double_encode === null) {\n        $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');\n    }\n\n    try {\n        $esc_type = smarty_literal_compiler_param($params, 1, 'html');\n        $char_set = smarty_literal_compiler_param($params, 2, Smarty::$_CHARSET);\n        $double_encode = smarty_literal_compiler_param($params, 3, true);\n\n        if (!$char_set) {\n            $char_set = Smarty::$_CHARSET;\n        }\n\n        switch ($esc_type) {\n            case 'html':\n                if ($_double_encode) {\n                    return 'htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' .\n                           var_export($double_encode, true) . ')';\n                } elseif ($double_encode) {\n                    return 'htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ')';\n                } else {\n                    // fall back to modifier.escape.php\n                }\n\n            case 'htmlall':\n                if (Smarty::$_MBSTRING) {\n                    if ($_double_encode) {\n                        // php >=5.2.3 - go native\n                        return 'mb_convert_encoding(htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' .\n                               var_export($char_set, true) . ', ' . var_export($double_encode, true) .\n                               '), \"HTML-ENTITIES\", ' . var_export($char_set, true) . ')';\n                    } elseif ($double_encode) {\n                        // php <5.2.3 - only handle double encoding\n                        return 'mb_convert_encoding(htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' .\n                               var_export($char_set, true) . '), \"HTML-ENTITIES\", ' . var_export($char_set, true) . ')';\n                    } else {\n                        // fall back to modifier.escape.php\n                    }\n                }\n\n                // no MBString fallback\n                if ($_double_encode) {\n                    // php >=5.2.3 - go native\n                    return 'htmlentities(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' .\n                           var_export($double_encode, true) . ')';\n                } elseif ($double_encode) {\n                    // php <5.2.3 - only handle double encoding\n                    return 'htmlentities(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ')';\n                } else {\n                    // fall back to modifier.escape.php\n                }\n\n            case 'url':\n                return 'rawurlencode(' . $params[ 0 ] . ')';\n\n            case 'urlpathinfo':\n                return 'str_replace(\"%2F\", \"/\", rawurlencode(' . $params[ 0 ] . '))';\n\n            case 'quotes':\n                // escape unescaped single quotes\n                return 'preg_replace(\"%(?<!\\\\\\\\\\\\\\\\)\\'%\", \"\\\\\\'\",' . $params[ 0 ] . ')';\n\n            case 'javascript':\n                // escape quotes and backslashes, newlines, etc.\n                return 'strtr(' . $params[ 0 ] .\n                       ', array(\"\\\\\\\\\" => \"\\\\\\\\\\\\\\\\\", \"\\'\" => \"\\\\\\\\\\'\", \"\\\"\" => \"\\\\\\\\\\\"\", \"\\\\r\" => \"\\\\\\\\r\", \"\\\\n\" => \"\\\\\\n\", \"</\" => \"<\\/\" ))';\n        }\n    }\n    catch (SmartyException $e) {\n        // pass through to regular plugin fallback\n    }\n\n    // could not optimize |escape call, so fallback to regular plugin\n    if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) {\n        $compiler->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'file' ] =\n            SMARTY_PLUGINS_DIR . 'modifier.escape.php';\n        $compiler->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'function' ] =\n            'smarty_modifier_escape';\n    } else {\n        $compiler->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'file' ] =\n            SMARTY_PLUGINS_DIR . 'modifier.escape.php';\n        $compiler->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'function' ] =\n            'smarty_modifier_escape';\n    }\n\n    return 'smarty_modifier_escape(' . join(', ', $params) . ')';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.from_charset.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty from_charset modifier plugin\n * Type:     modifier\n * Name:     from_charset\n * Purpose:  convert character encoding from $charset to internal encoding\n *\n * @author Rodney Rehm\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_from_charset($params)\n{\n    if (!Smarty::$_MBSTRING) {\n        // FIXME: (rodneyrehm) shouldn't this throw an error?\n        return $params[ 0 ];\n    }\n\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = '\"ISO-8859-1\"';\n    }\n\n    return 'mb_convert_encoding(' . $params[ 0 ] . ', \"' . addslashes(Smarty::$_CHARSET) . '\", ' . $params[ 1 ] . ')';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.indent.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty indent modifier plugin\n * Type:     modifier\n * Name:     indent\n * Purpose:  indent lines of text\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.indent.php indent (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\n\nfunction smarty_modifiercompiler_indent($params)\n{\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = 4;\n    }\n    if (!isset($params[ 2 ])) {\n        $params[ 2 ] = \"' '\";\n    }\n\n    return 'preg_replace(\\'!^!m\\',str_repeat(' . $params[ 2 ] . ',' . $params[ 1 ] . '),' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.lower.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty lower modifier plugin\n * Type:     modifier\n * Name:     lower\n * Purpose:  convert string to lowercase\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual)\n * @author Monte Ohrt <monte at ohrt dot com>\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\n\nfunction smarty_modifiercompiler_lower($params)\n{\n    if (Smarty::$_MBSTRING) {\n        return 'mb_strtolower(' . $params[ 0 ] . ', \\'' . addslashes(Smarty::$_CHARSET) . '\\')';\n    }\n    // no MBString fallback\n    return 'strtolower(' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.noprint.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty noprint modifier plugin\n * Type:     modifier\n * Name:     noprint\n * Purpose:  return an empty string\n *\n * @author   Uwe Tews\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_noprint()\n{\n    return \"''\";\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.string_format.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty string_format modifier plugin\n * Type:     modifier\n * Name:     string_format\n * Purpose:  format strings via sprintf\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_string_format($params)\n{\n    return 'sprintf(' . $params[ 1 ] . ',' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.strip.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty strip modifier plugin\n * Type:     modifier\n * Name:     strip\n * Purpose:  Replace all repeated spaces, newlines, tabs\n *              with a single space or supplied replacement string.\n * Example:  {$var|strip} {$var|strip:\"&nbsp;\"}\n * Date:     September 25th, 2002\n *\n * @link   http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\n\nfunction smarty_modifiercompiler_strip($params)\n{\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = \"' '\";\n    }\n\n    return \"preg_replace('!\\s+!\" . Smarty::$_UTF8_MODIFIER . \"', {$params[1]},{$params[0]})\";\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.strip_tags.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty strip_tags modifier plugin\n * Type:     modifier\n * Name:     strip_tags\n * Purpose:  strip html tags from text\n *\n * @link   http://www.smarty.net/docs/en/language.modifier.strip.tags.tpl strip_tags (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_strip_tags($params)\n{\n    if (!isset($params[ 1 ]) || $params[ 1 ] === true || trim($params[ 1 ], '\"') === 'true') {\n        return \"preg_replace('!<[^>]*?>!', ' ', {$params[0]})\";\n    } else {\n        return 'strip_tags(' . $params[ 0 ] . ')';\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.to_charset.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty to_charset modifier plugin\n * Type:     modifier\n * Name:     to_charset\n * Purpose:  convert character encoding from internal encoding to $charset\n *\n * @author Rodney Rehm\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_to_charset($params)\n{\n    if (!Smarty::$_MBSTRING) {\n        // FIXME: (rodneyrehm) shouldn't this throw an error?\n        return $params[ 0 ];\n    }\n\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = '\"ISO-8859-1\"';\n    }\n\n    return 'mb_convert_encoding(' . $params[ 0 ] . ', ' . $params[ 1 ] . ', \"' . addslashes(Smarty::$_CHARSET) . '\")';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.unescape.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty unescape modifier plugin\n * Type:     modifier\n * Name:     unescape\n * Purpose:  unescape html entities\n *\n * @author Rodney Rehm\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_unescape($params)\n{\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = 'html';\n    }\n    if (!isset($params[ 2 ])) {\n        $params[ 2 ] = '\\'' . addslashes(Smarty::$_CHARSET) . '\\'';\n    } else {\n        $params[ 2 ] = \"'{$params[ 2 ]}'\";\n    }\n\n    switch (trim($params[ 1 ], '\"\\'')) {\n        case 'entity':\n        case 'htmlall':\n            if (Smarty::$_MBSTRING) {\n                return 'mb_convert_encoding(' . $params[ 0 ] . ', ' . $params[ 2 ] . ', \\'HTML-ENTITIES\\')';\n            }\n\n            return 'html_entity_decode(' . $params[ 0 ] . ', ENT_NOQUOTES, ' . $params[ 2 ] . ')';\n\n        case 'html':\n            return 'htmlspecialchars_decode(' . $params[ 0 ] . ', ENT_QUOTES)';\n\n        case 'url':\n            return 'rawurldecode(' . $params[ 0 ] . ')';\n\n        default:\n            return $params[ 0 ];\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.upper.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n\n/**\n * Smarty upper modifier plugin\n * Type:     modifier\n * Name:     lower\n * Purpose:  convert string to uppercase\n *\n * @link   http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array $params parameters\n *\n * @return string with compiled code\n */\nfunction smarty_modifiercompiler_upper($params)\n{\n    if (Smarty::$_MBSTRING) {\n        return 'mb_strtoupper(' . $params[ 0 ] . ', \\'' . addslashes(Smarty::$_CHARSET) . '\\')';\n    }\n    // no MBString fallback\n    return 'strtoupper(' . $params[ 0 ] . ')';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/modifiercompiler.wordwrap.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsModifierCompiler\n */\n/**\n * Smarty wordwrap modifier plugin\n * Type:     modifier\n * Name:     wordwrap\n * Purpose:  wrap a string of text at a given length\n *\n * @link   http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual)\n * @author Uwe Tews\n *\n * @param array                                 $params parameters\n * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n *\n * @return string with compiled code\n * @throws \\SmartyException\n */\nfunction smarty_modifiercompiler_wordwrap($params, Smarty_Internal_TemplateCompilerBase $compiler)\n{\n    if (!isset($params[ 1 ])) {\n        $params[ 1 ] = 80;\n    }\n    if (!isset($params[ 2 ])) {\n        $params[ 2 ] = '\"\\n\"';\n    }\n    if (!isset($params[ 3 ])) {\n        $params[ 3 ] = 'false';\n    }\n    $function = 'wordwrap';\n    if (Smarty::$_MBSTRING) {\n        $function = $compiler->getPlugin('mb_wordwrap','modifier');\n    }\n    return $function . '(' . $params[ 0 ] . ',' . $params[ 1 ] . ',' . $params[ 2 ] . ',' . $params[ 3 ] . ')';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/outputfilter.trimwhitespace.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFilter\n */\n\n/**\n * Smarty trimwhitespace outputfilter plugin\n * Trim unnecessary whitespace from HTML markup.\n *\n * @author   Rodney Rehm\n *\n * @param string $source input string\n *\n * @return string filtered output\n * @todo     substr_replace() is not overloaded by mbstring.func_overload - so this function might fail!\n */\nfunction smarty_outputfilter_trimwhitespace($source)\n{\n    $store = array();\n    $_store = 0;\n    $_offset = 0;\n\n    // Unify Line-Breaks to \\n\n    $source = preg_replace('/\\015\\012|\\015|\\012/', \"\\n\", $source);\n\n    // capture Internet Explorer and KnockoutJS Conditional Comments\n    if (preg_match_all('#<!--((\\[[^\\]]+\\]>.*?<!\\[[^\\]]+\\])|(\\s*/?ko\\s+.+))-->#is', $source, $matches,\n                       PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n        foreach ($matches as $match) {\n            $store[] = $match[ 0 ][ 0 ];\n            $_length = strlen($match[ 0 ][ 0 ]);\n            $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@';\n            $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] - $_offset, $_length);\n\n            $_offset += $_length - strlen($replace);\n            $_store ++;\n        }\n    }\n\n    // Strip all HTML-Comments\n    // yes, even the ones in <script> - see http://stackoverflow.com/a/808850/515124\n    $source = preg_replace('#<!--.*?-->#ms', '', $source);\n\n    // capture html elements not to be messed with\n    $_offset = 0;\n    if (preg_match_all('#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is',\n                       $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n        foreach ($matches as $match) {\n            $store[] = $match[ 0 ][ 0 ];\n            $_length = strlen($match[ 0 ][ 0 ]);\n            $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@';\n            $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] - $_offset, $_length);\n\n            $_offset += $_length - strlen($replace);\n            $_store ++;\n        }\n    }\n\n    $expressions = array(// replace multiple spaces between tags by a single space\n                         // can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements\n                         '#(:SMARTY@!@|>)\\s+(?=@!@SMARTY:|<)#s' => '\\1 \\2',\n                         // remove spaces between attributes (but not in attribute values!)\n                         '#(([a-z0-9]\\s*=\\s*(\"[^\"]*?\")|(\\'[^\\']*?\\'))|<[a-z0-9_]+)\\s+([a-z/>])#is' => '\\1 \\5',\n                         // note: for some very weird reason trim() seems to remove spaces inside attributes.\n                         // maybe a \\0 byte or something is interfering?\n                         '#^\\s+<#Ss' => '<', '#>\\s+$#Ss' => '>',);\n\n    $source = preg_replace(array_keys($expressions), array_values($expressions), $source);\n    // note: for some very weird reason trim() seems to remove spaces inside attributes.\n    // maybe a \\0 byte or something is interfering?\n    // $source = trim( $source );\n\n    $_offset = 0;\n    if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n        foreach ($matches as $match) {\n            $_length = strlen($match[ 0 ][ 0 ]);\n            $replace = $store[ $match[ 1 ][ 0 ] ];\n            $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] + $_offset, $_length);\n\n            $_offset += strlen($replace) - $_length;\n            $_store ++;\n        }\n    }\n\n    return $source;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/shared.escape_special_chars.php",
    "content": "<?php\n/**\n * Smarty shared plugin\n *\n * @package    Smarty\n * @subpackage PluginsShared\n */\n\n/**\n * escape_special_chars common function\n * Function: smarty_function_escape_special_chars\n * Purpose:  used by other smarty functions to escape\n *           special chars except for already escaped ones\n *\n * @author   Monte Ohrt <monte at ohrt dot com>\n *\n * @param  string $string text that should by escaped\n *\n * @return string\n */\nfunction smarty_function_escape_special_chars($string)\n{\n    if (!is_array($string)) {\n        if (version_compare(PHP_VERSION, '5.2.3', '>=')) {\n            $string = htmlspecialchars($string, ENT_COMPAT, Smarty::$_CHARSET, false);\n        } else {\n            $string = preg_replace('!&(#?\\w+);!', '%%%SMARTY_START%%%\\\\1%%%SMARTY_END%%%', $string);\n            $string = htmlspecialchars($string);\n            $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);\n        }\n    }\n\n    return $string;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/shared.literal_compiler_param.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsShared\n */\n\n/**\n * evaluate compiler parameter\n *\n * @param array   $params  parameter array as given to the compiler function\n * @param integer $index   array index of the parameter to convert\n * @param mixed   $default value to be returned if the parameter is not present\n *\n * @return mixed evaluated value of parameter or $default\n * @throws SmartyException if parameter is not a literal (but an expression, variable, …)\n * @author Rodney Rehm\n */\nfunction smarty_literal_compiler_param($params, $index, $default = null)\n{\n    // not set, go default\n    if (!isset($params[ $index ])) {\n        return $default;\n    }\n    // test if param is a literal\n    if (!preg_match('/^([\\'\"]?)[a-zA-Z0-9-]+(\\\\1)$/', $params[ $index ])) {\n        throw new SmartyException('$param[' . $index .\n                                  '] is not a literal and is thus not evaluatable at compile time');\n    }\n\n    $t = null;\n    eval(\"\\$t = \" . $params[ $index ] . \";\");\n\n    return $t;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/shared.make_timestamp.php",
    "content": "<?php\n/**\n * Smarty shared plugin\n *\n * @package    Smarty\n * @subpackage PluginsShared\n */\n\n/**\n * Function: smarty_make_timestamp\n * Purpose:  used by other smarty functions to make a timestamp from a string.\n *\n * @author   Monte Ohrt <monte at ohrt dot com>\n *\n * @param DateTime|int|string $string date object, timestamp or string that can be converted using strtotime()\n *\n * @return int\n */\nfunction smarty_make_timestamp($string)\n{\n    if (empty($string)) {\n        // use \"now\":\n        return time();\n    } elseif ($string instanceof DateTime ||\n              (interface_exists('DateTimeInterface', false) && $string instanceof DateTimeInterface)\n    ) {\n        return (int) $string->format('U'); // PHP 5.2 BC\n    } elseif (strlen($string) === 14 && ctype_digit($string)) {\n        // it is mysql timestamp format of YYYYMMDDHHMMSS?\n        return mktime(substr($string, 8, 2), substr($string, 10, 2), substr($string, 12, 2), substr($string, 4, 2),\n                      substr($string, 6, 2), substr($string, 0, 4));\n    } elseif (is_numeric($string)) {\n        // it is a numeric string, we handle it as timestamp\n        return (int) $string;\n    } else {\n        // strtotime should handle it\n        $time = strtotime($string);\n        if ($time === - 1 || $time === false) {\n            // strtotime() was not able to parse $string, use \"now\":\n            return time();\n        }\n\n        return $time;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/shared.mb_str_replace.php",
    "content": "<?php\n/**\n * Smarty shared plugin\n *\n * @package    Smarty\n * @subpackage PluginsShared\n */\nif (!function_exists('smarty_mb_str_replace')) {\n    /**\n     * Multibyte string replace\n     *\n     * @param  string|string[] $search  the string to be searched\n     * @param  string|string[] $replace the replacement string\n     * @param  string          $subject the source string\n     * @param  int             &$count  number of matches found\n     *\n     * @return string replaced string\n     * @author Rodney Rehm\n     */\n    function smarty_mb_str_replace($search, $replace, $subject, &$count = 0)\n    {\n        if (!is_array($search) && is_array($replace)) {\n            return false;\n        }\n        if (is_array($subject)) {\n            // call mb_replace for each single string in $subject\n            foreach ($subject as &$string) {\n                $string = smarty_mb_str_replace($search, $replace, $string, $c);\n                $count += $c;\n            }\n        } else if (is_array($search)) {\n            if (!is_array($replace)) {\n                foreach ($search as &$string) {\n                    $subject = smarty_mb_str_replace($string, $replace, $subject, $c);\n                    $count += $c;\n                }\n            } else {\n                $n = max(count($search), count($replace));\n                while ($n--) {\n                    $subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c);\n                    $count += $c;\n                    next($search);\n                    next($replace);\n                }\n            }\n        } else {\n            $parts = mb_split(preg_quote($search), $subject);\n            $count = count($parts) - 1;\n            $subject = implode($replace, $parts);\n        }\n        return $subject;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/shared.mb_unicode.php",
    "content": "<?php\n/**\n * Smarty shared plugin\n *\n * @package    Smarty\n * @subpackage PluginsShared\n */\n\n/**\n * convert characters to their decimal unicode equivalents\n *\n * @link   http://www.ibm.com/developerworks/library/os-php-unicode/index.html#listing3 for inspiration\n *\n * @param string $string   characters to calculate unicode of\n * @param string $encoding encoding of $string, if null mb_internal_encoding() is used\n *\n * @return array sequence of unicodes\n * @author Rodney Rehm\n */\nfunction smarty_mb_to_unicode($string, $encoding = null)\n{\n    if ($encoding) {\n        $expanded = mb_convert_encoding($string, 'UTF-32BE', $encoding);\n    } else {\n        $expanded = mb_convert_encoding($string, 'UTF-32BE');\n    }\n\n    return unpack('N*', $expanded);\n}\n\n/**\n * convert unicodes to the character of given encoding\n *\n * @link   http://www.ibm.com/developerworks/library/os-php-unicode/index.html#listing3 for inspiration\n *\n * @param integer|array $unicode  single unicode or list of unicodes to convert\n * @param string        $encoding encoding of returned string, if null mb_internal_encoding() is used\n *\n * @return string unicode as character sequence in given $encoding\n * @author Rodney Rehm\n */\nfunction smarty_mb_from_unicode($unicode, $encoding = null)\n{\n    $t = '';\n    if (!$encoding) {\n        $encoding = mb_internal_encoding();\n    }\n    foreach ((array) $unicode as $utf32be) {\n        $character = pack('N*', $utf32be);\n        $t .= mb_convert_encoding($character, $encoding, 'UTF-32BE');\n    }\n\n    return $t;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/plugins/variablefilter.htmlspecialchars.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage PluginsFilter\n */\n/**\n * Smarty htmlspecialchars variablefilter plugin\n *\n * @param string                    $source input string\n * @param \\Smarty_Internal_Template $template\n *\n * @return string filtered output\n */\nfunction smarty_variablefilter_htmlspecialchars($source, Smarty_Internal_Template $template)\n{\n    return htmlspecialchars($source, ENT_QUOTES, Smarty::$_CHARSET);\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_cacheresource.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin\n *\n * @package    Smarty\n * @subpackage Cacher\n */\n\n/**\n * Cache Handler API\n *\n * @package    Smarty\n * @subpackage Cacher\n * @author     Rodney Rehm\n */\nabstract class Smarty_CacheResource\n{\n    /**\n     * resource types provided by the core\n     *\n     * @var array\n     */\n    protected static $sysplugins = array('file' => 'smarty_internal_cacheresource_file.php',);\n\n    /**\n     * populate Cached Object with meta data from Resource\n     *\n     * @param Smarty_Template_Cached   $cached    cached object\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    abstract public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template);\n\n    /**\n     * populate Cached Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return void\n     */\n    abstract public function populateTimestamp(Smarty_Template_Cached $cached);\n\n    /**\n     * Read the cached template and process header\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param Smarty_Template_Cached   $cached    cached object\n     * @param boolean                  $update    flag if called because cache update\n     *\n     * @return boolean true or false if the cached content does not exist\n     */\n    abstract public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached = null,\n                                     $update = false);\n\n    /**\n     * Write the rendered template output to cache\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param string                   $content   content to cache\n     *\n     * @return boolean success\n     */\n    abstract public function writeCachedContent(Smarty_Internal_Template $_template, $content);\n\n    /**\n     * Read cached template from cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return string  content\n     */\n    abstract function readCachedContent(Smarty_Internal_Template $_template);\n\n    /**\n     * Return cached content\n     *\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return null|string\n     */\n    public function getCachedContent(Smarty_Internal_Template $_template)\n    {\n        if ($_template->cached->handler->process($_template)) {\n            ob_start();\n            $unifunc = $_template->cached->unifunc;\n            $unifunc($_template);\n            return ob_get_clean();\n        }\n\n        return null;\n    }\n\n    /**\n     * Empty cache\n     *\n     * @param Smarty  $smarty   Smarty object\n     * @param integer $exp_time expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    abstract public function clearAll(Smarty $smarty, $exp_time = null);\n\n    /**\n     * Empty cache for a specific template\n     *\n     * @param Smarty  $smarty        Smarty object\n     * @param string  $resource_name template name\n     * @param string  $cache_id      cache id\n     * @param string  $compile_id    compile id\n     * @param integer $exp_time      expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    abstract public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time);\n\n    /**\n     * @param Smarty                 $smarty\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return bool|null\n     */\n    public function locked(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        // theoretically locking_timeout should be checked against time_limit (max_execution_time)\n        $start = microtime(true);\n        $hadLock = null;\n        while ($this->hasLock($smarty, $cached)) {\n            $hadLock = true;\n            if (microtime(true) - $start > $smarty->locking_timeout) {\n                // abort waiting for lock release\n                return false;\n            }\n            sleep(1);\n        }\n\n        return $hadLock;\n    }\n\n    /**\n     * Check is cache is locked for this template\n     *\n     * @param Smarty                 $smarty\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return bool\n     */\n    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        // check if lock exists\n        return false;\n    }\n\n    /**\n     * Lock cache for this template\n     *\n     * @param Smarty                 $smarty\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return bool\n     */\n    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        // create lock\n        return true;\n    }\n\n    /**\n     * Unlock cache for this template\n     *\n     * @param Smarty                 $smarty\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return bool\n     */\n    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        // release lock\n        return true;\n    }\n\n    /**\n     * Load Cache Resource Handler\n     *\n     * @param Smarty $smarty Smarty object\n     * @param string $type   name of the cache resource\n     *\n     * @throws SmartyException\n     * @return Smarty_CacheResource Cache Resource Handler\n     */\n    public static function load(Smarty $smarty, $type = null)\n    {\n        if (!isset($type)) {\n            $type = $smarty->caching_type;\n        }\n\n        // try smarty's cache\n        if (isset($smarty->_cache[ 'cacheresource_handlers' ][ $type ])) {\n            return $smarty->_cache[ 'cacheresource_handlers' ][ $type ];\n        }\n\n        // try registered resource\n        if (isset($smarty->registered_cache_resources[ $type ])) {\n            // do not cache these instances as they may vary from instance to instance\n            return $smarty->_cache[ 'cacheresource_handlers' ][ $type ] = $smarty->registered_cache_resources[ $type ];\n        }\n        // try sysplugins dir\n        if (isset(self::$sysplugins[ $type ])) {\n            $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type);\n            return $smarty->_cache[ 'cacheresource_handlers' ][ $type ] = new $cache_resource_class();\n        }\n        // try plugins dir\n        $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type);\n        if ($smarty->loadPlugin($cache_resource_class)) {\n            return $smarty->_cache[ 'cacheresource_handlers' ][ $type ] = new $cache_resource_class();\n        }\n        // give up\n        throw new SmartyException(\"Unable to load cache resource '{$type}'\");\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_cacheresource_custom.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin\n *\n * @package    Smarty\n * @subpackage Cacher\n */\n\n/**\n * Cache Handler API\n *\n * @package    Smarty\n * @subpackage Cacher\n * @author     Rodney Rehm\n */\nabstract class Smarty_CacheResource_Custom extends Smarty_CacheResource\n{\n    /**\n     * fetch cached content and its modification time from data source\n     *\n     * @param  string  $id         unique cache content identifier\n     * @param  string  $name       template name\n     * @param  string  $cache_id   cache id\n     * @param  string  $compile_id compile id\n     * @param  string  $content    cached content\n     * @param  integer $mtime      cache modification timestamp (epoch)\n     *\n     * @return void\n     */\n    abstract protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime);\n\n    /**\n     * Fetch cached content's modification timestamp from data source\n     * {@internal implementing this method is optional.\n     *  Only implement it if modification times can be accessed faster than loading the complete cached content.}}\n     *\n     * @param  string $id         unique cache content identifier\n     * @param  string $name       template name\n     * @param  string $cache_id   cache id\n     * @param  string $compile_id compile id\n     *\n     * @return integer|boolean timestamp (epoch) the template was modified, or false if not found\n     */\n    protected function fetchTimestamp($id, $name, $cache_id, $compile_id)\n    {\n        return false;\n    }\n\n    /**\n     * Save content to cache\n     *\n     * @param  string       $id         unique cache content identifier\n     * @param  string       $name       template name\n     * @param  string       $cache_id   cache id\n     * @param  string       $compile_id compile id\n     * @param  integer|null $exp_time   seconds till expiration or null\n     * @param  string       $content    content to cache\n     *\n     * @return boolean      success\n     */\n    abstract protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content);\n\n    /**\n     * Delete content from cache\n     *\n     * @param  string|null  $name       template name\n     * @param  string|null  $cache_id   cache id\n     * @param  string|null  $compile_id compile id\n     * @param  integer|null $exp_time   seconds till expiration time in seconds or null\n     *\n     * @return integer      number of deleted caches\n     */\n    abstract protected function delete($name, $cache_id, $compile_id, $exp_time);\n\n    /**\n     * populate Cached Object with meta data from Resource\n     *\n     * @param  Smarty_Template_Cached   $cached    cached object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)\n    {\n        $_cache_id = isset($cached->cache_id) ? preg_replace('![^\\w\\|]+!', '_', $cached->cache_id) : null;\n        $_compile_id = isset($cached->compile_id) ? preg_replace('![^\\w]+!', '_', $cached->compile_id) : null;\n        $path = $cached->source->uid . $_cache_id . $_compile_id;\n        $cached->filepath = sha1($path);\n        if ($_template->smarty->cache_locking) {\n            $cached->lock_id = sha1('lock.' . $path);\n        }\n        $this->populateTimestamp($cached);\n    }\n\n    /**\n     * populate Cached Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Cached $cached\n     *\n     * @return void\n     */\n    public function populateTimestamp(Smarty_Template_Cached $cached)\n    {\n        $mtime =\n            $this->fetchTimestamp($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id);\n        if ($mtime !== null) {\n            $cached->timestamp = $mtime;\n            $cached->exists = !!$cached->timestamp;\n\n            return;\n        }\n        $timestamp = null;\n        $this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $cached->content,\n                     $timestamp);\n        $cached->timestamp = isset($timestamp) ? $timestamp : false;\n        $cached->exists = !!$cached->timestamp;\n    }\n\n    /**\n     * Read the cached template and process the header\n     *\n     * @param \\Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     * @param  Smarty_Template_Cached   $cached      cached object\n     * @param boolean                   $update      flag if called because cache update\n     *\n     * @return boolean                 true or false if the cached content does not exist\n     */\n    public function process(Smarty_Internal_Template $_smarty_tpl, Smarty_Template_Cached $cached = null,\n                            $update = false)\n    {\n        if (!$cached) {\n            $cached = $_smarty_tpl->cached;\n        }\n        $content = $cached->content ? $cached->content : null;\n        $timestamp = $cached->timestamp ? $cached->timestamp : null;\n        if ($content === null || !$timestamp) {\n            $this->fetch($_smarty_tpl->cached->filepath, $_smarty_tpl->source->name, $_smarty_tpl->cache_id,\n                         $_smarty_tpl->compile_id, $content, $timestamp);\n        }\n        if (isset($content)) {\n            eval('?>' . $content);\n            $cached->content = null;\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Write the rendered template output to cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     * @param  string                   $content   content to cache\n     *\n     * @return boolean                  success\n     */\n    public function writeCachedContent(Smarty_Internal_Template $_template, $content)\n    {\n        return $this->save($_template->cached->filepath, $_template->source->name, $_template->cache_id,\n                           $_template->compile_id, $_template->cache_lifetime, $content);\n    }\n\n    /**\n     * Read cached template from cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return string|boolean  content\n     */\n    public function readCachedContent(Smarty_Internal_Template $_template)\n    {\n        $content = $_template->cached->content ? $_template->cached->content : null;\n        $timestamp = null;\n        if ($content === null) {\n            $timestamp = null;\n            $this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id,\n                         $_template->compile_id, $content, $timestamp);\n        }\n        if (isset($content)) {\n            return $content;\n        }\n        return false;\n    }\n\n    /**\n     * Empty cache\n     *\n     * @param  Smarty  $smarty   Smarty object\n     * @param  integer $exp_time expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    public function clearAll(Smarty $smarty, $exp_time = null)\n    {\n        return $this->delete(null, null, null, $exp_time);\n    }\n\n    /**\n     * Empty cache for a specific template\n     *\n     * @param  Smarty  $smarty        Smarty object\n     * @param  string  $resource_name template name\n     * @param  string  $cache_id      cache id\n     * @param  string  $compile_id    compile id\n     * @param  integer $exp_time      expiration time (number of seconds, not timestamp)\n     *\n     * @return int number of cache files deleted\n     * @throws \\SmartyException\n     */\n    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)\n    {\n        $cache_name = null;\n\n        if (isset($resource_name)) {\n            $source = Smarty_Template_Source::load(null, $smarty, $resource_name);\n            if ($source->exists) {\n                $cache_name = $source->name;\n            } else {\n                return 0;\n            }\n        }\n\n        return $this->delete($cache_name, $cache_id, $compile_id, $exp_time);\n    }\n\n    /**\n     * Check is cache is locked for this template\n     *\n     * @param  Smarty                 $smarty Smarty object\n     * @param  Smarty_Template_Cached $cached cached object\n     *\n     * @return boolean               true or false if cache is locked\n     */\n    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $id = $cached->lock_id;\n        $name = $cached->source->name . '.lock';\n\n        $mtime = $this->fetchTimestamp($id, $name, $cached->cache_id, $cached->compile_id);\n        if ($mtime === null) {\n            $this->fetch($id, $name, $cached->cache_id, $cached->compile_id, $content, $mtime);\n        }\n        return $mtime && ($t = time()) - $mtime < $smarty->locking_timeout;\n    }\n\n    /**\n     * Lock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = true;\n        $id = $cached->lock_id;\n        $name = $cached->source->name . '.lock';\n        $this->save($id, $name, $cached->cache_id, $cached->compile_id, $smarty->locking_timeout, '');\n    }\n\n    /**\n     * Unlock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = false;\n        $name = $cached->source->name . '.lock';\n        $this->delete($name, $cached->cache_id, $cached->compile_id, null);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_cacheresource_keyvaluestore.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin\n *\n * @package    Smarty\n * @subpackage Cacher\n */\n\n/**\n * Smarty Cache Handler Base for Key/Value Storage Implementations\n * This class implements the functionality required to use simple key/value stores\n * for hierarchical cache groups. key/value stores like memcache or APC do not support\n * wildcards in keys, therefore a cache group cannot be cleared like \"a|*\" - which\n * is no problem to filesystem and RDBMS implementations.\n * This implementation is based on the concept of invalidation. While one specific cache\n * can be identified and cleared, any range of caches cannot be identified. For this reason\n * each level of the cache group hierarchy can have its own value in the store. These values\n * are nothing but microtimes, telling us when a particular cache group was cleared for the\n * last time. These keys are evaluated for every cache read to determine if the cache has\n * been invalidated since it was created and should hence be treated as inexistent.\n * Although deep hierarchies are possible, they are not recommended. Try to keep your\n * cache groups as shallow as possible. Anything up 3-5 parents should be ok. So\n * »a|b|c« is a good depth where »a|b|c|d|e|f|g|h|i|j|k« isn't. Try to join correlating\n * cache groups: if your cache groups look somewhat like »a|b|$page|$items|$whatever«\n * consider using »a|b|c|$page-$items-$whatever« instead.\n *\n * @package    Smarty\n * @subpackage Cacher\n * @author     Rodney Rehm\n */\nabstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource\n{\n    /**\n     * cache for contents\n     *\n     * @var array\n     */\n    protected $contents = array();\n\n    /**\n     * cache for timestamps\n     *\n     * @var array\n     */\n    protected $timestamps = array();\n\n    /**\n     * populate Cached Object with meta data from Resource\n     *\n     * @param  Smarty_Template_Cached   $cached    cached object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)\n    {\n        $cached->filepath = $_template->source->uid . '#' . $this->sanitize($cached->source->resource) . '#' .\n                            $this->sanitize($cached->cache_id) . '#' . $this->sanitize($cached->compile_id);\n\n        $this->populateTimestamp($cached);\n    }\n\n    /**\n     * populate Cached Object with timestamp and exists from Resource\n     *\n     * @param  Smarty_Template_Cached $cached cached object\n     *\n     * @return void\n     */\n    public function populateTimestamp(Smarty_Template_Cached $cached)\n    {\n        if (!$this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $content,\n                          $timestamp, $cached->source->uid)\n        ) {\n            return;\n        }\n        $cached->content = $content;\n        $cached->timestamp = (int) $timestamp;\n        $cached->exists = !!$cached->timestamp;\n    }\n\n    /**\n     * Read the cached template and process the header\n     *\n     * @param \\Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     * @param  Smarty_Template_Cached   $cached      cached object\n     * @param boolean                   $update      flag if called because cache update\n     *\n     * @return boolean                 true or false if the cached content does not exist\n     */\n    public function process(Smarty_Internal_Template $_smarty_tpl, Smarty_Template_Cached $cached = null,\n                            $update = false)\n    {\n        if (!$cached) {\n            $cached = $_smarty_tpl->cached;\n        }\n        $content = $cached->content ? $cached->content : null;\n        $timestamp = $cached->timestamp ? $cached->timestamp : null;\n        if ($content === null || !$timestamp) {\n            if (!$this->fetch($_smarty_tpl->cached->filepath, $_smarty_tpl->source->name, $_smarty_tpl->cache_id,\n                              $_smarty_tpl->compile_id, $content, $timestamp, $_smarty_tpl->source->uid)\n            ) {\n                return false;\n            }\n        }\n        if (isset($content)) {\n            eval('?>' . $content);\n\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Write the rendered template output to cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     * @param  string                   $content   content to cache\n     *\n     * @return boolean                  success\n     */\n    public function writeCachedContent(Smarty_Internal_Template $_template, $content)\n    {\n        $this->addMetaTimestamp($content);\n\n        return $this->write(array($_template->cached->filepath => $content), $_template->cache_lifetime);\n    }\n\n    /**\n     * Read cached template from cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return string|false  content\n     */\n    public function readCachedContent(Smarty_Internal_Template $_template)\n    {\n        $content = $_template->cached->content ? $_template->cached->content : null;\n        $timestamp = null;\n        if ($content === null) {\n            if (!$this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id,\n                              $_template->compile_id, $content, $timestamp, $_template->source->uid)\n            ) {\n                return false;\n            }\n        }\n        if (isset($content)) {\n            return $content;\n        }\n        return false;\n    }\n\n    /**\n     * Empty cache\n     * {@internal the $exp_time argument is ignored altogether }}\n     *\n     * @param  Smarty  $smarty   Smarty object\n     * @param  integer $exp_time expiration time [being ignored]\n     *\n     * @return integer number of cache files deleted [always -1]\n     * @uses purge() to clear the whole store\n     * @uses invalidate() to mark everything outdated if purge() is inapplicable\n     */\n    public function clearAll(Smarty $smarty, $exp_time = null)\n    {\n        if (!$this->purge()) {\n            $this->invalidate(null);\n        }\n        return - 1;\n    }\n\n    /**\n     * Empty cache for a specific template\n     * {@internal the $exp_time argument is ignored altogether}}\n     *\n     * @param  Smarty  $smarty        Smarty object\n     * @param  string  $resource_name template name\n     * @param  string  $cache_id      cache id\n     * @param  string  $compile_id    compile id\n     * @param  integer $exp_time      expiration time [being ignored]\n     *\n     * @return int number of cache files deleted [always -1]\n     * @throws \\SmartyException\n     * @uses buildCachedFilepath() to generate the CacheID\n     * @uses invalidate() to mark CacheIDs parent chain as outdated\n     * @uses delete() to remove CacheID from cache\n     */\n    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)\n    {\n        $uid = $this->getTemplateUid($smarty, $resource_name);\n        $cid = $uid . '#' . $this->sanitize($resource_name) . '#' . $this->sanitize($cache_id) . '#' .\n               $this->sanitize($compile_id);\n        $this->delete(array($cid));\n        $this->invalidate($cid, $resource_name, $cache_id, $compile_id, $uid);\n        return - 1;\n    }\n\n    /**\n     * Get template's unique ID\n     *\n     * @param  Smarty $smarty        Smarty object\n     * @param  string $resource_name template name\n     *\n     * @return string filepath of cache file\n     * @throws \\SmartyException\n     *\n     */\n    protected function getTemplateUid(Smarty $smarty, $resource_name)\n    {\n        if (isset($resource_name)) {\n            $source = Smarty_Template_Source::load(null, $smarty, $resource_name);\n            if ($source->exists) {\n                return $source->uid;\n            }\n        }\n        return '';\n    }\n\n    /**\n     * Sanitize CacheID components\n     *\n     * @param  string $string CacheID component to sanitize\n     *\n     * @return string sanitized CacheID component\n     */\n    protected function sanitize($string)\n    {\n        $string = trim($string, '|');\n        if (!$string) {\n            return '';\n        }\n        return preg_replace('#[^\\w\\|]+#S', '_', $string);\n    }\n\n    /**\n     * Fetch and prepare a cache object.\n     *\n     * @param  string  $cid           CacheID to fetch\n     * @param  string  $resource_name template name\n     * @param  string  $cache_id      cache id\n     * @param  string  $compile_id    compile id\n     * @param  string  $content       cached content\n     * @param  integer &$timestamp    cached timestamp (epoch)\n     * @param  string  $resource_uid  resource's uid\n     *\n     * @return boolean success\n     */\n    protected function fetch($cid, $resource_name = null, $cache_id = null, $compile_id = null, &$content = null,\n                             &$timestamp = null, $resource_uid = null)\n    {\n        $t = $this->read(array($cid));\n        $content = !empty($t[ $cid ]) ? $t[ $cid ] : null;\n        $timestamp = null;\n\n        if ($content && ($timestamp = $this->getMetaTimestamp($content))) {\n            $invalidated =\n                $this->getLatestInvalidationTimestamp($cid, $resource_name, $cache_id, $compile_id, $resource_uid);\n            if ($invalidated > $timestamp) {\n                $timestamp = null;\n                $content = null;\n            }\n        }\n\n        return !!$content;\n    }\n\n    /**\n     * Add current microtime to the beginning of $cache_content\n     * {@internal the header uses 8 Bytes, the first 4 Bytes are the seconds, the second 4 Bytes are the microseconds}}\n     *\n     * @param string &$content the content to be cached\n     */\n    protected function addMetaTimestamp(&$content)\n    {\n        $mt = explode(' ', microtime());\n        $ts = pack('NN', $mt[ 1 ], (int) ($mt[ 0 ] * 100000000));\n        $content = $ts . $content;\n    }\n\n    /**\n     * Extract the timestamp the $content was cached\n     *\n     * @param  string &$content the cached content\n     *\n     * @return float  the microtime the content was cached\n     */\n    protected function getMetaTimestamp(&$content)\n    {\n        extract(unpack('N1s/N1m/a*content', $content));\n        /**\n         * @var  int $s\n         * @var  int $m\n         */\n        return $s + ($m / 100000000);\n    }\n\n    /**\n     * Invalidate CacheID\n     *\n     * @param  string $cid           CacheID\n     * @param  string $resource_name template name\n     * @param  string $cache_id      cache id\n     * @param  string $compile_id    compile id\n     * @param  string $resource_uid  source's uid\n     *\n     * @return void\n     */\n    protected function invalidate($cid = null, $resource_name = null, $cache_id = null, $compile_id = null,\n                                  $resource_uid = null)\n    {\n        $now = microtime(true);\n        $key = null;\n        // invalidate everything\n        if (!$resource_name && !$cache_id && !$compile_id) {\n            $key = 'IVK#ALL';\n        } // invalidate all caches by template\n        else {\n            if ($resource_name && !$cache_id && !$compile_id) {\n                $key = 'IVK#TEMPLATE#' . $resource_uid . '#' . $this->sanitize($resource_name);\n            } // invalidate all caches by cache group\n            else {\n                if (!$resource_name && $cache_id && !$compile_id) {\n                    $key = 'IVK#CACHE#' . $this->sanitize($cache_id);\n                } // invalidate all caches by compile id\n                else {\n                    if (!$resource_name && !$cache_id && $compile_id) {\n                        $key = 'IVK#COMPILE#' . $this->sanitize($compile_id);\n                    } // invalidate by combination\n                    else {\n                        $key = 'IVK#CID#' . $cid;\n                    }\n                }\n            }\n        }\n        $this->write(array($key => $now));\n    }\n\n    /**\n     * Determine the latest timestamp known to the invalidation chain\n     *\n     * @param  string $cid           CacheID to determine latest invalidation timestamp of\n     * @param  string $resource_name template name\n     * @param  string $cache_id      cache id\n     * @param  string $compile_id    compile id\n     * @param  string $resource_uid  source's filepath\n     *\n     * @return float  the microtime the CacheID was invalidated\n     */\n    protected function getLatestInvalidationTimestamp($cid, $resource_name = null, $cache_id = null, $compile_id = null,\n                                                      $resource_uid = null)\n    {\n        // abort if there is no CacheID\n        if (false && !$cid) {\n            return 0;\n        }\n        // abort if there are no InvalidationKeys to check\n        if (!($_cid = $this->listInvalidationKeys($cid, $resource_name, $cache_id, $compile_id, $resource_uid))) {\n            return 0;\n        }\n\n        // there are no InValidationKeys\n        if (!($values = $this->read($_cid))) {\n            return 0;\n        }\n        // make sure we're dealing with floats\n        $values = array_map('floatval', $values);\n\n        return max($values);\n    }\n\n    /**\n     * Translate a CacheID into the list of applicable InvalidationKeys.\n     * Splits 'some|chain|into|an|array' into array( '#clearAll#', 'some', 'some|chain', 'some|chain|into', ... )\n     *\n     * @param  string $cid           CacheID to translate\n     * @param  string $resource_name template name\n     * @param  string $cache_id      cache id\n     * @param  string $compile_id    compile id\n     * @param  string $resource_uid  source's filepath\n     *\n     * @return array  list of InvalidationKeys\n     * @uses $invalidationKeyPrefix to prepend to each InvalidationKey\n     */\n    protected function listInvalidationKeys($cid, $resource_name = null, $cache_id = null, $compile_id = null,\n                                            $resource_uid = null)\n    {\n        $t = array('IVK#ALL');\n        $_name = $_compile = '#';\n        if ($resource_name) {\n            $_name .= $resource_uid . '#' . $this->sanitize($resource_name);\n            $t[] = 'IVK#TEMPLATE' . $_name;\n        }\n        if ($compile_id) {\n            $_compile .= $this->sanitize($compile_id);\n            $t[] = 'IVK#COMPILE' . $_compile;\n        }\n        $_name .= '#';\n        $cid = trim($cache_id, '|');\n        if (!$cid) {\n            return $t;\n        }\n        $i = 0;\n        while (true) {\n            // determine next delimiter position\n            $i = strpos($cid, '|', $i);\n            // add complete CacheID if there are no more delimiters\n            if ($i === false) {\n                $t[] = 'IVK#CACHE#' . $cid;\n                $t[] = 'IVK#CID' . $_name . $cid . $_compile;\n                $t[] = 'IVK#CID' . $_name . $_compile;\n                break;\n            }\n            $part = substr($cid, 0, $i);\n            // add slice to list\n            $t[] = 'IVK#CACHE#' . $part;\n            $t[] = 'IVK#CID' . $_name . $part . $_compile;\n            // skip past delimiter position\n            $i ++;\n        }\n\n        return $t;\n    }\n\n    /**\n     * Check is cache is locked for this template\n     *\n     * @param  Smarty                 $smarty Smarty object\n     * @param  Smarty_Template_Cached $cached cached object\n     *\n     * @return boolean               true or false if cache is locked\n     */\n    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $key = 'LOCK#' . $cached->filepath;\n        $data = $this->read(array($key));\n\n        return $data && time() - $data[ $key ] < $smarty->locking_timeout;\n    }\n\n    /**\n     * Lock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = true;\n        $key = 'LOCK#' . $cached->filepath;\n        $this->write(array($key => time()), $smarty->locking_timeout);\n    }\n\n    /**\n     * Unlock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = false;\n        $key = 'LOCK#' . $cached->filepath;\n        $this->delete(array($key));\n    }\n\n    /**\n     * Read values for a set of keys from cache\n     *\n     * @param  array $keys list of keys to fetch\n     *\n     * @return array list of values with the given keys used as indexes\n     */\n    abstract protected function read(array $keys);\n\n    /**\n     * Save values for a set of keys to cache\n     *\n     * @param  array $keys   list of values to save\n     * @param  int   $expire expiration time\n     *\n     * @return boolean true on success, false on failure\n     */\n    abstract protected function write(array $keys, $expire = null);\n\n    /**\n     * Remove values from cache\n     *\n     * @param  array $keys list of keys to delete\n     *\n     * @return boolean true on success, false on failure\n     */\n    abstract protected function delete(array $keys);\n\n    /**\n     * Remove *all* values from cache\n     *\n     * @return boolean true on success, false on failure\n     */\n    protected function purge()\n    {\n        return false;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_data.php",
    "content": "<?php\n/**\n * Smarty Plugin Data\n * This file contains the data object\n *\n * @package    Smarty\n * @subpackage Template\n * @author     Uwe Tews\n */\n\n/**\n * class for the Smarty data object\n * The Smarty data object will hold Smarty variables in the current scope\n *\n * @package    Smarty\n * @subpackage Template\n */\nclass Smarty_Data extends Smarty_Internal_Data\n{\n    /**\n     * Counter\n     *\n     * @var int\n     */\n    static $count = 0;\n\n    /**\n     * Data block name\n     *\n     * @var string\n     */\n    public $dataObjectName = '';\n\n    /**\n     * Smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n\n    /**\n     * create Smarty data object\n     *\n     * @param Smarty|array                    $_parent parent template\n     * @param Smarty|Smarty_Internal_Template $smarty  global smarty instance\n     * @param string                          $name    optional data block name\n     *\n     * @throws SmartyException\n     */\n    public function __construct($_parent = null, $smarty = null, $name = null)\n    {\n        parent::__construct();\n        self::$count ++;\n        $this->dataObjectName = 'Data_object ' . (isset($name) ? \"'{$name}'\" : self::$count);\n        $this->smarty = $smarty;\n        if (is_object($_parent)) {\n            // when object set up back pointer\n            $this->parent = $_parent;\n        } elseif (is_array($_parent)) {\n            // set up variable values\n            foreach ($_parent as $_key => $_val) {\n                $this->tpl_vars[ $_key ] = new Smarty_Variable($_val);\n            }\n        } elseif ($_parent !== null) {\n            throw new SmartyException('Wrong type for template variables');\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_block.php",
    "content": "<?php\n\n/**\n * Smarty {block} tag class\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Block\n{\n    /**\n     * Block name\n     *\n     * @var string\n     */\n    public $name = '';\n\n    /**\n     * Hide attribute\n     *\n     * @var bool\n     */\n    public $hide = false;\n\n    /**\n     * Append attribute\n     *\n     * @var bool\n     */\n    public $append = false;\n\n    /**\n     * prepend attribute\n     *\n     * @var bool\n     */\n    public $prepend = false;\n\n    /**\n     * Block calls $smarty.block.child\n     *\n     * @var bool\n     */\n    public $callsChild = false;\n\n    /**\n     * Inheritance child block\n     *\n     * @var Smarty_Internal_Block|null\n     */\n    public $child = null;\n\n    /**\n     * Inheritance calling parent block\n     *\n     * @var Smarty_Internal_Block|null\n     */\n    public $parent = null;\n\n    /**\n     * Inheritance Template index\n     *\n     * @var int\n     */\n    public $tplIndex = 0;\n\n    /**\n     * Smarty_Internal_Block constructor.\n     * - if outer level {block} of child template ($state === 1) save it as child root block\n     * - otherwise process inheritance and render\n     *\n     * @param string   $name     block name\n     * @param int|null $tplIndex index of outer level {block} if nested\n     */\n    public function __construct($name, $tplIndex)\n    {\n        $this->name = $name;\n        $this->tplIndex = $tplIndex;\n    }\n\n    /**\n     * Compiled block code overloaded by {block} class\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     */\n    public function callBlock(Smarty_Internal_Template $tpl)\n    {\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_cacheresource_file.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin CacheResource File\n *\n * @package    Smarty\n * @subpackage Cacher\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n/**\n * This class does contain all necessary methods for the HTML cache on file system\n * Implements the file system as resource for the HTML cache Version ussing nocache inserts.\n *\n * @package    Smarty\n * @subpackage Cacher\n */\nclass Smarty_Internal_CacheResource_File extends Smarty_CacheResource\n{\n    /**\n     * populate Cached Object with meta data from Resource\n     *\n     * @param Smarty_Template_Cached   $cached    cached object\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)\n    {\n        $source = &$_template->source;\n        $smarty = &$_template->smarty;\n        $_compile_dir_sep = $smarty->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';\n        $_filepath = sha1($source->uid . $smarty->_joined_template_dir);\n        $cached->filepath = $smarty->getCacheDir();\n        if (isset($_template->cache_id)) {\n            $cached->filepath .= preg_replace(array('![^\\w|]+!',\n                                                    '![|]+!'),\n                                              array('_',\n                                                    $_compile_dir_sep),\n                                              $_template->cache_id) . $_compile_dir_sep;\n        }\n        if (isset($_template->compile_id)) {\n            $cached->filepath .= preg_replace('![^\\w]+!', '_', $_template->compile_id) . $_compile_dir_sep;\n        }\n        // if use_sub_dirs, break file into directories\n        if ($smarty->use_sub_dirs) {\n            $cached->filepath .= $_filepath[ 0 ] . $_filepath[ 1 ] . DIRECTORY_SEPARATOR . $_filepath[ 2 ] .\n                                 $_filepath[ 3 ] .\n                                 DIRECTORY_SEPARATOR .\n                                 $_filepath[ 4 ] . $_filepath[ 5 ] . DIRECTORY_SEPARATOR;\n        }\n        $cached->filepath .= $_filepath;\n        $basename = $source->handler->getBasename($source);\n        if (!empty($basename)) {\n            $cached->filepath .= '.' . $basename;\n        }\n        if ($smarty->cache_locking) {\n            $cached->lock_id = $cached->filepath . '.lock';\n        }\n        $cached->filepath .= '.php';\n        $cached->timestamp = $cached->exists = is_file($cached->filepath);\n        if ($cached->exists) {\n            $cached->timestamp = filemtime($cached->filepath);\n        }\n    }\n\n    /**\n     * populate Cached Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return void\n     */\n    public function populateTimestamp(Smarty_Template_Cached $cached)\n    {\n        $cached->timestamp = $cached->exists = is_file($cached->filepath);\n        if ($cached->exists) {\n            $cached->timestamp = filemtime($cached->filepath);\n        }\n    }\n\n    /**\n     * Read the cached template and process its header\n     *\n     * @param \\Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     * @param Smarty_Template_Cached    $cached      cached object\n     * @param bool                      $update      flag if called because cache update\n     *\n     * @return boolean true or false if the cached content does not exist\n     */\n    public function process(Smarty_Internal_Template $_smarty_tpl,\n                            Smarty_Template_Cached $cached = null,\n                            $update = false)\n    {\n        $_smarty_tpl->cached->valid = false;\n        if ($update && defined('HHVM_VERSION')) {\n            eval('?>' . file_get_contents($_smarty_tpl->cached->filepath));\n            return true;\n        } else {\n            return @include $_smarty_tpl->cached->filepath;\n        }\n    }\n\n    /**\n     * Write the rendered template output to cache\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param string                   $content   content to cache\n     *\n     * @return bool success\n     * @throws \\SmartyException\n     */\n    public function writeCachedContent(Smarty_Internal_Template $_template, $content)\n    {\n        if ($_template->smarty->ext->_writeFile->writeFile($_template->cached->filepath,\n                                                           $content,\n                                                           $_template->smarty) === true\n        ) {\n            if (function_exists('opcache_invalidate') &&\n                (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api'))) < 1\n            ) {\n                opcache_invalidate($_template->cached->filepath, true);\n            } else if (function_exists('apc_compile_file')) {\n                apc_compile_file($_template->cached->filepath);\n            }\n            $cached = $_template->cached;\n            $cached->timestamp = $cached->exists = is_file($cached->filepath);\n            if ($cached->exists) {\n                $cached->timestamp = filemtime($cached->filepath);\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Read cached template from cache\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return string  content\n     */\n    public function readCachedContent(Smarty_Internal_Template $_template)\n    {\n        if (is_file($_template->cached->filepath)) {\n            return file_get_contents($_template->cached->filepath);\n        }\n        return false;\n    }\n\n    /**\n     * Empty cache\n     *\n     * @param Smarty  $smarty\n     * @param integer $exp_time expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    public function clearAll(Smarty $smarty, $exp_time = null)\n    {\n        return $smarty->ext->_cacheResourceFile->clear($smarty, null, null, null, $exp_time);\n    }\n\n    /**\n     * Empty cache for a specific template\n     *\n     * @param Smarty  $smarty\n     * @param string  $resource_name template name\n     * @param string  $cache_id      cache id\n     * @param string  $compile_id    compile id\n     * @param integer $exp_time      expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)\n    {\n        return $smarty->ext->_cacheResourceFile->clear($smarty, $resource_name, $cache_id, $compile_id, $exp_time);\n    }\n\n    /**\n     * Check is cache is locked for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return boolean true or false if cache is locked\n     */\n    public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {\n            clearstatcache(true, $cached->lock_id);\n        } else {\n            clearstatcache();\n        }\n        if (is_file($cached->lock_id)) {\n            $t = filemtime($cached->lock_id);\n            return $t && (time() - $t < $smarty->locking_timeout);\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * Lock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = true;\n        touch($cached->lock_id);\n    }\n\n    /**\n     * Unlock cache for this template\n     *\n     * @param Smarty                 $smarty Smarty object\n     * @param Smarty_Template_Cached $cached cached object\n     *\n     * @return bool|void\n     */\n    public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)\n    {\n        $cached->is_locked = false;\n        @unlink($cached->lock_id);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_append.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Append\n * Compiles the {append} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Append Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Append extends Smarty_Internal_Compile_Assign\n{\n    /**\n     * Compiles code for the {append} tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // the following must be assigned at runtime because it will be overwritten in parent class\n        $this->required_attributes = array('var', 'value');\n        $this->shorttag_order = array('var', 'value');\n        $this->optional_attributes = array('scope', 'index');\n        $this->mapCache = array();\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        // map to compile assign attributes\n        if (isset($_attr[ 'index' ])) {\n            $_params[ 'smarty_internal_index' ] = '[' . $_attr[ 'index' ] . ']';\n            unset($_attr[ 'index' ]);\n        } else {\n            $_params[ 'smarty_internal_index' ] = '[]';\n        }\n        $_new_attr = array();\n        foreach ($_attr as $key => $value) {\n            $_new_attr[] = array($key => $value);\n        }\n        // call compile assign\n        return parent::compile($_new_attr, $compiler, $_params);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_assign.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Assign\n * Compiles the {assign} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Assign Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array('nocache', 'noscope');\n\n   /**\n     * Valid scope names\n     *\n     * @var array\n     */\n    public $valid_scopes = array('local' => Smarty::SCOPE_LOCAL, 'parent' => Smarty::SCOPE_PARENT,\n                                 'root' => Smarty::SCOPE_ROOT, 'global' => Smarty::SCOPE_GLOBAL,\n                                 'tpl_root' => Smarty::SCOPE_TPL_ROOT, 'smarty' => Smarty::SCOPE_SMARTY);\n\n    /**\n     * Compiles code for the {assign} tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // the following must be assigned at runtime because it will be overwritten in Smarty_Internal_Compile_Append\n        $this->required_attributes = array('var', 'value');\n        $this->shorttag_order = array('var', 'value');\n        $this->optional_attributes = array('scope');\n        $this->mapCache = array();\n        $_nocache = false;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        // nocache ?\n        if ($_var = $compiler->getId($_attr[ 'var' ])) {\n            $_var = \"'{$_var}'\";\n        } else {\n            $_var = $_attr[ 'var' ];\n        }\n        if ($compiler->tag_nocache || $compiler->nocache) {\n            $_nocache = true;\n            // create nocache var to make it know for further compiling\n            $compiler->setNocacheInVariable($_attr[ 'var' ]);\n        }\n        // scope setup\n        if ($_attr[ 'noscope' ]) {\n            $_scope = - 1;\n        } else {\n            $_scope = $compiler->convertScope($_attr, $this->valid_scopes);\n        }\n        // optional parameter\n        $_params = '';\n        if ($_nocache || $_scope) {\n            $_params .= ' ,' . var_export($_nocache, true);\n        }\n        if ($_scope) {\n            $_params .= ' ,' . $_scope;\n        }\n        if (isset($parameter[ 'smarty_internal_index' ])) {\n            $output =\n                \"<?php \\$_tmp_array = isset(\\$_smarty_tpl->tpl_vars[{$_var}]) ? \\$_smarty_tpl->tpl_vars[{$_var}]->value : array();\\n\";\n            $output .= \"if (!is_array(\\$_tmp_array) || \\$_tmp_array instanceof ArrayAccess) {\\n\";\n            $output .= \"settype(\\$_tmp_array, 'array');\\n\";\n            $output .= \"}\\n\";\n            $output .= \"\\$_tmp_array{$parameter['smarty_internal_index']} = {$_attr['value']};\\n\";\n            $output .= \"\\$_smarty_tpl->_assignInScope({$_var}, \\$_tmp_array{$_params});?>\";\n        } else {\n            $output = \"<?php \\$_smarty_tpl->_assignInScope({$_var}, {$_attr['value']}{$_params});?>\";\n        }\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_block.php",
    "content": "<?php\n/*\n * This file is part of Smarty.\n *\n * (c) 2015 Uwe Tews\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Smarty Internal Plugin Compile Block Class\n *\n * @author Uwe Tews <uwe.tews@googlemail.com>\n */\nclass Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inheritance\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('name');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array('hide', 'nocache');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('assign');\n\n    /**\n     * Compiles code for the {block} tag\n     *\n     * @param  array                                 $args      array with attributes from parser\n     * @param  \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                 $parameter array with compilation parameter\n     *\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        if (!isset($compiler->_cache[ 'blockNesting' ])) {\n            $compiler->_cache[ 'blockNesting' ] = 0;\n        }\n        if ($compiler->_cache[ 'blockNesting' ] === 0) {\n            // make sure that inheritance gets initialized in template code\n            $this->registerInit($compiler);\n            $this->option_flags = array('hide', 'nocache', 'append', 'prepend');\n        } else {\n            $this->option_flags = array('hide', 'nocache');\n        }\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        ++$compiler->_cache[ 'blockNesting' ];\n        $_className = 'Block_' . preg_replace('![^\\w]+!', '_', uniqid(rand(), true));\n        $compiler->_cache[ 'blockName' ][ $compiler->_cache[ 'blockNesting' ] ] = $_attr[ 'name' ];\n        $compiler->_cache[ 'blockClass' ][ $compiler->_cache[ 'blockNesting' ] ] = $_className;\n        $compiler->_cache[ 'blockParams' ][ $compiler->_cache[ 'blockNesting' ] ] = array();\n        $compiler->_cache[ 'blockParams' ][ 1 ][ 'subBlocks' ][ trim($_attr[ 'name' ], '\"\\'') ][] = $_className;\n        $this->openTag($compiler,\n                       'block',\n                       array($_attr, $compiler->nocache, $compiler->parser->current_buffer,\n                             $compiler->template->compiled->has_nocache_code,\n                             $compiler->template->caching));\n        $compiler->saveRequiredPlugins(true);\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template();\n        $compiler->template->compiled->has_nocache_code = false;\n        $compiler->suppressNocacheProcessing = true;\n    }\n}\n/**\n * Smarty Internal Plugin Compile BlockClose Class\n *\n */\nclass Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_Inheritance\n{\n    /**\n     * Compiles code for the {/block} tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return bool true\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        list($_attr, $_nocache, $_buffer, $_has_nocache_code, $_caching) = $this->closeTag($compiler, array('block'));\n        // init block parameter\n        $_block = $compiler->_cache[ 'blockParams' ][ $compiler->_cache[ 'blockNesting' ] ];\n        unset($compiler->_cache[ 'blockParams' ][ $compiler->_cache[ 'blockNesting' ] ]);\n        $_name = $_attr[ 'name' ];\n        $_assign = isset($_attr[ 'assign' ]) ? $_attr[ 'assign' ] : null;\n        unset($_attr[ 'assign' ], $_attr[ 'name' ]);\n        foreach ($_attr as $name => $stat) {\n            if ((is_bool($stat) && $stat !== false) || (!is_bool($stat) && $stat !== 'false')) {\n                $_block[ $name ] = 'true';\n            }\n        }\n        $_className = $compiler->_cache[ 'blockClass' ][ $compiler->_cache[ 'blockNesting' ] ];\n        // get compiled block code\n        $_functionCode = $compiler->parser->current_buffer;\n        // setup buffer for template function code\n        $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template();\n\n        $output = \"<?php\\n\";\n        $output .= \"/* {block {$_name}} */\\n\";\n        $output .= \"class {$_className} extends Smarty_Internal_Block\\n\";\n        $output .= \"{\\n\";\n        foreach ($_block as $property => $value) {\n            $output .= \"public \\${$property} = \" . var_export($value,true) .\";\\n\";\n        }\n        $output .= \"public function callBlock(Smarty_Internal_Template \\$_smarty_tpl) {\\n\";\n        $output .= $compiler->compileRequiredPlugins();\n        $compiler->restoreRequiredPlugins();\n        if ($compiler->template->compiled->has_nocache_code) {\n            $output .= \"\\$_smarty_tpl->cached->hashes['{$compiler->template->compiled->nocache_hash}'] = true;\\n\";\n        }\n        if (isset($_assign)) {\n            $output .= \"ob_start();\\n\";\n        }\n        $output .= \"?>\\n\";\n        $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                          new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                            $output));\n        $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode);\n        $output = \"<?php\\n\";\n        if (isset($_assign)) {\n            $output .= \"\\$_smarty_tpl->assign({$_assign}, ob_get_clean());\\n\";\n        }\n        $output .= \"}\\n\";\n        $output .= \"}\\n\";\n        $output .= \"/* {/block {$_name}} */\\n\\n\";\n        $output .= \"?>\\n\";\n        $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                          new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                            $output));\n        $compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser);\n        $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template();\n        // restore old status\n        $compiler->template->compiled->has_nocache_code = $_has_nocache_code;\n        $compiler->tag_nocache = $compiler->nocache;\n        $compiler->nocache = $_nocache;\n        $compiler->parser->current_buffer = $_buffer;\n        $output = \"<?php \\n\";\n        if ($compiler->_cache[ 'blockNesting' ] === 1) {\n            $output .= \"\\$_smarty_tpl->inheritance->instanceBlock(\\$_smarty_tpl, '$_className', $_name);\\n\";\n        } else {\n            $output .= \"\\$_smarty_tpl->inheritance->instanceBlock(\\$_smarty_tpl, '$_className', $_name, \\$this->tplIndex);\\n\";\n        }\n        $output .= \"?>\\n\";\n        --$compiler->_cache[ 'blockNesting' ];\n        if ($compiler->_cache[ 'blockNesting' ] === 0) {\n            unset($compiler->_cache[ 'blockNesting' ]);\n        }\n        $compiler->has_code = true;\n        $compiler->suppressNocacheProcessing = true;\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_block_child.php",
    "content": "<?php\n/*\n * This file is part of Smarty.\n *\n * (c) 2015 Uwe Tews\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Smarty Internal Plugin Compile Block Child Class\n *\n * @author Uwe Tews <uwe.tews@googlemail.com>\n */\nclass Smarty_Internal_Compile_Block_Child extends Smarty_Internal_Compile_Child\n{\n    /**\n     * Tag name\n     *\n     * @var string\n     */\n    public $tag = 'block_child';\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_block_parent.php",
    "content": "<?php\n/*\n * This file is part of Smarty.\n *\n * (c) 2015 Uwe Tews\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Smarty Internal Plugin Compile Block Parent Class\n *\n * @author Uwe Tews <uwe.tews@googlemail.com>\n */\nclass Smarty_Internal_Compile_Block_Parent extends Smarty_Internal_Compile_Child\n{\n    /**\n     * Tag name\n     *\n     * @var string\n     */\n    public $tag = 'block_parent';\n\n    /**\n     * Block type\n     *\n     * @var string\n     */\n    public $blockType = 'Parent';\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_break.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Break\n * Compiles the {break} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Break Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('levels');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('levels');\n\n    /**\n    * Tag name may be overloaded by Smarty_Internal_Compile_Continue\n    *\n    * @var string\n    */\n    public $tag = 'break';\n\n    /**\n     * Compiles code for the {break} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        list($levels, $foreachLevels) = $this->checkLevels($args, $compiler);\n        $output = \"<?php \";\n        if ($foreachLevels > 0 && $this->tag === 'continue') {\n            $foreachLevels--;\n        }\n        if ($foreachLevels > 0) {\n            /* @var Smarty_Internal_Compile_Foreach $foreachCompiler */\n            $foreachCompiler = $compiler->getTagCompiler('foreach');\n            $output .= $foreachCompiler->compileRestore($foreachLevels);\n        }\n        $output .= \"{$this->tag} {$levels};?>\";\n        return $output;\n    }\n\n    /**\n     * check attributes and return array of break and foreach levels\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return array\n     * @throws \\SmartyCompilerException\n     */\n    public function checkLevels($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        static $_is_loopy = array('for' => true, 'foreach' => true, 'while' => true, 'section' => true);\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        if ($_attr[ 'nocache' ] === true) {\n            $compiler->trigger_template_error('nocache option not allowed', null, true);\n        }\n\n        if (isset($_attr[ 'levels' ])) {\n            if (!is_numeric($_attr[ 'levels' ])) {\n                $compiler->trigger_template_error('level attribute must be a numeric constant', null, true);\n            }\n            $levels = $_attr[ 'levels' ];\n        } else {\n            $levels = 1;\n        }\n        $level_count = $levels;\n        $stack_count = count($compiler->_tag_stack) - 1;\n        $foreachLevels = 0;\n        $lastTag = '';\n        while ($level_count > 0 && $stack_count >= 0) {\n            if (isset($_is_loopy[ $compiler->_tag_stack[ $stack_count ][ 0 ] ])) {\n                $lastTag = $compiler->_tag_stack[ $stack_count ][ 0 ];\n                if ($level_count === 0) {\n                    break;\n                }\n                $level_count --;\n                if ($compiler->_tag_stack[ $stack_count ][ 0 ] === 'foreach') {\n                    $foreachLevels ++;\n                }\n            }\n            $stack_count --;\n        }\n        if ($level_count !== 0) {\n            $compiler->trigger_template_error(\"cannot {$this->tag} {$levels} level(s)\", null, true);\n        }\n        if ($lastTag === 'foreach' && $this->tag === 'break' && $foreachLevels > 0) {\n            $foreachLevels --;\n        }\n        return array($levels, $foreachLevels);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_call.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Function_Call\n * Compiles the calls of user defined tags defined by {function}\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Function_Call Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles the calls of user defined tags defined by {function}\n     *\n     * @param  array  $args     array with attributes from parser\n     * @param  object $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        // save possible attributes\n        if (isset($_attr[ 'assign' ])) {\n            // output will be stored in a smarty variable instead of being displayed\n            $_assign = $_attr[ 'assign' ];\n        }\n        //$_name = trim($_attr['name'], \"''\");\n        $_name = $_attr[ 'name' ];\n        unset($_attr[ 'name' ], $_attr[ 'assign' ], $_attr[ 'nocache' ]);\n        // set flag (compiled code of {function} must be included in cache file\n        if (!$compiler->template->caching || $compiler->nocache || $compiler->tag_nocache) {\n            $_nocache = 'true';\n        } else {\n            $_nocache = 'false';\n        }\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        $_params = 'array(' . implode(',', $_paramsArray) . ')';\n        //$compiler->suppressNocacheProcessing = true;\n        // was there an assign attribute\n        if (isset($_assign)) {\n            $_output =\n                \"<?php ob_start();\\n\\$_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction(\\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});\\n\\$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\\n\";\n        } else {\n            $_output =\n                \"<?php \\$_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction(\\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});?>\\n\";\n        }\n        return $_output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_capture.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Capture\n * Compiles the {capture} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Capture Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('name', 'assign', 'append');\n\n    /**\n     * Compiles code for the {$smarty.capture.xxx}\n     *\n     * @param  array                            $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase$compiler  compiler object\n     * @param  array                            $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter = null)\n    {\n        $tag = trim($parameter[ 0 ], '\"\\'');\n        $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : null;\n        if (!$name) {\n            //$compiler->trigger_template_error(\"missing or illegal \\$smarty.{$tag} name attribute\", null, true);\n        }\n        return '$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl'.(isset($name)?\", '{$name}')\":')');\n    }\n\n    /**\n     * Compiles code for the {capture} tag\n     *\n     * @param  array                            $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     * @param null                              $parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter = null)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args, $parameter, 'capture');\n\n        $buffer = isset($_attr[ 'name' ]) ? $_attr[ 'name' ] : \"'default'\";\n        $assign = isset($_attr[ 'assign' ]) ? $_attr[ 'assign' ] : 'null';\n        $append = isset($_attr[ 'append' ]) ? $_attr[ 'append' ] : 'null';\n\n        $compiler->_cache[ 'capture_stack' ][] = array($compiler->nocache);\n        // maybe nocache because of nocache variables\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        $_output = \"<?php \\$_smarty_tpl->smarty->ext->_capture->open(\\$_smarty_tpl, $buffer, $assign, $append);?>\";\n\n        return $_output;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Captureclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/capture} tag\n     *\n     * @param  array                            $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     * @param null                              $parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args, $parameter, '/capture');\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n\n        list($compiler->nocache) = array_pop($compiler->_cache[ 'capture_stack' ]);\n\n        return \"<?php \\$_smarty_tpl->smarty->ext->_capture->close(\\$_smarty_tpl);?>\";\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_child.php",
    "content": "<?php\n/*\n * This file is part of Smarty.\n *\n * (c) 2015 Uwe Tews\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Smarty Internal Plugin Compile Child Class\n *\n * @author Uwe Tews <uwe.tews@googlemail.com>\n */\nclass Smarty_Internal_Compile_Child extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('assign');\n\n    /**\n     * Tag name\n     *\n     * @var string\n     */\n    public $tag = 'child';\n\n    /**\n     * Block type\n     *\n     * @var string\n     */\n    public $blockType = 'Child';\n\n    /**\n     * Compiles code for the {child} tag\n     *\n     * @param  array                                 $args      array with attributes from parser\n     * @param  \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                 $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $tag = isset($parameter[0]) ? \"'{$parameter[0]}'\" : \"'{{$this->tag}}'\";\n        if (!isset($compiler->_cache[ 'blockNesting' ])) {\n            $compiler->trigger_template_error(\"{$tag} used outside {block} tags \",\n                                              $compiler->parser->lex->taglineno);\n        }\n        $compiler->has_code = true;\n        $compiler->suppressNocacheProcessing = true;\n        if ($this->blockType === 'Child') {\n            $compiler->_cache[ 'blockParams' ][ $compiler->_cache[ 'blockNesting' ] ][ 'callsChild' ] = 'true';\n        }\n        $_assign = isset($_attr[ 'assign' ]) ? $_attr[ 'assign' ] : null;\n        $output = \"<?php \\n\";\n        if (isset($_assign)) {\n            $output .= \"ob_start();\\n\";\n        }\n        $output .= '$_smarty_tpl->inheritance->call' . $this->blockType . '($_smarty_tpl, $this' .\n                   ($this->blockType === 'Child' ? '' : \", {$tag}\"). \");\\n\";\n        if (isset($_assign)) {\n            $output .= \"\\$_smarty_tpl->assign({$_assign}, ob_get_clean());\\n\";\n        }\n        $output .=\"?>\\n\";\n        return $output;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_config_load.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Config Load\n * Compiles the {config load} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Config Load Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('file');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('file', 'section');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('section', 'scope');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array('nocache', 'noscope');\n\n    /**\n     * Valid scope names\n     *\n     * @var array\n     */\n    public $valid_scopes = array('local' => Smarty::SCOPE_LOCAL, 'parent' => Smarty::SCOPE_PARENT,\n                                 'root' => Smarty::SCOPE_ROOT, 'tpl_root' => Smarty::SCOPE_TPL_ROOT,\n                                 'smarty' => Smarty::SCOPE_SMARTY, 'global' => Smarty::SCOPE_SMARTY);\n\n    /**\n     * Compiles code for the {config_load} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        if ($_attr[ 'nocache' ] === true) {\n            $compiler->trigger_template_error('nocache option not allowed', null, true);\n        }\n\n        // save possible attributes\n        $conf_file = $_attr[ 'file' ];\n        if (isset($_attr[ 'section' ])) {\n            $section = $_attr[ 'section' ];\n        } else {\n            $section = 'null';\n        }\n        // scope setup\n        if ($_attr[ 'noscope' ]) {\n            $_scope = - 1;\n        } else {\n            $_scope = $compiler->convertScope($_attr, $this->valid_scopes);\n        }\n\n        // create config object\n        $_output =\n            \"<?php\\n\\$_smarty_tpl->smarty->ext->configLoad->_loadConfigFile(\\$_smarty_tpl, {$conf_file}, {$section}, {$_scope});\\n?>\\n\";\n\n        return $_output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_continue.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Continue\n * Compiles the {continue} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Continue Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Continue extends Smarty_Internal_Compile_Break\n{\n    /**\n    * Tag name\n    *\n    * @var string\n    */\n    public $tag = 'continue';\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_debug.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Debug\n * Compiles the {debug} tag.\n * It opens a window the the Smarty Debugging Console.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Debug Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {debug} tag\n     *\n     * @param  array  $args     array with attributes from parser\n     * @param  object $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        // compile always as nocache\n        $compiler->tag_nocache = true;\n\n        // display debug template\n        $_output =\n            \"<?php \\$_smarty_debug = new Smarty_Internal_Debug;\\n \\$_smarty_debug->display_debug(\\$_smarty_tpl);\\n\";\n        $_output .= \"unset(\\$_smarty_debug);\\n?>\";\n        return $_output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_eval.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Eval\n * Compiles the {eval} tag.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Eval Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('var');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('assign');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('var', 'assign');\n\n    /**\n     * Compiles code for the {eval} tag\n     *\n     * @param  array  $args     array with attributes from parser\n     * @param  object $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        if (isset($_attr[ 'assign' ])) {\n            // output will be stored in a smarty variable instead of being displayed\n            $_assign = $_attr[ 'assign' ];\n        }\n\n        // create template object\n        $_output = \"\\$_template = new {$compiler->smarty->template_class}('eval:'.{$_attr[ 'var' ]}, \\$_smarty_tpl->smarty, \\$_smarty_tpl);\";\n        //was there an assign attribute?\n        if (isset($_assign)) {\n            $_output .= \"\\$_smarty_tpl->assign($_assign,\\$_template->fetch());\";\n        } else {\n            $_output .= 'echo $_template->fetch();';\n        }\n\n        return \"<?php $_output ?>\";\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_extends.php",
    "content": "<?php\n\n/**\n * Smarty Internal Plugin Compile extend\n * Compiles the {extends} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile extend Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Extends extends Smarty_Internal_Compile_Shared_Inheritance\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('file');\n\n    /**\n     * Array of names of optional attribute required by tag\n     * use array('_any') if there is no restriction of attributes names\n     *\n     * @var array\n     */\n    public $optional_attributes = array('extends_resource');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('file');\n\n    /**\n     * Compiles code for the {extends} tag extends: resource\n     *\n     * @param array                                 $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        if ($_attr[ 'nocache' ] === true) {\n            $compiler->trigger_template_error('nocache option not allowed', $compiler->parser->lex->line - 1);\n        }\n        if (strpos($_attr[ 'file' ], '$_tmp') !== false) {\n            $compiler->trigger_template_error('illegal value for file attribute', $compiler->parser->lex->line - 1);\n        }\n        // add code to initialize inheritance\n        $this->registerInit($compiler, true);\n        $file = trim($_attr[ 'file' ], '\\'\"');\n        if (strlen($file) > 8 && substr($file, 0, 8) === 'extends:') {\n            // generate code for each template\n            $files = array_reverse(explode('|', substr($file, 8)));\n            $i = 0;\n            foreach ($files as $file) {\n                if ($file[ 0 ] === '\"') {\n                    $file = trim($file, '\".');\n                } else {\n                    $file = \"'{$file}'\";\n                }\n                $i ++;\n                if ($i === count($files) && isset($_attr[ 'extends_resource' ])) {\n                    $this->compileEndChild($compiler);\n                }\n                $this->compileInclude($compiler, $file);\n            }\n            if (!isset($_attr[ 'extends_resource' ])) {\n                $this->compileEndChild($compiler);\n            }\n        } else {\n            $this->compileEndChild($compiler, $_attr[ 'file' ]);\n        }\n        $compiler->has_code = false;\n        return '';\n    }\n\n    /**\n     * Add code for inheritance endChild() method to end of template\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param null|string                           $template optional inheritance parent template\n     *\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    private function compileEndChild(Smarty_Internal_TemplateCompilerBase $compiler, $template = null)\n    {\n        $inlineUids = '';\n        if (isset($template) && $compiler->smarty->merge_compiled_includes) {\n            $code = $compiler->compileTag('include', array($template, array('scope' => 'parent')));\n            if (preg_match('/([,][\\s]*[\\'][a-z0-9]+[\\'][,][\\s]*[\\']content.*[\\'])[)]/', $code, $match)) {\n                $inlineUids = $match[ 1 ];\n            }\n        }\n        $compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                  '<?php $_smarty_tpl->inheritance->endChild($_smarty_tpl' .\n                                                                                  (isset($template) ?\n                                                                                      \", {$template}{$inlineUids}\" :\n                                                                                      '') . \");\\n?>\");\n    }\n\n    /**\n     * Add code for including subtemplate to end of template\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param  string                               $template subtemplate name\n     *\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    private function compileInclude(Smarty_Internal_TemplateCompilerBase $compiler, $template)\n    {\n        $compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                  $compiler->compileTag('include',\n                                                                                                        array($template,\n                                                                                                              array('scope' => 'parent'))));\n    }\n\n    /**\n     * Create source code for {extends} from source components array\n     *\n     * @param \\Smarty_Internal_Template $template\n     *\n     * @return string\n     */\n    public static function extendsSourceArrayCode(Smarty_Internal_Template $template)\n    {\n        $resources = array();\n        foreach ($template->source->components as $source) {\n            $resources[] = $source->resource;\n        }\n        return $template->smarty->left_delimiter . 'extends file=\\'extends:' . join('|', $resources) .\n               '\\' extends_resource=true' . $template->smarty->right_delimiter;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_for.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile For\n * Compiles the {for} {forelse} {/for} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile For Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {for} tag\n     * Smarty 3 does implement two different syntax's:\n     * - {for $var in $array}\n     * For looping over arrays or iterators\n     * - {for $x=0; $x<$y; $x++}\n     * For general loops\n     * The parser is generating different sets of attribute by which this compiler can\n     * determine which syntax is used.\n     *\n     * @param  array  $args      array with attributes from parser\n     * @param  object $compiler  compiler object\n     * @param  array  $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler, $parameter)\n    {\n        $compiler->loopNesting ++;\n        if ($parameter === 0) {\n            $this->required_attributes = array('start', 'to');\n            $this->optional_attributes = array('max', 'step');\n        } else {\n            $this->required_attributes = array('start', 'ifexp', 'var', 'step');\n            $this->optional_attributes = array();\n        }\n        $this->mapCache = array();\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        $output = \"<?php\\n\";\n        if ($parameter === 1) {\n            foreach ($_attr[ 'start' ] as $_statement) {\n                if (is_array($_statement[ 'var' ])) {\n                    $var = $_statement[ 'var' ][ 'var' ];\n                    $index = $_statement[ 'var' ][ 'smarty_internal_index' ];\n                } else {\n                    $var = $_statement[ 'var' ];\n                    $index = '';\n                }\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var] = new Smarty_Variable(null, \\$_smarty_tpl->isRenderingCache);\\n\";\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var]->value{$index} = {$_statement['value']};\\n\";\n            }\n            if (is_array($_attr[ 'var' ])) {\n                $var = $_attr[ 'var' ][ 'var' ];\n                $index = $_attr[ 'var' ][ 'smarty_internal_index' ];\n            } else {\n                $var = $_attr[ 'var' ];\n                $index = '';\n            }\n            $output .= \"if ($_attr[ifexp]) {\\nfor (\\$_foo=true;$_attr[ifexp]; \\$_smarty_tpl->tpl_vars[$var]->value{$index}$_attr[step]) {\\n\";\n        } else {\n            $_statement = $_attr[ 'start' ];\n            if (is_array($_statement[ 'var' ])) {\n                $var = $_statement[ 'var' ][ 'var' ];\n                $index = $_statement[ 'var' ][ 'smarty_internal_index' ];\n            } else {\n                $var = $_statement[ 'var' ];\n                $index = '';\n            }\n            $output .= \"\\$_smarty_tpl->tpl_vars[$var] = new Smarty_Variable(null, \\$_smarty_tpl->isRenderingCache);\";\n            if (isset($_attr[ 'step' ])) {\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var]->step = $_attr[step];\";\n            } else {\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var]->step = 1;\";\n            }\n            if (isset($_attr[ 'max' ])) {\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var]->total = (int) min(ceil((\\$_smarty_tpl->tpl_vars[$var]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\\$_smarty_tpl->tpl_vars[$var]->step)),$_attr[max]);\\n\";\n            } else {\n                $output .= \"\\$_smarty_tpl->tpl_vars[$var]->total = (int) ceil((\\$_smarty_tpl->tpl_vars[$var]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\\$_smarty_tpl->tpl_vars[$var]->step));\\n\";\n            }\n            $output .= \"if (\\$_smarty_tpl->tpl_vars[$var]->total > 0) {\\n\";\n            $output .= \"for (\\$_smarty_tpl->tpl_vars[$var]->value{$index} = $_statement[value], \\$_smarty_tpl->tpl_vars[$var]->iteration = 1;\\$_smarty_tpl->tpl_vars[$var]->iteration <= \\$_smarty_tpl->tpl_vars[$var]->total;\\$_smarty_tpl->tpl_vars[$var]->value{$index} += \\$_smarty_tpl->tpl_vars[$var]->step, \\$_smarty_tpl->tpl_vars[$var]->iteration++) {\\n\";\n            $output .= \"\\$_smarty_tpl->tpl_vars[$var]->first = \\$_smarty_tpl->tpl_vars[$var]->iteration === 1;\";\n            $output .= \"\\$_smarty_tpl->tpl_vars[$var]->last = \\$_smarty_tpl->tpl_vars[$var]->iteration === \\$_smarty_tpl->tpl_vars[$var]->total;\";\n        }\n        $output .= '?>';\n\n        $this->openTag($compiler, 'for', array('for', $compiler->nocache));\n        // maybe nocache because of nocache variables\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        // return compiled code\n        return $output;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Forelse Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {forelse} tag\n     *\n     * @param  array  $args      array with attributes from parser\n     * @param  object $compiler  compiler object\n     * @param  array  $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        list($openTag, $nocache) = $this->closeTag($compiler, array('for'));\n        $this->openTag($compiler, 'forelse', array('forelse', $nocache));\n\n        return \"<?php }} else { ?>\";\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Forclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/for} tag\n     *\n     * @param  array  $args      array with attributes from parser\n     * @param  object $compiler  compiler object\n     * @param  array  $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, $compiler, $parameter)\n    {\n        $compiler->loopNesting --;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n\n        list($openTag, $compiler->nocache) = $this->closeTag($compiler, array('for', 'forelse'));\n\n        $output = \"<?php }\\n\";\n        if ($openTag !== 'forelse') {\n            $output .= \"}\\n\";\n        }\n        $output .= \"?>\";\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_foreach.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Foreach\n * Compiles the {foreach} {foreachelse} {/foreach} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Foreach Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_ForeachSection\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('from', 'item');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('name', 'key', 'properties');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('from', 'item', 'key', 'name');\n\n    /**\n     * counter\n     *\n     * @var int\n     */\n    public $counter = 0;\n\n    /**\n     * Name of this tag\n     *\n     * @var string\n     */\n    public $tagName = 'foreach';\n\n    /**\n     * Valid properties of $smarty.foreach.name.xxx variable\n     *\n     * @var array\n     */\n    public $nameProperties = array('first', 'last', 'index', 'iteration', 'show', 'total');\n\n    /**\n     * Valid properties of $item@xxx variable\n     *\n     * @var array\n     */\n    public $itemProperties = array('first', 'last', 'index', 'iteration', 'show', 'total', 'key');\n\n    /**\n     * Flag if tag had name attribute\n     *\n     * @var bool\n     */\n    public $isNamed = false;\n\n    /**\n     * Compiles code for the {foreach} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $compiler->loopNesting ++;\n        // init\n        $this->isNamed = false;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $from = $_attr[ 'from' ];\n        $item = $compiler->getId($_attr[ 'item' ]);\n        if ($item === false) {\n            $item = $compiler->getVariableName($_attr[ 'item' ]);\n        }\n        $key = $name = null;\n        $attributes = array('item' => $item);\n        if (isset($_attr[ 'key' ])) {\n            $key = $compiler->getId($_attr[ 'key' ]);\n            if ($key === false) {\n                $key = $compiler->getVariableName($_attr[ 'key' ]);\n            }\n            $attributes[ 'key' ] = $key;\n        }\n        if (isset($_attr[ 'name' ])) {\n            $this->isNamed = true;\n            $name = $attributes[ 'name' ] = $compiler->getId($_attr[ 'name' ]);\n        }\n        foreach ($attributes as $a => $v) {\n            if ($v === false) {\n                $compiler->trigger_template_error(\"'{$a}' attribute/variable has illegal value\", null, true);\n            }\n        }\n        $fromName = $compiler->getVariableName($_attr[ 'from' ]);\n        if ($fromName) {\n            foreach (array('item', 'key') as $a) {\n                if (isset($attributes[ $a ]) && $attributes[ $a ] === $fromName) {\n                    $compiler->trigger_template_error(\"'{$a}' and 'from' may not have same variable name '{$fromName}'\",\n                                                      null, true);\n                }\n            }\n        }\n\n        $itemVar = \"\\$_smarty_tpl->tpl_vars['{$item}']\";\n        $local = '$__foreach_' . $attributes[ 'item' ] . '_' . $this->counter ++ . '_';\n        // search for used tag attributes\n        $itemAttr = array();\n        $namedAttr = array();\n        $this->scanForProperties($attributes, $compiler);\n        if (!empty($this->matchResults[ 'item' ])) {\n            $itemAttr = $this->matchResults[ 'item' ];\n        }\n        if (!empty($this->matchResults[ 'named' ])) {\n            $namedAttr = $this->matchResults[ 'named' ];\n        }\n        if (isset($_attr[ 'properties' ]) && preg_match_all('/[\\'](.*?)[\\']/', $_attr[ 'properties' ], $match)) {\n            foreach ($match[ 1 ] as $prop) {\n                if (in_array($prop, $this->itemProperties)) {\n                    $itemAttr[ $prop ] = true;\n                } else {\n                    $compiler->trigger_template_error(\"Invalid property '{$prop}'\", null, true);\n                }\n            }\n            if ($this->isNamed) {\n                foreach ($match[ 1 ] as $prop) {\n                    if (in_array($prop, $this->nameProperties)) {\n                        $nameAttr[ $prop ] = true;\n                    } else {\n                        $compiler->trigger_template_error(\"Invalid property '{$prop}'\", null, true);\n                    }\n                }\n            }\n        }\n        if (isset($itemAttr[ 'first' ])) {\n            $itemAttr[ 'index' ] = true;\n        }\n        if (isset($namedAttr[ 'first' ])) {\n            $namedAttr[ 'index' ] = true;\n        }\n        if (isset($namedAttr[ 'last' ])) {\n            $namedAttr[ 'iteration' ] = true;\n            $namedAttr[ 'total' ] = true;\n        }\n        if (isset($itemAttr[ 'last' ])) {\n            $itemAttr[ 'iteration' ] = true;\n            $itemAttr[ 'total' ] = true;\n        }\n        if (isset($namedAttr[ 'show' ])) {\n            $namedAttr[ 'total' ] = true;\n        }\n        if (isset($itemAttr[ 'show' ])) {\n            $itemAttr[ 'total' ] = true;\n        }\n        $keyTerm = '';\n        if (isset($attributes[ 'key' ])) {\n            $keyTerm = \"\\$_smarty_tpl->tpl_vars['{$key}']->value => \";\n        }\n        if (isset($itemAttr[ 'key' ])) {\n            $keyTerm = \"{$itemVar}->key => \";\n        }\n        if ($this->isNamed) {\n            $foreachVar = \"\\$_smarty_tpl->tpl_vars['__smarty_foreach_{$attributes['name']}']\";\n        }\n        $needTotal = isset($itemAttr[ 'total' ]);\n        // Register tag\n        $this->openTag($compiler, 'foreach',\n                       array('foreach', $compiler->nocache, $local, $itemVar, empty($itemAttr) ? 1 : 2));\n        // maybe nocache because of nocache variables\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        // generate output code\n        $output = \"<?php\\n\";\n        $output .= \"\\$_from = \\$_smarty_tpl->smarty->ext->_foreach->init(\\$_smarty_tpl, $from, \" .\n                   var_export($item, true);\n        if ($name || $needTotal || $key) {\n            $output .= ', ' . var_export($needTotal, true);\n        }\n        if ($name || $key) {\n            $output .= ', ' . var_export($key, true);\n        }\n        if ($name) {\n            $output .= ', ' . var_export($name, true) . ', ' . var_export($namedAttr, true);\n        }\n        $output .= \");\\n\";\n        if (isset($itemAttr[ 'show' ])) {\n            $output .= \"{$itemVar}->show = ({$itemVar}->total > 0);\\n\";\n        }\n        if (isset($itemAttr[ 'iteration' ])) {\n            $output .= \"{$itemVar}->iteration = 0;\\n\";\n        }\n        if (isset($itemAttr[ 'index' ])) {\n            $output .= \"{$itemVar}->index = -1;\\n\";\n        }\n        $output .= \"if (\\$_from !== null) {\\n\";\n        $output .= \"foreach (\\$_from as {$keyTerm}{$itemVar}->value) {\\n\";\n        if (isset($attributes[ 'key' ]) && isset($itemAttr[ 'key' ])) {\n            $output .= \"\\$_smarty_tpl->tpl_vars['{$key}']->value = {$itemVar}->key;\\n\";\n        }\n        if (isset($itemAttr[ 'iteration' ])) {\n            $output .= \"{$itemVar}->iteration++;\\n\";\n        }\n        if (isset($itemAttr[ 'index' ])) {\n            $output .= \"{$itemVar}->index++;\\n\";\n        }\n        if (isset($itemAttr[ 'first' ])) {\n            $output .= \"{$itemVar}->first = !{$itemVar}->index;\\n\";\n        }\n        if (isset($itemAttr[ 'last' ])) {\n            $output .= \"{$itemVar}->last = {$itemVar}->iteration === {$itemVar}->total;\\n\";\n        }\n        if (isset($foreachVar)) {\n            if (isset($namedAttr[ 'iteration' ])) {\n                $output .= \"{$foreachVar}->value['iteration']++;\\n\";\n            }\n            if (isset($namedAttr[ 'index' ])) {\n                $output .= \"{$foreachVar}->value['index']++;\\n\";\n            }\n            if (isset($namedAttr[ 'first' ])) {\n                $output .= \"{$foreachVar}->value['first'] = !{$foreachVar}->value['index'];\\n\";\n            }\n            if (isset($namedAttr[ 'last' ])) {\n                $output .= \"{$foreachVar}->value['last'] = {$foreachVar}->value['iteration'] === {$foreachVar}->value['total'];\\n\";\n            }\n        }\n        if (!empty($itemAttr)) {\n            $output .= \"{$local}saved = {$itemVar};\\n\";\n        }\n        $output .= '?>';\n\n        return $output;\n    }\n\n    /**\n     * Compiles code for to restore saved template variables\n     *\n     * @param int $levels number of levels to restore\n     *\n     * @return string compiled code\n     */\n    public function compileRestore($levels)\n    {\n        return \"\\$_smarty_tpl->smarty->ext->_foreach->restore(\\$_smarty_tpl, {$levels});\";\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Foreachelse Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {foreachelse} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        list($openTag, $nocache, $local, $itemVar, $restore) = $this->closeTag($compiler, array('foreach'));\n        $this->openTag($compiler, 'foreachelse', array('foreachelse', $nocache, $local, $itemVar, 0));\n        $output = \"<?php\\n\";\n        if ($restore === 2) {\n            $output .= \"{$itemVar} = {$local}saved;\\n\";\n        }\n        $output .= \"}\\n} else {\\n?>\";\n        return $output;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Foreachclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/foreach} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n      */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $compiler->loopNesting --;\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n\n        list($openTag, $compiler->nocache, $local, $itemVar, $restore) =\n            $this->closeTag($compiler, array('foreach', 'foreachelse'));\n        $output = \"<?php\\n\";\n\n        if ($restore === 2) {\n            $output .= \"{$itemVar} = {$local}saved;\\n\";\n        }\n        if ($restore > 0) {\n            $output .= \"}\\n\";\n        }\n        $output .= \"}\\n\";\n        /* @var Smarty_Internal_Compile_Foreach $foreachCompiler */\n        $foreachCompiler = $compiler->getTagCompiler('foreach');\n        $output .= $foreachCompiler->compileRestore(1);\n        $output .= \"?>\";\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_function.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Function\n * Compiles the {function} {/function} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Function Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase\n{\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles code for the {function} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return bool true\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        if ($_attr[ 'nocache' ] === true) {\n            $compiler->trigger_template_error('nocache option not allowed', null, true);\n        }\n        unset($_attr[ 'nocache' ]);\n        $_name = trim($_attr[ 'name' ], '\\'\"');\n        $compiler->parent_compiler->tpl_function[ $_name ] = array();\n        $save = array($_attr, $compiler->parser->current_buffer, $compiler->template->compiled->has_nocache_code,\n                      $compiler->template->caching);\n        $this->openTag($compiler, 'function', $save);\n        // Init temporary context\n        $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template();\n        $compiler->template->compiled->has_nocache_code = false;\n        $compiler->saveRequiredPlugins(true);\n        return true;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Functionclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase\n{\n\n    /**\n     * Compiler object\n     *\n     * @var object\n     */\n    private $compiler = null;\n\n    /**\n     * Compiles code for the {/function} tag\n     *\n     * @param  array                                       $args     array with attributes from parser\n     * @param object|\\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return bool true\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $this->compiler = $compiler;\n        $saved_data = $this->closeTag($compiler, array('function'));\n        $_attr = $saved_data[ 0 ];\n        $_name = trim($_attr[ 'name' ], '\\'\"');\n        $compiler->parent_compiler->tpl_function[ $_name ][ 'compiled_filepath' ] =\n            $compiler->parent_compiler->template->compiled->filepath;\n        $compiler->parent_compiler->tpl_function[ $_name ][ 'uid' ] = $compiler->template->source->uid;\n        $_parameter = $_attr;\n        unset($_parameter[ 'name' ]);\n        // default parameter\n        $_paramsArray = array();\n        foreach ($_parameter as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        if (!empty($_paramsArray)) {\n            $_params = 'array(' . implode(',', $_paramsArray) . ')';\n            $_paramsCode = \"\\$params = array_merge($_params, \\$params);\\n\";\n        } else {\n            $_paramsCode = '';\n        }\n        $_functionCode = $compiler->parser->current_buffer;\n        // setup buffer for template function code\n        $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template();\n\n        $_funcName = \"smarty_template_function_{$_name}_{$compiler->template->compiled->nocache_hash}\";\n        $_funcNameCaching = $_funcName . '_nocache';\n        if ($compiler->template->compiled->has_nocache_code) {\n            $compiler->parent_compiler->tpl_function[ $_name ][ 'call_name_caching' ] = $_funcNameCaching;\n            $output = \"<?php\\n\";\n            $output .= \"/* {$_funcNameCaching} */\\n\";\n            $output .= \"if (!function_exists('{$_funcNameCaching}')) {\\n\";\n            $output .= \"function {$_funcNameCaching} (Smarty_Internal_Template \\$_smarty_tpl,\\$params) {\\n\";\n            $output .= \"ob_start();\\n\";\n            $output .= $compiler->compileRequiredPlugins();\n            $output .= \"\\$_smarty_tpl->compiled->has_nocache_code = true;\\n\";\n            $output .= $_paramsCode;\n            $output .= \"foreach (\\$params as \\$key => \\$value) {\\n\\$_smarty_tpl->tpl_vars[\\$key] = new Smarty_Variable(\\$value, \\$_smarty_tpl->isRenderingCache);\\n}\\n\";\n            $output .= \"\\$params = var_export(\\$params, true);\\n\";\n            $output .= \"echo \\\"/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/<?php \";\n            $output .= \"\\\\\\$_smarty_tpl->smarty->ext->_tplFunction->saveTemplateVariables(\\\\\\$_smarty_tpl, '{$_name}');\\nforeach (\\$params as \\\\\\$key => \\\\\\$value) {\\n\\\\\\$_smarty_tpl->tpl_vars[\\\\\\$key] = new Smarty_Variable(\\\\\\$value, \\\\\\$_smarty_tpl->isRenderingCache);\\n}\\n?>\";\n            $output .= \"/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\\\";?>\";\n            $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                              new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                                $output));\n            $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode);\n            $output = \"<?php echo \\\"/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/<?php \";\n            $output .= \"\\\\\\$_smarty_tpl->smarty->ext->_tplFunction->restoreTemplateVariables(\\\\\\$_smarty_tpl, '{$_name}');?>\\n\";\n            $output .= \"/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\\\";\\n?>\";\n            $output .= \"<?php echo str_replace('{$compiler->template->compiled->nocache_hash}', \\$_smarty_tpl->compiled->nocache_hash, ob_get_clean());\\n\";\n            $output .= \"}\\n}\\n\";\n            $output .= \"/*/ {$_funcName}_nocache */\\n\\n\";\n            $output .= \"?>\\n\";\n            $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                              new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                                $output));\n            $_functionCode = new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                               preg_replace_callback(\"/((<\\?php )?echo '\\/\\*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\\*\\/([\\S\\s]*?)\\/\\*\\/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\\*\\/';(\\?>\\n)?)/\",\n                                                                                     array($this, 'removeNocache'),\n                                                                                     $_functionCode->to_smarty_php($compiler->parser)));\n        }\n        $compiler->parent_compiler->tpl_function[ $_name ][ 'call_name' ] = $_funcName;\n        $output = \"<?php\\n\";\n        $output .= \"/* {$_funcName} */\\n\";\n        $output .= \"if (!function_exists('{$_funcName}')) {\\n\";\n        $output .= \"function {$_funcName}(Smarty_Internal_Template \\$_smarty_tpl,\\$params) {\\n\";\n        $output .= $_paramsCode;\n        $output .= \"foreach (\\$params as \\$key => \\$value) {\\n\\$_smarty_tpl->tpl_vars[\\$key] = new Smarty_Variable(\\$value, \\$_smarty_tpl->isRenderingCache);\\n}\\n\";\n        $output .= $compiler->compileCheckPlugins(array_merge($compiler->required_plugins[ 'compiled' ], $compiler->required_plugins[ 'nocache' ]));\n        $output .= \"?>\\n\";\n        $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                          new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                            $output));\n        $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode);\n        $output = \"<?php\\n}}\\n\";\n        $output .= \"/*/ {$_funcName} */\\n\\n\";\n        $output .= \"?>\\n\";\n        $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                          new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                            $output));\n        $compiler->parent_compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser);\n       // restore old buffer\n        $compiler->parser->current_buffer = $saved_data[ 1 ];\n        // restore old status\n        $compiler->restoreRequiredPlugins();\n        $compiler->template->compiled->has_nocache_code = $saved_data[ 2 ];\n        $compiler->template->caching = $saved_data[ 3 ];\n        return true;\n    }\n\n    /**\n     * Remove nocache code\n     *\n     * @param $match\n     *\n     * @return string\n     */\n    function removeNocache($match)\n    {\n        $code =\n            preg_replace(\"/((<\\?php )?echo '\\/\\*%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\\*\\/)|(\\/\\*\\/%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\\*\\/';(\\?>\\n)?)/\",\n                         '', $match[ 0 ]);\n        $code = str_replace(array('\\\\\\'', '\\\\\\\\\\''), array('\\'', '\\\\\\''), $code);\n        return $code;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_if.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile If\n * Compiles the {if} {else} {elseif} {/if} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile If Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {if} tag\n     *\n     * @param array                                 $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param array                                 $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $this->openTag($compiler, 'if', array(1, $compiler->nocache));\n        // must whole block be nocache ?\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n\n        if (!isset($parameter['if condition'])) {\n            $compiler->trigger_template_error('missing if condition', null, true);\n        }\n\n        if (is_array($parameter[ 'if condition' ])) {\n            if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                $var = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n            } else {\n                $var = $parameter[ 'if condition' ][ 'var' ];\n            }\n            if ($compiler->nocache) {\n                // create nocache var to make it know for further compiling\n                $compiler->setNocacheInVariable($var);\n            }\n            $prefixVar = $compiler->getNewPrefixVariable();\n            $_output = \"<?php {$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]};?>\\n\";\n            $assignAttr = array();\n            $assignAttr[][ 'value' ] = $prefixVar;\n            $assignCompiler = new Smarty_Internal_Compile_Assign();\n            if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n                $_output .= $assignCompiler->compile($assignAttr, $compiler,\n                                                    array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ]));\n            } else {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ];\n                $_output .= $assignCompiler->compile($assignAttr, $compiler, array());\n            }\n            $_output .= \"<?php if ({$prefixVar}) {?>\";\n            return $_output;\n        } else {\n            return \"<?php if ({$parameter['if condition']}) {?>\";\n        }\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Else Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {else} tag\n     *\n     * @param array                                 $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n      */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif'));\n        $this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache));\n\n        return '<?php } else { ?>';\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile ElseIf Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {elseif} tag\n     *\n     * @param array                                 $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param array                                 $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif'));\n\n        if (!isset($parameter['if condition'])) {\n            $compiler->trigger_template_error('missing elseif condition', null, true);\n        }\n\n        $assignCode = '';\n        $var = '';\n        if (is_array($parameter[ 'if condition' ])) {\n            $condition_by_assign = true;\n            if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                $var = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n            } else {\n                $var = $parameter[ 'if condition' ][ 'var' ];\n            }\n            if ($compiler->nocache) {\n                // create nocache var to make it know for further compiling\n                $compiler->setNocacheInVariable($var);\n            }\n            $prefixVar = $compiler->getNewPrefixVariable();\n            $assignCode = \"<?php {$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]};?>\\n\";\n            $assignCompiler = new Smarty_Internal_Compile_Assign();\n            $assignAttr = array();\n            $assignAttr[][ 'value' ] = $prefixVar;\n            if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n                $assignCode .= $assignCompiler->compile($assignAttr, $compiler,\n                                                       array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ]));\n            } else {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ];\n                $assignCode .= $assignCompiler->compile($assignAttr, $compiler, array());\n            }\n        } else {\n            $condition_by_assign = false;\n        }\n\n        $prefixCode = $compiler->getPrefixCode();\n        if (empty($prefixCode)) {\n            if ($condition_by_assign) {\n                $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache));\n                $_output = $compiler->appendCode(\"<?php } else {\\n?>\", $assignCode);\n                return $compiler->appendCode($_output, \"<?php if ({$prefixVar}) {?>\");\n            } else {\n                $this->openTag($compiler, 'elseif', array($nesting, $compiler->tag_nocache));\n                return \"<?php } elseif ({$parameter['if condition']}) {?>\";\n            }\n        } else {\n            $_output = $compiler->appendCode(\"<?php } else {\\n?>\", $prefixCode);\n            $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache));\n            if ($condition_by_assign) {\n                $_output = $compiler->appendCode($_output, $assignCode);\n                return $compiler->appendCode($_output, \"<?php if ({$prefixVar}) {?>\");\n            } else {\n                return $compiler->appendCode($_output, \"<?php if ({$parameter['if condition']}) {?>\");\n            }\n        }\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Ifclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/if} tag\n     *\n     * @param array                                 $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n        list($nesting, $compiler->nocache) = $this->closeTag($compiler, array('if', 'else', 'elseif'));\n        $tmp = '';\n        for ($i = 0; $i < $nesting; $i ++) {\n            $tmp .= '}';\n        }\n\n        return \"<?php {$tmp}?>\";\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_include.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Include\n * Compiles the {include} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n/**\n * Smarty Internal Plugin Compile Include Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase\n{\n    /**\n     * caching mode to create nocache code but no cache file\n     */\n    const CACHING_NOCACHE_CODE = 9999;\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('file');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('file');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array('nocache', 'inline', 'caching');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n    /**\n     * Valid scope names\n     *\n     * @var array\n     */\n    public $valid_scopes = array('parent' => Smarty::SCOPE_PARENT, 'root' => Smarty::SCOPE_ROOT,\n                                 'global' => Smarty::SCOPE_GLOBAL, 'tpl_root' => Smarty::SCOPE_TPL_ROOT,\n                                 'smarty' => Smarty::SCOPE_SMARTY);\n\n    /**\n     * Compiles code for the {include} tag\n     *\n     * @param  array                                  $args     array with attributes from parser\n     * @param  Smarty_Internal_SmartyTemplateCompiler $compiler compiler object\n     *\n     * @return string\n     * @throws \\Exception\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_SmartyTemplateCompiler $compiler)\n    {\n        $uid = $t_hash = null;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $fullResourceName = $source_resource = $_attr[ 'file' ];\n        $variable_template = false;\n        $cache_tpl = false;\n        // parse resource_name\n        if (preg_match('/^([\\'\"])(([A-Za-z0-9_\\-]{2,})[:])?(([^$()]+)|(.+))\\1$/', $source_resource, $match)) {\n            $type = !empty($match[ 3 ]) ? $match[ 3 ] : $compiler->template->smarty->default_resource_type;\n            $name = !empty($match[ 5 ]) ? $match[ 5 ] : $match[ 6 ];\n            $handler = Smarty_Resource::load($compiler->smarty, $type);\n            if ($handler->recompiled || $handler->uncompiled) {\n                $variable_template = true;\n            }\n            if (!$variable_template) {\n                if ($type !== 'string') {\n                    $fullResourceName = \"{$type}:{$name}\";\n                    $compiled = $compiler->parent_compiler->template->compiled;\n                    if (isset($compiled->includes[ $fullResourceName ])) {\n                        $compiled->includes[ $fullResourceName ]++;\n                        $cache_tpl = true;\n                    } else {\n                        if (\"{$compiler->template->source->type}:{$compiler->template->source->name}\" ==\n                            $fullResourceName\n                        ) {\n                            // recursive call of current template\n                            $compiled->includes[ $fullResourceName ] = 2;\n                            $cache_tpl = true;\n                        } else {\n                            $compiled->includes[ $fullResourceName ] = 1;\n                        }\n                    }\n                    $fullResourceName = $match[ 1 ] . $fullResourceName . $match[ 1 ];\n                }\n            }\n            if (empty($match[ 5 ])) {\n                $variable_template = true;\n            }\n        } else {\n            $variable_template = true;\n        }\n        // scope setup\n        $_scope = $compiler->convertScope($_attr, $this->valid_scopes);\n        // set flag to cache subtemplate object when called within loop or template name is variable.\n        if ($cache_tpl || $variable_template || $compiler->loopNesting > 0) {\n            $_cache_tpl = 'true';\n        } else {\n            $_cache_tpl = 'false';\n        }\n        // assume caching is off\n        $_caching = Smarty::CACHING_OFF;\n        $call_nocache = $compiler->tag_nocache || $compiler->nocache;\n        // caching was on and {include} is not in nocache mode\n        if ($compiler->template->caching && !$compiler->nocache && !$compiler->tag_nocache) {\n            $_caching = self::CACHING_NOCACHE_CODE;\n        }\n        // flag if included template code should be merged into caller\n        $merge_compiled_includes = ($compiler->smarty->merge_compiled_includes || $_attr[ 'inline' ] === true) &&\n                                   !$compiler->template->source->handler->recompiled;\n        if ($merge_compiled_includes) {\n            // variable template name ?\n            if ($variable_template) {\n                $merge_compiled_includes = false;\n            }\n            // variable compile_id?\n            if (isset($_attr[ 'compile_id' ]) && $compiler->isVariable($_attr[ 'compile_id' ])) {\n                $merge_compiled_includes = false;\n            }\n        }\n        /*\n        * if the {include} tag provides individual parameter for caching or compile_id\n        * the subtemplate must not be included into the common cache file and is treated like\n        * a call in nocache mode.\n        *\n        */\n        if ($_attr[ 'nocache' ] !== true && $_attr[ 'caching' ]) {\n            $_caching = $_new_caching = (int)$_attr[ 'caching' ];\n            $call_nocache = true;\n        } else {\n            $_new_caching = Smarty::CACHING_LIFETIME_CURRENT;\n        }\n        if (isset($_attr[ 'cache_lifetime' ])) {\n            $_cache_lifetime = $_attr[ 'cache_lifetime' ];\n            $call_nocache = true;\n            $_caching = $_new_caching;\n        } else {\n            $_cache_lifetime = '$_smarty_tpl->cache_lifetime';\n        }\n        if (isset($_attr[ 'cache_id' ])) {\n            $_cache_id = $_attr[ 'cache_id' ];\n            $call_nocache = true;\n            $_caching = $_new_caching;\n        } else {\n            $_cache_id = '$_smarty_tpl->cache_id';\n        }\n        if (isset($_attr[ 'compile_id' ])) {\n            $_compile_id = $_attr[ 'compile_id' ];\n        } else {\n            $_compile_id = '$_smarty_tpl->compile_id';\n        }\n        // if subtemplate will be called in nocache mode do not merge\n        if ($compiler->template->caching && $call_nocache) {\n            $merge_compiled_includes = false;\n        }\n        // assign attribute\n        if (isset($_attr[ 'assign' ])) {\n            // output will be stored in a smarty variable instead of being displayed\n            if ($_assign = $compiler->getId($_attr[ 'assign' ])) {\n                $_assign = \"'{$_assign}'\";\n                if ($compiler->tag_nocache || $compiler->nocache || $call_nocache) {\n                    // create nocache var to make it know for further compiling\n                    $compiler->setNocacheInVariable($_attr[ 'assign' ]);\n                }\n            } else {\n                $_assign = $_attr[ 'assign' ];\n            }\n        }\n        $has_compiled_template = false;\n        if ($merge_compiled_includes) {\n            $c_id = isset($_attr[ 'compile_id' ]) ? $_attr[ 'compile_id' ] : $compiler->template->compile_id;\n            // we must observe different compile_id and caching\n            $t_hash = sha1($c_id . ($_caching ? '--caching' : '--nocaching'));\n            $compiler->smarty->allow_ambiguous_resources = true;\n            /* @var Smarty_Internal_Template $tpl */\n            $tpl = new $compiler->smarty->template_class (trim($fullResourceName, '\"\\''), $compiler->smarty,\n                                                          $compiler->template, $compiler->template->cache_id, $c_id,\n                                                          $_caching);\n            $uid = $tpl->source->type . $tpl->source->uid;\n            if (!isset($compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ])) {\n                $has_compiled_template = $this->compileInlineTemplate($compiler, $tpl, $t_hash);\n            } else {\n                $has_compiled_template = true;\n            }\n            unset($tpl);\n        }\n        // delete {include} standard attributes\n        unset($_attr[ 'file' ], $_attr[ 'assign' ], $_attr[ 'cache_id' ], $_attr[ 'compile_id' ], $_attr[ 'cache_lifetime' ], $_attr[ 'nocache' ], $_attr[ 'caching' ], $_attr[ 'scope' ], $_attr[ 'inline' ]);\n        // remaining attributes must be assigned as smarty variable\n        $_vars = 'array()';\n        if (!empty($_attr)) {\n            $_pairs = array();\n            // create variables\n            foreach ($_attr as $key => $value) {\n                $_pairs[] = \"'$key'=>$value\";\n            }\n            $_vars = 'array(' . join(',', $_pairs) . ')';\n        }\n        $update_compile_id = $compiler->template->caching && !$compiler->tag_nocache && !$compiler->nocache &&\n                             $_compile_id !== '$_smarty_tpl->compile_id';\n        if ($has_compiled_template && !$call_nocache) {\n            $_output = \"<?php\\n\";\n            if ($update_compile_id) {\n                $_output .= $compiler->makeNocacheCode(\"\\$_compile_id_save[] = \\$_smarty_tpl->compile_id;\\n\\$_smarty_tpl->compile_id = {$_compile_id};\\n\");\n            }\n            if (!empty($_attr) && $_caching === 9999 && $compiler->template->caching) {\n                $_vars_nc = \"foreach ($_vars as \\$ik => \\$iv) {\\n\";\n                $_vars_nc .= \"\\$_smarty_tpl->tpl_vars[\\$ik] =  new Smarty_Variable(\\$iv);\\n\";\n                $_vars_nc .= \"}\\n\";\n                $_output .= substr($compiler->processNocacheCode('<?php ' . $_vars_nc . \"?>\\n\", true), 6, -3);\n            }\n            if (isset($_assign)) {\n                $_output .= \"ob_start();\\n\";\n            }\n            $_output .= \"\\$_smarty_tpl->_subTemplateRender({$fullResourceName}, {$_cache_id}, {$_compile_id}, {$_caching}, {$_cache_lifetime}, {$_vars}, {$_scope}, {$_cache_tpl}, '{$compiler->parent_compiler->mergedSubTemplatesData[$uid][$t_hash]['uid']}', '{$compiler->parent_compiler->mergedSubTemplatesData[$uid][$t_hash]['func']}');\\n\";\n            if (isset($_assign)) {\n                $_output .= \"\\$_smarty_tpl->assign({$_assign}, ob_get_clean());\\n\";\n            }\n            if ($update_compile_id) {\n                $_output .= $compiler->makeNocacheCode(\"\\$_smarty_tpl->compile_id = array_pop(\\$_compile_id_save);\\n\");\n            }\n            $_output .= \"?>\";\n            return $_output;\n        }\n        if ($call_nocache) {\n            $compiler->tag_nocache = true;\n        }\n        $_output = \"<?php \";\n        if ($update_compile_id) {\n            $_output .= \"\\$_compile_id_save[] = \\$_smarty_tpl->compile_id;\\n\\$_smarty_tpl->compile_id = {$_compile_id};\\n\";\n        }\n        // was there an assign attribute\n        if (isset($_assign)) {\n            $_output .= \"ob_start();\\n\";\n        }\n        $_output .= \"\\$_smarty_tpl->_subTemplateRender({$fullResourceName}, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_scope, {$_cache_tpl});\\n\";\n        if (isset($_assign)) {\n            $_output .= \"\\$_smarty_tpl->assign({$_assign}, ob_get_clean());\\n\";\n        }\n        if ($update_compile_id) {\n            $_output .= \"\\$_smarty_tpl->compile_id = array_pop(\\$_compile_id_save);\\n\";\n        }\n        $_output .= \"?>\";\n        return $_output;\n    }\n\n    /**\n     * Compile inline sub template\n     *\n     * @param \\Smarty_Internal_SmartyTemplateCompiler $compiler\n     * @param \\Smarty_Internal_Template               $tpl\n     * @param  string                                 $t_hash\n     *\n     * @return bool\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function compileInlineTemplate(Smarty_Internal_SmartyTemplateCompiler $compiler,\n                                          Smarty_Internal_Template $tpl,\n                                          $t_hash)\n    {\n        $uid = $tpl->source->type . $tpl->source->uid;\n        if (!($tpl->source->handler->uncompiled) && $tpl->source->exists) {\n            $compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ][ 'uid' ] = $tpl->source->uid;\n            if (isset($compiler->template->inheritance)) {\n                $tpl->inheritance = clone $compiler->template->inheritance;\n            }\n            $tpl->compiled = new Smarty_Template_Compiled();\n            $tpl->compiled->nocache_hash = $compiler->parent_compiler->template->compiled->nocache_hash;\n            $tpl->loadCompiler();\n            // save unique function name\n            $compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ][ 'func' ] =\n            $tpl->compiled->unifunc = 'content_' . str_replace(array('.', ','), '_', uniqid('', true));\n            // make sure whole chain gets compiled\n            $tpl->mustCompile = true;\n            $compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ][ 'nocache_hash' ] =\n                $tpl->compiled->nocache_hash;\n            if ($tpl->source->type === 'file') {\n                $sourceInfo = $tpl->source->filepath;\n            } else {\n                $basename = $tpl->source->handler->getBasename($tpl->source);\n                $sourceInfo = $tpl->source->type . ':' .\n                              ($basename ? $basename : $tpl->source->name);\n            }\n            // get compiled code\n            $compiled_code = \"<?php\\n\\n\";\n            $compiled_code .= \"/* Start inline template \\\"{$sourceInfo}\\\" =============================*/\\n\";\n            $compiled_code .= \"function {$tpl->compiled->unifunc} (Smarty_Internal_Template \\$_smarty_tpl) {\\n\";\n            $compiled_code .= \"?>\\n\" . $tpl->compiler->compileTemplateSource($tpl, null, $compiler->parent_compiler);\n            $compiled_code .= \"<?php\\n\";\n            $compiled_code .= \"}\\n?>\\n\";\n            $compiled_code .= $tpl->compiler->postFilter($tpl->compiler->blockOrFunctionCode);\n            $compiled_code .= \"<?php\\n\\n\";\n            $compiled_code .= \"/* End inline template \\\"{$sourceInfo}\\\" =============================*/\\n\";\n            $compiled_code .= '?>';\n            unset($tpl->compiler);\n            if ($tpl->compiled->has_nocache_code) {\n                // replace nocache_hash\n                $compiled_code =\n                    str_replace(\"{$tpl->compiled->nocache_hash}\",\n                                $compiler->template->compiled->nocache_hash,\n                                $compiled_code);\n                $compiler->template->compiled->has_nocache_code = true;\n            }\n            $compiler->parent_compiler->mergedSubTemplatesCode[ $tpl->compiled->unifunc ] = $compiled_code;\n            return true;\n        } else {\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_include_php.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Include PHP\n * Compiles the {include_php} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n/**\n * Smarty Internal Plugin Compile Insert Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('file');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('file');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('once', 'assign');\n\n    /**\n     * Compiles code for the {include_php} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        if (!($compiler->smarty instanceof SmartyBC)) {\n            throw new SmartyException(\"{include_php} is deprecated, use SmartyBC class to enable\");\n        }\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        /** @var Smarty_Internal_Template $_smarty_tpl\n         * used in evaluated code\n         */\n        $_smarty_tpl = $compiler->template;\n        $_filepath = false;\n        $_file = null;\n        eval('$_file = @' . $_attr[ 'file' ] . ';');\n        if (!isset($compiler->smarty->security_policy) && file_exists($_file)) {\n            $_filepath = $compiler->smarty->_realpath($_file, true);\n        } else {\n            if (isset($compiler->smarty->security_policy)) {\n                $_dir = $compiler->smarty->security_policy->trusted_dir;\n            } else {\n                $_dir = $compiler->smarty->trusted_dir;\n            }\n            if (!empty($_dir)) {\n                foreach ((array)$_dir as $_script_dir) {\n                    $_path = $compiler->smarty->_realpath($_script_dir . DIRECTORY_SEPARATOR . $_file, true);\n                    if (file_exists($_path)) {\n                        $_filepath = $_path;\n                        break;\n                    }\n                }\n            }\n        }\n        if ($_filepath === false) {\n            $compiler->trigger_template_error(\"{include_php} file '{$_file}' is not readable\", null, true);\n        }\n        if (isset($compiler->smarty->security_policy)) {\n            $compiler->smarty->security_policy->isTrustedPHPDir($_filepath);\n        }\n        if (isset($_attr[ 'assign' ])) {\n            // output will be stored in a smarty variable instead of being displayed\n            $_assign = $_attr[ 'assign' ];\n        }\n        $_once = '_once';\n        if (isset($_attr[ 'once' ])) {\n            if ($_attr[ 'once' ] === 'false') {\n                $_once = '';\n            }\n        }\n        if (isset($_assign)) {\n            return \"<?php ob_start();\\ninclude{$_once} ('{$_filepath}');\\n\\$_smarty_tpl->assign({$_assign},ob_get_clean());\\n?>\";\n        } else {\n            return \"<?php include{$_once} ('{$_filepath}');?>\\n\";\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_insert.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Insert\n * Compiles the {insert} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Insert Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('name');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name');\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles code for the {insert} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $nocacheParam = $compiler->template->caching && ($compiler->tag_nocache || $compiler->nocache);\n        if (!$nocacheParam) {\n            // do not compile as nocache code\n            $compiler->suppressNocacheProcessing = true;\n        }\n        $compiler->tag_nocache = true;\n        $_smarty_tpl = $compiler->template;\n        $_name = null;\n        $_script = null;\n        $_output = '<?php ';\n        // save possible attributes\n        eval('$_name = @' . $_attr[ 'name' ] . ';');\n        if (isset($_attr[ 'assign' ])) {\n            // output will be stored in a smarty variable instead of being displayed\n            $_assign = $_attr[ 'assign' ];\n            // create variable to make sure that the compiler knows about its nocache status\n            $var = trim($_attr[ 'assign' ], '\\'');\n            if (isset($compiler->template->tpl_vars[ $var ])) {\n                $compiler->template->tpl_vars[ $var ]->nocache = true;\n            } else {\n                $compiler->template->tpl_vars[ $var ] = new Smarty_Variable(null, true);\n            }\n        }\n        if (isset($_attr[ 'script' ])) {\n            // script which must be included\n            $_function = \"smarty_insert_{$_name}\";\n            $_smarty_tpl = $compiler->template;\n            $_filepath = false;\n            eval('$_script = @' . $_attr[ 'script' ] . ';');\n            if (!isset($compiler->smarty->security_policy) && file_exists($_script)) {\n                $_filepath = $_script;\n            } else {\n                if (isset($compiler->smarty->security_policy)) {\n                    $_dir = $compiler->smarty->security_policy->trusted_dir;\n                } else {\n                    $_dir = $compiler->smarty instanceof SmartyBC ? $compiler->smarty->trusted_dir : null;\n                }\n                if (!empty($_dir)) {\n                    foreach ((array)$_dir as $_script_dir) {\n                        $_script_dir = rtrim($_script_dir, '/\\\\') . DIRECTORY_SEPARATOR;\n                        if (file_exists($_script_dir . $_script)) {\n                            $_filepath = $_script_dir . $_script;\n                            break;\n                        }\n                    }\n                }\n            }\n            if ($_filepath === false) {\n                $compiler->trigger_template_error(\"{insert} missing script file '{$_script}'\", null, true);\n            }\n            // code for script file loading\n            $_output .= \"require_once '{$_filepath}' ;\";\n            require_once $_filepath;\n            if (!is_callable($_function)) {\n                $compiler->trigger_template_error(\" {insert} function '{$_function}' is not callable in script file '{$_script}'\",\n                                                  null,\n                                                  true);\n            }\n        } else {\n            $_filepath = 'null';\n            $_function = \"insert_{$_name}\";\n            // function in PHP script ?\n            if (!is_callable($_function)) {\n                // try plugin\n                if (!$_function = $compiler->getPlugin($_name, 'insert')) {\n                    $compiler->trigger_template_error(\"{insert} no function or plugin found for '{$_name}'\",\n                                                      null,\n                                                      true);\n                }\n            }\n        }\n        // delete {insert} standard attributes\n        unset($_attr[ 'name' ], $_attr[ 'assign' ], $_attr[ 'script' ], $_attr[ 'nocache' ]);\n        // convert attributes into parameter array string\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            $_paramsArray[] = \"'$_key' => $_value\";\n        }\n        $_params = 'array(' . implode(\", \", $_paramsArray) . ')';\n        // call insert\n        if (isset($_assign)) {\n            if ($_smarty_tpl->caching && !$nocacheParam) {\n                $_output .= \"echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \\$_smarty_tpl, '{$_filepath}',{$_assign});?>\";\n            } else {\n                $_output .= \"\\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\\$_smarty_tpl), true);?>\";\n            }\n        } else {\n            if ($_smarty_tpl->caching && !$nocacheParam) {\n                $_output .= \"echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \\$_smarty_tpl, '{$_filepath}');?>\";\n            } else {\n                $_output .= \"echo {$_function}({$_params},\\$_smarty_tpl);?>\";\n            }\n        }\n        return $_output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_ldelim.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Ldelim\n * Compiles the {ldelim} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Ldelim Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase\n{\n   /**\n     * Compiles code for the {ldelim} tag\n     * This tag does output the left delimiter\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $_attr = $this->getAttributes($compiler, $args);\n        if ($_attr[ 'nocache' ] === true) {\n            $compiler->trigger_template_error('nocache option not allowed', null, true);\n        }\n        return $compiler->smarty->left_delimiter;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_make_nocache.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Make_Nocache\n * Compiles the {make_nocache} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Make_Nocache Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Make_Nocache extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array();\n\n    /**\n     * Array of names of required attribute required by tag\n     *\n     * @var array\n     */\n    public $required_attributes = array('var');\n\n    /**\n     * Shorttag attribute order defined by its names\n     *\n     * @var array\n     */\n    public $shorttag_order = array('var');\n\n    /**\n     * Compiles code for the {make_nocache} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n      */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        if ($compiler->template->caching) {\n            $output = \"<?php \\$_smarty_tpl->smarty->ext->_make_nocache->save(\\$_smarty_tpl, {$_attr[ 'var' ]});\\n?>\\n\";\n            $compiler->template->compiled->has_nocache_code = true;\n            $compiler->suppressNocacheProcessing = true;\n            return $output;\n        } else {\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_nocache.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Nocache\n * Compiles the {nocache} {/nocache} tags.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Nocache Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase\n{\n    /**\n     * Array of names of valid option flags\n     *\n     * @var array\n     */\n    public $option_flags = array();\n\n    /**\n     * Compiles code for the {nocache} tag\n     * This tag does not generate compiled output. It only sets a compiler flag.\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return bool\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $_attr = $this->getAttributes($compiler, $args);\n        $this->openTag($compiler, 'nocache', array($compiler->nocache));\n        // enter nocache mode\n        $compiler->nocache = true;\n        // this tag does not return compiled code\n        $compiler->has_code = false;\n\n        return true;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Nocacheclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/nocache} tag\n     * This tag does not generate compiled output. It only sets a compiler flag.\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return bool\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $_attr = $this->getAttributes($compiler, $args);\n        // leave nocache mode\n        list($compiler->nocache) = $this->closeTag($compiler, array('nocache'));\n        // this tag does not return compiled code\n        $compiler->has_code = false;\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_parent.php",
    "content": "<?php\n/*\n * This file is part of Smarty.\n *\n * (c) 2015 Uwe Tews\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Smarty Internal Plugin Compile Parent Class\n *\n * @author Uwe Tews <uwe.tews@googlemail.com>\n */\nclass Smarty_Internal_Compile_Parent extends Smarty_Internal_Compile_Child\n{\n\n    /**\n     * Tag name\n     *\n     * @var string\n     */\n    public $tag = 'parent';\n\n    /**\n     * Block type\n     *\n     * @var string\n     */\n    public $blockType = 'Parent';\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_block_plugin.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Block Plugin\n * Compiles code for the execution of block plugin\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Block Plugin Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * nesting level\n     *\n     * @var int\n     */\n    public $nesting = 0;\n\n    /**\n     * Compiles code for the execution of block plugin\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     * @param  string                               $tag       name of block plugin\n     * @param  string                               $function  PHP function name\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function = null)\n    {\n        if (!isset($tag[ 5 ]) || substr($tag, - 5) !== 'close') {\n            // opening tag of block plugin\n            // check and get attributes\n            $_attr = $this->getAttributes($compiler, $args);\n            $this->nesting ++;\n            unset($_attr[ 'nocache' ]);\n            list($callback, $_paramsArray, $callable) = $this->setup($compiler, $_attr, $tag, $function);\n            $_params = 'array(' . implode(',', $_paramsArray) . ')';\n\n            // compile code\n            $output = \"<?php \";\n            if (is_array($callback)) {\n                $output .= \"\\$_block_plugin{$this->nesting} = isset({$callback[0]}) ? {$callback[0]} : null;\\n\";\n                $callback = \"\\$_block_plugin{$this->nesting}{$callback[1]}\";\n            }\n            if (isset($callable)) {\n                $output .= \"if (!is_callable({$callable})) {\\nthrow new SmartyException('block tag \\'{$tag}\\' not callable or registered');\\n}\\n\";\n            }\n            $output .= \"\\$_smarty_tpl->smarty->_cache['_tag_stack'][] = array('{$tag}', {$_params});\\n\";\n            $output .= \"\\$_block_repeat=true;\\necho {$callback}({$_params}, null, \\$_smarty_tpl, \\$_block_repeat);\\nwhile (\\$_block_repeat) {\\nob_start();?>\";\n            $this->openTag($compiler, $tag, array($_params, $compiler->nocache, $callback));\n            // maybe nocache because of nocache variables or nocache plugin\n            $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        } else {\n            // must endblock be nocache?\n            if ($compiler->nocache) {\n                $compiler->tag_nocache = true;\n            }\n            // closing tag of block plugin, restore nocache\n            list($_params, $compiler->nocache, $callback) = $this->closeTag($compiler, substr($tag, 0, - 5));\n            // compile code\n            if (!isset($parameter[ 'modifier_list' ])) {\n                $mod_pre = $mod_post = $mod_content = '';\n                $mod_content2 = 'ob_get_clean()';\n            } else {\n                $mod_content2 = \"\\$_block_content{$this->nesting}\";\n                $mod_content = \"\\$_block_content{$this->nesting} = ob_get_clean();\\n\";\n                $mod_pre = \"ob_start();\\n\";\n                $mod_post = 'echo ' . $compiler->compileTag('private_modifier', array(),\n                                                            array('modifierlist' => $parameter[ 'modifier_list' ],\n                                                                  'value' => 'ob_get_clean()')) . \";\\n\";\n            }\n            $output = \"<?php {$mod_content}\\$_block_repeat=false;\\n{$mod_pre}echo {$callback}({$_params}, {$mod_content2}, \\$_smarty_tpl, \\$_block_repeat);\\n{$mod_post}}\\n\";\n            $output .= 'array_pop($_smarty_tpl->smarty->_cache[\\'_tag_stack\\']);?>';\n        }\n        return $output;\n    }\n\n    /**\n     * Setup callback and parameter array\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param  array                                $_attr attributes\n     * @param  string                               $tag\n     * @param  string                               $function\n     *\n     * @return array\n     */\n    public function setup(Smarty_Internal_TemplateCompilerBase $compiler, $_attr, $tag, $function)\n    {\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        return array($function, $_paramsArray, null);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_foreachsection.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile ForeachSection\n * Shared methods for {foreach} {section} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile ForeachSection Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_CompileBase\n{\n\n    /**\n     * Preg search pattern\n     *\n     * @var string\n     */\n    private $propertyPreg = '';\n\n    /**\n     * Offsets in preg match result\n     *\n     * @var array\n     */\n    private $resultOffsets = array();\n\n    /**\n     * Start offset\n     *\n     * @var int\n     */\n    private $startOffset = 0;\n\n    /**\n     * Name of this tag\n     *\n     * @var string\n     */\n    public $tagName = '';\n\n    /**\n     * Valid properties of $smarty.xxx variable\n     *\n     * @var array\n     */\n    public $nameProperties = array();\n\n    /**\n     * {section} tag has no item properties\n     *\n     * @var array\n     */\n    public $itemProperties = null;\n\n    /**\n     * {section} tag has always name attribute\n     *\n     * @var bool\n     */\n    public $isNamed = true;\n\n    /**\n     * @var array\n     */\n    public $matchResults = array();\n\n    /**\n     * Scan sources for used tag attributes\n     *\n     * @param  array                                $attributes\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     *\n     * @throws \\SmartyException\n     */\n    public function scanForProperties($attributes, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $this->propertyPreg = '~(';\n        $this->startOffset = 0;\n        $this->resultOffsets = array();\n        $this->matchResults = array('named' => array(), 'item' => array());\n        if ($this->isNamed) {\n            $this->buildPropertyPreg(true, $attributes);\n        }\n        if (isset($this->itemProperties)) {\n            if ($this->isNamed) {\n                $this->propertyPreg .= '|';\n            }\n            $this->buildPropertyPreg(false, $attributes);\n        }\n        $this->propertyPreg .= ')\\W~i';\n        // Template source\n        $this->matchTemplateSource($compiler);\n        // Parent template source\n        $this->matchParentTemplateSource($compiler);\n        // {block} source\n        $this->matchBlockSource($compiler);\n    }\n\n    /**\n     * Build property preg string\n     *\n     * @param bool  $named\n     * @param array $attributes\n     */\n    public function buildPropertyPreg($named, $attributes)\n    {\n        if ($named) {\n            $this->resultOffsets[ 'named' ] = $this->startOffset + 4;\n            $this->propertyPreg .= \"(([\\$]smarty[.]{$this->tagName}[.]\" . ($this->tagName === 'section' ? \"|[\\[]\\s*\" : '')\n                                   . \"){$attributes['name']}[.](\";\n            $properties = $this->nameProperties;\n        } else {\n            $this->resultOffsets[ 'item' ] = $this->startOffset + 3;\n            $this->propertyPreg .= \"([\\$]{$attributes['item']}[@](\";\n            $properties = $this->itemProperties;\n        }\n        $this->startOffset += count($properties) + 2;\n        $propName = reset($properties);\n        while ($propName) {\n            $this->propertyPreg .= \"({$propName})\";\n            $propName = next($properties);\n            if ($propName) {\n                $this->propertyPreg .= '|';\n            }\n        }\n        $this->propertyPreg .= '))';\n    }\n\n    /**\n     * Find matches in source string\n     *\n     * @param string $source\n     */\n    public function matchProperty($source)\n    {\n        preg_match_all($this->propertyPreg, $source, $match, PREG_SET_ORDER);\n        foreach ($this->resultOffsets as $key => $offset) {\n            foreach ($match as $m) {\n                if (isset($m[ $offset ]) && !empty($m[ $offset ])) {\n                    $this->matchResults[ $key ][ strtolower($m[ $offset ]) ] = true;\n                }\n            }\n        }\n    }\n\n    /**\n     * Find matches in template source\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     */\n    public function matchTemplateSource(Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $this->matchProperty($compiler->parser->lex->data);\n    }\n\n    /**\n     * Find matches in all parent template source\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     *\n     * @throws \\SmartyException\n     */\n    public function matchParentTemplateSource(Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // search parent compiler template source\n        $nextCompiler = $compiler;\n        while ($nextCompiler !== $nextCompiler->parent_compiler) {\n            $nextCompiler = $nextCompiler->parent_compiler;\n            if ($compiler !== $nextCompiler) {\n                // get template source\n                $_content = $nextCompiler->template->source->getContent();\n                if ($_content !== '') {\n                    // run pre filter if required\n                    if ((isset($nextCompiler->smarty->autoload_filters[ 'pre' ]) ||\n                         isset($nextCompiler->smarty->registered_filters[ 'pre' ]))\n                    ) {\n                        $_content = $nextCompiler->smarty->ext->_filterHandler->runFilter('pre', $_content,\n                                                                                          $nextCompiler->template);\n                    }\n                    $this->matchProperty($_content);\n                }\n            }\n        }\n    }\n\n    /**\n     * Find matches in {block} tag source\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     */\n    public function matchBlockSource(Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n    }\n\n    /**\n     * Compiles code for the {$smarty.foreach.xxx} or {$smarty.section.xxx}tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        $tag = strtolower(trim($parameter[ 0 ], '\"\\''));\n        $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : false;\n        if (!$name) {\n            $compiler->trigger_template_error(\"missing or illegal \\$smarty.{$tag} name attribute\", null, true);\n        }\n        $property = isset($parameter[ 2 ]) ? strtolower($compiler->getId($parameter[ 2 ])) : false;\n        if (!$property || !in_array($property, $this->nameProperties)) {\n            $compiler->trigger_template_error(\"missing or illegal \\$smarty.{$tag} property attribute\", null, true);\n        }\n        $tagVar = \"'__smarty_{$tag}_{$name}'\";\n        return \"(isset(\\$_smarty_tpl->tpl_vars[{$tagVar}]->value['{$property}']) ? \\$_smarty_tpl->tpl_vars[{$tagVar}]->value['{$property}'] : null)\";\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_function_plugin.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Function Plugin\n * Compiles code for the execution of function plugin\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Function Plugin Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array();\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles code for the execution of function plugin\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     * @param  string                               $tag       name of function plugin\n     * @param  string                               $function  PHP function name\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        unset($_attr[ 'nocache' ]);\n        // convert attributes into parameter array string\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        $_params = 'array(' . implode(',', $_paramsArray) . ')';\n        // compile code\n        $output = \"{$function}({$_params},\\$_smarty_tpl)\";\n        if (!empty($parameter[ 'modifierlist' ])) {\n            $output = $compiler->compileTag('private_modifier', array(),\n                                            array('modifierlist' => $parameter[ 'modifierlist' ],\n                                                  'value' => $output));\n        }\n        $output = \"<?php echo {$output};?>\\n\";\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_modifier.php",
    "content": "<?php\n\n/**\n * Smarty Internal Plugin Compile Modifier\n * Compiles code for modifier execution\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Modifier Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for modifier execution\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $output = $parameter[ 'value' ];\n        // loop over list of modifiers\n        foreach ($parameter[ 'modifierlist' ] as $single_modifier) {\n            /* @var string $modifier */\n            $modifier = $single_modifier[ 0 ];\n            $single_modifier[ 0 ] = $output;\n            $params = implode(',', $single_modifier);\n            // check if we know already the type of modifier\n            if (isset($compiler->known_modifier_type[ $modifier ])) {\n                $modifier_types = array($compiler->known_modifier_type[ $modifier ]);\n            } else {\n                $modifier_types = array(1, 2, 3, 4, 5, 6);\n            }\n            foreach ($modifier_types as $type) {\n                switch ($type) {\n                    case 1:\n                        // registered modifier\n                        if (isset($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ])) {\n                            if (is_callable($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ][ 0 ])) {\n                                $output =\n                                    sprintf('call_user_func_array($_smarty_tpl->registered_plugins[ \\'%s\\' ][ %s ][ 0 ], array( %s ))',\n                                            Smarty::PLUGIN_MODIFIER, var_export($modifier, true), $params);\n                                $compiler->known_modifier_type[ $modifier ] = $type;\n                                break 2;\n                            }\n                        }\n                        break;\n                    case 2:\n                        // registered modifier compiler\n                        if (isset($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIERCOMPILER ][ $modifier ][ 0 ])) {\n                            $output =\n                                call_user_func($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIERCOMPILER ][ $modifier ][ 0 ],\n                                               $single_modifier, $compiler->smarty);\n                            $compiler->known_modifier_type[ $modifier ] = $type;\n                            break 2;\n                        }\n                        break;\n                    case 3:\n                        // modifiercompiler plugin\n                        if ($compiler->smarty->loadPlugin('smarty_modifiercompiler_' . $modifier)) {\n                            // check if modifier allowed\n                            if (!is_object($compiler->smarty->security_policy) ||\n                                $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)\n                            ) {\n                                $plugin = 'smarty_modifiercompiler_' . $modifier;\n                                $output = $plugin($single_modifier, $compiler);\n                            }\n                            $compiler->known_modifier_type[ $modifier ] = $type;\n                            break 2;\n                        }\n                        break;\n                    case 4:\n                        // modifier plugin\n                        if ($function = $compiler->getPlugin($modifier, Smarty::PLUGIN_MODIFIER)) {\n                            // check if modifier allowed\n                            if (!is_object($compiler->smarty->security_policy) ||\n                                $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)\n                            ) {\n                                $output = \"{$function}({$params})\";\n                            }\n                            $compiler->known_modifier_type[ $modifier ] = $type;\n                            break 2;\n                        }\n                        break;\n                    case 5:\n                        // PHP function\n                        if (is_callable($modifier)) {\n                            // check if modifier allowed\n                            if (!is_object($compiler->smarty->security_policy) ||\n                                $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler)\n                            ) {\n                                $output = \"{$modifier}({$params})\";\n                            }\n                            $compiler->known_modifier_type[ $modifier ] = $type;\n                            break 2;\n                        }\n                        break;\n                    case 6:\n                        // default plugin handler\n                        if (isset($compiler->default_handler_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ]) ||\n                            (is_callable($compiler->smarty->default_plugin_handler_func) &&\n                             $compiler->getPluginFromDefaultHandler($modifier, Smarty::PLUGIN_MODIFIER))\n                        ) {\n                            $function = $compiler->default_handler_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ][ 0 ];\n                            // check if modifier allowed\n                            if (!is_object($compiler->smarty->security_policy) ||\n                                $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)\n                            ) {\n                                if (!is_array($function)) {\n                                    $output = \"{$function}({$params})\";\n                                } else {\n                                    if (is_object($function[ 0 ])) {\n                                        $output =  $function[ 0 ] . '->'. $function[ 1 ] . '(' . $params . ')';\n                                    } else {\n                                        $output = $function[ 0 ] . '::' . $function[ 1 ] . '(' . $params . ')';\n                                    }\n                                }\n                            }\n                            if (isset($compiler->required_plugins[ 'nocache' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ]) ||\n                                isset($compiler->required_plugins[ 'compiled' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ])\n                            ) {\n                                // was a plugin\n                                $compiler->known_modifier_type[ $modifier ] = 4;\n                            } else {\n                                $compiler->known_modifier_type[ $modifier ] = $type;\n                            }\n                            break 2;\n                        }\n                }\n            }\n            if (!isset($compiler->known_modifier_type[ $modifier ])) {\n                $compiler->trigger_template_error(\"unknown modifier '{$modifier}'\", null, true);\n            }\n        }\n\n        return $output;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_object_block_function.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Object Block Function\n * Compiles code for registered objects as block function\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Object Block Function Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Internal_Compile_Private_Block_Plugin\n{\n    /**\n     * Setup callback and parameter array\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param  array                                $_attr attributes\n     * @param  string                               $tag\n     * @param  string                               $method\n     *\n     * @return array\n     */\n    public function setup(Smarty_Internal_TemplateCompilerBase $compiler, $_attr, $tag, $method)\n    {\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        $callback = array(\"\\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]\", \"->{$method}\");\n        return array($callback, $_paramsArray, \"array(\\$_block_plugin{$this->nesting}, '{$method}')\");\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_object_function.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Object Function\n * Compiles code for registered objects as function\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Object Function Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles code for the execution of function plugin\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     * @param  string                               $tag       name of function\n     * @param  string                               $method    name of method to call\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $method)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        unset($_attr[ 'nocache' ]);\n        $_assign = null;\n        if (isset($_attr[ 'assign' ])) {\n            $_assign = $_attr[ 'assign' ];\n            unset($_attr[ 'assign' ]);\n        }\n        // method or property ?\n        if (is_callable(array($compiler->smarty->registered_objects[ $tag ][ 0 ], $method))) {\n            // convert attributes into parameter array string\n            if ($compiler->smarty->registered_objects[ $tag ][ 2 ]) {\n                $_paramsArray = array();\n                foreach ($_attr as $_key => $_value) {\n                    if (is_int($_key)) {\n                        $_paramsArray[] = \"$_key=>$_value\";\n                    } else {\n                        $_paramsArray[] = \"'$_key'=>$_value\";\n                    }\n                }\n                $_params = 'array(' . implode(',', $_paramsArray) . ')';\n                $output = \"\\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\\$_smarty_tpl)\";\n            } else {\n                $_params = implode(',', $_attr);\n                $output = \"\\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})\";\n            }\n        } else {\n            // object property\n            $output = \"\\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}\";\n        }\n        if (!empty($parameter[ 'modifierlist' ])) {\n            $output = $compiler->compileTag('private_modifier', array(),\n                                            array('modifierlist' => $parameter[ 'modifierlist' ], 'value' => $output));\n        }\n        if (empty($_assign)) {\n            return \"<?php echo {$output};?>\\n\";\n        } else {\n            return \"<?php \\$_smarty_tpl->assign({$_assign},{$output});?>\\n\";\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_php.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile PHP Expression\n * Compiles any tag which will output an expression or variable\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile PHP Expression Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase\n{\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('code', 'type');\n\n    /**\n     * Compiles code for generating output from any expression\n     *\n     * @param array                                 $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param array                                 $parameter array with compilation parameter\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $compiler->has_code = false;\n        if ($_attr[ 'type' ] === 'xml') {\n            $compiler->tag_nocache = true;\n            $output = addcslashes($_attr[ 'code' ], \"'\\\\\");\n            $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                              new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                                $compiler->processNocacheCode(\"<?php echo '{$output}';?>\",\n                                                                                                                              true)));\n            return '';\n        }\n        if ($_attr[ 'type' ] !== 'tag') {\n            if ($compiler->php_handling === Smarty::PHP_REMOVE) {\n                return '';\n            } elseif ($compiler->php_handling === Smarty::PHP_QUOTE) {\n                $output =\n                    preg_replace_callback('#(<\\?(?:php|=)?)|(<%)|(<script\\s+language\\s*=\\s*[\"\\']?\\s*php\\s*[\"\\']?\\s*>)|(\\?>)|(%>)|(<\\/script>)#i',\n                                          array($this, 'quote'), $_attr[ 'code' ]);\n                $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                                  new Smarty_Internal_ParseTree_Text($output));\n                return '';\n            } elseif ($compiler->php_handling === Smarty::PHP_PASSTHRU || $_attr[ 'type' ] === 'unmatched') {\n                $compiler->tag_nocache = true;\n                $output = addcslashes($_attr[ 'code' ], \"'\\\\\");\n                $compiler->parser->current_buffer->append_subtree($compiler->parser,\n                                                                  new Smarty_Internal_ParseTree_Tag($compiler->parser,\n                                                                                                    $compiler->processNocacheCode(\"<?php echo '{$output}';?>\",\n                                                                                                                                  true)));\n                return '';\n            } elseif ($compiler->php_handling === Smarty::PHP_ALLOW) {\n                if (!($compiler->smarty instanceof SmartyBC)) {\n                    $compiler->trigger_template_error('$smarty->php_handling PHP_ALLOW not allowed. Use SmartyBC to enable it',\n                                                      null, true);\n                }\n                $compiler->has_code = true;\n                return $_attr[ 'code' ];\n            } else {\n                $compiler->trigger_template_error('Illegal $smarty->php_handling value', null, true);\n            }\n        } else {\n            $compiler->has_code = true;\n            if (!($compiler->smarty instanceof SmartyBC)) {\n                $compiler->trigger_template_error('{php}{/php} tags not allowed. Use SmartyBC to enable them', null,\n                                                  true);\n            }\n            $ldel = preg_quote($compiler->smarty->left_delimiter, '#');\n            $rdel = preg_quote($compiler->smarty->right_delimiter, '#');\n            preg_match(\"#^({$ldel}php\\\\s*)((.)*?)({$rdel})#\", $_attr[ 'code' ], $match);\n            if (!empty($match[ 2 ])) {\n                if ('nocache' === trim($match[ 2 ])) {\n                    $compiler->tag_nocache = true;\n                } else {\n                    $compiler->trigger_template_error(\"illegal value of option flag '{$match[2]}'\", null, true);\n                }\n            }\n            return preg_replace(array(\"#^{$ldel}\\\\s*php\\\\s*(.)*?{$rdel}#\", \"#{$ldel}\\\\s*/\\\\s*php\\\\s*{$rdel}$#\"),\n                                array('<?php ', '?>'), $_attr[ 'code' ]);\n        }\n    }\n\n    /**\n     * Lexer code for PHP tags\n     *\n     * This code has been moved from lexer here fo easier debugging and maintenance\n     *\n     * @param Smarty_Internal_Templatelexer $lex\n     *\n     * @throws \\SmartyCompilerException\n     */\n    public function parsePhp(Smarty_Internal_Templatelexer $lex)\n    {\n        $lex->token = Smarty_Internal_Templateparser::TP_PHP;\n        $close = 0;\n        $lex->taglineno = $lex->line;\n        $closeTag = '?>';\n        if (strpos($lex->value, '<?xml') === 0) {\n            $lex->is_xml = true;\n            $lex->phpType = 'xml';\n            return;\n        } elseif (strpos($lex->value, '<?') === 0) {\n            $lex->phpType = 'php';\n        } elseif (strpos($lex->value, '<%') === 0) {\n            $lex->phpType = 'asp';\n            $closeTag = '%>';\n        } elseif (strpos($lex->value, '%>') === 0) {\n            $lex->phpType = 'unmatched';\n        } elseif (strpos($lex->value, '?>') === 0) {\n            if ($lex->is_xml) {\n                $lex->is_xml = false;\n                $lex->phpType = 'xml';\n                return;\n            }\n            $lex->phpType = 'unmatched';\n        } elseif (strpos($lex->value, '<s') === 0) {\n            $lex->phpType = 'script';\n            $closeTag = '</script>';\n        } elseif (strpos($lex->value, $lex->smarty->left_delimiter) === 0) {\n            if ($lex->isAutoLiteral()) {\n                $lex->token = Smarty_Internal_Templateparser::TP_TEXT;\n                return;\n            }\n            $closeTag = \"{$lex->smarty->left_delimiter}/php{$lex->smarty->right_delimiter}\";\n            if ($lex->value === $closeTag) {\n                $lex->compiler->trigger_template_error(\"unexpected closing tag '{$closeTag}'\");\n            }\n            $lex->phpType = 'tag';\n        }\n        if ($lex->phpType === 'unmatched') {\n            return;\n        }\n        if (($lex->phpType === 'php' || $lex->phpType === 'asp') &&\n            ($lex->compiler->php_handling === Smarty::PHP_PASSTHRU || $lex->compiler->php_handling === Smarty::PHP_QUOTE)\n        ) {\n            return;\n        }\n        $start = $lex->counter + strlen($lex->value);\n        $body = true;\n        if (preg_match('~' . preg_quote($closeTag, '~') . '~i', $lex->data, $match, PREG_OFFSET_CAPTURE, $start)) {\n            $close = $match[ 0 ][ 1 ];\n        } else {\n            $lex->compiler->trigger_template_error(\"missing closing tag '{$closeTag}'\");\n        }\n        while ($body) {\n            if (preg_match('~([/][*])|([/][/][^\\n]*)|(\\'[^\\'\\\\\\\\]*(?:\\\\.[^\\'\\\\\\\\]*)*\\')|(\"[^\"\\\\\\\\]*(?:\\\\.[^\"\\\\\\\\]*)*\")~',\n                           $lex->data, $match, PREG_OFFSET_CAPTURE, $start)) {\n                $value = $match[ 0 ][ 0 ];\n                $from = $pos = $match[ 0 ][ 1 ];\n                if ($pos > $close) {\n                    $body = false;\n                } else {\n                    $start = $pos + strlen($value);\n                    $phpCommentStart = $value === '/*';\n                    if ($phpCommentStart) {\n                        $phpCommentEnd = preg_match('~([*][/])~', $lex->data, $match, PREG_OFFSET_CAPTURE, $start);\n                        if ($phpCommentEnd) {\n                            $pos2 = $match[ 0 ][ 1 ];\n                            $start = $pos2 + strlen($match[ 0 ][ 0 ]);\n                        }\n                    }\n                    while ($close > $pos && $close < $start) {\n                        if (preg_match('~' . preg_quote($closeTag, '~') . '~i', $lex->data, $match, PREG_OFFSET_CAPTURE,\n                                       $from)) {\n                            $close = $match[ 0 ][ 1 ];\n                            $from = $close + strlen($match[ 0 ][ 0 ]);\n                        } else {\n                            $lex->compiler->trigger_template_error(\"missing closing tag '{$closeTag}'\");\n                        }\n                    }\n                    if ($phpCommentStart && (!$phpCommentEnd || $pos2 > $close)) {\n                        $lex->taglineno = $lex->line + substr_count(substr($lex->data, $lex->counter, $start), \"\\n\");\n                        $lex->compiler->trigger_template_error(\"missing PHP comment closing tag '*/'\");\n                    }\n                }\n            } else {\n                $body = false;\n            }\n        }\n        $lex->value = substr($lex->data, $lex->counter, $close + strlen($closeTag) - $lex->counter);\n    }\n\n    /*\n     * Call back function for $php_handling = PHP_QUOTE\n     *\n     */\n    /**\n     * @param $match\n     *\n     * @return string\n     */\n    private function quote($match)\n    {\n        return htmlspecialchars($match[ 0 ], ENT_QUOTES);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_print_expression.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Print Expression\n * Compiles any tag which will output an expression or variable\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Print Expression Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('assign');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $option_flags = array('nocache', 'nofilter');\n\n    /**\n     * Compiles code for generating output from any expression\n     *\n     * @param array                                 $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param array                                 $parameter array with compilation parameter\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $output = $parameter[ 'value' ];\n        // tag modifier\n        if (!empty($parameter[ 'modifierlist' ])) {\n            $output = $compiler->compileTag('private_modifier', array(),\n                                            array('modifierlist' => $parameter[ 'modifierlist' ],\n                                                  'value' => $output));\n        }\n        if (isset($_attr[ 'assign' ])) {\n            // assign output to variable\n            return \"<?php \\$_smarty_tpl->assign({$_attr['assign']},{$output});?>\";\n        } else {\n            // display value\n            if (!$_attr[ 'nofilter' ]) {\n                // default modifier\n                if (!empty($compiler->smarty->default_modifiers)) {\n                    if (empty($compiler->default_modifier_list)) {\n                        $modifierlist = array();\n                        foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) {\n                            preg_match_all('/(\\'[^\\'\\\\\\\\]*(?:\\\\\\\\.[^\\'\\\\\\\\]*)*\\'|\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"|:|[^:]+)/',\n                                           $single_default_modifier, $mod_array);\n                            for ($i = 0, $count = count($mod_array[ 0 ]); $i < $count; $i ++) {\n                                if ($mod_array[ 0 ][ $i ] !== ':') {\n                                    $modifierlist[ $key ][] = $mod_array[ 0 ][ $i ];\n                                }\n                            }\n                        }\n                        $compiler->default_modifier_list = $modifierlist;\n                    }\n                    $output = $compiler->compileTag('private_modifier', array(),\n                                                    array('modifierlist' => $compiler->default_modifier_list,\n                                                          'value' => $output));\n                }\n                // autoescape html\n                if ($compiler->template->smarty->escape_html) {\n                    $output = \"htmlspecialchars({$output}, ENT_QUOTES, '\" . addslashes(Smarty::$_CHARSET) . \"')\";\n                }\n                // loop over registered filters\n                if (!empty($compiler->template->smarty->registered_filters[ Smarty::FILTER_VARIABLE ])) {\n                    foreach ($compiler->template->smarty->registered_filters[ Smarty::FILTER_VARIABLE ] as $key =>\n                             $function) {\n                        if (!is_array($function)) {\n                            $output = \"{$function}({$output},\\$_smarty_tpl)\";\n                        } elseif (is_object($function[ 0 ])) {\n                            $output =\n                                \"\\$_smarty_tpl->smarty->registered_filters[Smarty::FILTER_VARIABLE]['{$key}'][0]->{$function[1]}({$output},\\$_smarty_tpl)\";\n                        } else {\n                            $output = \"{$function[0]}::{$function[1]}({$output},\\$_smarty_tpl)\";\n                        }\n                    }\n                }\n                // auto loaded filters\n                if (isset($compiler->smarty->autoload_filters[ Smarty::FILTER_VARIABLE ])) {\n                    foreach ((array) $compiler->template->smarty->autoload_filters[ Smarty::FILTER_VARIABLE ] as $name)\n                    {\n                        $result = $this->compile_variable_filter($compiler, $name, $output);\n                        if ($result !== false) {\n                            $output = $result;\n                        } else {\n                            // not found, throw exception\n                            throw new SmartyException(\"Unable to load variable filter '{$name}'\");\n                        }\n                    }\n                }\n                foreach ($compiler->variable_filters as $filter) {\n                    if (count($filter) === 1 &&\n                        ($result = $this->compile_variable_filter($compiler, $filter[ 0 ], $output)) !== false\n                    ) {\n                        $output = $result;\n                    } else {\n                        $output = $compiler->compileTag('private_modifier', array(),\n                                                        array('modifierlist' => array($filter), 'value' => $output));\n                    }\n                }\n            }\n            $output = \"<?php echo {$output};?>\\n\";\n        }\n\n        return $output;\n    }\n\n    /**\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     * @param string                                $name     name of variable filter\n     * @param string                                $output   embedded output\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    private function compile_variable_filter(Smarty_Internal_TemplateCompilerBase $compiler, $name, $output)\n    {\n       $function= $compiler->getPlugin($name, 'variablefilter');\n       if ($function) {\n            return \"{$function}({$output},\\$_smarty_tpl)\";\n       } else {\n            // not found\n            return false;\n       }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_registered_block.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Registered Block\n * Compiles code for the execution of a registered block function\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Registered Block Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_Compile_Private_Block_Plugin\n{\n    /**\n     * Setup callback, parameter array and nocache mode\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param  array                                $_attr attributes\n     * @param  string                               $tag\n     * @param  null                                 $function\n     *\n     * @return array\n     */\n    public function setup(Smarty_Internal_TemplateCompilerBase $compiler, $_attr, $tag, $function)\n    {\n        if (isset($compiler->smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $tag ])) {\n            $tag_info = $compiler->smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $tag ];\n            $callback = $tag_info[ 0 ];\n            if (is_array($callback)) {\n                if (is_object($callback[ 0 ])) {\n                    $callable = \"array(\\$_block_plugin{$this->nesting}, '{$callback[1]}')\";\n                    $callback =\n                        array(\"\\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]\", \"->{$callback[1]}\");\n                } else {\n                    $callable = \"array(\\$_block_plugin{$this->nesting}, '{$callback[1]}')\";\n                    $callback =\n                        array(\"\\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]\", \"::{$callback[1]}\");\n                }\n            } else {\n                $callable = \"\\$_block_plugin{$this->nesting}\";\n                $callback = array(\"\\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0]\", '');\n            }\n        } else {\n            $tag_info = $compiler->default_handler_plugins[ Smarty::PLUGIN_BLOCK ][ $tag ];\n            $callback = $tag_info[ 0 ];\n            if (is_array($callback)) {\n                $callable = \"array('{$callback[0]}', '{$callback[1]}')\";\n                $callback = \"{$callback[1]}::{$callback[1]}\";\n            } else {\n                $callable = null;\n            }\n        }\n        $compiler->tag_nocache = !$tag_info[ 1 ] | $compiler->tag_nocache;\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } elseif ($compiler->template->caching && in_array($_key, $tag_info[ 2 ])) {\n                $_value = str_replace('\\'', \"^#^\", $_value);\n                $_paramsArray[] = \"'$_key'=>^#^.var_export($_value,true).^#^\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        return array($callback, $_paramsArray, $callable);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_registered_function.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Registered Function\n * Compiles code for the execution of a registered function\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Registered Function Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Internal_CompileBase\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('_any');\n\n    /**\n     * Compiles code for the execution of a registered function\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     * @param  string                               $tag       name of function\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        unset($_attr[ 'nocache' ]);\n        if (isset($compiler->smarty->registered_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ])) {\n            $tag_info = $compiler->smarty->registered_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ];\n            $is_registered = true;\n        } else {\n             $tag_info = $compiler->default_handler_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ];\n             $is_registered = false;\n        }\n        // not cacheable?\n        $compiler->tag_nocache = $compiler->tag_nocache || !$tag_info[ 1 ];\n        // convert attributes into parameter array string\n        $_paramsArray = array();\n        foreach ($_attr as $_key => $_value) {\n            if (is_int($_key)) {\n                $_paramsArray[] = \"$_key=>$_value\";\n            } elseif ($compiler->template->caching && in_array($_key, $tag_info[ 2 ])) {\n                $_value = str_replace('\\'', \"^#^\", $_value);\n                $_paramsArray[] = \"'$_key'=>^#^.var_export($_value,true).^#^\";\n            } else {\n                $_paramsArray[] = \"'$_key'=>$_value\";\n            }\n        }\n        $_params = 'array(' . implode(',', $_paramsArray) . ')';\n        // compile code\n        if ($is_registered) {\n            $output =\n                \"call_user_func_array( \\$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['{$tag}'][0], array( {$_params},\\$_smarty_tpl ) )\";\n        } else {\n            $function = $tag_info[ 0 ];\n            if (!is_array($function)) {\n                $output = \"{$function}({$_params},\\$_smarty_tpl)\";\n            } else {\n                $output = \"{$function[0]}::{$function[1]}({$_params},\\$_smarty_tpl)\";\n            }\n        }\n        if (!empty($parameter[ 'modifierlist' ])) {\n            $output = $compiler->compileTag('private_modifier', array(),\n                                            array('modifierlist' => $parameter[ 'modifierlist' ],\n                                                  'value' => $output));\n        }\n        $output = \"<?php echo {$output};?>\\n\";\n        return $output;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_private_special_variable.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Special Smarty Variable\n * Compiles the special $smarty variables\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile special Smarty Variable Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the special $smarty variables\n     *\n     * @param  array                                       $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase        $compiler compiler object\n     * @param                                              $parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        $_index = preg_split(\"/\\]\\[/\", substr($parameter, 1, strlen($parameter) - 2));\n        $variable = strtolower($compiler->getId($_index[ 0 ]));\n        if ($variable === false) {\n            $compiler->trigger_template_error(\"special \\$Smarty variable name index can not be variable\", null, true);\n        }\n        if (!isset($compiler->smarty->security_policy) ||\n            $compiler->smarty->security_policy->isTrustedSpecialSmartyVar($variable, $compiler)\n        ) {\n            switch ($variable) {\n                case 'foreach':\n                case 'section':\n                    if (!isset(Smarty_Internal_TemplateCompilerBase::$_tag_objects[ $variable ])) {\n                        $class = 'Smarty_Internal_Compile_' . ucfirst($variable);\n                        Smarty_Internal_TemplateCompilerBase::$_tag_objects[ $variable ] = new $class;\n                    }\n                    return Smarty_Internal_TemplateCompilerBase::$_tag_objects[ $variable ]->compileSpecialVariable(array(), $compiler, $_index);\n                case 'capture':\n                    if (class_exists('Smarty_Internal_Compile_Capture')) {\n                        return Smarty_Internal_Compile_Capture::compileSpecialVariable(array(), $compiler, $_index);\n                    }\n                    return '';\n                case 'now':\n                    return 'time()';\n                case 'cookies':\n                    if (isset($compiler->smarty->security_policy) &&\n                        !$compiler->smarty->security_policy->allow_super_globals\n                    ) {\n                        $compiler->trigger_template_error(\"(secure mode) super globals not permitted\");\n                        break;\n                    }\n                    $compiled_ref = '$_COOKIE';\n                    break;\n                case 'get':\n                case 'post':\n                case 'env':\n                case 'server':\n                case 'session':\n                case 'request':\n                    if (isset($compiler->smarty->security_policy) &&\n                        !$compiler->smarty->security_policy->allow_super_globals\n                    ) {\n                        $compiler->trigger_template_error(\"(secure mode) super globals not permitted\");\n                        break;\n                    }\n                    $compiled_ref = '$_' . strtoupper($variable);\n                    break;\n\n                case 'template':\n                    return 'basename($_smarty_tpl->source->filepath)';\n\n                case 'template_object':\n                    return '$_smarty_tpl';\n\n                case 'current_dir':\n                    return 'dirname($_smarty_tpl->source->filepath)';\n\n                case 'version':\n                    return \"Smarty::SMARTY_VERSION\";\n\n                case 'const':\n                    if (isset($compiler->smarty->security_policy) &&\n                        !$compiler->smarty->security_policy->allow_constants\n                    ) {\n                        $compiler->trigger_template_error(\"(secure mode) constants not permitted\");\n                        break;\n                    }\n                    if (strpos($_index[ 1 ], '$') === false && strpos($_index[ 1 ], '\\'') === false) {\n                        return \"@constant('{$_index[1]}')\";\n                    } else {\n                        return \"@constant({$_index[1]})\";\n                    }\n\n                case 'config':\n                    if (isset($_index[ 2 ])) {\n                        return \"(is_array(\\$tmp = \\$_smarty_tpl->smarty->ext->configload->_getConfigVariable(\\$_smarty_tpl, $_index[1])) ? \\$tmp[$_index[2]] : null)\";\n                    } else {\n                        return \"\\$_smarty_tpl->smarty->ext->configload->_getConfigVariable(\\$_smarty_tpl, $_index[1])\";\n                    }\n                case 'ldelim':\n                    return \"\\$_smarty_tpl->smarty->left_delimiter\";\n                case 'rdelim':\n                    return \"\\$_smarty_tpl->smarty->right_delimiter\";\n                default:\n                    $compiler->trigger_template_error('$smarty.' . trim($_index[ 0 ], \"'\") . ' is not defined');\n                    break;\n            }\n            if (isset($_index[ 1 ])) {\n                array_shift($_index);\n                foreach ($_index as $_ind) {\n                    $compiled_ref = $compiled_ref . \"[$_ind]\";\n                }\n            }\n            return $compiled_ref;\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_rdelim.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Rdelim\n * Compiles the {rdelim} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Rdelim Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Rdelim extends Smarty_Internal_Compile_Ldelim\n{\n    /**\n     * Compiles code for the {rdelim} tag\n     * This tag does output the right delimiter.\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        parent::compile($args,$compiler);\n        return $compiler->smarty->right_delimiter;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_section.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Section\n * Compiles the {section} {sectionelse} {/section} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Section Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_ForeachSection\n{\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $required_attributes = array('name', 'loop');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $shorttag_order = array('name', 'loop');\n\n    /**\n     * Attribute definition: Overwrites base class.\n     *\n     * @var array\n     * @see Smarty_Internal_CompileBase\n     */\n    public $optional_attributes = array('start', 'step', 'max', 'show', 'properties');\n\n    /**\n     * counter\n     *\n     * @var int\n     */\n    public $counter = 0;\n\n    /**\n     * Name of this tag\n     *\n     * @var string\n     */\n    public $tagName = 'section';\n\n    /**\n     * Valid properties of $smarty.section.name.xxx variable\n     *\n     * @var array\n     */\n    public $nameProperties = array('first', 'last', 'index', 'iteration', 'show', 'total', 'rownum', 'index_prev',\n                                   'index_next', 'loop');\n\n    /**\n     * {section} tag has no item properties\n     *\n     * @var array\n     */\n    public $itemProperties = null;\n\n    /**\n     * {section} tag has always name attribute\n     *\n     * @var bool\n     */\n    public $isNamed = true;\n\n    /**\n     * Compiles code for the {section} tag\n     *\n     * @param  array                                 $args     array with attributes from parser\n     * @param  \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     * @throws \\SmartyException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $compiler->loopNesting ++;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $attributes = array('name' => $compiler->getId($_attr[ 'name' ]));\n        unset($_attr[ 'name' ]);\n        foreach ($attributes as $a => $v) {\n            if ($v === false) {\n                $compiler->trigger_template_error(\"'{$a}' attribute/variable has illegal value\", null, true);\n            }\n        }\n        $local = \"\\$__section_{$attributes['name']}_\" . $this->counter ++ . '_';\n        $sectionVar = \"\\$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}']\";\n        $this->openTag($compiler, 'section', array('section', $compiler->nocache, $local, $sectionVar));\n        // maybe nocache because of nocache variables\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n\n        $initLocal = array();\n        $initNamedProperty = array();\n        $initFor = array();\n        $incFor = array();\n        $cmpFor = array();\n        $propValue = array('index' => \"{$sectionVar}->value['index']\", 'show' => 'true', 'step' => 1,\n                           'iteration' => \"{$local}iteration\",\n\n        );\n        $propType = array('index' => 2, 'iteration' => 2, 'show' => 0, 'step' => 0,);\n        // search for used tag attributes\n        $this->scanForProperties($attributes, $compiler);\n        if (!empty($this->matchResults[ 'named' ])) {\n            $namedAttr = $this->matchResults[ 'named' ];\n        }\n        if (isset($_attr[ 'properties' ]) && preg_match_all(\"/['](.*?)[']/\", $_attr[ 'properties' ], $match)) {\n            foreach ($match[ 1 ] as $prop) {\n                if (in_array($prop, $this->nameProperties)) {\n                    $namedAttr[ $prop ] = true;\n                } else {\n                    $compiler->trigger_template_error(\"Invalid property '{$prop}'\", null, true);\n                }\n            }\n        }\n        $namedAttr[ 'index' ] = true;\n        $output = \"<?php\\n\";\n        foreach ($_attr as $attr_name => $attr_value) {\n            switch ($attr_name) {\n                case 'loop':\n                    if (is_numeric($attr_value)) {\n                        $v = (int) $attr_value;\n                        $t = 0;\n                    } else {\n                        $v = \"(is_array(@\\$_loop=$attr_value) ? count(\\$_loop) : max(0, (int) \\$_loop))\";\n                        $t = 1;\n                    }\n                    if ($t === 1) {\n                        $initLocal[ 'loop' ] = $v;\n                        $v = \"{$local}loop\";\n                    }\n                    break;\n                case 'show':\n                    if (is_bool($attr_value)) {\n                        $v = $attr_value ? 'true' : 'false';\n                        $t = 0;\n                    } else {\n                        $v = \"(bool) $attr_value\";\n                        $t = 3;\n                    }\n                    break;\n                case 'step':\n                    if (is_numeric($attr_value)) {\n                        $v = (int) $attr_value;\n                        $v = ($v === 0) ? 1 : $v;\n                        $t = 0;\n                        break;\n                    }\n                    $initLocal[ 'step' ] = \"((int)@$attr_value) === 0 ? 1 : (int)@$attr_value\";\n                    $v = \"{$local}step\";\n                    $t = 2;\n                    break;\n\n                case 'max':\n                case 'start':\n                    if (is_numeric($attr_value)) {\n                        $v = (int) $attr_value;\n                        $t = 0;\n                        break;\n                    }\n                    $v = \"(int)@$attr_value\";\n                    $t = 3;\n                    break;\n            }\n            if ($t === 3 && $compiler->getId($attr_value)) {\n                $t = 1;\n            }\n            $propValue[ $attr_name ] = $v;\n            $propType[ $attr_name ] = $t;\n        }\n\n        if (isset($namedAttr[ 'step' ])) {\n            $initNamedProperty[ 'step' ] = $propValue[ 'step' ];\n        }\n        if (isset($namedAttr[ 'iteration' ])) {\n            $propValue[ 'iteration' ] = \"{$sectionVar}->value['iteration']\";\n        }\n        $incFor[ 'iteration' ] = \"{$propValue['iteration']}++\";\n        $initFor[ 'iteration' ] = \"{$propValue['iteration']} = 1\";\n\n        if ($propType[ 'step' ] === 0) {\n            if ($propValue[ 'step' ] === 1) {\n                $incFor[ 'index' ] = \"{$sectionVar}->value['index']++\";\n            } elseif ($propValue[ 'step' ] > 1) {\n                $incFor[ 'index' ] = \"{$sectionVar}->value['index'] += {$propValue['step']}\";\n            } else {\n                $incFor[ 'index' ] = \"{$sectionVar}->value['index'] -= \" . - $propValue[ 'step' ];\n            }\n        } else {\n            $incFor[ 'index' ] = \"{$sectionVar}->value['index'] += {$propValue['step']}\";\n        }\n\n        if (!isset($propValue[ 'max' ])) {\n            $propValue[ 'max' ] = $propValue[ 'loop' ];\n            $propType[ 'max' ] = $propType[ 'loop' ];\n        } elseif ($propType[ 'max' ] !== 0) {\n            $propValue[ 'max' ] = \"{$propValue['max']} < 0 ? {$propValue['loop']} : {$propValue['max']}\";\n            $propType[ 'max' ] = 1;\n        } else {\n            if ($propValue[ 'max' ] < 0) {\n                $propValue[ 'max' ] = $propValue[ 'loop' ];\n                $propType[ 'max' ] = $propType[ 'loop' ];\n            }\n        }\n\n        if (!isset($propValue[ 'start' ])) {\n            $start_code =\n                array(1 => \"{$propValue['step']} > 0 ? \", 2 => '0', 3 => ' : ', 4 => $propValue[ 'loop' ], 5 => ' - 1');\n            if ($propType[ 'loop' ] === 0) {\n                $start_code[ 5 ] = '';\n                $start_code[ 4 ] = $propValue[ 'loop' ] - 1;\n            }\n            if ($propType[ 'step' ] === 0) {\n                if ($propValue[ 'step' ] > 0) {\n                    $start_code = array(1 => '0');\n                    $propType[ 'start' ] = 0;\n                } else {\n                    $start_code[ 1 ] = $start_code[ 2 ] = $start_code[ 3 ] = '';\n                    $propType[ 'start' ] = $propType[ 'loop' ];\n                }\n            } else {\n                $propType[ 'start' ] = 1;\n            }\n            $propValue[ 'start' ] = join('', $start_code);\n        } else {\n            $start_code =\n                array(1 => \"{$propValue['start']} < 0 ? \", 2 => 'max(', 3 => \"{$propValue['step']} > 0 ? \", 4 => '0',\n                      5 => ' : ', 6 => '-1', 7 => ', ', 8 => \"{$propValue['start']} + {$propValue['loop']}\", 10 => ')',\n                      11 => ' : ', 12 => 'min(', 13 => $propValue[ 'start' ], 14 => ', ',\n                      15 => \"{$propValue['step']} > 0 ? \", 16 => $propValue[ 'loop' ], 17 => ' : ',\n                      18 => $propType[ 'loop' ] === 0 ? $propValue[ 'loop' ] - 1 : \"{$propValue['loop']} - 1\",\n                      19 => ')');\n            if ($propType[ 'step' ] === 0) {\n                $start_code[ 3 ] = $start_code[ 5 ] = $start_code[ 15 ] = $start_code[ 17 ] = '';\n                if ($propValue[ 'step' ] > 0) {\n                    $start_code[ 6 ] = $start_code[ 18 ] = '';\n                } else {\n                    $start_code[ 4 ] = $start_code[ 16 ] = '';\n                }\n            }\n            if ($propType[ 'start' ] === 0) {\n                if ($propType[ 'loop' ] === 0) {\n                    $start_code[ 8 ] = $propValue[ 'start' ] + $propValue[ 'loop' ];\n                }\n                $propType[ 'start' ] = $propType[ 'step' ] + $propType[ 'loop' ];\n                $start_code[ 1 ] = '';\n                if ($propValue[ 'start' ] < 0) {\n                    for ($i = 11; $i <= 19; $i ++) {\n                        $start_code[ $i ] = '';\n                    }\n                    if ($propType[ 'start' ] === 0) {\n                        $start_code = array(max($propValue[ 'step' ] > 0 ? 0 : - 1,\n                                                $propValue[ 'start' ] + $propValue[ 'loop' ]));\n                    }\n                } else {\n                    for ($i = 1; $i <= 11; $i ++) {\n                        $start_code[ $i ] = '';\n                    }\n                    if ($propType[ 'start' ] === 0) {\n                        $start_code =\n                            array(min($propValue[ 'step' ] > 0 ? $propValue[ 'loop' ] : $propValue[ 'loop' ] - 1,\n                                      $propValue[ 'start' ]));\n                    }\n                }\n            }\n            $propValue[ 'start' ] = join('', $start_code);\n        }\n        if ($propType[ 'start' ] !== 0) {\n            $initLocal[ 'start' ] = $propValue[ 'start' ];\n            $propValue[ 'start' ] = \"{$local}start\";\n        }\n\n        $initFor[ 'index' ] = \"{$sectionVar}->value['index'] = {$propValue['start']}\";\n\n        if (!isset($_attr[ 'start' ]) && !isset($_attr[ 'step' ]) && !isset($_attr[ 'max' ])) {\n            $propValue[ 'total' ] = $propValue[ 'loop' ];\n            $propType[ 'total' ] = $propType[ 'loop' ];\n        } else {\n            $propType[ 'total' ] =\n                $propType[ 'start' ] + $propType[ 'loop' ] + $propType[ 'step' ] + $propType[ 'max' ];\n            if ($propType[ 'total' ] === 0) {\n                $propValue[ 'total' ] =\n                    min(ceil(($propValue[ 'step' ] > 0 ? $propValue[ 'loop' ] - $propValue[ 'start' ] :\n                                 (int) $propValue[ 'start' ] + 1) / abs($propValue[ 'step' ])), $propValue[ 'max' ]);\n            } else {\n                $total_code = array(1 => 'min(', 2 => 'ceil(', 3 => '(', 4 => \"{$propValue['step']} > 0 ? \",\n                                    5 => $propValue[ 'loop' ], 6 => ' - ', 7 => $propValue[ 'start' ], 8 => ' : ',\n                                    9 => $propValue[ 'start' ], 10 => '+ 1', 11 => ')', 12 => '/ ', 13 => 'abs(',\n                                    14 => $propValue[ 'step' ], 15 => ')', 16 => ')', 17 => \", {$propValue['max']})\",);\n                if (!isset($propValue[ 'max' ])) {\n                    $total_code[ 1 ] = $total_code[ 17 ] = '';\n                }\n                if ($propType[ 'loop' ] + $propType[ 'start' ] === 0) {\n                    $total_code[ 5 ] = $propValue[ 'loop' ] - $propValue[ 'start' ];\n                    $total_code[ 6 ] = $total_code[ 7 ] = '';\n                }\n                if ($propType[ 'start' ] === 0) {\n                    $total_code[ 9 ] = (int) $propValue[ 'start' ] + 1;\n                    $total_code[ 10 ] = '';\n                }\n                if ($propType[ 'step' ] === 0) {\n                    $total_code[ 13 ] = $total_code[ 15 ] = '';\n                    if ($propValue[ 'step' ] === 1 || $propValue[ 'step' ] === - 1) {\n                        $total_code[ 2 ] = $total_code[ 12 ] = $total_code[ 14 ] = $total_code[ 16 ] = '';\n                    } elseif ($propValue[ 'step' ] < 0) {\n                        $total_code[ 14 ] = - $propValue[ 'step' ];\n                    }\n                    $total_code[ 4 ] = '';\n                    if ($propValue[ 'step' ] > 0) {\n                        $total_code[ 8 ] = $total_code[ 9 ] = $total_code[ 10 ] = '';\n                    } else {\n                        $total_code[ 5 ] = $total_code[ 6 ] = $total_code[ 7 ] = $total_code[ 8 ] = '';\n                    }\n                }\n                $propValue[ 'total' ] = join('', $total_code);\n            }\n        }\n\n        if (isset($namedAttr[ 'loop' ])) {\n            $initNamedProperty[ 'loop' ] = \"'loop' => {$propValue['loop']}\";\n        }\n        if (isset($namedAttr[ 'total' ])) {\n            $initNamedProperty[ 'total' ] = \"'total' => {$propValue['total']}\";\n            if ($propType[ 'total' ] > 0) {\n                $propValue[ 'total' ] = \"{$sectionVar}->value['total']\";\n            }\n        } elseif ($propType[ 'total' ] > 0) {\n            $initLocal[ 'total' ] = $propValue[ 'total' ];\n            $propValue[ 'total' ] = \"{$local}total\";\n        }\n\n        $cmpFor[ 'iteration' ] = \"{$propValue['iteration']} <= {$propValue['total']}\";\n\n        foreach ($initLocal as $key => $code) {\n            $output .= \"{$local}{$key} = {$code};\\n\";\n        }\n\n        $_vars = 'array(' . join(', ', $initNamedProperty) . ')';\n        $output .= \"{$sectionVar} = new Smarty_Variable({$_vars});\\n\";\n        $cond_code = \"{$propValue['total']} !== 0\";\n        if ($propType[ 'total' ] === 0) {\n            if ($propValue[ 'total' ] === 0) {\n                $cond_code = 'false';\n            } else {\n                $cond_code = 'true';\n            }\n        }\n        if ($propType[ 'show' ] > 0) {\n            $output .= \"{$local}show = {$propValue['show']} ? {$cond_code} : false;\\n\";\n            $output .= \"if ({$local}show) {\\n\";\n        } elseif ($propValue[ 'show' ] === 'true') {\n            $output .= \"if ({$cond_code}) {\\n\";\n        } else {\n            $output .= \"if (false) {\\n\";\n        }\n        $jinit = join(', ', $initFor);\n        $jcmp = join(', ', $cmpFor);\n        $jinc = join(', ', $incFor);\n        $output .= \"for ({$jinit}; {$jcmp}; {$jinc}){\\n\";\n        if (isset($namedAttr[ 'rownum' ])) {\n            $output .= \"{$sectionVar}->value['rownum'] = {$propValue['iteration']};\\n\";\n        }\n        if (isset($namedAttr[ 'index_prev' ])) {\n            $output .= \"{$sectionVar}->value['index_prev'] = {$propValue['index']} - {$propValue['step']};\\n\";\n        }\n        if (isset($namedAttr[ 'index_next' ])) {\n            $output .= \"{$sectionVar}->value['index_next'] = {$propValue['index']} + {$propValue['step']};\\n\";\n        }\n        if (isset($namedAttr[ 'first' ])) {\n            $output .= \"{$sectionVar}->value['first'] = ({$propValue['iteration']} === 1);\\n\";\n        }\n        if (isset($namedAttr[ 'last' ])) {\n            $output .= \"{$sectionVar}->value['last'] = ({$propValue['iteration']} === {$propValue['total']});\\n\";\n        }\n        $output .= '?>';\n\n        return $output;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Sectionelse Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {sectionelse} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n\n        list($openTag, $nocache, $local, $sectionVar) = $this->closeTag($compiler, array('section'));\n        $this->openTag($compiler, 'sectionelse', array('sectionelse', $nocache, $local, $sectionVar));\n\n        return \"<?php }} else {\\n ?>\";\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Sectionclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/section} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $compiler->loopNesting --;\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n\n        list($openTag, $compiler->nocache, $local, $sectionVar) =\n            $this->closeTag($compiler, array('section', 'sectionelse'));\n\n        $output = \"<?php\\n\";\n        if ($openTag === 'sectionelse') {\n            $output .= \"}\\n\";\n        } else {\n            $output .= \"}\\n}\\n\";\n        }\n        $output .= '?>';\n\n        return $output;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_setfilter.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Setfilter\n * Compiles code for setfilter tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Setfilter Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for setfilter tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        $compiler->variable_filter_stack[] = $compiler->variable_filters;\n        $compiler->variable_filters = $parameter[ 'modifier_list' ];\n        // this tag does not return compiled code\n        $compiler->has_code = false;\n\n        return true;\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Setfilterclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/setfilter} tag\n     * This tag does not generate compiled output. It resets variable filter.\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $_attr = $this->getAttributes($compiler, $args);\n        // reset variable filter to previous state\n        if (count($compiler->variable_filter_stack)) {\n            $compiler->variable_filters = array_pop($compiler->variable_filter_stack);\n        } else {\n            $compiler->variable_filters = array();\n        }\n        // this tag does not return compiled code\n        $compiler->has_code = false;\n\n        return true;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_shared_inheritance.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile Shared Inheritance\n * Shared methods for {extends} and {block} tags\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Shared Inheritance Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Shared_Inheritance extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compile inheritance initialization code as prefix\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param bool|false                            $initChildSequence if true force child template\n     */\n    static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)\n    {\n        $compiler->prefixCompiledCode .= \"<?php \\$_smarty_tpl->_loadInheritance();\\n\\$_smarty_tpl->inheritance->init(\\$_smarty_tpl, \" .\n                                         var_export($initChildSequence, true) . \");\\n?>\\n\";\n    }\n\n    /**\n     * Register post compile callback to compile inheritance initialization code\n     *\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     * @param bool|false                            $initChildSequence if true force child template\n     */\n    public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)\n    {\n        if ($initChildSequence || !isset($compiler->_cache['inheritanceInit'])) {\n            $compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'),\n                                                   array($initChildSequence),\n                                                   'inheritanceInit',\n                                                   $initChildSequence);\n\n            $compiler->_cache['inheritanceInit'] = true;\n        }\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compile_while.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Compile While\n * Compiles the {while} tag\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile While Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {while} tag\n     *\n     * @param  array                                $args      array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler  compiler object\n     * @param  array                                $parameter array with compilation parameter\n     *\n     * @return string compiled code\n     * @throws \\SmartyCompilerException\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)\n    {\n        $compiler->loopNesting ++;\n        // check and get attributes\n        $_attr = $this->getAttributes($compiler, $args);\n        $this->openTag($compiler, 'while', $compiler->nocache);\n\n        if (!array_key_exists('if condition', $parameter)) {\n            $compiler->trigger_template_error('missing while condition', null, true);\n        }\n\n        // maybe nocache because of nocache variables\n        $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;\n        if (is_array($parameter[ 'if condition' ])) {\n            if ($compiler->nocache) {\n                // create nocache var to make it know for further compiling\n                if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                    $var = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n                } else {\n                    $var = $parameter[ 'if condition' ][ 'var' ];\n                }\n                $compiler->setNocacheInVariable($var);\n            }\n            $prefixVar = $compiler->getNewPrefixVariable();\n            $assignCompiler = new Smarty_Internal_Compile_Assign();\n            $assignAttr = array();\n            $assignAttr[][ 'value' ] = $prefixVar;\n            if (is_array($parameter[ 'if condition' ][ 'var' ])) {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ];\n                $_output = \"<?php while ({$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]}) {?>\";\n                $_output .= $assignCompiler->compile($assignAttr, $compiler,\n                                                     array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ]));\n            } else {\n                $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ];\n                $_output = \"<?php while ({$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]}) {?>\";\n                $_output .= $assignCompiler->compile($assignAttr, $compiler, array());\n            }\n\n            return $_output;\n        } else {\n            return \"<?php\\n while ({$parameter['if condition']}) {?>\";\n        }\n    }\n}\n\n/**\n * Smarty Internal Plugin Compile Whileclose Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase\n{\n    /**\n     * Compiles code for the {/while} tag\n     *\n     * @param  array                                $args     array with attributes from parser\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler compiler object\n     *\n     * @return string compiled code\n     */\n    public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $compiler->loopNesting --;\n        // must endblock be nocache?\n        if ($compiler->nocache) {\n            $compiler->tag_nocache = true;\n        }\n        $compiler->nocache = $this->closeTag($compiler, array('while'));\n        return \"<?php }?>\\n\";\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_compilebase.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin CompileBase\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * This class does extend all internal compile plugins\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nabstract class Smarty_Internal_CompileBase\n{\n    /**\n     * Array of names of required attribute required by tag\n     *\n     * @var array\n     */\n    public $required_attributes = array();\n\n    /**\n     * Array of names of optional attribute required by tag\n     * use array('_any') if there is no restriction of attributes names\n     *\n     * @var array\n     */\n    public $optional_attributes = array();\n\n    /**\n     * Shorttag attribute order defined by its names\n     *\n     * @var array\n     */\n    public $shorttag_order = array();\n\n    /**\n     * Array of names of valid option flags\n     *\n     * @var array\n     */\n    public $option_flags = array('nocache');\n\n    /**\n     * Mapping array for boolean option value\n     *\n     * @var array\n     */\n    public $optionMap = array(1 => true, 0 => false, 'true' => true, 'false' => false);\n\n    /**\n     * Mapping array with attributes as key\n     *\n     * @var array\n     */\n    public $mapCache = array();\n\n    /**\n     * This function checks if the attributes passed are valid\n     * The attributes passed for the tag to compile are checked against the list of required and\n     * optional attributes. Required attributes must be present. Optional attributes are check against\n     * the corresponding list. The keyword '_any' specifies that any attribute will be accepted\n     * as valid\n     *\n     * @param  object $compiler   compiler object\n     * @param  array  $attributes attributes applied to the tag\n     *\n     * @return array  of mapped attributes for further processing\n     */\n    public function getAttributes($compiler, $attributes)\n    {\n        $_indexed_attr = array();\n        if (!isset($this->mapCache[ 'option' ])) {\n            $this->mapCache[ 'option' ] = array_fill_keys($this->option_flags, true);\n        }\n        foreach ($attributes as $key => $mixed) {\n            // shorthand ?\n            if (!is_array($mixed)) {\n                // option flag ?\n                if (isset($this->mapCache[ 'option' ][ trim($mixed, '\\'\"') ])) {\n                    $_indexed_attr[ trim($mixed, '\\'\"') ] = true;\n                    // shorthand attribute ?\n                } elseif (isset($this->shorttag_order[ $key ])) {\n                    $_indexed_attr[ $this->shorttag_order[ $key ] ] = $mixed;\n                } else {\n                    // too many shorthands\n                    $compiler->trigger_template_error('too many shorthand attributes', null, true);\n                }\n                // named attribute\n            } else {\n                foreach ($mixed as $k => $v) {\n                    // option flag?\n                    if (isset($this->mapCache[ 'option' ][ $k ])) {\n                        if (is_bool($v)) {\n                            $_indexed_attr[ $k ] = $v;\n                        } else {\n                            if (is_string($v)) {\n                                $v = trim($v, '\\'\" ');\n                            }\n                            if (isset($this->optionMap[ $v ])) {\n                                $_indexed_attr[ $k ] = $this->optionMap[ $v ];\n                            } else {\n                                $compiler->trigger_template_error(\"illegal value '\" . var_export($v, true) .\n                                                                  \"' for option flag '{$k}'\", null, true);\n                            }\n                        }\n                        // must be named attribute\n                    } else {\n                        $_indexed_attr[ $k ] = $v;\n                    }\n                }\n            }\n        }\n        // check if all required attributes present\n        foreach ($this->required_attributes as $attr) {\n            if (!isset($_indexed_attr[ $attr ])) {\n                $compiler->trigger_template_error(\"missing '{$attr}' attribute\", null, true);\n            }\n        }\n        // check for not allowed attributes\n        if ($this->optional_attributes !== array('_any')) {\n            if (!isset($this->mapCache[ 'all' ])) {\n                $this->mapCache[ 'all' ] =\n                    array_fill_keys(array_merge($this->required_attributes, $this->optional_attributes,\n                                                $this->option_flags), true);\n            }\n            foreach ($_indexed_attr as $key => $dummy) {\n                if (!isset($this->mapCache[ 'all' ][ $key ]) && $key !== 0) {\n                    $compiler->trigger_template_error(\"unexpected '{$key}' attribute\", null, true);\n                }\n            }\n        }\n        // default 'false' for all option flags not set\n        foreach ($this->option_flags as $flag) {\n            if (!isset($_indexed_attr[ $flag ])) {\n                $_indexed_attr[ $flag ] = false;\n            }\n        }\n        if (isset($_indexed_attr[ 'nocache' ]) && $_indexed_attr[ 'nocache' ]) {\n            $compiler->tag_nocache = true;\n        }\n        return $_indexed_attr;\n    }\n\n    /**\n     * Push opening tag name on stack\n     * Optionally additional data can be saved on stack\n     *\n     * @param object $compiler compiler object\n     * @param string $openTag  the opening tag's name\n     * @param mixed  $data     optional data saved\n     */\n    public function openTag($compiler, $openTag, $data = null)\n    {\n        array_push($compiler->_tag_stack, array($openTag, $data));\n    }\n\n    /**\n     * Pop closing tag\n     * Raise an error if this stack-top doesn't match with expected opening tags\n     *\n     * @param  object       $compiler    compiler object\n     * @param  array|string $expectedTag the expected opening tag names\n     *\n     * @return mixed        any type the opening tag's name or saved data\n     */\n    public function closeTag($compiler, $expectedTag)\n    {\n        if (count($compiler->_tag_stack) > 0) {\n            // get stacked info\n            list($_openTag, $_data) = array_pop($compiler->_tag_stack);\n            // open tag must match with the expected ones\n            if (in_array($_openTag, (array) $expectedTag)) {\n                if (is_null($_data)) {\n                    // return opening tag\n                    return $_openTag;\n                } else {\n                    // return restored data\n                    return $_data;\n                }\n            }\n            // wrong nesting of tags\n            $compiler->trigger_template_error(\"unclosed '{$compiler->smarty->left_delimiter}{$_openTag}{$compiler->smarty->right_delimiter}' tag\");\n\n            return;\n        }\n        // wrong nesting of tags\n        $compiler->trigger_template_error('unexpected closing tag', null, true);\n\n        return;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_config_file_compiler.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Config File Compiler\n * This is the config file compiler class. It calls the lexer and parser to\n * perform the compiling.\n *\n * @package    Smarty\n * @subpackage Config\n * @author     Uwe Tews\n */\n\n/**\n * Main config file compiler class\n *\n * @package    Smarty\n * @subpackage Config\n */\nclass Smarty_Internal_Config_File_Compiler\n{\n    /**\n     * Lexer class name\n     *\n     * @var string\n     */\n    public $lexer_class;\n\n    /**\n     * Parser class name\n     *\n     * @var string\n     */\n    public $parser_class;\n\n    /**\n     * Lexer object\n     *\n     * @var object\n     */\n    public $lex;\n\n    /**\n     * Parser object\n     *\n     * @var object\n     */\n    public $parser;\n\n    /**\n     * Smarty object\n     *\n     * @var Smarty object\n     */\n    public $smarty;\n\n    /**\n     * Smarty object\n     *\n     * @var Smarty_Internal_Template object\n     */\n    public $template;\n\n    /**\n     * Compiled config data sections and variables\n     *\n     * @var array\n     */\n    public $config_data = array();\n\n    /**\n     * compiled config data must always be written\n     *\n     * @var bool\n     */\n    public $write_compiled_code = true;\n\n    /**\n     * Initialize compiler\n     *\n     * @param string $lexer_class  class name\n     * @param string $parser_class class name\n     * @param Smarty $smarty       global instance\n     */\n    public function __construct($lexer_class, $parser_class, Smarty $smarty)\n    {\n        $this->smarty = $smarty;\n        // get required plugins\n        $this->lexer_class = $lexer_class;\n        $this->parser_class = $parser_class;\n        $this->smarty = $smarty;\n        $this->config_data[ 'sections' ] = array();\n        $this->config_data[ 'vars' ] = array();\n    }\n\n    /**\n     * Method to compile Smarty config source.\n     *\n     * @param Smarty_Internal_Template $template\n     *\n     * @return bool true if compiling succeeded, false if it failed\n     * @throws \\SmartyException\n     */\n    public function compileTemplate(Smarty_Internal_Template $template)\n    {\n        $this->template = $template;\n        $this->template->compiled->file_dependency[ $this->template->source->uid ] =\n            array($this->template->source->filepath,\n                  $this->template->source->getTimeStamp(),\n                  $this->template->source->type);\n        if ($this->smarty->debugging) {\n            if (!isset($this->smarty->_debug)) {\n                $this->smarty->_debug = new Smarty_Internal_Debug();\n            }\n            $this->smarty->_debug->start_compile($this->template);\n        }\n        // init the lexer/parser to compile the config file\n        /* @var Smarty_Internal_ConfigFileLexer $this ->lex */\n        $this->lex = new $this->lexer_class(str_replace(array(\"\\r\\n\",\n                                                              \"\\r\"), \"\\n\", $template->source->getContent()) . \"\\n\",\n                                            $this);\n        /* @var Smarty_Internal_ConfigFileParser $this ->parser */\n        $this->parser = new $this->parser_class($this->lex, $this);\n\n        if (function_exists('mb_internal_encoding')\n            && function_exists('ini_get')\n            && ((int) ini_get('mbstring.func_overload')) & 2\n        ) {\n            $mbEncoding = mb_internal_encoding();\n            mb_internal_encoding('ASCII');\n        } else {\n            $mbEncoding = null;\n        }\n        if ($this->smarty->_parserdebug) {\n            $this->parser->PrintTrace();\n        }\n        // get tokens from lexer and parse them\n        while ($this->lex->yylex()) {\n            if ($this->smarty->_parserdebug) {\n                echo \"<br>Parsing  {$this->parser->yyTokenName[$this->lex->token]} Token {$this->lex->value} Line {$this->lex->line} \\n\";\n            }\n            $this->parser->doParse($this->lex->token, $this->lex->value);\n        }\n        // finish parsing process\n        $this->parser->doParse(0, 0);\n\n        if ($mbEncoding) {\n            mb_internal_encoding($mbEncoding);\n        }\n        if ($this->smarty->debugging) {\n            $this->smarty->_debug->end_compile($this->template);\n        }\n        // template header code\n        $template_header =\n            \"<?php /* Smarty version \" . Smarty::SMARTY_VERSION . \", created on \" . strftime(\"%Y-%m-%d %H:%M:%S\") .\n            \"\\n\";\n        $template_header .= \"         compiled from '{$this->template->source->filepath}' */ ?>\\n\";\n\n        $code = '<?php $_smarty_tpl->smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' .\n                var_export($this->config_data, true) . '); ?>';\n        return $template_header . $this->template->smarty->ext->_codeFrame->create($this->template, $code);\n    }\n\n    /**\n     * display compiler error messages without dying\n     * If parameter $args is empty it is a parser detected syntax error.\n     * In this case the parser is called to obtain information about expected tokens.\n     * If parameter $args contains a string this is used as error message\n     *\n     * @param string $args individual error message or null\n     *\n     * @throws SmartyCompilerException\n     */\n    public function trigger_config_file_error($args = null)\n    {\n        // get config source line which has error\n        $line = $this->lex->line;\n        if (isset($args)) {\n            // $line--;\n        }\n        $match = preg_split(\"/\\n/\", $this->lex->data);\n        $error_text =\n            \"Syntax error in config file '{$this->template->source->filepath}' on line {$line} '{$match[$line - 1]}' \";\n        if (isset($args)) {\n            // individual error message\n            $error_text .= $args;\n        } else {\n            // expected token from parser\n            foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {\n                $exp_token = $this->parser->yyTokenName[ $token ];\n                if (isset($this->lex->smarty_token_names[ $exp_token ])) {\n                    // token type from lexer\n                    $expect[] = '\"' . $this->lex->smarty_token_names[ $exp_token ] . '\"';\n                } else {\n                    // otherwise internal token name\n                    $expect[] = $this->parser->yyTokenName[ $token ];\n                }\n            }\n            // output parser error message\n            $error_text .= ' - Unexpected \"' . $this->lex->value . '\", expected one of: ' . implode(' , ', $expect);\n        }\n        throw new SmartyCompilerException($error_text);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_configfilelexer.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Configfilelexer\n *\n * This is the lexer to break the config file source into tokens\n *\n * @package    Smarty\n * @subpackage Config\n * @author     Uwe Tews\n */\n\n/**\n * Smarty_Internal_Configfilelexer\n *\n * This is the config file lexer.\n * It is generated from the smarty_internal_configfilelexer.plex file\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Configfilelexer\n{\n    const START              = 1;\n    const VALUE              = 2;\n    const NAKED_STRING_VALUE = 3;\n    const COMMENT            = 4;\n    const SECTION            = 5;\n    const TRIPPLE            = 6;\n    /**\n     * Source\n     *\n     * @var string\n     */\n    public $data;\n    /**\n     * Source length\n     *\n     * @var int\n     */\n    public $dataLength = null;\n    /**\n     * byte counter\n     *\n     * @var int\n     */\n    public $counter;\n    /**\n     * token number\n     *\n     * @var int\n     */\n    public $token;\n    /**\n     * token value\n     *\n     * @var string\n     */\n    public $value;\n    /**\n     * current line\n     *\n     * @var int\n     */\n    public $line;\n    /**\n     * state number\n     *\n     * @var int\n     */\n    public $state = 1;\n    /**\n     * Smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n    /**\n     * trace file\n     *\n     * @var resource\n     */\n    public $yyTraceFILE;\n    /**\n     * trace prompt\n     *\n     * @var string\n     */\n    public $yyTracePrompt;\n    /**\n     * state names\n     *\n     * @var array\n     */\n    public $state_name = array(1 => 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION',\n                               6 => 'TRIPPLE');\n    /**\n     * token names\n     *\n     * @var array\n     */\n    public $smarty_token_names = array(        // Text for parser error messages\n    );\n    /**\n     * compiler object\n     *\n     * @var Smarty_Internal_Config_File_Compiler\n     */\n    private $compiler = null;\n    /**\n     * copy of config_booleanize\n     *\n     * @var bool\n     */\n    private $configBooleanize = false;\n    /**\n     * storage for assembled token patterns\n     *\n     * @var string\n     */\n    private $yy_global_pattern1 = null;\n    private $yy_global_pattern2 = null;\n    private $yy_global_pattern3 = null;\n    private $yy_global_pattern4 = null;\n    private $yy_global_pattern5 = null;\n    private $yy_global_pattern6 = null;\n    private $_yy_state          = 1;\n    private $_yy_stack          = array();\n\n    /**\n     * constructor\n     *\n     * @param   string                             $data template source\n     * @param Smarty_Internal_Config_File_Compiler $compiler\n     */\n    function __construct($data, Smarty_Internal_Config_File_Compiler $compiler)\n    {\n        $this->data = $data . \"\\n\"; //now all lines are \\n-terminated\n        $this->dataLength = strlen($data);\n        $this->counter = 0;\n        if (preg_match('/^\\xEF\\xBB\\xBF/', $this->data, $match)) {\n            $this->counter += strlen($match[ 0 ]);\n        }\n        $this->line = 1;\n        $this->compiler = $compiler;\n        $this->smarty = $compiler->smarty;\n        $this->configBooleanize = $this->smarty->config_booleanize;\n    }\n\n    public function replace($input)\n    {\n        return $input;\n    } // end function\n\n    public function PrintTrace()\n    {\n        $this->yyTraceFILE = fopen('php://output', 'w');\n        $this->yyTracePrompt = '<br>';\n    }\n\n    public function yylex()\n    {\n        return $this->{'yylex' . $this->_yy_state}();\n    }\n\n    public function yypushstate($state)\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState push %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n        array_push($this->_yy_stack, $this->_yy_state);\n        $this->_yy_state = $state;\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%snew State %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yypopstate()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState pop %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n        $this->_yy_state = array_pop($this->_yy_stack);\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%snew State %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yybegin($state)\n    {\n        $this->_yy_state = $state;\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState set %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yylex1()\n    {\n        if (!isset($this->yy_global_pattern1)) {\n            $this->yy_global_pattern1 =\n                $this->replace(\"/\\G(#|;)|\\G(\\\\[)|\\G(\\\\])|\\G(=)|\\G([ \\t\\r]+)|\\G(\\n)|\\G([0-9]*[a-zA-Z_]\\\\w*)|\\G([\\S\\s])/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state START');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r1_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r1_1()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_COMMENTSTART;\n        $this->yypushstate(self::COMMENT);\n    }\n\n    function yy_r1_2()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_OPENB;\n        $this->yypushstate(self::SECTION);\n    }\n\n    function yy_r1_3()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_CLOSEB;\n    }\n\n    function yy_r1_4()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_EQUAL;\n        $this->yypushstate(self::VALUE);\n    } // end function\n\n    function yy_r1_5()\n    {\n        return false;\n    }\n\n    function yy_r1_6()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;\n    }\n\n    function yy_r1_7()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_ID;\n    }\n\n    function yy_r1_8()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_OTHER;\n    }\n\n    public function yylex2()\n    {\n        if (!isset($this->yy_global_pattern2)) {\n            $this->yy_global_pattern2 =\n                $this->replace(\"/\\G([ \\t\\r]+)|\\G(\\\\d+\\\\.\\\\d+(?=[ \\t\\r]*[\\n#;]))|\\G(\\\\d+(?=[ \\t\\r]*[\\n#;]))|\\G(\\\"\\\"\\\")|\\G('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*'(?=[ \\t\\r]*[\\n#;]))|\\G(\\\"[^\\\"\\\\\\\\]*(?:\\\\\\\\.[^\\\"\\\\\\\\]*)*\\\"(?=[ \\t\\r]*[\\n#;]))|\\G([a-zA-Z]+(?=[ \\t\\r]*[\\n#;]))|\\G([^\\n]+?(?=[ \\t\\r]*\\n))|\\G(\\n)/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state VALUE');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r2_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r2_1()\n    {\n        return false;\n    }\n\n    function yy_r2_2()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_FLOAT;\n        $this->yypopstate();\n    }\n\n    function yy_r2_3()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_INT;\n        $this->yypopstate();\n    }\n\n    function yy_r2_4()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES;\n        $this->yypushstate(self::TRIPPLE);\n    }\n\n    function yy_r2_5()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_SINGLE_QUOTED_STRING;\n        $this->yypopstate();\n    }\n\n    function yy_r2_6()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_DOUBLE_QUOTED_STRING;\n        $this->yypopstate();\n    } // end function\n\n    function yy_r2_7()\n    {\n        if (!$this->configBooleanize ||\n            !in_array(strtolower($this->value), array('true', 'false', 'on', 'off', 'yes', 'no'))) {\n            $this->yypopstate();\n            $this->yypushstate(self::NAKED_STRING_VALUE);\n            return true; //reprocess in new state\n        } else {\n            $this->token = Smarty_Internal_Configfileparser::TPC_BOOL;\n            $this->yypopstate();\n        }\n    }\n\n    function yy_r2_8()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;\n        $this->yypopstate();\n    }\n\n    function yy_r2_9()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;\n        $this->value = '';\n        $this->yypopstate();\n    } // end function\n\n    public function yylex3()\n    {\n        if (!isset($this->yy_global_pattern3)) {\n            $this->yy_global_pattern3 = $this->replace(\"/\\G([^\\n]+?(?=[ \\t\\r]*\\n))/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state NAKED_STRING_VALUE');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r3_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r3_1()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;\n        $this->yypopstate();\n    }\n\n    public function yylex4()\n    {\n        if (!isset($this->yy_global_pattern4)) {\n            $this->yy_global_pattern4 = $this->replace(\"/\\G([ \\t\\r]+)|\\G([^\\n]+?(?=[ \\t\\r]*\\n))|\\G(\\n)/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state COMMENT');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r4_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r4_1()\n    {\n        return false;\n    }\n\n    function yy_r4_2()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;\n    } // end function\n\n    function yy_r4_3()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;\n        $this->yypopstate();\n    }\n\n    public function yylex5()\n    {\n        if (!isset($this->yy_global_pattern5)) {\n            $this->yy_global_pattern5 = $this->replace(\"/\\G(\\\\.)|\\G(.*?(?=[\\.=[\\]\\r\\n]))/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state SECTION');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r5_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r5_1()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_DOT;\n    }\n\n    function yy_r5_2()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_SECTION;\n        $this->yypopstate();\n    } // end function\n\n    public function yylex6()\n    {\n        if (!isset($this->yy_global_pattern6)) {\n            $this->yy_global_pattern6 = $this->replace(\"/\\G(\\\"\\\"\\\"(?=[ \\t\\r]*[\\n#;]))|\\G([\\S\\s])/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern6, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state TRIPPLE');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r6_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r6_1()\n    {\n        $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES_END;\n        $this->yypopstate();\n        $this->yypushstate(self::START);\n    }\n\n    function yy_r6_2()\n    {\n        $to = strlen($this->data);\n        preg_match(\"/\\\"\\\"\\\"[ \\t\\r]*[\\n#;]/\", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);\n        if (isset($match[ 0 ][ 1 ])) {\n            $to = $match[ 0 ][ 1 ];\n        } else {\n            $this->compiler->trigger_template_error('missing or misspelled literal closing tag');\n        }\n        $this->value = substr($this->data, $this->counter, $to - $this->counter);\n        $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_TEXT;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_configfileparser.php",
    "content": "<?php\n\nclass TPC_yyStackEntry\n{\n    public $stateno;       /* The state-number */\n    public $major;         /* The major token value.  This is the code\n                     ** number for the token at this stack level */\n    public $minor; /* The user-supplied minor token value.  This\n                     ** is the value of the token  */\n}\n\n#line 12 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n\n/**\n * Smarty Internal Plugin Configfileparse\n *\n * This is the config file parser.\n * It is generated from the smarty_internal_configfileparser.y file\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Configfileparser\n{\n    #line 25 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    const TPC_OPENB                = 1;\n    const TPC_SECTION              = 2;\n    const TPC_CLOSEB               = 3;\n    const TPC_DOT                  = 4;\n    const TPC_ID                   = 5;\n    const TPC_EQUAL                = 6;\n    const TPC_FLOAT                = 7;\n    const TPC_INT                  = 8;\n    const TPC_BOOL                 = 9;\n    const TPC_SINGLE_QUOTED_STRING = 10;\n    const TPC_DOUBLE_QUOTED_STRING = 11;\n    const TPC_TRIPPLE_QUOTES       = 12;\n    const TPC_TRIPPLE_TEXT         = 13;\n    const TPC_TRIPPLE_QUOTES_END   = 14;\n    const TPC_NAKED_STRING         = 15;\n    const TPC_OTHER                = 16;\n    const TPC_NEWLINE              = 17;\n    const TPC_COMMENTSTART         = 18;\n    const YY_NO_ACTION             = 60;\n    const YY_ACCEPT_ACTION         = 59;\n    const YY_ERROR_ACTION          = 58;\n    const YY_SZ_ACTTAB             = 38;\n    const YY_SHIFT_USE_DFLT        = -8;\n    const YY_SHIFT_MAX             = 19;\n    const YY_REDUCE_USE_DFLT       = -21;\n    const YY_REDUCE_MAX            = 10;\n    const YYNOCODE                 = 29;\n    const YYSTACKDEPTH             = 100;\n    const YYNSTATE                 = 36;\n    const YYNRULE                  = 22;\n    const YYERRORSYMBOL            = 19;\n    const YYERRSYMDT               = 'yy0';\n    const YYFALLBACK               = 0;\n    static public $yy_action        = array(\n        29, 30, 34, 33, 24, 13, 19, 25, 35, 21,\n        59, 8, 3, 1, 20, 12, 14, 31, 20, 12,\n        15, 17, 23, 18, 27, 26, 4, 5, 6, 32,\n        2, 11, 28, 22, 16, 9, 7, 10,\n    );\n    static public $yy_lookahead     = array(\n        7, 8, 9, 10, 11, 12, 5, 27, 15, 16,\n        20, 21, 23, 23, 17, 18, 13, 14, 17, 18,\n        15, 2, 17, 4, 25, 26, 6, 3, 3, 14,\n        23, 1, 24, 17, 2, 25, 22, 25,\n    );\n    static public $yy_shift_ofst    = array(\n        -8, 1, 1, 1, -7, -3, -3, 30, -8, -8,\n        -8, 19, 5, 3, 15, 16, 24, 25, 32, 20,\n    );\n    static public $yy_reduce_ofst   = array(\n        -10, -1, -1, -1, -20, 10, 12, 8, 14, 7,\n        -11,\n    );\n    static public $yyExpectedTokens = array(\n        array(),\n        array(5, 17, 18,),\n        array(5, 17, 18,),\n        array(5, 17, 18,),\n        array(7, 8, 9, 10, 11, 12, 15, 16,),\n        array(17, 18,),\n        array(17, 18,),\n        array(1,),\n        array(),\n        array(),\n        array(),\n        array(2, 4,),\n        array(15, 17,),\n        array(13, 14,),\n        array(14,),\n        array(17,),\n        array(3,),\n        array(3,),\n        array(2,),\n        array(6,),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n    );\n    static public $yy_default       = array(\n        44, 37, 41, 40, 58, 58, 58, 36, 39, 44,\n        44, 58, 58, 58, 58, 58, 58, 58, 58, 58,\n        55, 54, 57, 56, 50, 45, 43, 42, 38, 46,\n        47, 52, 51, 49, 48, 53,\n    );\n    public static $yyFallback       = array();\n    public static $yyRuleName       = array(\n        'start ::= global_vars sections',\n        'global_vars ::= var_list',\n        'sections ::= sections section',\n        'sections ::=',\n        'section ::= OPENB SECTION CLOSEB newline var_list',\n        'section ::= OPENB DOT SECTION CLOSEB newline var_list',\n        'var_list ::= var_list newline',\n        'var_list ::= var_list var',\n        'var_list ::=',\n        'var ::= ID EQUAL value',\n        'value ::= FLOAT',\n        'value ::= INT',\n        'value ::= BOOL',\n        'value ::= SINGLE_QUOTED_STRING',\n        'value ::= DOUBLE_QUOTED_STRING',\n        'value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END',\n        'value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END',\n        'value ::= NAKED_STRING',\n        'value ::= OTHER',\n        'newline ::= NEWLINE',\n        'newline ::= COMMENTSTART NEWLINE',\n        'newline ::= COMMENTSTART NAKED_STRING NEWLINE',\n    );\n    public static $yyRuleInfo       = array(\n        array(0 => 20, 1 => 2),\n        array(0 => 21, 1 => 1),\n        array(0 => 22, 1 => 2),\n        array(0 => 22, 1 => 0),\n        array(0 => 24, 1 => 5),\n        array(0 => 24, 1 => 6),\n        array(0 => 23, 1 => 2),\n        array(0 => 23, 1 => 2),\n        array(0 => 23, 1 => 0),\n        array(0 => 26, 1 => 3),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 3),\n        array(0 => 27, 1 => 2),\n        array(0 => 27, 1 => 1),\n        array(0 => 27, 1 => 1),\n        array(0 => 25, 1 => 1),\n        array(0 => 25, 1 => 2),\n        array(0 => 25, 1 => 3),\n    );\n    public static $yyReduceMap      = array(\n        0  => 0,\n        2  => 0,\n        3  => 0,\n        19 => 0,\n        20 => 0,\n        21 => 0,\n        1  => 1,\n        4  => 4,\n        5  => 5,\n        6  => 6,\n        7  => 7,\n        8  => 8,\n        9  => 9,\n        10 => 10,\n        11 => 11,\n        12 => 12,\n        13 => 13,\n        14 => 14,\n        15 => 15,\n        16 => 16,\n        17 => 17,\n        18 => 17,\n    );\n    /**\n     * helper map\n     *\n     * @var array\n     */\n    private static $escapes_single = array('\\\\' => '\\\\',\n                                           '\\'' => '\\'');\n    /**\n     * result status\n     *\n     * @var bool\n     */\n    public $successful = true;\n    /**\n     * return value\n     *\n     * @var mixed\n     */\n    public $retvalue = 0;\n    /**\n     * @var\n     */\n    public $yymajor;\n    /**\n     * compiler object\n     *\n     * @var Smarty_Internal_Config_File_Compiler\n     */\n    public $compiler = null;\n    /**\n     * smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty      = null;\n    public $yyTraceFILE;\n    public $yyTracePrompt;\n    public $yyidx;\n    public $yyerrcnt;\n    public $yystack     = array();\n    public $yyTokenName = array(\n        '$', 'OPENB', 'SECTION', 'CLOSEB',\n        'DOT', 'ID', 'EQUAL', 'FLOAT',\n        'INT', 'BOOL', 'SINGLE_QUOTED_STRING', 'DOUBLE_QUOTED_STRING',\n        'TRIPPLE_QUOTES', 'TRIPPLE_TEXT', 'TRIPPLE_QUOTES_END', 'NAKED_STRING',\n        'OTHER', 'NEWLINE', 'COMMENTSTART', 'error',\n        'start', 'global_vars', 'sections', 'var_list',\n        'section', 'newline', 'var', 'value',\n    );\n    /**\n     * lexer object\n     *\n     * @var Smarty_Internal_Configfilelexer\n     */\n    private $lex;\n    /**\n     * internal error flag\n     *\n     * @var bool\n     */\n    private $internalError = false;\n    /**\n     * copy of config_overwrite property\n     *\n     * @var bool\n     */\n    private $configOverwrite = false;\n    /**\n     * copy of config_read_hidden property\n     *\n     * @var bool\n     */\n    private $configReadHidden = false;\n    private $_retvalue;\n\n    /**\n     * constructor\n     *\n     * @param Smarty_Internal_Configfilelexer      $lex\n     * @param Smarty_Internal_Config_File_Compiler $compiler\n     */\n    function __construct(Smarty_Internal_Configfilelexer $lex, Smarty_Internal_Config_File_Compiler $compiler)\n    {\n        $this->lex = $lex;\n        $this->smarty = $compiler->smarty;\n        $this->compiler = $compiler;\n        $this->configOverwrite = $this->smarty->config_overwrite;\n        $this->configReadHidden = $this->smarty->config_read_hidden;\n    }\n\n    public static function yy_destructor($yymajor, $yypminor)\n    {\n        switch ($yymajor) {\n            default:\n                break;   /* If no destructor action specified: do nothing */\n        }\n    }\n\n    /**\n     * parse single quoted string\n     *  remove outer quotes\n     *  unescape inner quotes\n     *\n     * @param string $qstr\n     *\n     * @return string\n     */\n    private static function parse_single_quoted_string($qstr)\n    {\n        $escaped_string = substr($qstr, 1, strlen($qstr) - 2); //remove outer quotes\n        $ss = preg_split('/(\\\\\\\\.)/', $escaped_string, -1, PREG_SPLIT_DELIM_CAPTURE);\n        $str = '';\n        foreach ($ss as $s) {\n            if (strlen($s) === 2 && $s[ 0 ] === '\\\\') {\n                if (isset(self::$escapes_single[ $s[ 1 ] ])) {\n                    $s = self::$escapes_single[ $s[ 1 ] ];\n                }\n            }\n            $str .= $s;\n        }\n        return $str;\n    }                    /* Index of top element in stack */\n    /**\n     * parse double quoted string\n     *\n     * @param string $qstr\n     *\n     * @return string\n     */\n    private static function parse_double_quoted_string($qstr)\n    {\n        $inner_str = substr($qstr, 1, strlen($qstr) - 2);\n        return stripcslashes($inner_str);\n    }                 /* Shifts left before out of the error */\n    /**\n     * parse triple quoted string\n     *\n     * @param string $qstr\n     *\n     * @return string\n     */\n    private static function parse_tripple_double_quoted_string($qstr)\n    {\n        return stripcslashes($qstr);\n    }  /* The parser's stack */\n    public function Trace($TraceFILE, $zTracePrompt)\n    {\n        if (!$TraceFILE) {\n            $zTracePrompt = 0;\n        } else if (!$zTracePrompt) {\n            $TraceFILE = 0;\n        }\n        $this->yyTraceFILE = $TraceFILE;\n        $this->yyTracePrompt = $zTracePrompt;\n    }\n\n    public function PrintTrace()\n    {\n        $this->yyTraceFILE = fopen('php://output', 'w');\n        $this->yyTracePrompt = '<br>';\n    }\n\n    public function tokenName($tokenType)\n    {\n        if ($tokenType === 0) {\n            return 'End of Input';\n        }\n        if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {\n            return $this->yyTokenName[ $tokenType ];\n        } else {\n            return 'Unknown';\n        }\n    }\n\n    public function yy_pop_parser_stack()\n    {\n        if (empty($this->yystack)) {\n            return;\n        }\n        $yytos = array_pop($this->yystack);\n        if ($this->yyTraceFILE && $this->yyidx >= 0) {\n            fwrite($this->yyTraceFILE,\n                   $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] .\n                   \"\\n\");\n        }\n        $yymajor = $yytos->major;\n        self::yy_destructor($yymajor, $yytos->minor);\n        $this->yyidx--;\n        return $yymajor;\n    }\n\n    public function __destruct()\n    {\n        while ($this->yystack !== Array()) {\n            $this->yy_pop_parser_stack();\n        }\n        if (is_resource($this->yyTraceFILE)) {\n            fclose($this->yyTraceFILE);\n        }\n    }\n\n    public function yy_get_expected_tokens($token)\n    {\n        static $res3 = array();\n        static $res4 = array();\n        $state = $this->yystack[ $this->yyidx ]->stateno;\n        $expected = self::$yyExpectedTokens[ $state ];\n        if (isset($res3[ $state ][ $token ])) {\n            if ($res3[ $state ][ $token ]) {\n                return $expected;\n            }\n        } else {\n            if ($res3[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) {\n                return $expected;\n            }\n        }\n        $stack = $this->yystack;\n        $yyidx = $this->yyidx;\n        do {\n            $yyact = $this->yy_find_shift_action($token);\n            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n                // reduce action\n                $done = 0;\n                do {\n                    if ($done++ === 100) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // too much recursion prevents proper detection\n                        // so give up\n                        return array_unique($expected);\n                    }\n                    $yyruleno = $yyact - self::YYNSTATE;\n                    $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ];\n                    $nextstate = $this->yy_find_reduce_action(\n                        $this->yystack[ $this->yyidx ]->stateno,\n                        self::$yyRuleInfo[ $yyruleno ][ 0 ]);\n                    if (isset(self::$yyExpectedTokens[ $nextstate ])) {\n                        $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]);\n                        if (isset($res4[ $nextstate ][ $token ])) {\n                            if ($res4[ $nextstate ][ $token ]) {\n                                $this->yyidx = $yyidx;\n                                $this->yystack = $stack;\n                                return array_unique($expected);\n                            }\n                        } else {\n                            if ($res4[ $nextstate ][ $token ] =\n                                in_array($token, self::$yyExpectedTokens[ $nextstate ], true)) {\n                                $this->yyidx = $yyidx;\n                                $this->yystack = $stack;\n                                return array_unique($expected);\n                            }\n                        }\n                    }\n                    if ($nextstate < self::YYNSTATE) {\n                        // we need to shift a non-terminal\n                        $this->yyidx++;\n                        $x = new TPC_yyStackEntry;\n                        $x->stateno = $nextstate;\n                        $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n                        $this->yystack[ $this->yyidx ] = $x;\n                        continue 2;\n                    } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // the last token was just ignored, we can't accept\n                        // by ignoring input, this is in essence ignoring a\n                        // syntax error!\n                        return array_unique($expected);\n                    } else if ($nextstate === self::YY_NO_ACTION) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // input accepted, but not shifted (I guess)\n                        return $expected;\n                    } else {\n                        $yyact = $nextstate;\n                    }\n                } while (true);\n            }\n            break;\n        } while (true);\n        $this->yyidx = $yyidx;\n        $this->yystack = $stack;\n        return array_unique($expected);\n    }\n\n    public function yy_is_expected_token($token)\n    {\n        static $res = array();\n        static $res2 = array();\n        if ($token === 0) {\n            return true; // 0 is not part of this\n        }\n        $state = $this->yystack[ $this->yyidx ]->stateno;\n        if (isset($res[ $state ][ $token ])) {\n            if ($res[ $state ][ $token ]) {\n                return true;\n            }\n        } else {\n            if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) {\n                return true;\n            }\n        }\n        $stack = $this->yystack;\n        $yyidx = $this->yyidx;\n        do {\n            $yyact = $this->yy_find_shift_action($token);\n            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n                // reduce action\n                $done = 0;\n                do {\n                    if ($done++ === 100) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // too much recursion prevents proper detection\n                        // so give up\n                        return true;\n                    }\n                    $yyruleno = $yyact - self::YYNSTATE;\n                    $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ];\n                    $nextstate = $this->yy_find_reduce_action(\n                        $this->yystack[ $this->yyidx ]->stateno,\n                        self::$yyRuleInfo[ $yyruleno ][ 0 ]);\n                    if (isset($res2[ $nextstate ][ $token ])) {\n                        if ($res2[ $nextstate ][ $token ]) {\n                            $this->yyidx = $yyidx;\n                            $this->yystack = $stack;\n                            return true;\n                        }\n                    } else {\n                        if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) &&\n                                                             in_array($token,\n                                                                      self::$yyExpectedTokens[ $nextstate ],\n                                                                      true))) {\n                            $this->yyidx = $yyidx;\n                            $this->yystack = $stack;\n                            return true;\n                        }\n                    }\n                    if ($nextstate < self::YYNSTATE) {\n                        // we need to shift a non-terminal\n                        $this->yyidx++;\n                        $x = new TPC_yyStackEntry;\n                        $x->stateno = $nextstate;\n                        $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n                        $this->yystack[ $this->yyidx ] = $x;\n                        continue 2;\n                    } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        if (!$token) {\n                            // end of input: this is valid\n                            return true;\n                        }\n                        // the last token was just ignored, we can't accept\n                        // by ignoring input, this is in essence ignoring a\n                        // syntax error!\n                        return false;\n                    } else if ($nextstate === self::YY_NO_ACTION) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // input accepted, but not shifted (I guess)\n                        return true;\n                    } else {\n                        $yyact = $nextstate;\n                    }\n                } while (true);\n            }\n            break;\n        } while (true);\n        $this->yyidx = $yyidx;\n        $this->yystack = $stack;\n        return true;\n    }\n\n    public function yy_find_shift_action($iLookAhead)\n    {\n        $stateno = $this->yystack[ $this->yyidx ]->stateno;\n        /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */\n        if (!isset(self::$yy_shift_ofst[ $stateno ])) {\n            // no shift actions\n            return self::$yy_default[ $stateno ];\n        }\n        $i = self::$yy_shift_ofst[ $stateno ];\n        if ($i === self::YY_SHIFT_USE_DFLT) {\n            return self::$yy_default[ $stateno ];\n        }\n        if ($iLookAhead === self::YYNOCODE) {\n            return self::YY_NO_ACTION;\n        }\n        $i += $iLookAhead;\n        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||\n            self::$yy_lookahead[ $i ] != $iLookAhead) {\n            if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)\n                && ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0) {\n                if ($this->yyTraceFILE) {\n                    fwrite($this->yyTraceFILE,\n                           $this->yyTracePrompt . 'FALLBACK ' .\n                           $this->yyTokenName[ $iLookAhead ] . ' => ' .\n                           $this->yyTokenName[ $iFallback ] . \"\\n\");\n                }\n                return $this->yy_find_shift_action($iFallback);\n            }\n            return self::$yy_default[ $stateno ];\n        } else {\n            return self::$yy_action[ $i ];\n        }\n    }\n\n    public function yy_find_reduce_action($stateno, $iLookAhead)\n    {\n        /* $stateno = $this->yystack[$this->yyidx]->stateno; */\n        if (!isset(self::$yy_reduce_ofst[ $stateno ])) {\n            return self::$yy_default[ $stateno ];\n        }\n        $i = self::$yy_reduce_ofst[ $stateno ];\n        if ($i === self::YY_REDUCE_USE_DFLT) {\n            return self::$yy_default[ $stateno ];\n        }\n        if ($iLookAhead === self::YYNOCODE) {\n            return self::YY_NO_ACTION;\n        }\n        $i += $iLookAhead;\n        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||\n            self::$yy_lookahead[ $i ] != $iLookAhead) {\n            return self::$yy_default[ $stateno ];\n        } else {\n            return self::$yy_action[ $i ];\n        }\n    }\n\n    public function yy_shift($yyNewState, $yyMajor, $yypMinor)\n    {\n        $this->yyidx++;\n        if ($this->yyidx >= self::YYSTACKDEPTH) {\n            $this->yyidx--;\n            if ($this->yyTraceFILE) {\n                fprintf($this->yyTraceFILE, \"%sStack Overflow!\\n\", $this->yyTracePrompt);\n            }\n            while ($this->yyidx >= 0) {\n                $this->yy_pop_parser_stack();\n            }\n            #line 239 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n            $this->internalError = true;\n            $this->compiler->trigger_config_file_error('Stack overflow in configfile parser');\n            return;\n        }\n        $yytos = new TPC_yyStackEntry;\n        $yytos->stateno = $yyNewState;\n        $yytos->major = $yyMajor;\n        $yytos->minor = $yypMinor;\n        $this->yystack[] = $yytos;\n        if ($this->yyTraceFILE && $this->yyidx > 0) {\n            fprintf($this->yyTraceFILE,\n                    \"%sShift %d\\n\",\n                    $this->yyTracePrompt,\n                    $yyNewState);\n            fprintf($this->yyTraceFILE, \"%sStack:\", $this->yyTracePrompt);\n            for ($i = 1; $i <= $this->yyidx; $i++) {\n                fprintf($this->yyTraceFILE,\n                        \" %s\",\n                        $this->yyTokenName[ $this->yystack[ $i ]->major ]);\n            }\n            fwrite($this->yyTraceFILE, \"\\n\");\n        }\n    }\n\n    function yy_r0()\n    {\n        $this->_retvalue = null;\n    }\n\n    function yy_r1()\n    {\n        $this->add_global_vars($this->yystack[ $this->yyidx + 0 ]->minor);\n        $this->_retvalue = null;\n    }\n\n    function yy_r4()\n    {\n        $this->add_section_vars($this->yystack[ $this->yyidx + -3 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor);\n        $this->_retvalue = null;\n    }\n\n    #line 245 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r5()\n    {\n        if ($this->configReadHidden) {\n            $this->add_section_vars($this->yystack[ $this->yyidx + -3 ]->minor,\n                                    $this->yystack[ $this->yyidx + 0 ]->minor);\n        }\n        $this->_retvalue = null;\n    }\n\n    #line 250 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r6()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 264 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r7()\n    {\n        $this->_retvalue =\n            array_merge($this->yystack[ $this->yyidx + -1 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor));\n    }\n\n    #line 269 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r8()\n    {\n        $this->_retvalue = array();\n    }\n\n    #line 277 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r9()\n    {\n        $this->_retvalue = array('key'   => $this->yystack[ $this->yyidx + -2 ]->minor,\n                                 'value' => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 281 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r10()\n    {\n        $this->_retvalue = (float)$this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 285 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r11()\n    {\n        $this->_retvalue = (int)$this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 291 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r12()\n    {\n        $this->_retvalue = $this->parse_bool($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 296 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r13()\n    {\n        $this->_retvalue = self::parse_single_quoted_string($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 300 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r14()\n    {\n        $this->_retvalue = self::parse_double_quoted_string($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 304 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r15()\n    {\n        $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[ $this->yyidx + -1 ]->minor);\n    }\n\n    #line 308 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r16()\n    {\n        $this->_retvalue = '';\n    }\n\n    #line 312 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    function yy_r17()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 316 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    public function yy_reduce($yyruleno)\n    {\n        if ($this->yyTraceFILE && $yyruleno >= 0\n            && $yyruleno < count(self::$yyRuleName)) {\n            fprintf($this->yyTraceFILE,\n                    \"%sReduce (%d) [%s].\\n\",\n                    $this->yyTracePrompt,\n                    $yyruleno,\n                    self::$yyRuleName[ $yyruleno ]);\n        }\n        $this->_retvalue = $yy_lefthand_side = null;\n        if (isset(self::$yyReduceMap[ $yyruleno ])) {\n            // call the action\n            $this->_retvalue = null;\n            $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}();\n            $yy_lefthand_side = $this->_retvalue;\n        }\n        $yygoto = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n        $yysize = self::$yyRuleInfo[ $yyruleno ][ 1 ];\n        $this->yyidx -= $yysize;\n        for ($i = $yysize; $i; $i--) {\n            // pop all of the right-hand side parameters\n            array_pop($this->yystack);\n        }\n        $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto);\n        if ($yyact < self::YYNSTATE) {\n            if (!$this->yyTraceFILE && $yysize) {\n                $this->yyidx++;\n                $x = new TPC_yyStackEntry;\n                $x->stateno = $yyact;\n                $x->major = $yygoto;\n                $x->minor = $yy_lefthand_side;\n                $this->yystack[ $this->yyidx ] = $x;\n            } else {\n                $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);\n            }\n        } else if ($yyact === self::YYNSTATE + self::YYNRULE + 1) {\n            $this->yy_accept();\n        }\n    }\n\n    #line 320 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    public function yy_parse_failed()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE, \"%sFail!\\n\", $this->yyTracePrompt);\n        }\n        while ($this->yyidx >= 0) {\n            $this->yy_pop_parser_stack();\n        }\n    }\n\n    #line 324 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n    public function yy_syntax_error($yymajor, $TOKEN)\n    {\n        #line 232 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n        $this->internalError = true;\n        $this->yymajor = $yymajor;\n        $this->compiler->trigger_config_file_error();\n    }\n\n    public function yy_accept()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE, \"%sAccept!\\n\", $this->yyTracePrompt);\n        }\n        while ($this->yyidx >= 0) {\n            $this->yy_pop_parser_stack();\n        }\n        #line 225 \"../smarty/lexer/smarty_internal_configfileparser.y\"\n        $this->successful = !$this->internalError;\n        $this->internalError = false;\n        $this->retvalue = $this->_retvalue;\n    }\n\n    public function doParse($yymajor, $yytokenvalue)\n    {\n        $yyerrorhit = 0;   /* True if yymajor has invoked an error */\n        if ($this->yyidx === null || $this->yyidx < 0) {\n            $this->yyidx = 0;\n            $this->yyerrcnt = -1;\n            $x = new TPC_yyStackEntry;\n            $x->stateno = 0;\n            $x->major = 0;\n            $this->yystack = array();\n            $this->yystack[] = $x;\n        }\n        $yyendofinput = ($yymajor == 0);\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sInput %s\\n\",\n                    $this->yyTracePrompt,\n                    $this->yyTokenName[ $yymajor ]);\n        }\n        do {\n            $yyact = $this->yy_find_shift_action($yymajor);\n            if ($yymajor < self::YYERRORSYMBOL &&\n                !$this->yy_is_expected_token($yymajor)) {\n                // force a syntax error\n                $yyact = self::YY_ERROR_ACTION;\n            }\n            if ($yyact < self::YYNSTATE) {\n                $this->yy_shift($yyact, $yymajor, $yytokenvalue);\n                $this->yyerrcnt--;\n                if ($yyendofinput && $this->yyidx >= 0) {\n                    $yymajor = 0;\n                } else {\n                    $yymajor = self::YYNOCODE;\n                }\n            } else if ($yyact < self::YYNSTATE + self::YYNRULE) {\n                $this->yy_reduce($yyact - self::YYNSTATE);\n            } else if ($yyact === self::YY_ERROR_ACTION) {\n                if ($this->yyTraceFILE) {\n                    fprintf($this->yyTraceFILE,\n                            \"%sSyntax Error!\\n\",\n                            $this->yyTracePrompt);\n                }\n                if (self::YYERRORSYMBOL) {\n                    if ($this->yyerrcnt < 0) {\n                        $this->yy_syntax_error($yymajor, $yytokenvalue);\n                    }\n                    $yymx = $this->yystack[ $this->yyidx ]->major;\n                    if ($yymx === self::YYERRORSYMBOL || $yyerrorhit) {\n                        if ($this->yyTraceFILE) {\n                            fprintf($this->yyTraceFILE,\n                                    \"%sDiscard input token %s\\n\",\n                                    $this->yyTracePrompt,\n                                    $this->yyTokenName[ $yymajor ]);\n                        }\n                        $this->yy_destructor($yymajor, $yytokenvalue);\n                        $yymajor = self::YYNOCODE;\n                    } else {\n                        while ($this->yyidx >= 0 &&\n                               $yymx !== self::YYERRORSYMBOL &&\n                               ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE\n                        ) {\n                            $this->yy_pop_parser_stack();\n                        }\n                        if ($this->yyidx < 0 || $yymajor == 0) {\n                            $this->yy_destructor($yymajor, $yytokenvalue);\n                            $this->yy_parse_failed();\n                            $yymajor = self::YYNOCODE;\n                        } else if ($yymx !== self::YYERRORSYMBOL) {\n                            $u2 = 0;\n                            $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);\n                        }\n                    }\n                    $this->yyerrcnt = 3;\n                    $yyerrorhit = 1;\n                } else {\n                    if ($this->yyerrcnt <= 0) {\n                        $this->yy_syntax_error($yymajor, $yytokenvalue);\n                    }\n                    $this->yyerrcnt = 3;\n                    $this->yy_destructor($yymajor, $yytokenvalue);\n                    if ($yyendofinput) {\n                        $this->yy_parse_failed();\n                    }\n                    $yymajor = self::YYNOCODE;\n                }\n            } else {\n                $this->yy_accept();\n                $yymajor = self::YYNOCODE;\n            }\n        } while ($yymajor !== self::YYNOCODE && $this->yyidx >= 0);\n    }\n\n    /**\n     * parse optional boolean keywords\n     *\n     * @param string $str\n     *\n     * @return bool\n     */\n    private function parse_bool($str)\n    {\n        $str = strtolower($str);\n        if (in_array($str, array('on', 'yes', 'true'))) {\n            $res = true;\n        } else {\n            $res = false;\n        }\n        return $res;\n    }\n\n    /**\n     * set a config variable in target array\n     *\n     * @param array $var\n     * @param array $target_array\n     */\n    private function set_var(array $var, array &$target_array)\n    {\n        $key = $var[ 'key' ];\n        $value = $var[ 'value' ];\n        if ($this->configOverwrite || !isset($target_array[ 'vars' ][ $key ])) {\n            $target_array[ 'vars' ][ $key ] = $value;\n        } else {\n            settype($target_array[ 'vars' ][ $key ], 'array');\n            $target_array[ 'vars' ][ $key ][] = $value;\n        }\n    }\n\n    /**\n     * add config variable to global vars\n     *\n     * @param array $vars\n     */\n    private function add_global_vars(array $vars)\n    {\n        if (!isset($this->compiler->config_data[ 'vars' ])) {\n            $this->compiler->config_data[ 'vars' ] = array();\n        }\n        foreach ($vars as $var) {\n            $this->set_var($var, $this->compiler->config_data);\n        }\n    }\n\n    /**\n     * add config variable to section\n     *\n     * @param string $section_name\n     * @param array  $vars\n     */\n    private function add_section_vars($section_name, array $vars)\n    {\n        if (!isset($this->compiler->config_data[ 'sections' ][ $section_name ][ 'vars' ])) {\n            $this->compiler->config_data[ 'sections' ][ $section_name ][ 'vars' ] = array();\n        }\n        foreach ($vars as $var) {\n            $this->set_var($var, $this->compiler->config_data[ 'sections' ][ $section_name ]);\n        }\n    }\n}\n\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_data.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Data\n * This file contains the basic classes and methods for template and variable creation\n *\n * @package    Smarty\n * @subpackage Template\n * @author     Uwe Tews\n */\n\n/**\n * Base class with template and variable methods\n *\n * @package    Smarty\n * @subpackage Template\n *\n * @property int    $scope\n * @property Smarty $smarty\n * The following methods will be dynamically loaded by the extension handler when they are called.\n * They are located in a corresponding Smarty_Internal_Method_xxxx class\n *\n * @method mixed _getConfigVariable(string $varName, bool $errorEnable = true)\n * @method mixed getConfigVariable(string $varName, bool $errorEnable = true)\n * @method mixed getConfigVars(string $varName = null, bool $searchParents = true)\n * @method mixed getGlobal(string $varName = null)\n * @method mixed getStreamVariable(string $variable)\n * @method Smarty_Internal_Data clearAssign(mixed $tpl_var)\n * @method Smarty_Internal_Data clearAllAssign()\n * @method Smarty_Internal_Data clearConfig(string $varName = null)\n * @method Smarty_Internal_Data configLoad(string $config_file, mixed $sections = null, string $scope = 'local')\n */\nabstract class Smarty_Internal_Data\n{\n    /**\n     * This object type (Smarty = 1, template = 2, data = 4)\n     *\n     * @var int\n     */\n    public $_objType = 4;\n\n    /**\n     * name of class used for templates\n     *\n     * @var string\n     */\n    public $template_class = 'Smarty_Internal_Template';\n\n    /**\n     * template variables\n     *\n     * @var Smarty_Variable[]\n     */\n    public $tpl_vars = array();\n\n    /**\n     * parent template (if any)\n     *\n     * @var Smarty|Smarty_Internal_Template|Smarty_Data\n     */\n    public $parent = null;\n\n    /**\n     * configuration settings\n     *\n     * @var string[]\n     */\n    public $config_vars = array();\n\n    /**\n     * extension handler\n     *\n     * @var Smarty_Internal_Extension_Handler\n     */\n    public $ext = null;\n\n    /**\n     * Smarty_Internal_Data constructor.\n     *\n     * Install extension handler\n     */\n    public function __construct()\n    {\n        $this->ext = new Smarty_Internal_Extension_Handler();\n        $this->ext->objType = $this->_objType;\n    }\n\n    /**\n     * assigns a Smarty variable\n     *\n     * @param  array|string $tpl_var the template variable name(s)\n     * @param  mixed        $value   the value to assign\n     * @param  boolean      $nocache if true any output of this variable will be not cached\n     *\n     * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for\n     *                              chaining\n     */\n    public function assign($tpl_var, $value = null, $nocache = false)\n    {\n        if (is_array($tpl_var)) {\n            foreach ($tpl_var as $_key => $_val) {\n                $this->assign($_key, $_val, $nocache);\n            }\n        } else {\n            if ($tpl_var !== '') {\n                if ($this->_objType === 2) {\n                    /** @var  Smarty_Internal_Template $this */\n                    $this->_assignInScope($tpl_var, $value, $nocache);\n                } else {\n                    $this->tpl_vars[ $tpl_var ] = new Smarty_Variable($value, $nocache);\n                }\n            }\n        }\n        return $this;\n    }\n\n    /**\n     * appends values to template variables\n     *\n     * @api  Smarty::append()\n     * @link http://www.smarty.net/docs/en/api.append.tpl\n     *\n     * @param  array|string $tpl_var                                           the template variable name(s)\n     * @param  mixed        $value                                             the value to append\n     * @param  bool         $merge                                             flag if array elements shall be merged\n     * @param  bool         $nocache                                           if true any output of this variable will\n     *                                                                         be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function append($tpl_var, $value = null, $merge = false, $nocache = false)\n    {\n        return $this->ext->append->append($this, $tpl_var, $value, $merge, $nocache);\n    }\n\n    /**\n     * assigns a global Smarty variable\n     *\n     * @param  string  $varName the global variable name\n     * @param  mixed   $value   the value to assign\n     * @param  boolean $nocache if true any output of this variable will be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function assignGlobal($varName, $value = null, $nocache = false)\n    {\n        return $this->ext->assignGlobal->assignGlobal($this, $varName, $value, $nocache);\n    }\n\n    /**\n     * appends values to template variables by reference\n     *\n     * @param  string  $tpl_var the template variable name\n     * @param  mixed   &$value  the referenced value to append\n     * @param  boolean $merge   flag if array elements shall be merged\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function appendByRef($tpl_var, &$value, $merge = false)\n    {\n        return $this->ext->appendByRef->appendByRef($this, $tpl_var, $value, $merge);\n    }\n\n    /**\n     * assigns values to template variables by reference\n     *\n     * @param string   $tpl_var the template variable name\n     * @param          $value\n     * @param  boolean $nocache if true any output of this variable will be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function assignByRef($tpl_var, &$value, $nocache = false)\n    {\n        return $this->ext->assignByRef->assignByRef($this, $tpl_var, $value, $nocache);\n    }\n\n    /**\n     * Returns a single or all template variables\n     *\n     * @api  Smarty::getTemplateVars()\n     * @link http://www.smarty.net/docs/en/api.get.template.vars.tpl\n     *\n     * @param  string                                                 $varName       variable name or null\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $_ptr          optional pointer to data object\n     * @param  bool                                                   $searchParents include parent templates?\n     *\n     * @return mixed variable value or or array of variables\n     */\n    public function getTemplateVars($varName = null, Smarty_Internal_Data $_ptr = null, $searchParents = true)\n    {\n        return $this->ext->getTemplateVars->getTemplateVars($this, $varName, $_ptr, $searchParents);\n    }\n\n    /**\n     * gets the object of a Smarty variable\n     *\n     * @param  string               $variable      the name of the Smarty variable\n     * @param  Smarty_Internal_Data $_ptr          optional pointer to data object\n     * @param  boolean              $searchParents search also in parent data\n     * @param bool                  $error_enable\n     *\n     * @return Smarty_Variable|Smarty_Undefined_Variable the object of the variable\n     * @deprecated since 3.1.28 please use Smarty_Internal_Data::getTemplateVars() instead.\n     */\n    public function getVariable($variable = null, Smarty_Internal_Data $_ptr = null, $searchParents = true,\n                                $error_enable = true)\n    {\n        return $this->ext->getTemplateVars->_getVariable($this, $variable, $_ptr, $searchParents, $error_enable);\n    }\n\n    /**\n     * Follow the parent chain an merge template and config variables\n     *\n     * @param \\Smarty_Internal_Data|null $data\n     */\n    public function _mergeVars(Smarty_Internal_Data $data = null)\n    {\n        if (isset($data)) {\n            if (!empty($this->tpl_vars)) {\n                $data->tpl_vars = array_merge($this->tpl_vars, $data->tpl_vars);\n            }\n            if (!empty($this->config_vars)) {\n                $data->config_vars = array_merge($this->config_vars, $data->config_vars);\n            }\n        } else {\n            $data = $this;\n        }\n        if (isset($this->parent)) {\n            $this->parent->_mergeVars($data);\n        }\n    }\n\n    /**\n     * Return true if this instance is a Data obj\n     *\n     * @return bool\n     */\n    public function _isDataObj()\n    {\n        return $this->_objType === 4;\n    }\n\n    /**\n     * Return true if this instance is a template obj\n     *\n     * @return bool\n     */\n    public function _isTplObj()\n    {\n        return $this->_objType === 2;\n    }\n\n    /**\n     * Return true if this instance is a Smarty obj\n     *\n     * @return bool\n     */\n    public function _isSmartyObj()\n    {\n        return $this->_objType === 1;\n    }\n\n    /**\n     * Get Smarty object\n     *\n     * @return Smarty\n     */\n    public function _getSmartyObj()\n    {\n        return $this->smarty;\n    }\n\n    /**\n     * Handle unknown class methods\n     *\n     * @param string $name unknown method-name\n     * @param array  $args argument array\n     *\n     * @return mixed\n     * @throws SmartyException\n     */\n    public function __call($name, $args)\n    {\n        return $this->ext->_callExternalMethod($this, $name, $args);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_debug.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Debug\n * Class to collect data for the Smarty Debugging Console\n *\n * @package    Smarty\n * @subpackage Debug\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Debug Class\n *\n * @package    Smarty\n * @subpackage Debug\n */\nclass Smarty_Internal_Debug extends Smarty_Internal_Data\n{\n    /**\n     * template data\n     *\n     * @var array\n     */\n    public $template_data = array();\n\n    /**\n     * List of uid's which shall be ignored\n     *\n     * @var array\n     */\n    public $ignore_uid = array();\n\n    /**\n     * Index of display() and fetch() calls\n     *\n     * @var int\n     */\n    public $index = 0;\n\n    /**\n     * Counter for window offset\n     *\n     * @var int\n     */\n    public $offset = 0;\n\n    /**\n     * Start logging template\n     *\n     * @param \\Smarty_Internal_Template $template template\n     * @param null                      $mode     true: display   false: fetch  null: subtemplate\n     */\n    public function start_template(Smarty_Internal_Template $template, $mode = null)\n    {\n        if (isset($mode) && !$template->_isSubTpl()) {\n            $this->index ++;\n            $this->offset ++;\n            $this->template_data[ $this->index ] = null;\n        }\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'start_template_time' ] = microtime(true);\n    }\n\n    /**\n     * End logging of cache time\n     *\n     * @param \\Smarty_Internal_Template $template cached template\n     */\n    public function end_template(Smarty_Internal_Template $template)\n    {\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'total_time' ] +=\n            microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_template_time' ];\n        //$this->template_data[$this->index][$key]['properties'] = $template->properties;\n    }\n\n    /**\n     * Start logging of compile time\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function start_compile(Smarty_Internal_Template $template)\n    {\n        static $_is_stringy = array('string' => true, 'eval' => true);\n        if (!empty($template->compiler->trace_uid)) {\n            $key = $template->compiler->trace_uid;\n            if (!isset($this->template_data[ $this->index ][ $key ])) {\n                if (isset($_is_stringy[ $template->source->type ])) {\n                    $this->template_data[ $this->index ][ $key ][ 'name' ] =\n                        '\\'' . substr($template->source->name, 0, 25) . '...\\'';\n                } else {\n                    $this->template_data[ $this->index ][ $key ][ 'name' ] = $template->source->filepath;\n                }\n                $this->template_data[ $this->index ][ $key ][ 'compile_time' ] = 0;\n                $this->template_data[ $this->index ][ $key ][ 'render_time' ] = 0;\n                $this->template_data[ $this->index ][ $key ][ 'cache_time' ] = 0;\n            }\n        } else {\n            if (isset($this->ignore_uid[ $template->source->uid ])) {\n                return;\n            }\n            $key = $this->get_key($template);\n        }\n        $this->template_data[ $this->index ][ $key ][ 'start_time' ] = microtime(true);\n    }\n\n    /**\n     * End logging of compile time\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function end_compile(Smarty_Internal_Template $template)\n    {\n        if (!empty($template->compiler->trace_uid)) {\n            $key = $template->compiler->trace_uid;\n        } else {\n            if (isset($this->ignore_uid[ $template->source->uid ])) {\n                return;\n            }\n\n            $key = $this->get_key($template);\n        }\n        $this->template_data[ $this->index ][ $key ][ 'compile_time' ] +=\n            microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ];\n    }\n\n    /**\n     * Start logging of render time\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function start_render(Smarty_Internal_Template $template)\n    {\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'start_time' ] = microtime(true);\n    }\n\n    /**\n     * End logging of compile time\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function end_render(Smarty_Internal_Template $template)\n    {\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'render_time' ] +=\n            microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ];\n    }\n\n    /**\n     * Start logging of cache time\n     *\n     * @param \\Smarty_Internal_Template $template cached template\n     */\n    public function start_cache(Smarty_Internal_Template $template)\n    {\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'start_time' ] = microtime(true);\n    }\n\n    /**\n     * End logging of cache time\n     *\n     * @param \\Smarty_Internal_Template $template cached template\n     */\n    public function end_cache(Smarty_Internal_Template $template)\n    {\n        $key = $this->get_key($template);\n        $this->template_data[ $this->index ][ $key ][ 'cache_time' ] +=\n            microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ];\n    }\n\n    /**\n     * Register template object\n     *\n     * @param \\Smarty_Internal_Template $template cached template\n     */\n    public function register_template(Smarty_Internal_Template $template)\n    {\n    }\n\n    /**\n     * Register data object\n     *\n     * @param \\Smarty_Data $data data object\n     */\n    public static function register_data(Smarty_Data $data)\n    {\n    }\n\n    /**\n     * Opens a window for the Smarty Debugging Console and display the data\n     *\n     * @param Smarty_Internal_Template|Smarty $obj object to debug\n     * @param bool                            $full\n     *\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function display_debug($obj, $full = false)\n    {\n        if (!$full) {\n            $this->offset ++;\n            $savedIndex = $this->index;\n            $this->index = 9999;\n        }\n        $smarty = $obj->_getSmartyObj();\n        // create fresh instance of smarty for displaying the debug console\n        // to avoid problems if the application did overload the Smarty class\n        $debObj = new Smarty();\n        // copy the working dirs from application\n        $debObj->setCompileDir($smarty->getCompileDir());\n        // init properties by hand as user may have edited the original Smarty class\n        $debObj->setPluginsDir(is_dir(__DIR__ . '/../plugins') ? __DIR__ . '/../plugins' : $smarty->getPluginsDir());\n        $debObj->force_compile = false;\n        $debObj->compile_check = Smarty::COMPILECHECK_ON;\n        $debObj->left_delimiter = '{';\n        $debObj->right_delimiter = '}';\n        $debObj->security_policy = null;\n        $debObj->debugging = false;\n        $debObj->debugging_ctrl = 'NONE';\n        $debObj->error_reporting = E_ALL & ~E_NOTICE;\n        $debObj->debug_tpl = isset($smarty->debug_tpl) ? $smarty->debug_tpl : 'file:' . __DIR__ . '/../debug.tpl';\n        $debObj->registered_plugins = array();\n        $debObj->registered_resources = array();\n        $debObj->registered_filters = array();\n        $debObj->autoload_filters = array();\n        $debObj->default_modifiers = array();\n        $debObj->escape_html = true;\n        $debObj->caching = Smarty::CACHING_OFF;\n        $debObj->compile_id = null;\n        $debObj->cache_id = null;\n        // prepare information of assigned variables\n        $ptr = $this->get_debug_vars($obj);\n        $_assigned_vars = $ptr->tpl_vars;\n        ksort($_assigned_vars);\n        $_config_vars = $ptr->config_vars;\n        ksort($_config_vars);\n        $debugging = $smarty->debugging;\n\n        $_template = new Smarty_Internal_Template($debObj->debug_tpl, $debObj);\n        if ($obj->_isTplObj()) {\n            $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name);\n        }\n        if ($obj->_objType === 1 || $full) {\n            $_template->assign('template_data', $this->template_data[ $this->index ]);\n        } else {\n            $_template->assign('template_data', null);\n        }\n        $_template->assign('assigned_vars', $_assigned_vars);\n        $_template->assign('config_vars', $_config_vars);\n        $_template->assign('execution_time', microtime(true) - $smarty->start_time);\n        $_template->assign('display_mode', $debugging === 2 || !$full);\n        $_template->assign('offset', $this->offset * 50);\n        echo $_template->fetch();\n        if (isset($full)) {\n            $this->index --;\n        }\n        if (!$full) {\n            $this->index = $savedIndex;\n        }\n    }\n\n    /**\n     * Recursively gets variables from all template/data scopes\n     *\n     * @param  Smarty_Internal_Template|Smarty_Data $obj object to debug\n     *\n     * @return StdClass\n     */\n    public function get_debug_vars($obj)\n    {\n        $config_vars = array();\n        foreach ($obj->config_vars as $key => $var) {\n            $config_vars[ $key ][ 'value' ] = $var;\n            if ($obj->_isTplObj()) {\n                $config_vars[ $key ][ 'scope' ] = $obj->source->type . ':' . $obj->source->name;\n            } elseif ($obj->_isDataObj()) {\n                $tpl_vars[ $key ][ 'scope' ] = $obj->dataObjectName;\n            } else {\n                $config_vars[ $key ][ 'scope' ] = 'Smarty object';\n            }\n        }\n        $tpl_vars = array();\n        foreach ($obj->tpl_vars as $key => $var) {\n            foreach ($var as $varkey => $varvalue) {\n                if ($varkey === 'value') {\n                    $tpl_vars[ $key ][ $varkey ] = $varvalue;\n                } else {\n                    if ($varkey === 'nocache') {\n                        if ($varvalue === true) {\n                            $tpl_vars[ $key ][ $varkey ] = $varvalue;\n                        }\n                    } else {\n                        if ($varkey !== 'scope' || $varvalue !== 0) {\n                            $tpl_vars[ $key ][ 'attributes' ][ $varkey ] = $varvalue;\n                        }\n                    }\n                }\n            }\n            if ($obj->_isTplObj()) {\n                $tpl_vars[ $key ][ 'scope' ] = $obj->source->type . ':' . $obj->source->name;\n            } elseif ($obj->_isDataObj()) {\n                $tpl_vars[ $key ][ 'scope' ] = $obj->dataObjectName;\n            } else {\n                $tpl_vars[ $key ][ 'scope' ] = 'Smarty object';\n            }\n        }\n\n        if (isset($obj->parent)) {\n            $parent = $this->get_debug_vars($obj->parent);\n            foreach ($parent->tpl_vars as $name => $pvar) {\n                if (isset($tpl_vars[ $name ]) && $tpl_vars[ $name ][ 'value' ] === $pvar[ 'value' ]) {\n                    $tpl_vars[ $name ][ 'scope' ] = $pvar[ 'scope' ];\n                }\n            }\n            $tpl_vars = array_merge($parent->tpl_vars, $tpl_vars);\n\n            foreach ($parent->config_vars as $name => $pvar) {\n                if (isset($config_vars[ $name ]) && $config_vars[ $name ][ 'value' ] === $pvar[ 'value' ]) {\n                    $config_vars[ $name ][ 'scope' ] = $pvar[ 'scope' ];\n                }\n            }\n            $config_vars = array_merge($parent->config_vars, $config_vars);\n        } else {\n            foreach (Smarty::$global_tpl_vars as $key => $var) {\n                if (!array_key_exists($key, $tpl_vars)) {\n                    foreach ($var as $varkey => $varvalue) {\n                        if ($varkey === 'value') {\n                            $tpl_vars[ $key ][ $varkey ] = $varvalue;\n                        } else {\n                            if ($varkey === 'nocache') {\n                                if ($varvalue === true) {\n                                    $tpl_vars[ $key ][ $varkey ] = $varvalue;\n                                }\n                            } else {\n                                if ($varkey !== 'scope' || $varvalue !== 0) {\n                                    $tpl_vars[ $key ][ 'attributes' ][ $varkey ] = $varvalue;\n                                }\n                            }\n                        }\n                    }\n                    $tpl_vars[ $key ][ 'scope' ] = 'Global';\n                }\n            }\n        }\n\n        return (object) array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars);\n    }\n\n    /**\n     * Return key into $template_data for template\n     *\n     * @param \\Smarty_Internal_Template $template template object\n     *\n     * @return string key into $template_data\n     */\n    private function get_key(Smarty_Internal_Template $template)\n    {\n        static $_is_stringy = array('string' => true, 'eval' => true);\n        // calculate Uid if not already done\n        if ($template->source->uid === '') {\n            $template->source->filepath;\n        }\n        $key = $template->source->uid;\n        if (isset($this->template_data[ $this->index ][ $key ])) {\n            return $key;\n        } else {\n            if (isset($_is_stringy[ $template->source->type ])) {\n                $this->template_data[ $this->index ][ $key ][ 'name' ] =\n                    '\\'' . substr($template->source->name, 0, 25) . '...\\'';\n            } else {\n                $this->template_data[ $this->index ][ $key ][ 'name' ] = $template->source->filepath;\n            }\n            $this->template_data[ $this->index ][ $key ][ 'compile_time' ] = 0;\n            $this->template_data[ $this->index ][ $key ][ 'render_time' ] = 0;\n            $this->template_data[ $this->index ][ $key ][ 'cache_time' ] = 0;\n            $this->template_data[ $this->index ][ $key ][ 'total_time' ] = 0;\n\n            return $key;\n        }\n    }\n\n    /**\n     * Ignore template\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function ignore(Smarty_Internal_Template $template)\n    {\n        // calculate Uid if not already done\n        if ($template->source->uid === '') {\n            $template->source->filepath;\n        }\n        $this->ignore_uid[ $template->source->uid ] = true;\n    }\n\n    /**\n     * handle 'URL' debugging mode\n     *\n     * @param Smarty $smarty\n     */\n    public function debugUrl(Smarty $smarty)\n    {\n        if (isset($_SERVER[ 'QUERY_STRING' ])) {\n            $_query_string = $_SERVER[ 'QUERY_STRING' ];\n        } else {\n            $_query_string = '';\n        }\n        if (false !== strpos($_query_string, $smarty->smarty_debug_id)) {\n            if (false !== strpos($_query_string, $smarty->smarty_debug_id . '=on')) {\n                // enable debugging for this browser session\n                setcookie('SMARTY_DEBUG', true);\n                $smarty->debugging = true;\n            } elseif (false !== strpos($_query_string, $smarty->smarty_debug_id . '=off')) {\n                // disable debugging for this browser session\n                setcookie('SMARTY_DEBUG', false);\n                $smarty->debugging = false;\n            } else {\n                // enable debugging for this page\n                $smarty->debugging = true;\n            }\n        } else {\n            if (isset($_COOKIE[ 'SMARTY_DEBUG' ])) {\n                $smarty->debugging = true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_errorhandler.php",
    "content": "<?php\n\n/**\n * Smarty error handler\n *\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n * @deprecated\nSmarty does no longer use @filemtime()\n */\nclass Smarty_Internal_ErrorHandler\n{\n    /**\n     * contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors()\n     */\n    public static $mutedDirectories = array();\n    /**\n     * error handler returned by set_error_handler() in self::muteExpectedErrors()\n     */\n    private static $previousErrorHandler = null;\n\n    /**\n     * Enable error handler to mute expected messages\n     *\n     * @return boolean\n     */\n    public static function muteExpectedErrors()\n    {\n        /*\n            error muting is done because some people implemented custom error_handlers using\n            http://php.net/set_error_handler and for some reason did not understand the following paragraph:\n\n                It is important to remember that the standard PHP error handler is completely bypassed for the\n                error types specified by error_types unless the callback function returns FALSE.\n                error_reporting() settings will have no effect and your error handler will be called regardless -\n                however you are still able to read the current value of error_reporting and act appropriately.\n                Of particular note is that this value will be 0 if the statement that caused the error was\n                prepended by the @ error-control operator.\n\n            Smarty deliberately uses @filemtime() over file_exists() and filemtime() in some places. Reasons include\n                - @filemtime() is almost twice as fast as using an additional file_exists()\n                - between file_exists() and filemtime() a possible race condition is opened,\n                  which does not exist using the simple @filemtime() approach.\n        */\n        $error_handler = array('Smarty_Internal_ErrorHandler', 'mutingErrorHandler');\n        $previous = set_error_handler($error_handler);\n        // avoid dead loops\n        if ($previous !== $error_handler) {\n            self::$previousErrorHandler = $previous;\n        }\n    }\n\n    /**\n     * Error Handler to mute expected messages\n     *\n     * @link http://php.net/set_error_handler\n     *\n     * @param  integer $errno Error level\n     * @param          $errstr\n     * @param          $errfile\n     * @param          $errline\n     * @param          $errcontext\n     *\n     * @return bool\n     */\n    public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)\n    {\n        $_is_muted_directory = false;\n        // add the SMARTY_DIR to the list of muted directories\n        if (!isset(self::$mutedDirectories[ SMARTY_DIR ])) {\n            $smarty_dir = realpath(SMARTY_DIR);\n            if ($smarty_dir !== false) {\n                self::$mutedDirectories[ SMARTY_DIR ] =\n                    array('file' => $smarty_dir, 'length' => strlen($smarty_dir),);\n            }\n        }\n        // walk the muted directories and test against $errfile\n        foreach (self::$mutedDirectories as $key => &$dir) {\n            if (!$dir) {\n                // resolve directory and length for speedy comparisons\n                $file = realpath($key);\n                if ($file === false) {\n                    // this directory does not exist, remove and skip it\n                    unset(self::$mutedDirectories[ $key ]);\n                    continue;\n                }\n                $dir = array('file' => $file, 'length' => strlen($file),);\n            }\n            if (!strncmp($errfile, $dir[ 'file' ], $dir[ 'length' ])) {\n                $_is_muted_directory = true;\n                break;\n            }\n        }\n        // pass to next error handler if this error did not occur inside SMARTY_DIR\n        // or the error was within smarty but masked to be ignored\n        if (!$_is_muted_directory || ($errno && $errno & error_reporting())) {\n            if (self::$previousErrorHandler) {\n                return call_user_func(self::$previousErrorHandler,\n                                      $errno,\n                                      $errstr,\n                                      $errfile,\n                                      $errline,\n                                      $errcontext);\n            } else {\n                return false;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_extension_handler.php",
    "content": "<?php\n\n/**\n * Smarty Extension handler\n *\n * Load extensions dynamically\n *\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n * Runtime extensions\n * @property Smarty_Internal_Runtime_CacheModify       $_cacheModify\n * @property Smarty_Internal_Runtime_CacheResourceFile $_cacheResourceFile\n * @property Smarty_Internal_Runtime_Capture           $_capture\n * @property Smarty_Internal_Runtime_CodeFrame         $_codeFrame\n * @property Smarty_Internal_Runtime_FilterHandler     $_filterHandler\n * @property Smarty_Internal_Runtime_Foreach           $_foreach\n * @property Smarty_Internal_Runtime_GetIncludePath    $_getIncludePath\n * @property Smarty_Internal_Runtime_Make_Nocache      $_make_nocache\n * @property Smarty_Internal_Runtime_UpdateCache       $_updateCache\n * @property Smarty_Internal_Runtime_UpdateScope       $_updateScope\n * @property Smarty_Internal_Runtime_TplFunction       $_tplFunction\n * @property Smarty_Internal_Runtime_WriteFile         $_writeFile\n *\n * Method extensions\n * @property Smarty_Internal_Method_GetTemplateVars    $getTemplateVars\n * @property Smarty_Internal_Method_Append             $append\n * @property Smarty_Internal_Method_AppendByRef    $appendByRef\n * @property Smarty_Internal_Method_AssignGlobal   $assignGlobal\n * @property Smarty_Internal_Method_AssignByRef    $assignByRef\n * @property Smarty_Internal_Method_LoadFilter     $loadFilter\n * @property Smarty_Internal_Method_LoadPlugin     $loadPlugin\n * @property Smarty_Internal_Method_RegisterFilter $registerFilter\n * @property Smarty_Internal_Method_RegisterObject $registerObject\n * @property Smarty_Internal_Method_RegisterPlugin $registerPlugin\n * @property mixed|\\Smarty_Template_Cached         configLoad\n */\nclass Smarty_Internal_Extension_Handler\n{\n\n    public $objType = null;\n\n    /**\n     * Cache for property information from generic getter/setter\n     * Preloaded with names which should not use with generic getter/setter\n     *\n     * @var array\n     */\n    private $_property_info     = array('AutoloadFilters' => 0, 'DefaultModifiers' => 0, 'ConfigVars' => 0,\n                                        'DebugTemplate'   => 0, 'RegisteredObject' => 0, 'StreamVariable' => 0,\n                                        'TemplateVars'    => 0, 'Literals' => 'Literals',);#\n\n    private $resolvedProperties = array();\n\n    /**\n     * Call external Method\n     *\n     * @param \\Smarty_Internal_Data $data\n     * @param string                $name external method names\n     * @param array                 $args argument array\n     *\n     * @return mixed\n     * @throws SmartyException\n     */\n    public function _callExternalMethod(Smarty_Internal_Data $data, $name, $args)\n    {\n        /* @var Smarty $data ->smarty */\n        $smarty = isset($data->smarty) ? $data->smarty : $data;\n        if (!isset($smarty->ext->$name)) {\n            if (preg_match('/^((set|get)|(.*?))([A-Z].*)$/', $name, $match)) {\n                $basename = $this->upperCase($match[4]);\n                if (!isset($smarty->ext->$basename) && isset($this->_property_info[ $basename ]) &&\n                    is_string($this->_property_info[ $basename ])) {\n                    $class = 'Smarty_Internal_Method_' . $this->_property_info[ $basename ];\n                    if (class_exists($class)) {\n                        $classObj = new $class();\n                        $methodes = get_class_methods($classObj);\n                        foreach ($methodes as $method) {\n                            $smarty->ext->$method = $classObj;\n                        }\n                    }\n                }\n                if (!empty($match[2]) && !isset($smarty->ext->$name)) {\n                    $class = 'Smarty_Internal_Method_' . $this->upperCase($name);\n                    if (!class_exists($class)) {\n                        $objType = $data->_objType;\n                        $propertyType = false;\n                        if (!isset($this->resolvedProperties[ $match[0] ][ $objType ])) {\n                            $property = isset($this->resolvedProperties['property'][ $basename ]) ?\n                                $this->resolvedProperties['property'][ $basename ] :\n                                $property = $this->resolvedProperties['property'][ $basename ] = strtolower(join('_',\n                                                                                                                 preg_split('/([A-Z][^A-Z]*)/',\n                                                                                                                            $basename,\n                                                                                                                            -1,\n                                                                                                                            PREG_SPLIT_NO_EMPTY |\n                                                                                                                            PREG_SPLIT_DELIM_CAPTURE)));\n\n                            if ($property !== false) {\n                                if (property_exists($data, $property)) {\n                                    $propertyType = $this->resolvedProperties[ $match[0] ][ $objType ] = 1;\n                                } else if (property_exists($smarty, $property)) {\n                                    $propertyType = $this->resolvedProperties[ $match[0] ][ $objType ] = 2;\n                                } else {\n                                    $this->resolvedProperties['property'][ $basename ] = $property = false;\n                                }\n                            }\n                        } else {\n                            $propertyType = $this->resolvedProperties[ $match[0] ][ $objType ];\n                            $property = $this->resolvedProperties['property'][ $basename ];\n                        }\n                        if ($propertyType) {\n                            $obj = $propertyType === 1 ? $data : $smarty;\n                            if ($match[2] === 'get') {\n                                return $obj->$property;\n                            } else if ($match[2] === 'set') {\n                                return $obj->$property = $args[0];\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        $callback = array($smarty->ext->$name, $name);\n        array_unshift($args, $data);\n        if (isset($callback) && $callback[0]->objMap | $data->_objType) {\n            return call_user_func_array($callback, $args);\n        }\n        return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), $args);\n    }\n\n    /**\n     * Make first character of name parts upper case\n     *\n     * @param string $name\n     *\n     * @return string\n     */\n    public function upperCase($name)\n    {\n        $_name = explode('_', $name);\n        $_name = array_map('ucfirst', $_name);\n        return implode('_', $_name);\n    }\n\n    /**\n     * get extension object\n     *\n     * @param string $property_name property name\n     *\n     * @return mixed|Smarty_Template_Cached\n     * @throws SmartyException\n     */\n    public function __get($property_name)\n    {\n        // object properties of runtime template extensions will start with '_'\n        if ($property_name[0] === '_') {\n            $class = 'Smarty_Internal_Runtime' . $this->upperCase($property_name);\n        } else {\n            $class = 'Smarty_Internal_Method_' . $this->upperCase($property_name);\n        }\n        if (!class_exists($class)) {\n            return $this->$property_name = new Smarty_Internal_Undefined($class);\n        }\n        return $this->$property_name = new $class();\n    }\n\n    /**\n     * set extension property\n     *\n     * @param string $property_name property name\n     * @param mixed  $value         value\n     *\n     * @throws SmartyException\n     */\n    public function __set($property_name, $value)\n    {\n        $this->$property_name = $value;\n    }\n\n    /**\n     * Call error handler for undefined method\n     *\n     * @param string $name unknown method-name\n     * @param array  $args argument array\n     *\n     * @return mixed\n     * @throws SmartyException\n     */\n    public function __call($name, $args)\n    {\n        return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), array($this));\n    }\n\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_addautoloadfilters.php",
    "content": "<?php\n\n/**\n * Smarty Method AddAutoloadFilters\n *\n * Smarty::addAutoloadFilters() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_AddAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters\n{\n    /**\n     * Add autoload filters\n     *\n     * @api Smarty::setAutoloadFilters()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array                                                          $filters filters to load automatically\n     * @param  string                                                         $type    \"pre\", \"output\", … specify the\n     *                                                                                 filter type to set. Defaults to\n     *                                                                                 none treating $filters' keys as\n     *                                                                                 the appropriate types\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function addAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if ($type !== null) {\n            $this->_checkFilterType($type);\n            if (!empty($smarty->autoload_filters[ $type ])) {\n                $smarty->autoload_filters[ $type ] = array_merge($smarty->autoload_filters[ $type ], (array) $filters);\n            } else {\n                $smarty->autoload_filters[ $type ] = (array) $filters;\n            }\n        } else {\n            foreach ((array) $filters as $type => $value) {\n                $this->_checkFilterType($type);\n                if (!empty($smarty->autoload_filters[ $type ])) {\n                    $smarty->autoload_filters[ $type ] =\n                        array_merge($smarty->autoload_filters[ $type ], (array) $value);\n                } else {\n                    $smarty->autoload_filters[ $type ] = (array) $value;\n                }\n            }\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_adddefaultmodifiers.php",
    "content": "<?php\n\n/**\n * Smarty Method AddDefaultModifiers\n *\n * Smarty::addDefaultModifiers() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_AddDefaultModifiers\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Add default modifiers\n     *\n     * @api Smarty::addDefaultModifiers()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array|string                                                   $modifiers modifier or list of modifiers\n     *                                                                                   to add\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function addDefaultModifiers(Smarty_Internal_TemplateBase $obj, $modifiers)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (is_array($modifiers)) {\n            $smarty->default_modifiers = array_merge($smarty->default_modifiers, $modifiers);\n        } else {\n            $smarty->default_modifiers[] = $modifiers;\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_append.php",
    "content": "<?php\n\n/**\n * Smarty Method Append\n *\n * Smarty::append() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_Append\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * appends values to template variables\n     *\n     * @api  Smarty::append()\n     * @link http://www.smarty.net/docs/en/api.append.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  array|string                                           $tpl_var the template variable name(s)\n     * @param  mixed                                                  $value   the value to append\n     * @param  bool                                                   $merge   flag if array elements shall be merged\n     * @param  bool                                                   $nocache if true any output of this variable will\n     *                                                                         be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function append(Smarty_Internal_Data $data, $tpl_var, $value = null, $merge = false, $nocache = false)\n    {\n        if (is_array($tpl_var)) {\n            // $tpl_var is an array, ignore $value\n            foreach ($tpl_var as $_key => $_val) {\n                if ($_key !== '') {\n                    $this->append($data, $_key, $_val, $merge, $nocache);\n                }\n            }\n        } else {\n            if ($tpl_var !== '' && isset($value)) {\n                if (!isset($data->tpl_vars[ $tpl_var ])) {\n                    $tpl_var_inst = $data->ext->getTemplateVars->_getVariable($data, $tpl_var, null, true, false);\n                    if ($tpl_var_inst instanceof Smarty_Undefined_Variable) {\n                        $data->tpl_vars[ $tpl_var ] = new Smarty_Variable(null, $nocache);\n                    } else {\n                        $data->tpl_vars[ $tpl_var ] = clone $tpl_var_inst;\n                    }\n                }\n                if (!(is_array($data->tpl_vars[ $tpl_var ]->value) ||\n                      $data->tpl_vars[ $tpl_var ]->value instanceof ArrayAccess)\n                ) {\n                    settype($data->tpl_vars[ $tpl_var ]->value, 'array');\n                }\n                if ($merge && is_array($value)) {\n                    foreach ($value as $_mkey => $_mval) {\n                        $data->tpl_vars[ $tpl_var ]->value[ $_mkey ] = $_mval;\n                    }\n                } else {\n                    $data->tpl_vars[ $tpl_var ]->value[] = $value;\n                }\n            }\n            if ($data->_isTplObj() && $data->scope) {\n                $data->ext->_updateScope->_updateScope($data, $tpl_var);\n            }\n        }\n        return $data;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_appendbyref.php",
    "content": "<?php\n\n/**\n * Smarty Method AppendByRef\n *\n * Smarty::appendByRef() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_AppendByRef\n{\n\n    /**\n     * appends values to template variables by reference\n     *\n     * @api  Smarty::appendByRef()\n     * @link http://www.smarty.net/docs/en/api.append.by.ref.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $tpl_var the template variable name\n     * @param  mixed                                                  &$value  the referenced value to append\n     * @param  bool                                                   $merge   flag if array elements shall be merged\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public static function appendByRef(Smarty_Internal_Data $data, $tpl_var, &$value, $merge = false)\n    {\n        if ($tpl_var !== '' && isset($value)) {\n            if (!isset($data->tpl_vars[ $tpl_var ])) {\n                $data->tpl_vars[ $tpl_var ] = new Smarty_Variable();\n            }\n            if (!is_array($data->tpl_vars[ $tpl_var ]->value)) {\n                settype($data->tpl_vars[ $tpl_var ]->value, 'array');\n            }\n            if ($merge && is_array($value)) {\n                foreach ($value as $_key => $_val) {\n                    $data->tpl_vars[ $tpl_var ]->value[ $_key ] = &$value[ $_key ];\n                }\n            } else {\n                $data->tpl_vars[ $tpl_var ]->value[] = &$value;\n            }\n            if ($data->_isTplObj() && $data->scope) {\n                $data->ext->_updateScope->_updateScope($data, $tpl_var);\n            }\n        }\n        return $data;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_assignbyref.php",
    "content": "<?php\n\n/**\n * Smarty Method AssignByRef\n *\n * Smarty::assignByRef() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_AssignByRef\n{\n\n    /**\n     * assigns values to template variables by reference\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param string                                                  $tpl_var the template variable name\n     * @param                                                         $value\n     * @param  boolean                                                $nocache if true any output of this variable will be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function assignByRef(Smarty_Internal_Data $data, $tpl_var, &$value, $nocache)\n    {\n        if ($tpl_var !== '') {\n            $data->tpl_vars[ $tpl_var ] = new Smarty_Variable(null, $nocache);\n            $data->tpl_vars[ $tpl_var ]->value = &$value;\n            if ($data->_isTplObj() && $data->scope) {\n                $data->ext->_updateScope->_updateScope($data, $tpl_var);\n            }\n        }\n        return $data;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_assignglobal.php",
    "content": "<?php\n\n/**\n * Smarty Method AssignGlobal\n *\n * Smarty::assignGlobal() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_AssignGlobal\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * assigns a global Smarty variable\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $varName the global variable name\n     * @param  mixed                                                  $value   the value to assign\n     * @param  boolean                                                $nocache if true any output of this variable will be not cached\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function assignGlobal(Smarty_Internal_Data $data, $varName, $value = null, $nocache = false)\n    {\n        if ($varName !== '') {\n            Smarty::$global_tpl_vars[ $varName ] = new Smarty_Variable($value, $nocache);\n            $ptr = $data;\n            while ($ptr->_isTplObj()) {\n                $ptr->tpl_vars[ $varName ] = clone Smarty::$global_tpl_vars[ $varName ];\n                $ptr = $ptr->parent;\n            }\n        }\n        return $data;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_clearallassign.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearAllAssign\n *\n * Smarty::clearAllAssign() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearAllAssign\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * clear all the assigned template variables.\n     *\n     * @api  Smarty::clearAllAssign()\n     * @link http://www.smarty.net/docs/en/api.clear.all.assign.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function clearAllAssign(Smarty_Internal_Data $data)\n    {\n        $data->tpl_vars = array();\n\n        return $data;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_clearallcache.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearAllCache\n *\n * Smarty::clearAllCache() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearAllCache\n{\n    /**\n     * Valid for Smarty object\n     *\n     * @var int\n     */\n    public $objMap = 1;\n\n    /**\n     * Empty cache folder\n     *\n     * @api  Smarty::clearAllCache()\n     * @link http://www.smarty.net/docs/en/api.clear.all.cache.tpl\n     *\n     * @param \\Smarty  $smarty\n     * @param  integer $exp_time expiration time\n     * @param  string  $type     resource type\n     *\n     * @return int number of cache files deleted\n     * @throws \\SmartyException\n     */\n    public function clearAllCache(Smarty $smarty, $exp_time = null, $type = null)\n    {\n        $smarty->_clearTemplateCache();\n        // load cache resource and call clearAll\n        $_cache_resource = Smarty_CacheResource::load($smarty, $type);\n        return $_cache_resource->clearAll($smarty, $exp_time);\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_clearassign.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearAssign\n *\n * Smarty::clearAssign() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearAssign\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * clear the given assigned template variable(s).\n     *\n     * @api  Smarty::clearAssign()\n     * @link http://www.smarty.net/docs/en/api.clear.assign.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string|array                                           $tpl_var the template variable(s) to clear\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function clearAssign(Smarty_Internal_Data $data, $tpl_var)\n    {\n        if (is_array($tpl_var)) {\n            foreach ($tpl_var as $curr_var) {\n                unset($data->tpl_vars[ $curr_var ]);\n            }\n        } else {\n            unset($data->tpl_vars[ $tpl_var ]);\n        }\n\n        return $data;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_clearcache.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearCache\n *\n * Smarty::clearCache() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearCache\n{\n    /**\n     * Valid for Smarty object\n     *\n     * @var int\n     */\n    public $objMap = 1;\n\n    /**\n     * Empty cache for a specific template\n     *\n     * @api  Smarty::clearCache()\n     * @link http://www.smarty.net/docs/en/api.clear.cache.tpl\n     *\n     * @param \\Smarty  $smarty\n     * @param  string  $template_name template name\n     * @param  string  $cache_id      cache id\n     * @param  string  $compile_id    compile id\n     * @param  integer $exp_time      expiration time\n     * @param  string  $type          resource type\n     *\n     * @return int number of cache files deleted\n     * @throws \\SmartyException\n     */\n    public function clearCache(Smarty $smarty, $template_name, $cache_id = null, $compile_id = null, $exp_time = null,\n                               $type = null)\n    {\n        $smarty->_clearTemplateCache();\n        // load cache resource and call clear\n        $_cache_resource = Smarty_CacheResource::load($smarty, $type);\n        return $_cache_resource->clear($smarty, $template_name, $cache_id, $compile_id, $exp_time);\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearCompiledTemplate\n *\n * Smarty::clearCompiledTemplate() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearCompiledTemplate\n{\n    /**\n     * Valid for Smarty object\n     *\n     * @var int\n     */\n    public $objMap = 1;\n\n    /**\n     * Delete compiled template file\n     *\n     * @api  Smarty::clearCompiledTemplate()\n     * @link http://www.smarty.net/docs/en/api.clear.compiled.template.tpl\n     *\n     * @param \\Smarty  $smarty\n     * @param  string  $resource_name template name\n     * @param  string  $compile_id    compile id\n     * @param  integer $exp_time      expiration time\n     *\n     * @return int number of template files deleted\n     * @throws \\SmartyException\n     */\n    public function clearCompiledTemplate(Smarty $smarty, $resource_name = null, $compile_id = null, $exp_time = null)\n    {\n        // clear template objects cache\n        $smarty->_clearTemplateCache();\n        $_compile_dir = $smarty->getCompileDir();\n        if ($_compile_dir === '/') { //We should never want to delete this!\n            return 0;\n        }\n        $_compile_id = isset($compile_id) ? preg_replace('![^\\w]+!', '_', $compile_id) : null;\n        $_dir_sep = $smarty->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';\n        if (isset($resource_name)) {\n            $_save_stat = $smarty->caching;\n            $smarty->caching = Smarty::CACHING_OFF;\n            /* @var Smarty_Internal_Template $tpl */\n            $tpl = $smarty->createTemplate($resource_name);\n            $smarty->caching = $_save_stat;\n            if (!$tpl->source->handler->uncompiled && !$tpl->source->handler->recompiled && $tpl->source->exists) {\n                $_resource_part_1 = basename(str_replace('^', DIRECTORY_SEPARATOR, $tpl->compiled->filepath));\n                $_resource_part_1_length = strlen($_resource_part_1);\n            } else {\n                return 0;\n            }\n            $_resource_part_2 = str_replace('.php', '.cache.php', $_resource_part_1);\n            $_resource_part_2_length = strlen($_resource_part_2);\n        }\n        $_dir = $_compile_dir;\n        if ($smarty->use_sub_dirs && isset($_compile_id)) {\n            $_dir .= $_compile_id . $_dir_sep;\n        }\n        if (isset($_compile_id)) {\n            $_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep;\n            $_compile_id_part_length = strlen($_compile_id_part);\n        }\n        $_count = 0;\n        try {\n            $_compileDirs = new RecursiveDirectoryIterator($_dir);\n            // NOTE: UnexpectedValueException thrown for PHP >= 5.3\n        }\n        catch (Exception $e) {\n            return 0;\n        }\n        $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);\n        foreach ($_compile as $_file) {\n            if (substr(basename($_file->getPathname()), 0, 1) === '.') {\n                continue;\n            }\n            $_filepath = (string)$_file;\n            if ($_file->isDir()) {\n                if (!$_compile->isDot()) {\n                    // delete folder if empty\n                    @rmdir($_file->getPathname());\n                }\n            } else {\n                // delete only php files\n                if (substr($_filepath, -4) !== '.php') {\n                    continue;\n                }\n                $unlink = false;\n                if ((!isset($_compile_id) || (isset($_filepath[ $_compile_id_part_length ]) && $a =\n                                !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) &&\n                    (!isset($resource_name) || (isset($_filepath[ $_resource_part_1_length ]) &&\n                                                substr_compare($_filepath,\n                                                               $_resource_part_1,\n                                                               -$_resource_part_1_length,\n                                                               $_resource_part_1_length) ===\n                                                0) || (isset($_filepath[ $_resource_part_2_length ]) &&\n                                                       substr_compare($_filepath,\n                                                                      $_resource_part_2,\n                                                                      -$_resource_part_2_length,\n                                                                      $_resource_part_2_length) === 0))\n                ) {\n                    if (isset($exp_time)) {\n                        if (is_file($_filepath) && time() - filemtime($_filepath) >= $exp_time) {\n                            $unlink = true;\n                        }\n                    } else {\n                        $unlink = true;\n                    }\n                }\n                if ($unlink && is_file($_filepath) && @unlink($_filepath)) {\n                    $_count++;\n                    if (function_exists('opcache_invalidate')\n                        && (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api')) < 1)\n                    ) {\n                        opcache_invalidate($_filepath, true);\n                    } else if (function_exists('apc_delete_file')) {\n                        apc_delete_file($_filepath);\n                    }\n                }\n            }\n        }\n        return $_count;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_clearconfig.php",
    "content": "<?php\n\n/**\n * Smarty Method ClearConfig\n *\n * Smarty::clearConfig() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ClearConfig\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * clear a single or all config variables\n     *\n     * @api  Smarty::clearConfig()\n     * @link http://www.smarty.net/docs/en/api.clear.config.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string|null                                            $name variable name or null\n     *\n     * @return \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty\n     */\n    public function clearConfig(Smarty_Internal_Data $data, $name = null)\n    {\n        if (isset($name)) {\n            unset($data->config_vars[ $name ]);\n        } else {\n            $data->config_vars = array();\n        }\n        return $data;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_compileallconfig.php",
    "content": "<?php\n\n/**\n * Smarty Method CompileAllConfig\n *\n * Smarty::compileAllConfig() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_CompileAllConfig extends Smarty_Internal_Method_CompileAllTemplates\n{\n\n    /**\n     * Compile all config files\n     *\n     * @api  Smarty::compileAllConfig()\n     *\n     * @param \\Smarty $smarty        passed smarty object\n     * @param  string $extension     file extension\n     * @param  bool   $force_compile force all to recompile\n     * @param  int    $time_limit\n     * @param  int    $max_errors\n     *\n     * @return int number of template files recompiled\n     */\n    public function compileAllConfig(Smarty $smarty, $extension = '.conf', $force_compile = false, $time_limit = 0,\n                                     $max_errors = null)\n    {\n        return $this->compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors, true);\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_compilealltemplates.php",
    "content": "<?php\n/**\n * Smarty Method CompileAllTemplates\n *\n * Smarty::compileAllTemplates() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_CompileAllTemplates\n{\n    /**\n     * Valid for Smarty object\n     *\n     * @var int\n     */\n    public $objMap = 1;\n\n    /**\n     * Compile all template files\n     *\n     * @api  Smarty::compileAllTemplates()\n     *\n     * @param \\Smarty $smarty        passed smarty object\n     * @param  string $extension     file extension\n     * @param  bool   $force_compile force all to recompile\n     * @param  int    $time_limit\n     * @param  int    $max_errors\n     *\n     * @return integer number of template files recompiled\n     */\n    public function compileAllTemplates(Smarty $smarty,\n                                        $extension = '.tpl',\n                                        $force_compile = false,\n                                        $time_limit = 0,\n                                        $max_errors = null)\n    {\n        return $this->compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors);\n    }\n\n    /**\n     * Compile all template or config files\n     *\n     * @param \\Smarty $smarty\n     * @param  string $extension     template file name extension\n     * @param  bool   $force_compile force all to recompile\n     * @param  int    $time_limit    set maximum execution time\n     * @param  int    $max_errors    set maximum allowed errors\n     * @param bool    $isConfig      flag true if called for config files\n     *\n     * @return int number of template files compiled\n     */\n    protected function compileAll(Smarty $smarty,\n                                  $extension,\n                                  $force_compile,\n                                  $time_limit,\n                                  $max_errors,\n                                  $isConfig = false)\n    {\n        // switch off time limit\n        if (function_exists('set_time_limit')) {\n            @set_time_limit($time_limit);\n        }\n        $_count = 0;\n        $_error_count = 0;\n        $sourceDir = $isConfig ? $smarty->getConfigDir() : $smarty->getTemplateDir();\n        // loop over array of source directories\n        foreach ($sourceDir as $_dir) {\n            $_dir_1 = new RecursiveDirectoryIterator($_dir, defined('FilesystemIterator::FOLLOW_SYMLINKS') ?\n                FilesystemIterator::FOLLOW_SYMLINKS : 0);\n            $_dir_2 = new RecursiveIteratorIterator($_dir_1);\n            foreach ($_dir_2 as $_fileinfo) {\n                $_file = $_fileinfo->getFilename();\n                if (substr(basename($_fileinfo->getPathname()), 0, 1) === '.' || strpos($_file, '.svn') !== false) {\n                    continue;\n                }\n                if (!substr_compare($_file, $extension, -strlen($extension)) === 0) {\n                    continue;\n                }\n                if ($_fileinfo->getPath() !== substr($_dir, 0, -1)) {\n                    $_file = substr($_fileinfo->getPath(), strlen($_dir)) . DIRECTORY_SEPARATOR . $_file;\n                }\n                echo \"\\n<br>\", $_dir, '---', $_file;\n                flush();\n                $_start_time = microtime(true);\n                $_smarty = clone $smarty;\n                //\n                $_smarty->_cache = array();\n                $_smarty->ext = new Smarty_Internal_Extension_Handler();\n                $_smarty->ext->objType = $_smarty->_objType;\n                $_smarty->force_compile = $force_compile;\n                try {\n                    /* @var Smarty_Internal_Template $_tpl */\n                    $_tpl = new $smarty->template_class($_file, $_smarty);\n                    $_tpl->caching = Smarty::CACHING_OFF;\n                    $_tpl->source =\n                        $isConfig ? Smarty_Template_Config::load($_tpl) : Smarty_Template_Source::load($_tpl);\n                    if ($_tpl->mustCompile()) {\n                        $_tpl->compileTemplateSource();\n                        $_count++;\n                        echo ' compiled in  ', microtime(true) - $_start_time, ' seconds';\n                        flush();\n                    } else {\n                        echo ' is up to date';\n                        flush();\n                    }\n                }\n                catch (Exception $e) {\n                    echo \"\\n<br>        ------>Error: \", $e->getMessage(), \"<br><br>\\n\";\n                    $_error_count++;\n                }\n                // free memory\n                unset($_tpl);\n                $_smarty->_clearTemplateCache();\n                if ($max_errors !== null && $_error_count === $max_errors) {\n                    echo \"\\n<br><br>too many errors\\n\";\n                    exit(1);\n                }\n            }\n        }\n        echo \"\\n<br>\";\n        return $_count;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_configload.php",
    "content": "<?php\n\n/**\n * Smarty Method ConfigLoad\n *\n * Smarty::configLoad() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_ConfigLoad\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * load a config file, optionally load just selected sections\n     *\n     * @api  Smarty::configLoad()\n     * @link http://www.smarty.net/docs/en/api.config.load.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $config_file filename\n     * @param  mixed                                                  $sections    array of section names, single\n     *                                                                             section or null\n     *\n     * @return \\Smarty|\\Smarty_Internal_Data|\\Smarty_Internal_Template\n     * @throws \\Exception\n     */\n    public function configLoad(Smarty_Internal_Data $data, $config_file, $sections = null)\n    {\n        $this->_loadConfigFile($data, $config_file, $sections, null);\n        return $data;\n    }\n\n    /**\n     * load a config file, optionally load just selected sections\n     *\n     * @api  Smarty::configLoad()\n     * @link http://www.smarty.net/docs/en/api.config.load.tpl\n     *\n     * @param \\Smarty|\\Smarty_Internal_Data|\\Smarty_Internal_Template $data\n     * @param  string                                                 $config_file filename\n     * @param  mixed                                                  $sections    array of section names, single\n     *                                                                             section or null\n     * @param int                                                     $scope       scope into which config variables\n     *                                                                             shall be loaded\n     *\n     * @return \\Smarty|\\Smarty_Internal_Data|\\Smarty_Internal_Template\n     * @throws \\Exception\n     */\n    public function _loadConfigFile(Smarty_Internal_Data $data, $config_file, $sections = null, $scope = 0)\n    {\n        /* @var \\Smarty $smarty */\n        $smarty = $data->_getSmartyObj();\n        /* @var \\Smarty_Internal_Template $confObj */\n        $confObj = new Smarty_Internal_Template($config_file, $smarty, $data, null, null, null, null, true);\n        $confObj->caching = Smarty::CACHING_OFF;\n        $confObj->source->config_sections = $sections;\n        $confObj->source->scope = $scope;\n        $confObj->compiled = Smarty_Template_Compiled::load($confObj);\n        $confObj->compiled->render($confObj);\n        if ($data->_isTplObj()) {\n            $data->compiled->file_dependency[ $confObj->source->uid ] =\n                array($confObj->source->filepath, $confObj->source->getTimeStamp(), $confObj->source->type);\n        }\n    }\n\n    /**\n     * load config variables into template object\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  array                    $new_config_vars\n     *\n     */\n    public function _loadConfigVars(Smarty_Internal_Template $tpl, $new_config_vars)\n    {\n        $this->_assignConfigVars($tpl->parent->config_vars, $tpl, $new_config_vars);\n        $tagScope = $tpl->source->scope;\n        if ($tagScope >= 0) {\n            if ($tagScope === Smarty::SCOPE_LOCAL) {\n                $this->_updateVarStack($tpl, $new_config_vars);\n                $tagScope = 0;\n                if (!$tpl->scope) {\n                    return;\n                }\n            }\n            if ($tpl->parent->_isTplObj() && ($tagScope || $tpl->parent->scope)) {\n                $mergedScope = $tagScope | $tpl->scope;\n                if ($mergedScope) {\n                    // update scopes\n                    /* @var \\Smarty_Internal_Template|\\Smarty|\\Smarty_Internal_Data $ptr */\n                    foreach ($tpl->smarty->ext->_updateScope->_getAffectedScopes($tpl->parent, $mergedScope) as $ptr) {\n                        $this->_assignConfigVars($ptr->config_vars, $tpl, $new_config_vars);\n                        if ($tagScope && $ptr->_isTplObj() && isset($tpl->_cache[ 'varStack' ])) {\n                            $this->_updateVarStack($tpl, $new_config_vars);\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * Assign all config variables in given scope\n     *\n     * @param array                     $config_vars     config variables in scope\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  array                    $new_config_vars loaded config variables\n     */\n    public function _assignConfigVars(&$config_vars, Smarty_Internal_Template $tpl, $new_config_vars)\n    {\n        // copy global config vars\n        foreach ($new_config_vars[ 'vars' ] as $variable => $value) {\n            if ($tpl->smarty->config_overwrite || !isset($config_vars[ $variable ])) {\n                $config_vars[ $variable ] = $value;\n            } else {\n                $config_vars[ $variable ] = array_merge((array) $config_vars[ $variable ], (array) $value);\n            }\n        }\n        // scan sections\n        $sections = $tpl->source->config_sections;\n        if (!empty($sections)) {\n            foreach ((array) $sections as $tpl_section) {\n                if (isset($new_config_vars[ 'sections' ][ $tpl_section ])) {\n                    foreach ($new_config_vars[ 'sections' ][ $tpl_section ][ 'vars' ] as $variable => $value) {\n                        if ($tpl->smarty->config_overwrite || !isset($config_vars[ $variable ])) {\n                            $config_vars[ $variable ] = $value;\n                        } else {\n                            $config_vars[ $variable ] = array_merge((array) $config_vars[ $variable ], (array) $value);\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * Update config variables in template local variable stack\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param array                     $config_vars\n     */\n    public function _updateVarStack(Smarty_Internal_Template $tpl, $config_vars)\n    {\n        $i = 0;\n        while (isset($tpl->_cache[ 'varStack' ][ $i ])) {\n            $this->_assignConfigVars($tpl->_cache[ 'varStack' ][ $i ][ 'config' ], $tpl, $config_vars);\n            $i ++;\n        }\n    }\n\n    /**\n     * gets  a config variable value\n     *\n     * @param \\Smarty|\\Smarty_Internal_Data|\\Smarty_Internal_Template $data\n     * @param string                                                  $varName the name of the config variable\n     * @param bool                                                    $errorEnable\n     *\n     * @return null|string  the value of the config variable\n     */\n    public function _getConfigVariable(Smarty_Internal_Data $data, $varName, $errorEnable = true)\n    {\n        $_ptr = $data;\n        while ($_ptr !== null) {\n            if (isset($_ptr->config_vars[ $varName ])) {\n                // found it, return it\n                return $_ptr->config_vars[ $varName ];\n            }\n            // not found, try at parent\n            $_ptr = $_ptr->parent;\n        }\n        if ($data->smarty->error_unassigned && $errorEnable) {\n            // force a notice\n            $x = $$varName;\n        }\n        return null;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_createdata.php",
    "content": "<?php\n\n/**\n * Smarty Method CreateData\n *\n * Smarty::createData() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_CreateData\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * creates a data object\n     *\n     * @api  Smarty::createData()\n     * @link http://www.smarty.net/docs/en/api.create.data.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty      $obj\n     * @param \\Smarty_Internal_Template|\\Smarty_Internal_Data|\\Smarty_Data|\\Smarty $parent next higher level of Smarty\n     *                                                                                     variables\n     * @param string                                                               $name   optional data block name\n     *\n     * @returns Smarty_Data data object\n     */\n    public function createData(Smarty_Internal_TemplateBase $obj, Smarty_Internal_Data $parent = null, $name = null)\n    {\n        /* @var Smarty $smarty */\n        $smarty = $obj->_getSmartyObj();\n        $dataObj = new Smarty_Data($parent, $smarty, $name);\n        if ($smarty->debugging) {\n            Smarty_Internal_Debug::register_data($dataObj);\n        }\n        return $dataObj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_getautoloadfilters.php",
    "content": "<?php\n\n/**\n * Smarty Method GetAutoloadFilters\n *\n * Smarty::getAutoloadFilters() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters\n{\n    /**\n     * Get autoload filters\n     *\n     * @api Smarty::getAutoloadFilters()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type type of filter to get auto loads\n     *                                                                              for. Defaults to all autoload\n     *                                                                              filters\n     *\n     * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type\n     *                was specified\n     * @throws \\SmartyException\n     */\n    public function getAutoloadFilters(Smarty_Internal_TemplateBase $obj, $type = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if ($type !== null) {\n            $this->_checkFilterType($type);\n            return isset($smarty->autoload_filters[ $type ]) ? $smarty->autoload_filters[ $type ] : array();\n        }\n        return $smarty->autoload_filters;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_getconfigvariable.php",
    "content": "<?php\n\n/**\n * Smarty Method GetConfigVariable\n *\n * Smarty::getConfigVariable() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetConfigVariable\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * gets  a config variable value\n     *\n     * @param \\Smarty|\\Smarty_Internal_Data|\\Smarty_Internal_Template $data\n     * @param string                                                  $varName the name of the config variable\n     * @param bool                                                    $errorEnable\n     *\n     * @return null|string  the value of the config variable\n     */\n    public function getConfigVariable(Smarty_Internal_Data $data, $varName = null, $errorEnable = true)\n    {\n        return $data->ext->configLoad->_getConfigVariable($data, $varName, $errorEnable);\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_getconfigvars.php",
    "content": "<?php\n\n/**\n * Smarty Method GetConfigVars\n *\n * Smarty::getConfigVars() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetConfigVars\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * Returns a single or all config variables\n     *\n     * @api  Smarty::getConfigVars()\n     * @link http://www.smarty.net/docs/en/api.get.config.vars.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $varname        variable name or null\n     * @param  bool                                                   $search_parents include parent templates?\n     *\n     * @return mixed variable value or or array of variables\n     */\n    public function getConfigVars(Smarty_Internal_Data $data, $varname = null, $search_parents = true)\n    {\n        $_ptr = $data;\n        $var_array = array();\n        while ($_ptr !== null) {\n            if (isset($varname)) {\n                if (isset($_ptr->config_vars[ $varname ])) {\n                    return $_ptr->config_vars[ $varname ];\n                }\n            } else {\n                $var_array = array_merge($_ptr->config_vars, $var_array);\n            }\n            // not found, try at parent\n            if ($search_parents) {\n                $_ptr = $_ptr->parent;\n            } else {\n                $_ptr = null;\n            }\n        }\n        if (isset($varname)) {\n            return '';\n        } else {\n            return $var_array;\n        }\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_getdebugtemplate.php",
    "content": "<?php\n\n/**\n * Smarty Method GetDebugTemplate\n *\n * Smarty::getDebugTemplate() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetDebugTemplate\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * return name of debugging template\n     *\n     * @api Smarty::getDebugTemplate()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     *\n     * @return string\n     */\n    public function getDebugTemplate(Smarty_Internal_TemplateBase $obj)\n    {\n        $smarty = $obj->_getSmartyObj();\n        return $smarty->debug_tpl;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_getdefaultmodifiers.php",
    "content": "<?php\n\n/**\n * Smarty Method GetDefaultModifiers\n *\n * Smarty::getDefaultModifiers() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetDefaultModifiers\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Get default modifiers\n     *\n     * @api Smarty::getDefaultModifiers()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     *\n     * @return array list of default modifiers\n     */\n    public function getDefaultModifiers(Smarty_Internal_TemplateBase $obj)\n    {\n        $smarty = $obj->_getSmartyObj();\n        return $smarty->default_modifiers;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_getglobal.php",
    "content": "<?php\n\n/**\n * Smarty Method GetGlobal\n *\n * Smarty::getGlobal() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetGlobal\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * Returns a single or all global  variables\n     *\n     * @api  Smarty::getGlobal()\n     *\n     * @param \\Smarty_Internal_Data $data\n     * @param  string              $varName variable name or null\n     *\n     * @return string|array variable value or or array of variables\n     */\n    public function getGlobal(Smarty_Internal_Data $data, $varName = null)\n    {\n        if (isset($varName)) {\n            if (isset(Smarty::$global_tpl_vars[ $varName ])) {\n                return Smarty::$global_tpl_vars[ $varName ]->value;\n            } else {\n                return '';\n            }\n        } else {\n            $_result = array();\n            foreach (Smarty::$global_tpl_vars AS $key => $var) {\n                $_result[ $key ] = $var->value;\n            }\n            return $_result;\n        }\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_getregisteredobject.php",
    "content": "<?php\n\n/**\n * Smarty Method GetRegisteredObject\n *\n * Smarty::getRegisteredObject() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetRegisteredObject\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * return a reference to a registered object\n     *\n     * @api  Smarty::getRegisteredObject()\n     * @link http://www.smarty.net/docs/en/api.get.registered.object.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $object_name object name\n     *\n     * @return object\n     * @throws \\SmartyException if no such object is found\n     */\n    public function getRegisteredObject(Smarty_Internal_TemplateBase $obj, $object_name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (!isset($smarty->registered_objects[ $object_name ])) {\n            throw new SmartyException(\"'$object_name' is not a registered object\");\n        }\n        if (!is_object($smarty->registered_objects[ $object_name ][ 0 ])) {\n            throw new SmartyException(\"registered '$object_name' is not an object\");\n        }\n        return $smarty->registered_objects[ $object_name ][ 0 ];\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_getstreamvariable.php",
    "content": "<?php\n\n/**\n * Smarty Method GetStreamVariable\n *\n * Smarty::getStreamVariable() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetStreamVariable\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * gets  a stream variable\n     *\n     * @api Smarty::getStreamVariable()\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $variable the stream of the variable\n     *\n     * @return mixed\n     * @throws \\SmartyException\n     */\n    public function getStreamVariable(Smarty_Internal_Data $data, $variable)\n    {\n        $_result = '';\n        $fp = fopen($variable, 'r+');\n        if ($fp) {\n            while (!feof($fp) && ($current_line = fgets($fp)) !== false) {\n                $_result .= $current_line;\n            }\n            fclose($fp);\n\n            return $_result;\n        }\n        $smarty = isset($data->smarty) ? $data->smarty : $data;\n        if ($smarty->error_unassigned) {\n            throw new SmartyException('Undefined stream variable \"' . $variable . '\"');\n        } else {\n            return null;\n        }\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_gettags.php",
    "content": "<?php\n\n/**\n * Smarty Method GetTags\n *\n * Smarty::getTags() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetTags\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Return array of tag/attributes of all tags used by an template\n     *\n     * @api  Smarty::getTags()\n     * @link http://www.smarty.net/docs/en/api.get.tags.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param null|string|Smarty_Internal_Template                            $template\n     *\n     * @return array of tag/attributes\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function getTags(Smarty_Internal_TemplateBase $obj, $template = null)\n    {\n        /* @var Smarty $smarty */\n        $smarty = $obj->_getSmartyObj();\n        if ($obj->_isTplObj() && !isset($template)) {\n            $tpl = clone $obj;\n        } elseif (isset($template) && $template->_isTplObj()) {\n            $tpl = clone $template;\n        } elseif (isset($template) && is_string($template)) {\n            /* @var Smarty_Internal_Template $tpl */\n            $tpl = new $smarty->template_class($template, $smarty);\n            // checks if template exists\n            if (!$tpl->source->exists) {\n                throw new SmartyException(\"Unable to load template {$tpl->source->type} '{$tpl->source->name}'\");\n            }\n        }\n        if (isset($tpl)) {\n            $tpl->smarty = clone $tpl->smarty;\n            $tpl->smarty->_cache[ 'get_used_tags' ] = true;\n            $tpl->_cache[ 'used_tags' ] = array();\n            $tpl->smarty->merge_compiled_includes = false;\n            $tpl->smarty->disableSecurity();\n            $tpl->caching = Smarty::CACHING_OFF;\n            $tpl->loadCompiler();\n            $tpl->compiler->compileTemplate($tpl);\n            return $tpl->_cache[ 'used_tags' ];\n        }\n        throw new SmartyException('Missing template specification');\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_gettemplatevars.php",
    "content": "<?php\n\n/**\n * Smarty Method GetTemplateVars\n *\n * Smarty::getTemplateVars() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_GetTemplateVars\n{\n    /**\n     * Valid for all objects\n     *\n     * @var int\n     */\n    public $objMap = 7;\n\n    /**\n     * Returns a single or all template variables\n     *\n     * @api  Smarty::getTemplateVars()\n     * @link http://www.smarty.net/docs/en/api.get.template.vars.tpl\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param  string                                                 $varName       variable name or null\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $_ptr          optional pointer to data object\n     * @param  bool                                                   $searchParents include parent templates?\n     *\n     * @return mixed variable value or or array of variables\n     */\n    public function getTemplateVars(Smarty_Internal_Data $data, $varName = null, Smarty_Internal_Data $_ptr = null,\n                                    $searchParents = true)\n    {\n        if (isset($varName)) {\n            $_var = $this->_getVariable($data, $varName, $_ptr, $searchParents, false);\n            if (is_object($_var)) {\n                return $_var->value;\n            } else {\n                return null;\n            }\n        } else {\n            $_result = array();\n            if ($_ptr === null) {\n                $_ptr = $data;\n            }\n            while ($_ptr !== null) {\n                foreach ($_ptr->tpl_vars AS $key => $var) {\n                    if (!array_key_exists($key, $_result)) {\n                        $_result[ $key ] = $var->value;\n                    }\n                }\n                // not found, try at parent\n                if ($searchParents && isset($_ptr->parent)) {\n                    $_ptr = $_ptr->parent;\n                } else {\n                    $_ptr = null;\n                }\n            }\n            if ($searchParents && isset(Smarty::$global_tpl_vars)) {\n                foreach (Smarty::$global_tpl_vars AS $key => $var) {\n                    if (!array_key_exists($key, $_result)) {\n                        $_result[ $key ] = $var->value;\n                    }\n                }\n            }\n            return $_result;\n        }\n    }\n\n    /**\n     * gets the object of a Smarty variable\n     *\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $data\n     * @param string                                                  $varName       the name of the Smarty variable\n     * @param \\Smarty_Internal_Data|\\Smarty_Internal_Template|\\Smarty $_ptr          optional pointer to data object\n     * @param bool                                                    $searchParents search also in parent data\n     * @param bool                                                    $errorEnable\n     *\n     * @return \\Smarty_Variable\n     */\n    public function _getVariable(Smarty_Internal_Data $data, $varName, Smarty_Internal_Data $_ptr = null,\n                                 $searchParents = true, $errorEnable = true)\n    {\n        if ($_ptr === null) {\n            $_ptr = $data;\n        }\n        while ($_ptr !== null) {\n            if (isset($_ptr->tpl_vars[ $varName ])) {\n                // found it, return it\n                return $_ptr->tpl_vars[ $varName ];\n            }\n            // not found, try at parent\n            if ($searchParents && isset($_ptr->parent)) {\n                $_ptr = $_ptr->parent;\n            } else {\n                $_ptr = null;\n            }\n        }\n        if (isset(Smarty::$global_tpl_vars[ $varName ])) {\n            // found it, return it\n            return Smarty::$global_tpl_vars[ $varName ];\n        }\n        if ($errorEnable && $data->_getSmartyObj()->error_unassigned) {\n            // force a notice\n            $x = $$varName;\n        }\n\n        return new Smarty_Undefined_Variable;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_literals.php",
    "content": "<?php\n\n/**\n * Smarty Method GetLiterals\n *\n * Smarty::getLiterals() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_Literals\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Get literals\n     *\n     * @api Smarty::getLiterals()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     *\n     * @return array list of literals\n     */\n    public function getLiterals(Smarty_Internal_TemplateBase $obj)\n    {\n        $smarty = $obj->_getSmartyObj();\n        return (array)$smarty->literals;\n    }\n\n    /**\n     * Add literals\n     *\n     * @api Smarty::addLiterals()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array|string                                                   $literals  literal or list of literals\n     *                                                                                   to add\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function addLiterals(Smarty_Internal_TemplateBase $obj, $literals = null)\n    {\n        if (isset($literals)) {\n            $this->set($obj->_getSmartyObj(), (array)$literals);\n        }\n        return $obj;\n    }\n\n    /**\n     * Set literals\n     *\n     * @api Smarty::setLiterals()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array|string                                                   $literals  literal or list of literals\n     *                                                                                   to set\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function setLiterals(Smarty_Internal_TemplateBase $obj, $literals = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $smarty->literals = array();\n        if (!empty($literals)) {\n            $this->set($smarty, (array)$literals);\n        }\n        return $obj;\n    }\n\n    /**\n     * common setter for literals for easier handling of duplicates the\n     * Smarty::$literals array gets filled with identical key values\n     *\n     * @param \\Smarty $smarty\n     * @param  array  $literals\n     *\n     * @throws \\SmartyException\n     */\n    private function set(Smarty $smarty, $literals)\n    {\n        $literals = array_combine($literals, $literals);\n        $error = isset($literals[ $smarty->left_delimiter ]) ? array($smarty->left_delimiter) : array();\n        $error = isset($literals[ $smarty->right_delimiter ]) ? $error[] = $smarty->right_delimiter : $error;\n        if (!empty($error)) {\n            throw new SmartyException('User defined literal(s) \"' . $error .\n                                      '\" may not be identical with left or right delimiter');\n        }\n        $smarty->literals = array_merge((array)$smarty->literals, (array)$literals);\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_loadfilter.php",
    "content": "<?php\n\n/**\n * Smarty Method LoadFilter\n *\n * Smarty::loadFilter() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_LoadFilter\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Valid filter types\n     *\n     * @var array\n     */\n    private $filterTypes = array('pre' => true, 'post' => true, 'output' => true, 'variable' => true);\n\n    /**\n     * load a filter of specified type and name\n     *\n     * @api  Smarty::loadFilter()\n     *\n     * @link http://www.smarty.net/docs/en/api.load.filter.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type filter type\n     * @param  string                                                         $name filter name\n     *\n     * @return bool\n     * @throws SmartyException if filter could not be loaded\n     */\n    public function loadFilter(Smarty_Internal_TemplateBase $obj, $type, $name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $this->_checkFilterType($type);\n        $_plugin = \"smarty_{$type}filter_{$name}\";\n        $_filter_name = $_plugin;\n        if (is_callable($_plugin)) {\n            $smarty->registered_filters[ $type ][ $_filter_name ] = $_plugin;\n            return true;\n        }\n        if ($smarty->loadPlugin($_plugin)) {\n            if (class_exists($_plugin, false)) {\n                $_plugin = array($_plugin, 'execute');\n            }\n            if (is_callable($_plugin)) {\n                $smarty->registered_filters[ $type ][ $_filter_name ] = $_plugin;\n                return true;\n            }\n        }\n        throw new SmartyException(\"{$type}filter '{$name}' not found or callable\");\n    }\n\n    /**\n     * Check if filter type is valid\n     *\n     * @param string $type\n     *\n     * @throws \\SmartyException\n     */\n    public function _checkFilterType($type)\n    {\n        if (!isset($this->filterTypes[ $type ])) {\n            throw new SmartyException(\"Illegal filter type '{$type}'\");\n        }\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_loadplugin.php",
    "content": "<?php\n\n/**\n * Smarty Extension Loadplugin\n *\n * $smarty->loadPlugin() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_LoadPlugin\n{\n    /**\n     * Cache of searched plugin files\n     *\n     * @var array\n     */\n    public $plugin_files = array();\n\n    /**\n     * Takes unknown classes and loads plugin files for them\n     * class name format: Smarty_PluginType_PluginName\n     * plugin filename format: plugintype.pluginname.php\n     *\n     * @param \\Smarty $smarty\n     * @param  string $plugin_name class plugin name to load\n     * @param  bool   $check       check if already loaded\n     *\n     * @return bool|string\n     * @throws \\SmartyException\n     */\n    public function loadPlugin(Smarty $smarty, $plugin_name, $check)\n    {\n        // if function or class exists, exit silently (already loaded)\n        if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false))) {\n            return true;\n        }\n        if (!preg_match('#^smarty_((internal)|([^_]+))_(.+)$#i', $plugin_name, $match)) {\n            throw new SmartyException(\"plugin {$plugin_name} is not a valid name format\");\n        }\n        if (!empty($match[ 2 ])) {\n            $file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php';\n            if (isset($this->plugin_files[ $file ])) {\n                if ($this->plugin_files[ $file ] !== false) {\n                    return $this->plugin_files[ $file ];\n                } else {\n                    return false;\n                }\n            } else {\n                if (is_file($file)) {\n                    $this->plugin_files[ $file ] = $file;\n                    require_once($file);\n                    return $file;\n                } else {\n                    $this->plugin_files[ $file ] = false;\n                    return false;\n                }\n            }\n        }\n        // plugin filename is expected to be: [type].[name].php\n        $_plugin_filename = \"{$match[1]}.{$match[4]}.php\";\n        $_lower_filename = strtolower($_plugin_filename);\n        if (isset($this->plugin_files)) {\n            if (isset($this->plugin_files[ 'plugins_dir' ][ $_lower_filename ])) {\n                if (!$smarty->use_include_path || $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] !== false) {\n                    return $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ];\n                }\n            }\n            if (!$smarty->use_include_path || $smarty->ext->_getIncludePath->isNewIncludePath($smarty)) {\n                unset($this->plugin_files[ 'include_path' ]);\n            } else {\n                if (isset($this->plugin_files[ 'include_path' ][ $_lower_filename ])) {\n                    return $this->plugin_files[ 'include_path' ][ $_lower_filename ];\n                }\n            }\n        }\n        $_file_names = array($_plugin_filename);\n        if ($_lower_filename !== $_plugin_filename) {\n            $_file_names[] = $_lower_filename;\n        }\n        $_p_dirs = $smarty->getPluginsDir();\n        if (!isset($this->plugin_files[ 'plugins_dir' ][ $_lower_filename ])) {\n            // loop through plugin dirs and find the plugin\n            foreach ($_p_dirs as $_plugin_dir) {\n                foreach ($_file_names as $name) {\n                    $file = $_plugin_dir . $name;\n                    if (is_file($file)) {\n                        $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] = $file;\n                        require_once($file);\n                        return $file;\n                    }\n                    $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] = false;\n                }\n            }\n        }\n        if ($smarty->use_include_path) {\n            foreach ($_file_names as $_file_name) {\n                // try PHP include_path\n                $file = $smarty->ext->_getIncludePath->getIncludePath($_p_dirs, $_file_name, $smarty);\n                $this->plugin_files[ 'include_path' ][ $_lower_filename ] = $file;\n                if ($file !== false) {\n                    require_once($file);\n                    return $file;\n                }\n            }\n        }\n        // no plugin loaded\n        return false;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_mustcompile.php",
    "content": "<?php\n\n/**\n * Smarty Method MustCompile\n *\n * Smarty_Internal_Template::mustCompile() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_MustCompile\n{\n    /**\n     * Valid for template object\n     *\n     * @var int\n     */\n    public $objMap = 2;\n\n    /**\n     * Returns if the current template must be compiled by the Smarty compiler\n     * It does compare the timestamps of template source and the compiled templates and checks the force compile\n     * configuration\n     *\n     * @param \\Smarty_Internal_Template $_template\n     *\n     * @return bool\n     * @throws \\SmartyException\n     */\n    public function mustCompile(Smarty_Internal_Template $_template)\n    {\n        if (!$_template->source->exists) {\n            if ($_template->_isSubTpl()) {\n                $parent_resource = \" in '$_template->parent->template_resource}'\";\n            } else {\n                $parent_resource = '';\n            }\n            throw new SmartyException(\"Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}\");\n        }\n        if ($_template->mustCompile === null) {\n            $_template->mustCompile = (!$_template->source->handler->uncompiled &&\n                                       ($_template->smarty->force_compile || $_template->source->handler->recompiled ||\n                                        !$_template->compiled->exists || ($_template->compile_check &&\n                                                                          $_template->compiled->getTimeStamp() <\n                                                                          $_template->source->getTimeStamp())));\n        }\n\n        return $_template->mustCompile;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_registercacheresource.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterCacheResource\n *\n * Smarty::registerCacheResource() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterCacheResource\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers a resource to fetch a template\n     *\n     * @api  Smarty::registerCacheResource()\n     * @link http://www.smarty.net/docs/en/api.register.cacheresource.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $name name of resource type\n     * @param \\Smarty_CacheResource                                           $resource_handler\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function registerCacheResource(Smarty_Internal_TemplateBase $obj, $name,\n                                          Smarty_CacheResource $resource_handler)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $smarty->registered_cache_resources[ $name ] = $resource_handler;\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_registerclass.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterClass\n *\n * Smarty::registerClass() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterClass\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers static classes to be used in templates\n     *\n     * @api  Smarty::registerClass()\n     * @link http://www.smarty.net/docs/en/api.register.class.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $class_name\n     * @param  string                                                         $class_impl the referenced PHP class to\n     *                                                                                    register\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function registerClass(Smarty_Internal_TemplateBase $obj, $class_name, $class_impl)\n    {\n        $smarty = $obj->_getSmartyObj();\n        // test if exists\n        if (!class_exists($class_impl)) {\n            throw new SmartyException(\"Undefined class '$class_impl' in register template class\");\n        }\n        // register the class\n        $smarty->registered_classes[ $class_name ] = $class_impl;\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterDefaultConfigHandler\n *\n * Smarty::registerDefaultConfigHandler() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterDefaultConfigHandler\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Register config default handler\n     *\n     * @api  Smarty::registerDefaultConfigHandler()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  callable                                                       $callback class/method name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException              if $callback is not callable\n     */\n    public function registerDefaultConfigHandler(Smarty_Internal_TemplateBase $obj, $callback)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (is_callable($callback)) {\n            $smarty->default_config_handler_func = $callback;\n        } else {\n            throw new SmartyException('Default config handler not callable');\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterDefaultPluginHandler\n *\n * Smarty::registerDefaultPluginHandler() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterDefaultPluginHandler\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers a default plugin handler\n     *\n     * @api  Smarty::registerDefaultPluginHandler()\n     * @link http://www.smarty.net/docs/en/api.register.default.plugin.handler.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  callable                                                       $callback class/method name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException              if $callback is not callable\n     */\n    public function registerDefaultPluginHandler(Smarty_Internal_TemplateBase $obj, $callback)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (is_callable($callback)) {\n            $smarty->default_plugin_handler_func = $callback;\n        } else {\n            throw new SmartyException(\"Default plugin handler '$callback' not callable\");\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterDefaultTemplateHandler\n *\n * Smarty::registerDefaultTemplateHandler() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterDefaultTemplateHandler\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Register template default handler\n     *\n     * @api  Smarty::registerDefaultTemplateHandler()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  callable                                                       $callback class/method name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException              if $callback is not callable\n     */\n    public function registerDefaultTemplateHandler(Smarty_Internal_TemplateBase $obj, $callback)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (is_callable($callback)) {\n            $smarty->default_template_handler_func = $callback;\n        } else {\n            throw new SmartyException('Default template handler not callable');\n        }\n        return $obj;\n    }\n\n    /**\n     * get default content from template or config resource handler\n     *\n     * @param Smarty_Template_Source $source\n     *\n     * @throws \\SmartyException\n     */\n    public static function _getDefaultTemplate(Smarty_Template_Source $source)\n    {\n        if ($source->isConfig) {\n            $default_handler = $source->smarty->default_config_handler_func;\n        } else {\n            $default_handler = $source->smarty->default_template_handler_func;\n        }\n        $_content = $_timestamp = null;\n        $_return = call_user_func_array($default_handler,\n                                        array($source->type, $source->name, &$_content, &$_timestamp, $source->smarty));\n        if (is_string($_return)) {\n            $source->exists = is_file($_return);\n            if ($source->exists) {\n                $source->timestamp = filemtime($_return);\n            } else {\n                throw new SmartyException('Default handler: Unable to load ' .\n                                          ($source->isConfig ? 'config' : 'template') .\n                                          \" default file '{$_return}' for '{$source->type}:{$source->name}'\");\n            }\n            $source->name = $source->filepath = $_return;\n            $source->uid = sha1($source->filepath);\n        } elseif ($_return === true) {\n            $source->content = $_content;\n            $source->exists = true;\n            $source->uid = $source->name = sha1($_content);\n            $source->handler = Smarty_Resource::load($source->smarty, 'eval');\n        } else {\n            $source->exists = false;\n            throw new SmartyException('Default handler: No ' . ($source->isConfig ? 'config' : 'template') .\n                                      \" default content for '{$source->type}:{$source->name}'\");\n        }\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_registerfilter.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterFilter\n *\n * Smarty::registerFilter() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterFilter\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Valid filter types\n     *\n     * @var array\n     */\n    private $filterTypes = array('pre' => true, 'post' => true, 'output' => true, 'variable' => true);\n\n    /**\n     * Registers a filter function\n     *\n     * @api  Smarty::registerFilter()\n     *\n     * @link http://www.smarty.net/docs/en/api.register.filter.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type filter type\n     * @param  callback                                                       $callback\n     * @param  string|null                                                    $name optional filter name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function registerFilter(Smarty_Internal_TemplateBase $obj, $type, $callback, $name = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $this->_checkFilterType($type);\n        $name = isset($name) ? $name : $this->_getFilterName($callback);\n        if (!is_callable($callback)) {\n            throw new SmartyException(\"{$type}filter '{$name}' not callable\");\n        }\n        $smarty->registered_filters[ $type ][ $name ] = $callback;\n        return $obj;\n    }\n\n    /**\n     * Return internal filter name\n     *\n     * @param  callback $function_name\n     *\n     * @return string   internal filter name\n     */\n    public function _getFilterName($function_name)\n    {\n        if (is_array($function_name)) {\n            $_class_name = (is_object($function_name[ 0 ]) ? get_class($function_name[ 0 ]) : $function_name[ 0 ]);\n\n            return $_class_name . '_' . $function_name[ 1 ];\n        } elseif (is_string($function_name)) {\n            return $function_name;\n        } else {\n            return 'closure';\n        }\n    }\n\n    /**\n     * Check if filter type is valid\n     *\n     * @param string $type\n     *\n     * @throws \\SmartyException\n     */\n    public function _checkFilterType($type)\n    {\n        if (!isset($this->filterTypes[ $type ])) {\n            throw new SmartyException(\"Illegal filter type '{$type}'\");\n        }\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_registerobject.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterObject\n *\n * Smarty::registerObject() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterObject\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers object to be used in templates\n     *\n     * @api  Smarty::registerObject()\n     * @link http://www.smarty.net/docs/en/api.register.object.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $object_name\n     * @param  object                                                         $object                     the\n     *                                                                                                    referenced\n     *                                                                                                    PHP object to\n     *                                                                                                    register\n     * @param  array                                                          $allowed_methods_properties list of\n     *                                                                                                    allowed\n     *                                                                                                    methods\n     *                                                                                                    (empty = all)\n     * @param  bool                                                           $format                     smarty\n     *                                                                                                    argument\n     *                                                                                                    format, else\n     *                                                                                                    traditional\n     * @param  array                                                          $block_methods              list of\n     *                                                                                                    block-methods\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function registerObject(Smarty_Internal_TemplateBase $obj, $object_name, $object,\n                                   $allowed_methods_properties = array(), $format = true, $block_methods = array())\n    {\n        $smarty = $obj->_getSmartyObj();\n        // test if allowed methods callable\n        if (!empty($allowed_methods_properties)) {\n            foreach ((array) $allowed_methods_properties as $method) {\n                if (!is_callable(array($object, $method)) && !property_exists($object, $method)) {\n                    throw new SmartyException(\"Undefined method or property '$method' in registered object\");\n                }\n            }\n        }\n        // test if block methods callable\n        if (!empty($block_methods)) {\n            foreach ((array) $block_methods as $method) {\n                if (!is_callable(array($object, $method))) {\n                    throw new SmartyException(\"Undefined method '$method' in registered object\");\n                }\n            }\n        }\n        // register the object\n        $smarty->registered_objects[ $object_name ] =\n            array($object, (array) $allowed_methods_properties, (boolean) $format, (array) $block_methods);\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_registerplugin.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterPlugin\n *\n * Smarty::registerPlugin() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterPlugin\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers plugin to be used in templates\n     *\n     * @api  Smarty::registerPlugin()\n     * @link http://www.smarty.net/docs/en/api.register.plugin.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type       plugin type\n     * @param  string                                                         $name       name of template tag\n     * @param  callback                                                       $callback   PHP callback to register\n     * @param  bool                                                           $cacheable  if true (default) this\n     *                                                                                    function is cache able\n     * @param  mixed                                                          $cache_attr caching attributes if any\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException              when the plugin tag is invalid\n     */\n    public function registerPlugin(Smarty_Internal_TemplateBase $obj, $type, $name, $callback, $cacheable = true,\n                                   $cache_attr = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (isset($smarty->registered_plugins[ $type ][ $name ])) {\n            throw new SmartyException(\"Plugin tag '{$name}' already registered\");\n        } elseif (!is_callable($callback)) {\n            throw new SmartyException(\"Plugin '{$name}' not callable\");\n        } else {\n            $smarty->registered_plugins[ $type ][ $name ] = array($callback, (bool) $cacheable, (array) $cache_attr);\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_registerresource.php",
    "content": "<?php\n\n/**\n * Smarty Method RegisterResource\n *\n * Smarty::registerResource() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_RegisterResource\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers a resource to fetch a template\n     *\n     * @api  Smarty::registerResource()\n     * @link http://www.smarty.net/docs/en/api.register.resource.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $name             name of resource type\n     * @param  Smarty_Resource|array                                          $resource_handler or instance of\n     *                                                                                          Smarty_Resource, or\n     *                                                                                          array of callbacks to\n     *                                                                                          handle resource\n     *                                                                                          (deprecated)\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function registerResource(Smarty_Internal_TemplateBase $obj, $name, $resource_handler)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $smarty->registered_resources[ $name ] =\n            $resource_handler instanceof Smarty_Resource ? $resource_handler : array($resource_handler, false);\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_setautoloadfilters.php",
    "content": "<?php\n\n/**\n * Smarty Method SetAutoloadFilters\n *\n * Smarty::setAutoloadFilters() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_SetAutoloadFilters\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Valid filter types\n     *\n     * @var array\n     */\n    private $filterTypes = array('pre' => true, 'post' => true, 'output' => true, 'variable' => true);\n\n    /**\n     * Set autoload filters\n     *\n     * @api Smarty::setAutoloadFilters()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array                                                          $filters filters to load automatically\n     * @param  string                                                         $type    \"pre\", \"output\", … specify the\n     *                                                                                 filter type to set. Defaults to\n     *                                                                                 none treating $filters' keys as\n     *                                                                                 the appropriate types\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function setAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if ($type !== null) {\n            $this->_checkFilterType($type);\n            $smarty->autoload_filters[ $type ] = (array) $filters;\n        } else {\n            foreach ((array) $filters as $type => $value) {\n                $this->_checkFilterType($type);\n            }\n            $smarty->autoload_filters = (array) $filters;\n        }\n        return $obj;\n    }\n\n    /**\n     * Check if filter type is valid\n     *\n     * @param string $type\n     *\n     * @throws \\SmartyException\n     */\n    public function _checkFilterType($type)\n    {\n        if (!isset($this->filterTypes[ $type ])) {\n            throw new SmartyException(\"Illegal filter type '{$type}'\");\n        }\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_setdebugtemplate.php",
    "content": "<?php\n\n/**\n * Smarty Method SetDebugTemplate\n *\n * Smarty::setDebugTemplate() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_SetDebugTemplate\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * set the debug template\n     *\n     * @api Smarty::setDebugTemplate()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $tpl_name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException if file is not readable\n     */\n    public function setDebugTemplate(Smarty_Internal_TemplateBase $obj, $tpl_name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (!is_readable($tpl_name)) {\n            throw new SmartyException(\"Unknown file '{$tpl_name}'\");\n        }\n        $smarty->debug_tpl = $tpl_name;\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_setdefaultmodifiers.php",
    "content": "<?php\n\n/**\n * Smarty Method SetDefaultModifiers\n *\n * Smarty::setDefaultModifiers() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_SetDefaultModifiers\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Set default modifiers\n     *\n     * @api Smarty::setDefaultModifiers()\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  array|string                                                   $modifiers modifier or list of modifiers\n     *                                                                                   to set\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function setDefaultModifiers(Smarty_Internal_TemplateBase $obj, $modifiers)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $smarty->default_modifiers = (array) $modifiers;\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_unloadfilter.php",
    "content": "<?php\n\n/**\n * Smarty Method UnloadFilter\n *\n * Smarty::unloadFilter() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnloadFilter extends Smarty_Internal_Method_LoadFilter\n{\n    /**\n     * load a filter of specified type and name\n     *\n     * @api  Smarty::unloadFilter()\n     *\n     * @link http://www.smarty.net/docs/en/api.unload.filter.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type filter type\n     * @param  string                                                         $name filter name\n     *\n     * @return Smarty_Internal_TemplateBase\n     * @throws \\SmartyException\n     */\n    public function unloadFilter(Smarty_Internal_TemplateBase $obj, $type, $name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $this->_checkFilterType($type);\n        if (isset($smarty->registered_filters[ $type ])) {\n            $_filter_name = \"smarty_{$type}filter_{$name}\";\n            if (isset($smarty->registered_filters[ $type ][ $_filter_name ])) {\n                unset ($smarty->registered_filters[ $type ][ $_filter_name ]);\n                if (empty($smarty->registered_filters[ $type ])) {\n                    unset($smarty->registered_filters[ $type ]);\n                }\n            }\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_unregistercacheresource.php",
    "content": "<?php\n\n/**\n * Smarty Method UnregisterCacheResource\n *\n * Smarty::unregisterCacheResource() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnregisterCacheResource\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers a resource to fetch a template\n     *\n     * @api      Smarty::unregisterCacheResource()\n     * @link     http://www.smarty.net/docs/en/api.unregister.cacheresource.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param                                                                 $name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function unregisterCacheResource(Smarty_Internal_TemplateBase $obj, $name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (isset($smarty->registered_cache_resources[ $name ])) {\n            unset($smarty->registered_cache_resources[ $name ]);\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_unregisterfilter.php",
    "content": "<?php\n\n/**\n * Smarty Method UnregisterFilter\n *\n * Smarty::unregisterFilter() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnregisterFilter extends Smarty_Internal_Method_RegisterFilter\n{\n    /**\n     * Unregisters a filter function\n     *\n     * @api  Smarty::unregisterFilter()\n     *\n     * @link http://www.smarty.net/docs/en/api.unregister.filter.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type filter type\n     * @param  callback|string                                                $callback\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function unregisterFilter(Smarty_Internal_TemplateBase $obj, $type, $callback)\n    {\n        $smarty = $obj->_getSmartyObj();\n        $this->_checkFilterType($type);\n        if (isset($smarty->registered_filters[ $type ])) {\n            $name = is_string($callback) ? $callback : $this->_getFilterName($callback);\n            if (isset($smarty->registered_filters[ $type ][ $name ])) {\n                unset($smarty->registered_filters[ $type ][ $name ]);\n                if (empty($smarty->registered_filters[ $type ])) {\n                    unset($smarty->registered_filters[ $type ]);\n                }\n            }\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_unregisterobject.php",
    "content": "<?php\n\n/**\n * Smarty Method UnregisterObject\n *\n * Smarty::unregisterObject() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnregisterObject\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers plugin to be used in templates\n     *\n     * @api  Smarty::unregisterObject()\n     * @link http://www.smarty.net/docs/en/api.unregister.object.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $object_name name of object\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function unregisterObject(Smarty_Internal_TemplateBase $obj, $object_name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (isset($smarty->registered_objects[ $object_name ])) {\n            unset($smarty->registered_objects[ $object_name ]);\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_unregisterplugin.php",
    "content": "<?php\n\n/**\n * Smarty Method UnregisterPlugin\n *\n * Smarty::unregisterPlugin() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnregisterPlugin\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers plugin to be used in templates\n     *\n     * @api  Smarty::unregisterPlugin()\n     * @link http://www.smarty.net/docs/en/api.unregister.plugin.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type plugin type\n     * @param  string                                                         $name name of template tag\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function unregisterPlugin(Smarty_Internal_TemplateBase $obj, $type, $name)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (isset($smarty->registered_plugins[ $type ][ $name ])) {\n            unset($smarty->registered_plugins[ $type ][ $name ]);\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_method_unregisterresource.php",
    "content": "<?php\n\n/**\n * Smarty Method UnregisterResource\n *\n * Smarty::unregisterResource() method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Method_UnregisterResource\n{\n    /**\n     * Valid for Smarty and template object\n     *\n     * @var int\n     */\n    public $objMap = 3;\n\n    /**\n     * Registers a resource to fetch a template\n     *\n     * @api  Smarty::unregisterResource()\n     * @link http://www.smarty.net/docs/en/api.unregister.resource.tpl\n     *\n     * @param \\Smarty_Internal_TemplateBase|\\Smarty_Internal_Template|\\Smarty $obj\n     * @param  string                                                         $type name of resource type\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     */\n    public function unregisterResource(Smarty_Internal_TemplateBase $obj, $type)\n    {\n        $smarty = $obj->_getSmartyObj();\n        if (isset($smarty->registered_resources[ $type ])) {\n            unset($smarty->registered_resources[ $type ]);\n        }\n        return $obj;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_nocache_insert.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Nocache Insert\n * Compiles the {insert} tag into the cache file\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Internal Plugin Compile Insert Class\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_Nocache_Insert\n{\n    /**\n     * Compiles code for the {insert} tag into cache file\n     *\n     * @param  string                   $_function insert function name\n     * @param  array                    $_attr     array with parameter\n     * @param  Smarty_Internal_Template $_template template object\n     * @param  string                   $_script   script name to load or 'null'\n     * @param  string                   $_assign   optional variable name\n     *\n     * @return string                   compiled code\n     */\n    public static function compile($_function, $_attr, $_template, $_script, $_assign = null)\n    {\n        $_output = '<?php ';\n        if ($_script !== 'null') {\n            // script which must be included\n            // code for script file loading\n            $_output .= \"require_once '{$_script}';\";\n        }\n        // call insert\n        if (isset($_assign)) {\n            $_output .= \"\\$_smarty_tpl->assign('{$_assign}' , {$_function} (\" . var_export($_attr, true) .\n                        ',\\$_smarty_tpl), true);?>';\n        } else {\n            $_output .= \"echo {$_function}(\" . var_export($_attr, true) . ',$_smarty_tpl);?>';\n        }\n        $_tpl = $_template;\n        while ($_tpl->_isSubTpl()) {\n            $_tpl = $_tpl->parent;\n        }\n\n        return \"/*%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/{$_output}/*/%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/\";\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_parsetree.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Templateparser Parsetree\n * These are classes to build parsetree in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n */\n\n/**\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nabstract class Smarty_Internal_ParseTree\n{\n\n    /**\n     * Buffer content\n     *\n     * @var mixed\n     */\n    public $data;\n\n    /**\n     * Subtree array\n     *\n     * @var array\n     */\n    public $subtrees = array();\n\n    /**\n     * Return buffer\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string buffer content\n     */\n    abstract public function to_smarty_php(Smarty_Internal_Templateparser $parser);\n\n    /**\n     * Template data object destructor\n     */\n    public function __destruct()\n    {\n        $this->data = null;\n        $this->subtrees = null;\n    }\n\n}\n\n\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_parsetree_code.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Templateparser Parse Tree\n * These are classes to build parse trees in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n */\n\n/**\n * Code fragment inside a tag .\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_Code extends Smarty_Internal_ParseTree\n{\n    /**\n     * Create parse tree buffer for code fragment\n     *\n     * @param string $data content\n     */\n    public function __construct($data)\n    {\n        $this->data = $data;\n    }\n\n    /**\n     * Return buffer content in parentheses\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string content\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        return sprintf('(%s)', $this->data);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_parsetree_dq.php",
    "content": "<?php\n\n/**\n * Double quoted string inside a tag.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\n\n/**\n * Double quoted string inside a tag.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_Dq extends Smarty_Internal_ParseTree\n{\n    /**\n     * Create parse tree buffer for double quoted string subtrees\n     *\n     * @param object                    $parser  parser object\n     * @param Smarty_Internal_ParseTree $subtree parse tree buffer\n     */\n    public function __construct($parser, Smarty_Internal_ParseTree $subtree)\n    {\n        $this->subtrees[] = $subtree;\n        if ($subtree instanceof Smarty_Internal_ParseTree_Tag) {\n            $parser->block_nesting_level = count($parser->compiler->_tag_stack);\n        }\n    }\n\n    /**\n     * Append buffer to subtree\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     * @param Smarty_Internal_ParseTree       $subtree parse tree buffer\n     */\n    public function append_subtree(Smarty_Internal_Templateparser $parser, Smarty_Internal_ParseTree $subtree)\n    {\n        $last_subtree = count($this->subtrees) - 1;\n        if ($last_subtree >= 0 && $this->subtrees[ $last_subtree ] instanceof Smarty_Internal_ParseTree_Tag &&\n            $this->subtrees[ $last_subtree ]->saved_block_nesting < $parser->block_nesting_level\n        ) {\n            if ($subtree instanceof Smarty_Internal_ParseTree_Code) {\n                $this->subtrees[ $last_subtree ]->data =\n                    $parser->compiler->appendCode($this->subtrees[ $last_subtree ]->data,\n                                                  '<?php echo ' . $subtree->data . ';?>');\n            } elseif ($subtree instanceof Smarty_Internal_ParseTree_DqContent) {\n                $this->subtrees[ $last_subtree ]->data =\n                    $parser->compiler->appendCode($this->subtrees[ $last_subtree ]->data,\n                                                  '<?php echo \"' . $subtree->data . '\";?>');\n            } else {\n                $this->subtrees[ $last_subtree ]->data =\n                    $parser->compiler->appendCode($this->subtrees[ $last_subtree ]->data, $subtree->data);\n            }\n        } else {\n            $this->subtrees[] = $subtree;\n        }\n        if ($subtree instanceof Smarty_Internal_ParseTree_Tag) {\n            $parser->block_nesting_level = count($parser->compiler->_tag_stack);\n        }\n    }\n\n    /**\n     * Merge subtree buffer content together\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string compiled template code\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        $code = '';\n        foreach ($this->subtrees as $subtree) {\n            if ($code !== '') {\n                $code .= '.';\n            }\n            if ($subtree instanceof Smarty_Internal_ParseTree_Tag) {\n                $more_php = $subtree->assign_to_var($parser);\n            } else {\n                $more_php = $subtree->to_smarty_php($parser);\n            }\n\n            $code .= $more_php;\n\n            if (!$subtree instanceof Smarty_Internal_ParseTree_DqContent) {\n                $parser->compiler->has_variable_string = true;\n            }\n        }\n\n        return $code;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_parsetree_dqcontent.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Templateparser Parse Tree\n * These are classes to build parse tree  in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n */\n\n/**\n * Raw chars as part of a double quoted string.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_DqContent extends Smarty_Internal_ParseTree\n{\n    /**\n     * Create parse tree buffer with string content\n     *\n     * @param string $data string section\n     */\n    public function __construct($data)\n    {\n        $this->data = $data;\n    }\n\n    /**\n     * Return content as double quoted string\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string doubled quoted string\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        return '\"' . $this->data . '\"';\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_parsetree_tag.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Templateparser Parse Tree\n * These are classes to build parse tree in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n */\n\n/**\n * A complete smarty tag.\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_Tag extends Smarty_Internal_ParseTree\n{\n\n    /**\n     * Saved block nesting level\n     *\n     * @var int\n     */\n    public $saved_block_nesting;\n\n    /**\n     * Create parse tree buffer for Smarty tag\n     *\n     * @param \\Smarty_Internal_Templateparser $parser parser object\n     * @param string                          $data   content\n     */\n    public function __construct(Smarty_Internal_Templateparser $parser, $data)\n    {\n        $this->data = $data;\n        $this->saved_block_nesting = $parser->block_nesting_level;\n    }\n\n    /**\n     * Return buffer content\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string content\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        return $this->data;\n    }\n\n    /**\n     * Return complied code that loads the evaluated output of buffer content into a temporary variable\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string template code\n     */\n    public function assign_to_var(Smarty_Internal_Templateparser $parser)\n    {\n        $var = $parser->compiler->getNewPrefixVariable();\n        $tmp = $parser->compiler->appendCode('<?php ob_start();?>', $this->data);\n        $tmp = $parser->compiler->appendCode($tmp, \"<?php {$var}=ob_get_clean();?>\");\n        $parser->compiler->prefix_code[] = sprintf('%s', $tmp);\n\n        return $var;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_parsetree_template.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Templateparser Parse Tree\n * These are classes to build parse tree in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n */\n\n/**\n * Template element\n *\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree\n{\n\n    /**\n     * Array of template elements\n     *\n     * @var array\n     */\n    public $subtrees = Array();\n\n    /**\n     * Create root of parse tree for template elements\n     *\n     */\n    public function __construct()\n    {\n    }\n\n    /**\n     * Append buffer to subtree\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     * @param Smarty_Internal_ParseTree       $subtree\n     */\n    public function append_subtree(Smarty_Internal_Templateparser $parser, Smarty_Internal_ParseTree $subtree)\n    {\n        if (!empty($subtree->subtrees)) {\n            $this->subtrees = array_merge($this->subtrees, $subtree->subtrees);\n        } else {\n            if ($subtree->data !== '') {\n                $this->subtrees[] = $subtree;\n            }\n        }\n    }\n\n    /**\n     * Append array to subtree\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     * @param \\Smarty_Internal_ParseTree[]    $array\n     */\n    public function append_array(Smarty_Internal_Templateparser $parser, $array = array())\n    {\n        if (!empty($array)) {\n            $this->subtrees = array_merge($this->subtrees, (array) $array);\n        }\n    }\n\n    /**\n     * Prepend array to subtree\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     * @param \\Smarty_Internal_ParseTree[]    $array\n     */\n    public function prepend_array(Smarty_Internal_Templateparser $parser, $array = array())\n    {\n        if (!empty($array)) {\n            $this->subtrees = array_merge((array) $array, $this->subtrees);\n        }\n    }\n\n    /**\n     * Sanitize and merge subtree buffers together\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string template code content\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        $code = '';\n        for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key ++) {\n            if ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Text) {\n                $subtree = $this->subtrees[ $key ]->to_smarty_php($parser);\n                while ($key + 1 < $cnt && ($this->subtrees[ $key + 1 ] instanceof Smarty_Internal_ParseTree_Text ||\n                                           $this->subtrees[ $key + 1 ]->data === '')) {\n                    $key ++;\n                    if ($this->subtrees[ $key ]->data === '') {\n                        continue;\n                    }\n                    $subtree .= $this->subtrees[ $key ]->to_smarty_php($parser);\n                }\n                if ($subtree === '') {\n                    continue;\n                }\n                $code .= preg_replace('/((<%)|(%>)|(<\\?php)|(<\\?)|(\\?>)|(<\\/?script))/', \"<?php echo '\\$1'; ?>\\n\",\n                                      $subtree);\n                continue;\n            }\n            if ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Tag) {\n                $subtree = $this->subtrees[ $key ]->to_smarty_php($parser);\n                while ($key + 1 < $cnt && ($this->subtrees[ $key + 1 ] instanceof Smarty_Internal_ParseTree_Tag ||\n                                           $this->subtrees[ $key + 1 ]->data === '')) {\n                    $key ++;\n                    if ($this->subtrees[ $key ]->data === '') {\n                        continue;\n                    }\n                    $subtree = $parser->compiler->appendCode($subtree, $this->subtrees[ $key ]->to_smarty_php($parser));\n                }\n                if ($subtree === '') {\n                    continue;\n                }\n                $code .= $subtree;\n                continue;\n            }\n            $code .= $this->subtrees[ $key ]->to_smarty_php($parser);\n        }\n        return $code;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_parsetree_text.php",
    "content": "<?php\n\n/**\n * Smarty Internal Plugin Templateparser Parse Tree\n * These are classes to build parse tree in the template parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Thue Kristensen\n * @author     Uwe Tews\n *             *\n *             template text\n * @package    Smarty\n * @subpackage Compiler\n * @ignore\n */\nclass Smarty_Internal_ParseTree_Text extends Smarty_Internal_ParseTree\n{\n    /**\n     * Create template text buffer\n     *\n     * @param string $data text\n     */\n    public function __construct($data)\n    {\n        $this->data = $data;\n    }\n\n    /**\n     * Return buffer content\n     *\n     * @param \\Smarty_Internal_Templateparser $parser\n     *\n     * @return string text\n     */\n    public function to_smarty_php(Smarty_Internal_Templateparser $parser)\n    {\n        return $this->data;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_resource_eval.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource Eval\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource Eval\n * Implements the strings as resource for Smarty template\n * {@internal unlike string-resources the compiled state of eval-resources is NOT saved for subsequent access}}\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nclass Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled\n{\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param  Smarty_Template_Source   $source    source object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $source->uid = $source->filepath = sha1($source->name);\n        $source->timestamp = $source->exists = true;\n    }\n\n    /**\n     * Load template's source from $resource_name into current template object\n     *\n     * @uses decode() to decode base64 and urlencoded template_resources\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        return $this->decode($source->name);\n    }\n\n    /**\n     * decode base64 and urlencode\n     *\n     * @param  string $string template_resource to decode\n     *\n     * @return string decoded template_resource\n     */\n    protected function decode($string)\n    {\n        // decode if specified\n        if (($pos = strpos($string, ':')) !== false) {\n            if (!strncmp($string, 'base64', 6)) {\n                return base64_decode(substr($string, 7));\n            } elseif (!strncmp($string, 'urlencode', 9)) {\n                return urldecode(substr($string, 10));\n            }\n        }\n\n        return $string;\n    }\n\n    /**\n     * modify resource_name according to resource handlers specifications\n     *\n     * @param  Smarty  $smarty        Smarty instance\n     * @param  string  $resource_name resource_name to make unique\n     * @param  boolean $isConfig      flag for config resource\n     *\n     * @return string unique resource name\n     */\n    public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false)\n    {\n        return get_class($this) . '#' . $this->decode($resource_name);\n    }\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return '';\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_resource_extends.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource Extends\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource Extends\n * Implements the file system as resource for Smarty which {extend}s a chain of template files templates\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nclass Smarty_Internal_Resource_Extends extends Smarty_Resource\n{\n    /**\n     * mbstring.overload flag\n     *\n     * @var int\n     */\n    public $mbstring_overload = 0;\n\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param Smarty_Template_Source   $source    source object\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @throws SmartyException\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $uid = '';\n        $sources = array();\n        $components = explode('|', $source->name);\n        $smarty = &$source->smarty;\n        $exists = true;\n        foreach ($components as $component) {\n            /* @var \\Smarty_Template_Source $_s */\n            $_s = Smarty_Template_Source::load(null, $smarty, $component);\n            if ($_s->type === 'php') {\n                throw new SmartyException(\"Resource type {$_s->type} cannot be used with the extends resource type\");\n            }\n            $sources[ $_s->uid ] = $_s;\n            $uid .= $_s->filepath;\n            if ($_template) {\n                $exists = $exists && $_s->exists;\n            }\n        }\n        $source->components = $sources;\n        $source->filepath = $_s->filepath;\n        $source->uid = sha1($uid . $source->smarty->_joined_template_dir);\n        $source->exists = $exists;\n        if ($_template) {\n            $source->timestamp = $_s->timestamp;\n        }\n    }\n\n    /**\n     * populate Source Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Source $source source object\n     */\n    public function populateTimestamp(Smarty_Template_Source $source)\n    {\n        $source->exists = true;\n        /* @var \\Smarty_Template_Source $_s */\n        foreach ($source->components as $_s) {\n            $source->exists = $source->exists && $_s->exists;\n        }\n        $source->timestamp = $source->exists ? $_s->getTimeStamp() : false;\n    }\n\n    /**\n     * Load template's source from files into current template object\n     *\n     * @param Smarty_Template_Source $source source object\n     *\n     * @return string template source\n     * @throws SmartyException if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        if (!$source->exists) {\n            throw new SmartyException(\"Unable to load template '{$source->type}:{$source->name}'\");\n        }\n\n        $_components = array_reverse($source->components);\n\n        $_content = '';\n        /* @var \\Smarty_Template_Source $_s */\n        foreach ($_components as $_s) {\n            // read content\n            $_content .= $_s->getContent();\n        }\n        return $_content;\n    }\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param Smarty_Template_Source $source source object\n     *\n     * @return string resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return str_replace(':', '.', basename($source->filepath));\n    }\n\n    /*\n      * Disable timestamp checks for extends resource.\n      * The individual source components will be checked.\n      *\n      * @return bool\n      */\n    /**\n     * @return bool\n     */\n    public function checkTimestamps()\n    {\n        return false;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_resource_file.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource File\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource File\n * Implements the file system as resource for Smarty templates\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nclass Smarty_Internal_Resource_File extends Smarty_Resource\n{\n    /**\n     * build template filepath by traversing the template_dir array\n     *\n     * @param Smarty_Template_Source    $source    source object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return string fully qualified filepath\n     * @throws SmartyException\n     */\n    protected function buildFilepath(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $file = $source->name;\n        // absolute file ?\n        if ($file[ 0 ] === '/' || $file[ 1 ] === ':') {\n            $file = $source->smarty->_realpath($file, true);\n            return is_file($file) ? $file : false;\n        }\n        // go relative to a given template?\n        if ($file[ 0 ] === '.' && $_template && $_template->_isSubTpl() &&\n            preg_match('#^[.]{1,2}[\\\\\\/]#', $file)\n        ) {\n            if ($_template->parent->source->type !== 'file' && $_template->parent->source->type !== 'extends' &&\n                !isset($_template->parent->_cache[ 'allow_relative_path' ])\n            ) {\n                throw new SmartyException(\"Template '{$file}' cannot be relative to template of resource type '{$_template->parent->source->type}'\");\n            }\n            // normalize path\n            $path = $source->smarty->_realpath(dirname($_template->parent->source->filepath) . DIRECTORY_SEPARATOR . $file);\n            // files relative to a template only get one shot\n            return is_file($path) ? $path : false;\n        }\n        // normalize DIRECTORY_SEPARATOR\n        if (strpos($file, DIRECTORY_SEPARATOR === '/' ? '\\\\' : '/') !== false) {\n            $file = str_replace(DIRECTORY_SEPARATOR === '/' ? '\\\\' : '/', DIRECTORY_SEPARATOR, $file);\n        }\n\n        $_directories = $source->smarty->getTemplateDir(null, $source->isConfig);\n        // template_dir index?\n        if ($file[ 0 ] === '[' && preg_match('#^\\[([^\\]]+)\\](.+)$#', $file, $fileMatch)) {\n            $file = $fileMatch[ 2 ];\n            $_indices = explode(',', $fileMatch[ 1 ]);\n            $_index_dirs = array();\n            foreach ($_indices as $index) {\n                $index = trim($index);\n                // try string indexes\n                if (isset($_directories[ $index ])) {\n                    $_index_dirs[] = $_directories[ $index ];\n                } elseif (is_numeric($index)) {\n                    // try numeric index\n                    $index = (int) $index;\n                    if (isset($_directories[ $index ])) {\n                        $_index_dirs[] = $_directories[ $index ];\n                    } else {\n                        // try at location index\n                        $keys = array_keys($_directories);\n                        if (isset($_directories[ $keys[ $index ] ])) {\n                            $_index_dirs[] = $_directories[ $keys[ $index ] ];\n                        }\n                    }\n                }\n            }\n            if (empty($_index_dirs)) {\n                // index not found\n                return false;\n            } else {\n                $_directories = $_index_dirs;\n            }\n        }\n\n        // relative file name?\n        foreach ($_directories as $_directory) {\n            $path = $_directory . $file;\n            if (is_file($path)) {\n                return (strpos($path, '.' . DIRECTORY_SEPARATOR) !== false) ? $source->smarty->_realpath($path) : $path;\n            }\n        }\n        if (!isset($_index_dirs)) {\n            // Could be relative to cwd\n            $path = $source->smarty->_realpath($file, true);\n            if (is_file($path)) {\n                return $path;\n            }\n        }\n        // Use include path ?\n        if ($source->smarty->use_include_path) {\n            return $source->smarty->ext->_getIncludePath->getIncludePath($_directories, $file, $source->smarty);\n        }\n        return false;\n    }\n\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param Smarty_Template_Source   $source    source object\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @throws \\SmartyException\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $source->filepath = $this->buildFilepath($source, $_template);\n\n        if ($source->filepath !== false) {\n            if (isset($source->smarty->security_policy) && is_object($source->smarty->security_policy)) {\n                $source->smarty->security_policy->isTrustedResourceDir($source->filepath, $source->isConfig);\n            }\n            $source->exists = true;\n            $source->uid = sha1($source->filepath . ($source->isConfig ? $source->smarty->_joined_config_dir :\n                                    $source->smarty->_joined_template_dir));\n            $source->timestamp = filemtime($source->filepath);\n        } else {\n            $source->timestamp = $source->exists = false;\n        }\n    }\n\n    /**\n     * populate Source Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Source $source source object\n     */\n    public function populateTimestamp(Smarty_Template_Source $source)\n    {\n        if (!$source->exists) {\n            $source->timestamp = $source->exists = is_file($source->filepath);\n        }\n        if ($source->exists) {\n            $source->timestamp = filemtime($source->filepath);\n        }\n    }\n\n    /**\n     * Load template's source from file into current template object\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     * @throws SmartyException        if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        if ($source->exists) {\n            return file_get_contents($source->filepath);\n        }\n        throw new SmartyException('Unable to read ' . ($source->isConfig ? 'config' : 'template') .\n                                  \" {$source->type} '{$source->name}'\");\n    }\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return basename($source->filepath);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_resource_php.php",
    "content": "<?php\n\n/**\n * Smarty Internal Plugin Resource PHP\n * Implements the file system as resource for PHP templates\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\nclass Smarty_Internal_Resource_Php extends Smarty_Internal_Resource_File\n{\n    /**\n     * Flag that it's an uncompiled resource\n     *\n     * @var bool\n     */\n    public $uncompiled = true;\n\n    /**\n     * Resource does implement populateCompiledFilepath() method\n     *\n     * @var bool\n     */\n    public $hasCompiledHandler = true;\n\n    /**\n     * container for short_open_tag directive's value before executing PHP templates\n     *\n     * @var string\n     */\n    protected $short_open_tag;\n\n    /**\n     * Create a new PHP Resource\n     */\n    public function __construct()\n    {\n        $this->short_open_tag = function_exists('ini_get') ? ini_get('short_open_tag') : 1;\n    }\n\n    /**\n     * Load template's source from file into current template object\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     * @throws SmartyException        if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        if ($source->exists) {\n            return '';\n        }\n        throw new SmartyException(\"Unable to read template {$source->type} '{$source->name}'\");\n    }\n\n    /**\n     * populate compiled object with compiled filepath\n     *\n     * @param Smarty_Template_Compiled $compiled  compiled object\n     * @param Smarty_Internal_Template $_template template object (is ignored)\n     */\n    public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)\n    {\n        $compiled->filepath = $_template->source->filepath;\n        $compiled->timestamp = $_template->source->timestamp;\n        $compiled->exists = $_template->source->exists;\n        $compiled->file_dependency[ $_template->source->uid ] =\n            array($compiled->filepath,\n                  $compiled->timestamp,\n                  $_template->source->type,);\n    }\n\n    /**\n     * Render and output the template (without using the compiler)\n     *\n     * @param  Smarty_Template_Source   $source    source object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     * @throws SmartyException          if template cannot be loaded or allow_php_templates is disabled\n     */\n    public function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template)\n    {\n        if (!$source->smarty->allow_php_templates) {\n            throw new SmartyException('PHP templates are disabled');\n        }\n        if (!$source->exists) {\n            throw new SmartyException(\"Unable to load template '{$source->type}:{$source->name}'\" .\n                                      ($_template->_isSubTpl() ? \" in '{$_template->parent->template_resource}'\" : ''));\n        }\n\n        // prepare variables\n        extract($_template->getTemplateVars());\n\n        // include PHP template with short open tags enabled\n        if (function_exists('ini_set')) {\n            ini_set('short_open_tag', '1');\n        }\n        /** @var Smarty_Internal_Template $_smarty_template\n         * used in included file\n         */\n        $_smarty_template = $_template;\n        include($source->filepath);\n        if (function_exists('ini_set')) {\n            ini_set('short_open_tag', $this->short_open_tag);\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_resource_registered.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource Registered\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource Registered\n * Implements the registered resource for Smarty template\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @deprecated\n */\nclass Smarty_Internal_Resource_Registered extends Smarty_Resource\n{\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param  Smarty_Template_Source   $source    source object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $source->filepath = $source->type . ':' . $source->name;\n        $source->uid = sha1($source->filepath . $source->smarty->_joined_template_dir);\n        $source->timestamp = $this->getTemplateTimestamp($source);\n        $source->exists = !!$source->timestamp;\n    }\n\n    /**\n     * populate Source Object with timestamp and exists from Resource\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return void\n     */\n    public function populateTimestamp(Smarty_Template_Source $source)\n    {\n        $source->timestamp = $this->getTemplateTimestamp($source);\n        $source->exists = !!$source->timestamp;\n    }\n\n    /**\n     * Get timestamp (epoch) the template source was modified\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return integer|boolean        timestamp (epoch) the template was modified, false if resources has no timestamp\n     */\n    public function getTemplateTimestamp(Smarty_Template_Source $source)\n    {\n        // return timestamp\n        $time_stamp = false;\n        call_user_func_array($source->smarty->registered_resources[ $source->type ][ 0 ][ 1 ],\n                             array($source->name, &$time_stamp, $source->smarty));\n\n        return is_numeric($time_stamp) ? (int) $time_stamp : $time_stamp;\n    }\n\n    /**\n     * Load template's source by invoking the registered callback into current template object\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     * @throws SmartyException        if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        // return template string\n        $content = null;\n        $t = call_user_func_array($source->smarty->registered_resources[ $source->type ][ 0 ][ 0 ],\n                                  array($source->name, &$content, $source->smarty));\n        if (is_bool($t) && !$t) {\n            throw new SmartyException(\"Unable to read template {$source->type} '{$source->name}'\");\n        }\n\n        return $content;\n    }\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return basename($source->name);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_resource_stream.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource Stream\n * Implements the streams as resource for Smarty template\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource Stream\n * Implements the streams as resource for Smarty template\n *\n * @link       http://php.net/streams\n * @package    Smarty\n * @subpackage TemplateResources\n */\nclass Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled\n{\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param Smarty_Template_Source   $source    source object\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     * @throws \\SmartyException\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        if (strpos($source->resource, '://') !== false) {\n            $source->filepath = $source->resource;\n        } else {\n            $source->filepath = str_replace(':', '://', $source->resource);\n        }\n        $source->uid = false;\n        $source->content = $this->getContent($source);\n        $source->timestamp = $source->exists = !!$source->content;\n    }\n\n    /**\n     * Load template's source from stream into current template object\n     *\n     * @param Smarty_Template_Source $source source object\n     *\n     * @return string template source\n     * @throws SmartyException if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        $t = '';\n        // the availability of the stream has already been checked in Smarty_Resource::fetch()\n        $fp = fopen($source->filepath, 'r+');\n        if ($fp) {\n            while (!feof($fp) && ($current_line = fgets($fp)) !== false) {\n                $t .= $current_line;\n            }\n            fclose($fp);\n\n            return $t;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * modify resource_name according to resource handlers specifications\n     *\n     * @param Smarty   $smarty        Smarty instance\n     * @param string   $resource_name resource_name to make unique\n     * @param  boolean $isConfig      flag for config resource\n     *\n     * @return string unique resource name\n     */\n    public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false)\n    {\n        return get_class($this) . '#' . $resource_name;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_resource_string.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Resource String\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Internal Plugin Resource String\n * Implements the strings as resource for Smarty template\n * {@internal unlike eval-resources the compiled state of string-resources is saved for subsequent access}}\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nclass Smarty_Internal_Resource_String extends Smarty_Resource\n{\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param  Smarty_Template_Source   $source    source object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $source->uid = $source->filepath = sha1($source->name . $source->smarty->_joined_template_dir);\n        $source->timestamp = $source->exists = true;\n    }\n\n    /**\n     * Load template's source from $resource_name into current template object\n     *\n     * @uses decode() to decode base64 and urlencoded template_resources\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        return $this->decode($source->name);\n    }\n\n    /**\n     * decode base64 and urlencode\n     *\n     * @param  string $string template_resource to decode\n     *\n     * @return string decoded template_resource\n     */\n    protected function decode($string)\n    {\n        // decode if specified\n        if (($pos = strpos($string, ':')) !== false) {\n            if (!strncmp($string, 'base64', 6)) {\n                return base64_decode(substr($string, 7));\n            } elseif (!strncmp($string, 'urlencode', 9)) {\n                return urldecode(substr($string, 10));\n            }\n        }\n\n        return $string;\n    }\n\n    /**\n     * modify resource_name according to resource handlers specifications\n     *\n     * @param  Smarty  $smarty        Smarty instance\n     * @param  string  $resource_name resource_name to make unique\n     * @param  boolean $isConfig      flag for config resource\n     *\n     * @return string unique resource name\n     */\n    public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false)\n    {\n        return get_class($this) . '#' . $this->decode($resource_name);\n    }\n\n    /**\n     * Determine basename for compiled filename\n     * Always returns an empty string.\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return '';\n    }\n\n    /*\n        * Disable timestamp checks for string resource.\n        *\n        * @return bool\n        */\n    /**\n     * @return bool\n     */\n    public function checkTimestamps()\n    {\n        return false;\n    }\n}\n\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_cachemodify.php",
    "content": "<?php\n\n/**\n * Inline Runtime Methods render, setSourceByUid, setupSubTemplate\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n **/\nclass Smarty_Internal_Runtime_CacheModify\n{\n    /**\n     * check client side cache\n     *\n     * @param \\Smarty_Template_Cached   $cached\n     * @param \\Smarty_Internal_Template $_template\n     * @param  string                   $content\n     *\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)\n    {\n        $_isCached = $_template->isCached() && !$_template->compiled->has_nocache_code;\n        $_last_modified_date =\n            @substr($_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ], 0, strpos($_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ], 'GMT') + 3);\n        if ($_isCached && $cached->timestamp <= strtotime($_last_modified_date)) {\n            switch (PHP_SAPI) {\n                case 'cgi': // php-cgi < 5.3\n                case 'cgi-fcgi': // php-cgi >= 5.3\n                case 'fpm-fcgi': // php-fpm >= 5.3.3\n                    header('Status: 304 Not Modified');\n                    break;\n\n                case 'cli':\n                    if ( /* ^phpunit */\n                    !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */\n                    ) {\n                        $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] = '304 Not Modified';\n                    }\n                    break;\n\n                default:\n                    if ( /* ^phpunit */\n                    !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */\n                    ) {\n                        $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] = '304 Not Modified';\n                    } else {\n                        header($_SERVER[ 'SERVER_PROTOCOL' ] . ' 304 Not Modified');\n                    }\n                    break;\n            }\n        } else {\n            switch (PHP_SAPI) {\n                case 'cli':\n                    if ( /* ^phpunit */\n                    !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */\n                    ) {\n                        $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] =\n                            'Last-Modified: ' . gmdate('D, d M Y H:i:s', $cached->timestamp) . ' GMT';\n                    }\n                    break;\n                default:\n                    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $cached->timestamp) . ' GMT');\n                    break;\n            }\n            echo $content;\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_cacheresourcefile.php",
    "content": "<?php\n/**\n * Smarty cache resource file clear method\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\n/**\n * Smarty Internal Runtime Cache Resource File Class\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n */\nclass Smarty_Internal_Runtime_CacheResourceFile\n{\n    /**\n     * Empty cache for a specific template\n     *\n     * @param Smarty  $smarty\n     * @param string  $resource_name template name\n     * @param string  $cache_id      cache id\n     * @param string  $compile_id    compile id\n     * @param integer $exp_time      expiration time (number of seconds, not timestamp)\n     *\n     * @return integer number of cache files deleted\n     */\n    public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)\n    {\n        $_cache_id = isset($cache_id) ? preg_replace('![^\\w\\|]+!', '_', $cache_id) : null;\n        $_compile_id = isset($compile_id) ? preg_replace('![^\\w]+!', '_', $compile_id) : null;\n        $_dir_sep = $smarty->use_sub_dirs ? '/' : '^';\n        $_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;\n        $_dir = $smarty->getCacheDir();\n        if ($_dir === '/') { //We should never want to delete this!\n            return 0;\n        }\n        $_dir_length = strlen($_dir);\n        if (isset($_cache_id)) {\n            $_cache_id_parts = explode('|', $_cache_id);\n            $_cache_id_parts_count = count($_cache_id_parts);\n            if ($smarty->use_sub_dirs) {\n                foreach ($_cache_id_parts as $id_part) {\n                    $_dir .= $id_part . DIRECTORY_SEPARATOR;\n                }\n            }\n        }\n        if (isset($resource_name)) {\n            $_save_stat = $smarty->caching;\n            $smarty->caching = Smarty::CACHING_LIFETIME_CURRENT;\n            $tpl = new $smarty->template_class($resource_name, $smarty);\n            $smarty->caching = $_save_stat;\n            // remove from template cache\n            $tpl->source; // have the template registered before unset()\n            if ($tpl->source->exists) {\n                $_resourcename_parts = basename(str_replace('^', '/', $tpl->cached->filepath));\n            } else {\n                return 0;\n            }\n        }\n        $_count = 0;\n        $_time = time();\n        if (file_exists($_dir)) {\n            $_cacheDirs = new RecursiveDirectoryIterator($_dir);\n            $_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);\n            foreach ($_cache as $_file) {\n                if (substr(basename($_file->getPathname()), 0, 1) === '.') {\n                    continue;\n                }\n                $_filepath = (string)$_file;\n                // directory ?\n                if ($_file->isDir()) {\n                    if (!$_cache->isDot()) {\n                        // delete folder if empty\n                        @rmdir($_file->getPathname());\n                    }\n                } else {\n                    // delete only php files\n                    if (substr($_filepath, -4) !== '.php') {\n                        continue;\n                    }\n                    $_parts = explode($_dir_sep, str_replace('\\\\', '/', substr($_filepath, $_dir_length)));\n                    $_parts_count = count($_parts);\n                    // check name\n                    if (isset($resource_name)) {\n                        if ($_parts[ $_parts_count - 1 ] !== $_resourcename_parts) {\n                            continue;\n                        }\n                    }\n                    // check compile id\n                    if (isset($_compile_id) && (!isset($_parts[ $_parts_count - 2 - $_compile_id_offset ]) ||\n                                                $_parts[ $_parts_count - 2 - $_compile_id_offset ] !== $_compile_id)\n                    ) {\n                        continue;\n                    }\n                    // check cache id\n                    if (isset($_cache_id)) {\n                        // count of cache id parts\n                        $_parts_count = (isset($_compile_id)) ? $_parts_count - 2 - $_compile_id_offset :\n                            $_parts_count - 1 - $_compile_id_offset;\n                        if ($_parts_count < $_cache_id_parts_count) {\n                            continue;\n                        }\n                        for ($i = 0; $i < $_cache_id_parts_count; $i++) {\n                            if ($_parts[ $i ] !== $_cache_id_parts[ $i ]) {\n                                continue 2;\n                            }\n                        }\n                    }\n                    if (is_file($_filepath)) {\n                        // expired ?\n                        if (isset($exp_time)) {\n                            if ($exp_time < 0) {\n                                preg_match('#\\'cache_lifetime\\' =>\\s*(\\d*)#', file_get_contents($_filepath), $match);\n                                if ($_time < (filemtime($_filepath) + $match[ 1 ])) {\n                                    continue;\n                                }\n                            } else {\n                                if ($_time - filemtime($_filepath) < $exp_time) {\n                                    continue;\n                                }\n                            }\n                        }\n                        $_count += @unlink($_filepath) ? 1 : 0;\n                        if (function_exists('opcache_invalidate')\n                            && (!function_exists('ini_get') || strlen(ini_get(\"opcache.restrict_api\")) < 1)\n                        ) {\n                            opcache_invalidate($_filepath, true);\n                        } else if (function_exists('apc_delete_file')) {\n                            apc_delete_file($_filepath);\n                        }\n                    }\n                }\n            }\n        }\n        return $_count;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_capture.php",
    "content": "<?php\n\n/**\n * Runtime Extension Capture\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Runtime_Capture\n{\n    /**\n     * Flag that this instance  will not be cached\n     *\n     * @var bool\n     */\n    public $isPrivateExtension = true;\n\n    /**\n     * Stack of capture parameter\n     *\n     * @var array\n     */\n    private $captureStack = array();\n\n    /**\n     * Current open capture sections\n     *\n     * @var int\n     */\n    private $captureCount = 0;\n\n    /**\n     * Count stack\n     *\n     * @var int[]\n     */\n    private $countStack = array();\n\n    /**\n     * Named buffer\n     *\n     * @var string[]\n     */\n    private $namedBuffer = array();\n\n    /**\n     * Flag if callbacks are registered\n     *\n     * @var bool\n     */\n    private $isRegistered = false;\n\n    /**\n     * Open capture section\n     *\n     * @param \\Smarty_Internal_Template $_template\n     * @param string                    $buffer capture name\n     * @param string                    $assign variable name\n     * @param string                    $append variable name\n     */\n    public function open(Smarty_Internal_Template $_template, $buffer, $assign, $append)\n    {\n        if (!$this->isRegistered) {\n            $this->register($_template);\n        }\n        $this->captureStack[] = array($buffer,\n                                      $assign,\n                                      $append);\n        $this->captureCount ++;\n        ob_start();\n    }\n\n    /**\n     * Register callbacks in template class\n     *\n     * @param \\Smarty_Internal_Template $_template\n     */\n    private function register(Smarty_Internal_Template $_template)\n    {\n        $_template->startRenderCallbacks[] = array($this,\n                                                   'startRender');\n        $_template->endRenderCallbacks[] = array($this,\n                                                 'endRender');\n        $this->startRender($_template);\n        $this->isRegistered = true;\n    }\n\n    /**\n     * Start render callback\n     *\n     * @param \\Smarty_Internal_Template $_template\n     */\n    public function startRender(Smarty_Internal_Template $_template)\n    {\n        $this->countStack[] = $this->captureCount;\n        $this->captureCount = 0;\n    }\n\n    /**\n     * Close capture section\n     *\n     * @param \\Smarty_Internal_Template $_template\n     *\n     * @throws \\SmartyException\n     */\n    public function close(Smarty_Internal_Template $_template)\n    {\n        if ($this->captureCount) {\n            list($buffer, $assign, $append) = array_pop($this->captureStack);\n            $this->captureCount --;\n            if (isset($assign)) {\n                $_template->assign($assign, ob_get_contents());\n            }\n            if (isset($append)) {\n                $_template->append($append, ob_get_contents());\n            }\n            $this->namedBuffer[ $buffer ] = ob_get_clean();\n        } else {\n            $this->error($_template);\n        }\n    }\n\n    /**\n     * Error exception on not matching {capture}{/capture}\n     *\n     * @param \\Smarty_Internal_Template $_template\n     *\n     * @throws \\SmartyException\n     */\n    public function error(Smarty_Internal_Template $_template)\n    {\n        throw new SmartyException(\"Not matching {capture}{/capture} in '{$_template->template_resource}'\");\n    }\n\n    /**\n     * Return content of named capture buffer by key or as array\n     *\n     * @param \\Smarty_Internal_Template $_template\n     * @param   string|null             $name\n     *\n     * @return string|string[]|null\n     */\n    public function getBuffer(Smarty_Internal_Template $_template, $name = null)\n    {\n        if (isset($name)) {\n            return isset($this->namedBuffer[ $name ]) ? $this->namedBuffer[ $name ] : null;\n        } else {\n            return $this->namedBuffer;\n        }\n    }\n\n    /**\n     * End render callback\n     *\n     * @param \\Smarty_Internal_Template $_template\n     *\n     * @throws \\SmartyException\n     */\n    public function endRender(Smarty_Internal_Template $_template)\n    {\n        if ($this->captureCount) {\n            $this->error($_template);\n        } else {\n            $this->captureCount = array_pop($this->countStack);\n        }\n    }\n\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_codeframe.php",
    "content": "<?php\n/**\n * Smarty Internal Extension\n * This file contains the Smarty template extension to create a code frame\n *\n * @package    Smarty\n * @subpackage Template\n * @author     Uwe Tews\n */\n\n/**\n * Class Smarty_Internal_Extension_CodeFrame\n * Create code frame for compiled and cached templates\n */\nclass Smarty_Internal_Runtime_CodeFrame\n{\n    /**\n     * Create code frame for compiled and cached templates\n     *\n     * @param Smarty_Internal_Template              $_template\n     * @param string                                $content   optional template content\n     * @param string                                $functions compiled template function and block code\n     * @param bool                                  $cache     flag for cache file\n     * @param \\Smarty_Internal_TemplateCompilerBase $compiler\n     *\n     * @return string\n     */\n    public function create(Smarty_Internal_Template $_template, $content = '', $functions = '', $cache = false,\n                           Smarty_Internal_TemplateCompilerBase $compiler = null)\n    {\n        // build property code\n        $properties[ 'version' ] = Smarty::SMARTY_VERSION;\n        $properties[ 'unifunc' ] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true));\n        if (!$cache) {\n            $properties[ 'has_nocache_code' ] = $_template->compiled->has_nocache_code;\n            $properties[ 'file_dependency' ] = $_template->compiled->file_dependency;\n            $properties[ 'includes' ] = $_template->compiled->includes;\n         } else {\n            $properties[ 'has_nocache_code' ] = $_template->cached->has_nocache_code;\n            $properties[ 'file_dependency' ] = $_template->cached->file_dependency;\n            $properties[ 'cache_lifetime' ] = $_template->cache_lifetime;\n        }\n        $output = \"<?php\\n\";\n        $output .= \"/* Smarty version {$properties[ 'version' ]}, created on \" . strftime(\"%Y-%m-%d %H:%M:%S\") .\n                   \"\\n  from '\" . str_replace('*/','* /',$_template->source->filepath) . \"' */\\n\\n\";\n        $output .= \"/* @var Smarty_Internal_Template \\$_smarty_tpl */\\n\";\n        $dec = \"\\$_smarty_tpl->_decodeProperties(\\$_smarty_tpl, \" . var_export($properties, true) . ',' .\n               ($cache ? 'true' : 'false') . ')';\n        $output .= \"if ({$dec}) {\\n\";\n        $output .= \"function {$properties['unifunc']} (Smarty_Internal_Template \\$_smarty_tpl) {\\n\";\n        if (!$cache && !empty($compiler->tpl_function)) {\n            $output .= '$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions($_smarty_tpl, ';\n            $output .= var_export($compiler->tpl_function, true);\n            $output .= \");\\n\";\n        }\n        if ($cache && isset($_template->smarty->ext->_tplFunction)) {\n            $output .= \"\\$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions(\\$_smarty_tpl, \" .\n                       var_export($_template->smarty->ext->_tplFunction->getTplFunction($_template), true) . \");\\n\";\n\n        }\n        // include code for required plugins\n        if (!$cache && isset($compiler)) {\n            $output .= $compiler->compileRequiredPlugins();\n        }\n        $output .= \"?>\";\n        $output .= $content;\n        $output .= \"<?php }\\n?>\";\n        $output .= $functions;\n        $output .= \"<?php }\\n\";\n        // remove unneeded PHP tags\n        if (preg_match('/\\s*\\?>[\\n]?<\\?php\\s*/', $output)) {\n            $curr_split = preg_split('/\\s*\\?>[\\n]?<\\?php\\s*/',\n                                     $output);\n            preg_match_all('/\\s*\\?>[\\n]?<\\?php\\s*/',\n                           $output,\n                           $curr_parts);\n            $output = '';\n            foreach ($curr_split as $idx => $curr_output) {\n                $output .= $curr_output;\n                if (isset($curr_parts[ 0 ][ $idx ])) {\n                    $output .= \"\\n\";\n                }\n            }\n        }\n        if (preg_match('/\\?>\\s*$/', $output)) {\n            $curr_split = preg_split('/\\?>\\s*$/',\n                                     $output);\n            $output = '';\n            foreach ($curr_split as $idx => $curr_output) {\n                $output .= $curr_output;\n            }\n        }\n        return $output;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_filterhandler.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Filter Handler\n * Smarty filter handler class\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\n\n/**\n * Class for filter processing\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n */\nclass Smarty_Internal_Runtime_FilterHandler\n{\n    /**\n     * Run filters over content\n     * The filters will be lazy loaded if required\n     * class name format: Smarty_FilterType_FilterName\n     * plugin filename format: filtertype.filtername.php\n     * Smarty2 filter plugins could be used\n     *\n     * @param  string                   $type     the type of filter ('pre','post','output') which shall run\n     * @param  string                   $content  the content which shall be processed by the filters\n     * @param  Smarty_Internal_Template $template template object\n     *\n     * @throws SmartyException\n     * @return string                   the filtered content\n     */\n    public function runFilter($type, $content, Smarty_Internal_Template $template)\n    {\n        // loop over autoload filters of specified type\n        if (!empty($template->smarty->autoload_filters[ $type ])) {\n            foreach ((array) $template->smarty->autoload_filters[ $type ] as $name) {\n                $plugin_name = \"Smarty_{$type}filter_{$name}\";\n                if (function_exists($plugin_name)) {\n                    $callback = $plugin_name;\n                } elseif (class_exists($plugin_name, false) && is_callable(array($plugin_name, 'execute'))) {\n                    $callback = array($plugin_name, 'execute');\n                } elseif ($template->smarty->loadPlugin($plugin_name, false)) {\n                    if (function_exists($plugin_name)) {\n                        // use loaded Smarty2 style plugin\n                        $callback = $plugin_name;\n                    } elseif (class_exists($plugin_name, false) && is_callable(array($plugin_name, 'execute'))) {\n                        // loaded class of filter plugin\n                        $callback = array($plugin_name, 'execute');\n                    } else {\n                        throw new SmartyException(\"Auto load {$type}-filter plugin method '{$plugin_name}::execute' not callable\");\n                    }\n                } else {\n                    // nothing found, throw exception\n                    throw new SmartyException(\"Unable to auto load {$type}-filter plugin '{$plugin_name}'\");\n                }\n                $content = call_user_func($callback, $content, $template);\n            }\n        }\n        // loop over registered filters of specified type\n        if (!empty($template->smarty->registered_filters[ $type ])) {\n            foreach ($template->smarty->registered_filters[ $type ] as $key => $name) {\n                $content = call_user_func($template->smarty->registered_filters[ $type ][ $key ], $content, $template);\n            }\n        }\n        // return filtered output\n        return $content;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_foreach.php",
    "content": "<?php\n\n/**\n * Foreach Runtime Methods count(), init(), restore()\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n */\nclass Smarty_Internal_Runtime_Foreach\n{\n\n    /**\n     * Stack of saved variables\n     *\n     * @var array\n     */\n    private $stack = array();\n\n    /**\n     * Init foreach loop\n     *  - save item and key variables, named foreach property data if defined\n     *  - init item and key variables, named foreach property data if required\n     *  - count total if required\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param mixed                     $from       values to loop over\n     * @param string                    $item       variable name\n     * @param bool                      $needTotal  flag if we need to count values\n     * @param null|string               $key        variable name\n     * @param null|string               $name       of named foreach\n     * @param array                     $properties of named foreach\n     *\n     * @return mixed $from\n     */\n    public function init(Smarty_Internal_Template $tpl, $from, $item, $needTotal = false, $key = null, $name = null,\n                         $properties = array())\n    {\n        $saveVars = array();\n        $total = null;\n        if (!is_array($from)) {\n            if (is_object($from)) {\n                $total = $this->count($from);\n            } else {\n                settype($from, 'array');\n            }\n        }\n        if (!isset($total)) {\n            $total = empty($from) ? 0 : (($needTotal || isset($properties[ 'total' ])) ? count($from) : 1);\n        }\n        if (isset($tpl->tpl_vars[ $item ])) {\n            $saveVars[ 'item' ] = array($item,\n                                        $tpl->tpl_vars[ $item ]);\n        }\n        $tpl->tpl_vars[ $item ] = new Smarty_Variable(null, $tpl->isRenderingCache);\n        if ($total === 0) {\n            $from = null;\n        } else {\n            if ($key) {\n                if (isset($tpl->tpl_vars[ $key ])) {\n                    $saveVars[ 'key' ] = array($key,\n                                               $tpl->tpl_vars[ $key ]);\n                }\n                $tpl->tpl_vars[ $key ] = new Smarty_Variable(null, $tpl->isRenderingCache);\n            }\n        }\n        if ($needTotal) {\n            $tpl->tpl_vars[ $item ]->total = $total;\n        }\n        if ($name) {\n            $namedVar = \"__smarty_foreach_{$name}\";\n            if (isset($tpl->tpl_vars[ $namedVar ])) {\n                $saveVars[ 'named' ] = array($namedVar,\n                                             $tpl->tpl_vars[ $namedVar ]);\n            }\n            $namedProp = array();\n            if (isset($properties[ 'total' ])) {\n                $namedProp[ 'total' ] = $total;\n            }\n            if (isset($properties[ 'iteration' ])) {\n                $namedProp[ 'iteration' ] = 0;\n            }\n            if (isset($properties[ 'index' ])) {\n                $namedProp[ 'index' ] = - 1;\n            }\n            if (isset($properties[ 'show' ])) {\n                $namedProp[ 'show' ] = ($total > 0);\n            }\n            $tpl->tpl_vars[ $namedVar ] = new Smarty_Variable($namedProp);\n        }\n        $this->stack[] = $saveVars;\n        return $from;\n    }\n\n    /**\n     *\n     * [util function] counts an array, arrayAccess/traversable or PDOStatement object\n     *\n     * @param  mixed $value\n     *\n     * @return int   the count for arrays and objects that implement countable, 1 for other objects that don't, and 0\n     *               for empty elements\n     */\n    public function count($value)\n    {\n        if ($value instanceof IteratorAggregate) {\n            // Note: getIterator() returns a Traversable, not an Iterator\n            // thus rewind() and valid() methods may not be present\n            return iterator_count($value->getIterator());\n        } elseif ($value instanceof Iterator) {\n            return $value instanceof Generator ? 1 : iterator_count($value);\n        } elseif ($value instanceof Countable) {\n            return count($value);\n        } elseif ($value instanceof PDOStatement) {\n            return $value->rowCount();\n        } elseif ($value instanceof Traversable) {\n            return iterator_count($value);\n        }\n        return count((array) $value);\n    }\n\n    /**\n     * Restore saved variables\n     *\n     * will be called by {break n} or {continue n} for the required number of levels\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param int                       $levels number of levels\n     */\n    public function restore(Smarty_Internal_Template $tpl, $levels = 1)\n    {\n        while ($levels) {\n            $saveVars = array_pop($this->stack);\n            if (!empty($saveVars)) {\n                if (isset($saveVars[ 'item' ])) {\n                    $item = &$saveVars[ 'item' ];\n                    $tpl->tpl_vars[ $item[ 0 ] ]->value = $item[ 1 ]->value;\n                }\n                if (isset($saveVars[ 'key' ])) {\n                    $tpl->tpl_vars[ $saveVars[ 'key' ][ 0 ] ] = $saveVars[ 'key' ][ 1 ];\n                }\n                if (isset($saveVars[ 'named' ])) {\n                    $tpl->tpl_vars[ $saveVars[ 'named' ][ 0 ] ] = $saveVars[ 'named' ][ 1 ];\n                }\n            }\n            $levels --;\n        }\n    }\n\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_getincludepath.php",
    "content": "<?php\n/**\n * Smarty read include path plugin\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Monte Ohrt\n */\n\n/**\n * Smarty Internal Read Include Path Class\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n */\nclass Smarty_Internal_Runtime_GetIncludePath\n{\n    /**\n     * include path cache\n     *\n     * @var string\n     */\n    public $_include_path = '';\n    /**\n     * include path directory cache\n     *\n     * @var array\n     */\n    public $_include_dirs = array();\n    /**\n     * include path directory cache\n     *\n     * @var array\n     */\n    public $_user_dirs = array();\n    /**\n     * stream cache\n     *\n     * @var string[][]\n     */\n    public $isFile = array();\n    /**\n     * stream cache\n     *\n     * @var string[]\n     */\n    public $isPath = array();\n    /**\n     * stream cache\n     *\n     * @var int[]\n     */\n    public $number = array();\n    /**\n     * status cache\n     *\n     * @var bool\n     */\n    public $_has_stream_include = null;\n    /**\n     * Number for array index\n     *\n     * @var int\n     */\n    public $counter = 0;\n\n    /**\n     * Check if include path was updated\n     *\n     * @param \\Smarty $smarty\n     *\n     * @return bool\n     */\n    public function isNewIncludePath(Smarty $smarty)\n    {\n        $_i_path = get_include_path();\n        if ($this->_include_path !== $_i_path) {\n            $this->_include_dirs = array();\n            $this->_include_path = $_i_path;\n            $_dirs = (array)explode(PATH_SEPARATOR, $_i_path);\n            foreach ($_dirs as $_path) {\n                if (is_dir($_path)) {\n                    $this->_include_dirs[] = $smarty->_realpath($_path . DIRECTORY_SEPARATOR, true);\n                }\n            }\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * return array with include path directories\n     *\n     * @param \\Smarty $smarty\n     *\n     * @return array\n     */\n    public function getIncludePathDirs(Smarty $smarty)\n    {\n        $this->isNewIncludePath($smarty);\n        return $this->_include_dirs;\n    }\n\n    /**\n     * Return full file path from PHP include_path\n     *\n     * @param  string[] $dirs\n     * @param  string   $file\n     * @param \\Smarty   $smarty\n     *\n     * @return bool|string full filepath or false\n     *\n     */\n    public function getIncludePath($dirs, $file, Smarty $smarty)\n    {\n        //if (!(isset($this->_has_stream_include) ? $this->_has_stream_include : $this->_has_stream_include = false)) {\n        if (!(isset($this->_has_stream_include) ? $this->_has_stream_include :\n            $this->_has_stream_include = function_exists('stream_resolve_include_path'))\n        ) {\n            $this->isNewIncludePath($smarty);\n        }\n        // try PHP include_path\n        foreach ($dirs as $dir) {\n            $dir_n = isset($this->number[ $dir ]) ? $this->number[ $dir ] : $this->number[ $dir ] = $this->counter++;\n            if (isset($this->isFile[ $dir_n ][ $file ])) {\n                if ($this->isFile[ $dir_n ][ $file ]) {\n                    return $this->isFile[ $dir_n ][ $file ];\n                } else {\n                    continue;\n                }\n            }\n            if (isset($this->_user_dirs[ $dir_n ])) {\n                if (false === $this->_user_dirs[ $dir_n ]) {\n                    continue;\n                } else {\n                    $dir = $this->_user_dirs[ $dir_n ];\n                }\n            } else {\n                if ($dir[ 0 ] === '/' || $dir[ 1 ] === ':') {\n                    $dir = str_ireplace(getcwd(), '.', $dir);\n                    if ($dir[ 0 ] === '/' || $dir[ 1 ] === ':') {\n                        $this->_user_dirs[ $dir_n ] = false;\n                        continue;\n                    }\n                }\n                $dir = substr($dir, 2);\n                $this->_user_dirs[ $dir_n ] = $dir;\n            }\n            if ($this->_has_stream_include) {\n                $path = stream_resolve_include_path($dir . (isset($file) ? $file : ''));\n                if ($path) {\n                    return $this->isFile[ $dir_n ][ $file ] = $path;\n                }\n            } else {\n                foreach ($this->_include_dirs as $key => $_i_path) {\n                    $path = isset($this->isPath[ $key ][ $dir_n ]) ? $this->isPath[ $key ][ $dir_n ] :\n                        $this->isPath[ $key ][ $dir_n ] = is_dir($_dir_path = $_i_path . $dir) ? $_dir_path : false;\n                    if ($path === false) {\n                        continue;\n                    }\n                    if (isset($file)) {\n                        $_file = $this->isFile[ $dir_n ][ $file ] = (is_file($path . $file)) ? $path . $file : false;\n                        if ($_file) {\n                            return $_file;\n                        }\n                    } else {\n                        // no file was given return directory path\n                        return $path;\n                    }\n                }\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_inheritance.php",
    "content": "<?php\n\n/**\n * Inheritance Runtime Methods processBlock, endChild, init\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n **/\nclass Smarty_Internal_Runtime_Inheritance\n{\n\n    /**\n     * State machine\n     * - 0 idle next extends will create a new inheritance tree\n     * - 1 processing child template\n     * - 2 wait for next inheritance template\n     * - 3 assume parent template, if child will loaded goto state 1\n     *     a call to a sub template resets the state to 0\n     *\n     * @var int\n     */\n    public $state = 0;\n\n    /**\n     * Array of root child {block} objects\n     *\n     * @var Smarty_Internal_Block[]\n     */\n    public $childRoot = array();\n\n    /**\n     * inheritance template nesting level\n     *\n     * @var int\n     */\n    public $inheritanceLevel = 0;\n\n    /**\n     * inheritance template index\n     *\n     * @var int\n     */\n    public $tplIndex = - 1;\n\n    /**\n     * Array of template source objects\n     *\n     * @var Smarty_Template_Source[]\n     */\n    public $sources = array();\n\n    /**\n     * Stack of source objects while executing block code\n     *\n     * @var Smarty_Template_Source[]\n     */\n    public $sourceStack = array();\n\n    /**\n     * Initialize inheritance\n     *\n     * @param \\Smarty_Internal_Template $tpl        template object of caller\n     * @param bool                      $initChild  if true init for child template\n     * @param array                     $blockNames outer level block name\n     *\n     */\n    public function init(Smarty_Internal_Template $tpl, $initChild, $blockNames = array())\n    {\n        // if called while executing parent template it must be a sub-template with new inheritance root\n        if ($initChild && $this->state === 3 && (strpos($tpl->template_resource, 'extendsall') === false)) {\n            $tpl->inheritance = new Smarty_Internal_Runtime_Inheritance();\n            $tpl->inheritance->init($tpl, $initChild, $blockNames);\n            return;\n        }\n        ++$this->tplIndex;\n        $this->sources[ $this->tplIndex ] = $tpl->source;\n\n        // start of child sub template(s)\n        if ($initChild) {\n            $this->state = 1;\n            if (!$this->inheritanceLevel) {\n                //grab any output of child templates\n                ob_start();\n            }\n            ++$this->inheritanceLevel;\n            //           $tpl->startRenderCallbacks[ 'inheritance' ] = array($this, 'subTemplateStart');\n            //           $tpl->endRenderCallbacks[ 'inheritance' ] = array($this, 'subTemplateEnd');\n        }\n        // if state was waiting for parent change state to parent\n        if ($this->state === 2) {\n            $this->state = 3;\n        }\n    }\n\n    /**\n     * End of child template(s)\n     * - if outer level is reached flush output buffer and switch to wait for parent template state\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param null|string               $template optional name of inheritance parent template\n     * @param null|string               $uid      uid of inline template\n     * @param null|string               $func     function call name of inline template\n     *\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function endChild(Smarty_Internal_Template $tpl, $template = null, $uid = null, $func = null)\n    {\n        --$this->inheritanceLevel;\n        if (!$this->inheritanceLevel) {\n            ob_end_clean();\n            $this->state = 2;\n        }\n        if (isset($template) && (($tpl->parent->_isTplObj() && $tpl->parent->source->type !== 'extends') ||\n                                 $tpl->smarty->extends_recursion)) {\n            $tpl->_subTemplateRender($template,\n                                     $tpl->cache_id,\n                                     $tpl->compile_id,\n                                     $tpl->caching ? 9999 : 0,\n                                     $tpl->cache_lifetime,\n                                     array(),\n                                     2,\n                                     false,\n                                     $uid,\n                                     $func);\n        }\n    }\n\n    /**\n     * Smarty_Internal_Block constructor.\n     * - if outer level {block} of child template ($state === 1) save it as child root block\n     * - otherwise process inheritance and render\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param                           $className\n     * @param string                    $name\n     * @param int|null                  $tplIndex index of outer level {block} if nested\n     *\n     * @throws \\SmartyException\n     */\n    public function instanceBlock(Smarty_Internal_Template $tpl, $className, $name, $tplIndex = null)\n    {\n        $block = new $className($name, isset($tplIndex) ? $tplIndex : $this->tplIndex);\n        if (isset($this->childRoot[ $name ])) {\n            $block->child = $this->childRoot[ $name ];\n        }\n        if ($this->state === 1) {\n            $this->childRoot[ $name ] = $block;\n            return;\n        }\n        // make sure we got child block of child template of current block\n        while ($block->child && $block->tplIndex <= $block->child->tplIndex) {\n            $block->child = $block->child->child;\n        }\n        $this->process($tpl, $block);\n    }\n\n    /**\n     * Goto child block or render this\n     *\n     * @param \\Smarty_Internal_Template   $tpl\n     * @param \\Smarty_Internal_Block      $block\n     * @param \\Smarty_Internal_Block|null $parent\n     *\n     * @throws \\SmartyException\n     */\n    public function process(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block,\n                            Smarty_Internal_Block $parent = null)\n    {\n        if ($block->hide && !isset($block->child)) {\n            return;\n        }\n        if (isset($block->child) && $block->child->hide && !isset($block->child->child)) {\n            $block->child = null;\n        }\n        $block->parent = $parent;\n        if ($block->append && !$block->prepend && isset($parent)) {\n            $this->callParent($tpl, $block, '\\'{block append}\\'');\n        }\n        if ($block->callsChild || !isset($block->child) || ($block->child->hide && !isset($block->child->child))) {\n            $this->callBlock($block, $tpl);\n        } else {\n            $this->process($tpl, $block->child, $block);\n        }\n        if ($block->prepend && isset($parent)) {\n            $this->callParent($tpl, $block, '{block prepend}');\n            if ($block->append) {\n                if ($block->callsChild || !isset($block->child) ||\n                    ($block->child->hide && !isset($block->child->child))\n                ) {\n                    $this->callBlock($block, $tpl);\n                } else {\n                    $this->process($tpl, $block->child, $block);\n                }\n            }\n        }\n        $block->parent = null;\n    }\n\n    /**\n     * Render child on \\$smarty.block.child\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param \\Smarty_Internal_Block    $block\n     *\n     * @return null|string block content\n     * @throws \\SmartyException\n     */\n    public function callChild(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block)\n    {\n        if (isset($block->child)) {\n            $this->process($tpl, $block->child, $block);\n        }\n    }\n\n    /**\n     * Render parent block on \\$smarty.block.parent or {block append/prepend}\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param \\Smarty_Internal_Block    $block\n     * @param string                    $tag\n     *\n     * @return null|string  block content\n     * @throws \\SmartyException\n     */\n    public function callParent(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block, $tag)\n    {\n        if (isset($block->parent)) {\n            $this->callBlock($block->parent, $tpl);\n        } else {\n            throw new SmartyException(\"inheritance: illegal '{$tag}' used in child template '{$tpl->inheritance->sources[$block->tplIndex]->filepath}' block '{$block->name}'\");\n        }\n    }\n\n    /**\n     * render block\n     *\n     * @param \\Smarty_Internal_Block    $block\n     * @param \\Smarty_Internal_Template $tpl\n     */\n    public function callBlock(Smarty_Internal_Block $block, Smarty_Internal_Template $tpl)\n    {\n        $this->sourceStack[] = $tpl->source;\n        $tpl->source = $this->sources[ $block->tplIndex ];\n        $block->callBlock($tpl);\n        $tpl->source = array_pop($this->sourceStack);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_make_nocache.php",
    "content": "<?php\n\n/**\n * {make_nocache} Runtime Methods save(), store()\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n */\nclass Smarty_Internal_Runtime_Make_Nocache\n{\n\n    /**\n     * Save current variable value while rendering compiled template and inject nocache code to\n     * assign variable value in cahed template\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param string                    $var variable name\n     *\n     * @throws \\SmartyException\n     */\n    public function save(Smarty_Internal_Template $tpl, $var)\n    {\n        if (isset($tpl->tpl_vars[ $var ])) {\n            $export =\n                preg_replace('/^Smarty_Variable::__set_state[(]|[)]$/', '', var_export($tpl->tpl_vars[ $var ], true));\n            if (preg_match('/(\\w+)::__set_state/', $export, $match)) {\n                throw new SmartyException(\"{make_nocache \\${$var}} in template '{$tpl->source->name}': variable does contain object '{$match[1]}' not implementing method '__set_state'\");\n            }\n            echo \"/*%%SmartyNocache:{$tpl->compiled->nocache_hash}%%*/<?php \" .\n                 addcslashes(\"\\$_smarty_tpl->smarty->ext->_make_nocache->store(\\$_smarty_tpl, '{$var}', \", '\\\\') .\n                 $export . \");?>\\n/*/%%SmartyNocache:{$tpl->compiled->nocache_hash}%%*/\";\n        }\n    }\n\n    /**\n     * Store variable value saved while rendering compiled template in cached template context\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  string                   $var variable name\n     * @param  array                    $properties\n     */\n    public function store(Smarty_Internal_Template $tpl, $var, $properties)\n    {\n        // do not overwrite existing nocache variables\n        if (!isset($tpl->tpl_vars[ $var ]) || !$tpl->tpl_vars[ $var ]->nocache) {\n            $newVar = new Smarty_Variable();\n            unset($properties[ 'nocache' ]);\n            foreach ($properties as $k => $v) {\n                $newVar->$k = $v;\n            }\n            $tpl->tpl_vars[ $var ] = $newVar;\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_tplfunction.php",
    "content": "<?php\n\n/**\n * TplFunction Runtime Methods callTemplateFunction\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n **/\nclass Smarty_Internal_Runtime_TplFunction\n{\n    /**\n     * Call template function\n     *\n     * @param \\Smarty_Internal_Template $tpl     template object\n     * @param string                    $name    template function name\n     * @param array                     $params  parameter array\n     * @param bool                      $nocache true if called nocache\n     *\n     * @throws \\SmartyException\n     */\n    public function callTemplateFunction(Smarty_Internal_Template $tpl, $name, $params, $nocache)\n    {\n        $funcParam = isset($tpl->tplFunctions[ $name ]) ? $tpl->tplFunctions[ $name ] :\n            (isset($tpl->smarty->tplFunctions[ $name ]) ? $tpl->smarty->tplFunctions[ $name ] : null);\n        if (isset($funcParam)) {\n            if (!$tpl->caching || ($tpl->caching && $nocache)) {\n                $function = $funcParam[ 'call_name' ];\n            } else {\n                if (isset($funcParam[ 'call_name_caching' ])) {\n                    $function = $funcParam[ 'call_name_caching' ];\n                } else {\n                    $function = $funcParam[ 'call_name' ];\n                }\n            }\n            if (function_exists($function)) {\n                $this->saveTemplateVariables($tpl, $name);\n                $function ($tpl, $params);\n                $this->restoreTemplateVariables($tpl, $name);\n                return;\n            }\n            // try to load template function dynamically\n            if ($this->addTplFuncToCache($tpl, $name, $function)) {\n                $this->saveTemplateVariables($tpl, $name);\n                $function ($tpl, $params);\n                $this->restoreTemplateVariables($tpl, $name);\n                return;\n            }\n        }\n        throw new SmartyException(\"Unable to find template function '{$name}'\");\n    }\n\n    /**\n     * Register template functions defined by template\n     *\n     * @param \\Smarty|\\Smarty_Internal_Template|\\Smarty_Internal_TemplateBase $obj\n     * @param  array                                                          $tplFunctions source information array of template functions defined in template\n     * @param bool                                                            $override     if true replace existing functions with same name\n     */\n    public function registerTplFunctions(Smarty_Internal_TemplateBase $obj, $tplFunctions, $override = true)\n    {\n        $obj->tplFunctions =\n            $override ? array_merge($obj->tplFunctions, $tplFunctions) : array_merge($tplFunctions, $obj->tplFunctions);\n        // make sure that the template functions are known in parent templates\n        if ($obj->_isSubTpl()) {\n            $obj->smarty->ext->_tplFunction->registerTplFunctions($obj->parent, $tplFunctions, false);\n        } else {\n            $obj->smarty->tplFunctions = $override ? array_merge($obj->smarty->tplFunctions, $tplFunctions) :\n                array_merge($tplFunctions, $obj->smarty->tplFunctions);\n        }\n    }\n\n    /**\n     * Return source parameter array for single or all template functions\n     *\n     * @param \\Smarty_Internal_Template $tpl  template object\n     * @param null|string               $name template function name\n     *\n     * @return array|bool|mixed\n     */\n    public function getTplFunction(Smarty_Internal_Template $tpl, $name = null)\n    {\n        if (isset($name)) {\n            return isset($tpl->tplFunctions[ $name ]) ? $tpl->tplFunctions[ $name ] :\n                (isset($tpl->smarty->tplFunctions[ $name ]) ? $tpl->smarty->tplFunctions[ $name ] : false);\n        } else {\n            return empty($tpl->tplFunctions) ? $tpl->smarty->tplFunctions : $tpl->tplFunctions;\n        }\n    }\n\n    /**\n     *\n     * Add template function to cache file for nocache calls\n     *\n     * @param Smarty_Internal_Template $tpl\n     * @param string                   $_name     template function name\n     * @param string                   $_function PHP function name\n     *\n     * @return bool\n     */\n    public function addTplFuncToCache(Smarty_Internal_Template $tpl, $_name, $_function)\n    {\n        $funcParam = $tpl->tplFunctions[ $_name ];\n        if (is_file($funcParam[ 'compiled_filepath' ])) {\n            // read compiled file\n            $code = file_get_contents($funcParam[ 'compiled_filepath' ]);\n            // grab template function\n            if (preg_match(\"/\\/\\* {$_function} \\*\\/([\\S\\s]*?)\\/\\*\\/ {$_function} \\*\\//\", $code, $match)) {\n                // grab source info from file dependency\n                preg_match(\"/\\s*'{$funcParam['uid']}'([\\S\\s]*?)\\),/\", $code, $match1);\n                unset($code);\n                // make PHP function known\n                eval($match[ 0 ]);\n                if (function_exists($_function)) {\n                    // search cache file template\n                    $tplPtr = $tpl;\n                    while (!isset($tplPtr->cached) && isset($tplPtr->parent)) {\n                        $tplPtr = $tplPtr->parent;\n                    }\n                    // add template function code to cache file\n                    if (isset($tplPtr->cached)) {\n                        $content = $tplPtr->cached->read($tplPtr);\n                        if ($content) {\n                            // check if we must update file dependency\n                            if (!preg_match(\"/'{$funcParam['uid']}'(.*?)'nocache_hash'/\", $content, $match2)) {\n                                $content = preg_replace(\"/('file_dependency'(.*?)\\()/\", \"\\\\1{$match1[0]}\", $content);\n                            }\n                            $tplPtr->smarty->ext->_updateCache->write($tplPtr,\n                                                                      preg_replace('/\\s*\\?>\\s*$/', \"\\n\", $content) .\n                                                                      \"\\n\" . preg_replace(array('/^\\s*<\\?php\\s+/',\n                                                                                                '/\\s*\\?>\\s*$/',), \"\\n\",\n                                                                                          $match[ 0 ]));\n                        }\n                    }\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Save current template variables on stack\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  string                   $name stack name\n     */\n    public function saveTemplateVariables(Smarty_Internal_Template $tpl, $name)\n    {\n        $tpl->_cache[ 'varStack' ][] =\n            array('tpl' => $tpl->tpl_vars, 'config' => $tpl->config_vars, 'name' => \"_tplFunction_{$name}\");\n    }\n\n    /**\n     * Restore saved variables into template objects\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  string                   $name stack name\n     */\n    public function restoreTemplateVariables(Smarty_Internal_Template $tpl, $name)\n    {\n        if (isset($tpl->_cache[ 'varStack' ])) {\n            $vars = array_pop($tpl->_cache[ 'varStack' ]);\n            $tpl->tpl_vars = $vars[ 'tpl' ];\n            $tpl->config_vars = $vars[ 'config' ];\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_updatecache.php",
    "content": "<?php\n\n/**\n * Inline Runtime Methods render, setSourceByUid, setupSubTemplate\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n **/\nclass Smarty_Internal_Runtime_UpdateCache\n{\n    /**\n     * check client side cache\n     *\n     * @param \\Smarty_Template_Cached  $cached\n     * @param Smarty_Internal_Template $_template\n     * @param  string                  $content\n     */\n    public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)\n    {\n    }\n\n    /**\n     * Cache was invalid , so render from compiled and write to cache\n     *\n     * @param \\Smarty_Template_Cached   $cached\n     * @param \\Smarty_Internal_Template $_template\n     * @param                           $no_output_filter\n     *\n     * @throws \\Exception\n     */\n    public function updateCache(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $no_output_filter)\n    {\n        ob_start();\n        if (!isset($_template->compiled)) {\n            $_template->loadCompiled();\n        }\n        $_template->compiled->render($_template);\n        if ($_template->smarty->debugging) {\n            $_template->smarty->_debug->start_cache($_template);\n        }\n        $this->removeNoCacheHash($cached, $_template, $no_output_filter);\n        $compile_check = (int)$_template->compile_check;\n        $_template->compile_check = Smarty::COMPILECHECK_OFF;\n        if ($_template->_isSubTpl()) {\n            $_template->compiled->unifunc = $_template->parent->compiled->unifunc;\n        }\n        if (!$_template->cached->processed) {\n            $_template->cached->process($_template, true);\n        }\n        $_template->compile_check = $compile_check;\n        $cached->getRenderedTemplateCode($_template);\n        if ($_template->smarty->debugging) {\n            $_template->smarty->_debug->end_cache($_template);\n        }\n    }\n\n    /**\n     * Sanitize content and write it to cache resource\n     *\n     * @param \\Smarty_Template_Cached  $cached\n     * @param Smarty_Internal_Template $_template\n     * @param bool                     $no_output_filter\n     *\n     * @throws \\SmartyException\n     */\n    public function removeNoCacheHash(Smarty_Template_Cached $cached,\n                                      Smarty_Internal_Template $_template,\n                                      $no_output_filter)\n    {\n        $php_pattern = '/(<%|%>|<\\?php|<\\?|\\?>|<script\\s+language\\s*=\\s*[\\\"\\']?\\s*php\\s*[\\\"\\']?\\s*>)/';\n        $content = ob_get_clean();\n        $hash_array = $cached->hashes;\n        $hash_array[$_template->compiled->nocache_hash] = true;\n        $hash_array = array_keys($hash_array);\n        $nocache_hash = '(' . implode('|', $hash_array) . ')';\n        $_template->cached->has_nocache_code = false;\n        // get text between non-cached items\n        $cache_split =\n            preg_split(\"!/\\*%%SmartyNocache:{$nocache_hash}%%\\*\\/(.+?)/\\*/%%SmartyNocache:{$nocache_hash}%%\\*/!s\",\n                       $content);\n        // get non-cached items\n        preg_match_all(\"!/\\*%%SmartyNocache:{$nocache_hash}%%\\*\\/(.+?)/\\*/%%SmartyNocache:{$nocache_hash}%%\\*/!s\",\n                       $content,\n                       $cache_parts);\n        $content = '';\n        // loop over items, stitch back together\n        foreach ($cache_split as $curr_idx => $curr_split) {\n            if (preg_match($php_pattern, $curr_split)) {\n                // escape PHP tags in template content\n                $php_split = preg_split($php_pattern,\n                                        $curr_split);\n                preg_match_all($php_pattern,\n                               $curr_split,\n                               $php_parts);\n                foreach ($php_split as $idx_php => $curr_php) {\n                    $content .= $curr_php;\n                    if (isset($php_parts[ 0 ][ $idx_php ])) {\n                        $content .= \"<?php echo '{$php_parts[ 1 ][ $idx_php ]}'; ?>\\n\";\n                    }\n                }\n            } else {\n                $content .= $curr_split;\n            }\n            if (isset($cache_parts[ 0 ][ $curr_idx ])) {\n                $_template->cached->has_nocache_code = true;\n                $content .= $cache_parts[ 2 ][ $curr_idx ];\n            }\n        }\n        if (!$no_output_filter && !$_template->cached->has_nocache_code &&\n            (isset($_template->smarty->autoload_filters[ 'output' ]) ||\n             isset($_template->smarty->registered_filters[ 'output' ]))\n        ) {\n            $content = $_template->smarty->ext->_filterHandler->runFilter('output', $content, $_template);\n        }\n        // write cache file content\n        $this->writeCachedContent($_template, $content);\n    }\n\n    /**\n     * Writes the content to cache resource\n     *\n     * @param Smarty_Internal_Template $_template\n     * @param string                   $content\n     *\n     * @return bool\n     */\n    public function writeCachedContent(Smarty_Internal_Template $_template, $content)\n    {\n        if ($_template->source->handler->recompiled || !$_template->caching\n        ) {\n            // don't write cache file\n            return false;\n        }\n        if (!isset($_template->cached)) {\n            $_template->loadCached();\n        }\n        $content = $_template->smarty->ext->_codeFrame->create($_template, $content, '', true);\n        return $this->write($_template, $content);\n    }\n\n    /**\n     * Write this cache object to handler\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param string                   $content   content to cache\n     *\n     * @return bool success\n     */\n    public function write(Smarty_Internal_Template $_template, $content)\n    {\n        if (!$_template->source->handler->recompiled) {\n            $cached = $_template->cached;\n            if ($cached->handler->writeCachedContent($_template, $content)) {\n                $cached->content = null;\n                $cached->timestamp = time();\n                $cached->exists = true;\n                $cached->valid = true;\n                $cached->cache_lifetime = $_template->cache_lifetime;\n                $cached->processed = false;\n                if ($_template->smarty->cache_locking) {\n                    $cached->handler->releaseLock($_template->smarty, $cached);\n                }\n\n                return true;\n            }\n            $cached->content = null;\n            $cached->timestamp = false;\n            $cached->exists = false;\n            $cached->valid = false;\n            $cached->processed = false;\n        }\n\n        return false;\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_updatescope.php",
    "content": "<?php\n\n/**\n * Runtime Extension updateScope\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n *\n **/\nclass Smarty_Internal_Runtime_UpdateScope\n{\n\n    /**\n     * Update new assigned template or config variable in other effected scopes\n     *\n     * @param Smarty_Internal_Template $tpl     data object\n     * @param string|null              $varName variable name\n     * @param int                      $tagScope   tag scope to which bubble up variable value\n     *\n     */\n    public function _updateScope(Smarty_Internal_Template $tpl, $varName, $tagScope = 0)\n    {\n        if ($tagScope) {\n            $this->_updateVarStack($tpl, $varName);\n            $tagScope = $tagScope & ~Smarty::SCOPE_LOCAL;\n            if (!$tpl->scope && !$tagScope) return;\n        }\n        $mergedScope = $tagScope | $tpl->scope;\n        if ($mergedScope) {\n            if ($mergedScope & Smarty::SCOPE_GLOBAL && $varName) {\n                Smarty::$global_tpl_vars[ $varName ] = $tpl->tpl_vars[ $varName ];\n            }\n            // update scopes\n            foreach ($this->_getAffectedScopes($tpl, $mergedScope) as $ptr) {\n                $this->_updateVariableInOtherScope($ptr->tpl_vars, $tpl, $varName);\n                if($tagScope && $ptr->_isTplObj() && isset($tpl->_cache[ 'varStack' ])) {\n                    $this->_updateVarStack($ptr, $varName);              }\n            }\n        }\n    }\n\n    /**\n     * Get array of objects which needs to be updated  by given scope value\n     *\n     * @param Smarty_Internal_Template $tpl\n     * @param int                      $mergedScope merged tag and template scope to which bubble up variable value\n     *\n     * @return array\n     */\n    public function _getAffectedScopes(Smarty_Internal_Template $tpl, $mergedScope)\n    {\n        $_stack = array();\n        $ptr = $tpl->parent;\n        if ($mergedScope && isset($ptr) && $ptr->_isTplObj()) {\n            $_stack[] = $ptr;\n            $mergedScope = $mergedScope & ~Smarty::SCOPE_PARENT;\n            if (!$mergedScope) {\n                // only parent was set, we are done\n                return $_stack;\n            }\n            $ptr = $ptr->parent;\n        }\n        while (isset($ptr) && $ptr->_isTplObj()) {\n                $_stack[] = $ptr;\n             $ptr = $ptr->parent;\n        }\n        if ($mergedScope & Smarty::SCOPE_SMARTY) {\n            if (isset($tpl->smarty)) {\n                $_stack[] = $tpl->smarty;\n            }\n        } elseif ($mergedScope & Smarty::SCOPE_ROOT) {\n            while (isset($ptr)) {\n                if (!$ptr->_isTplObj()) {\n                    $_stack[] = $ptr;\n                    break;\n                }\n                $ptr = $ptr->parent;\n            }\n        }\n        return $_stack;\n    }\n\n    /**\n     * Update variable in other scope\n     *\n     * @param array     $tpl_vars template variable array\n     * @param \\Smarty_Internal_Template $from\n     * @param string               $varName variable name\n     */\n    public function _updateVariableInOtherScope(&$tpl_vars, Smarty_Internal_Template $from, $varName)\n    {\n        if (!isset($tpl_vars[ $varName ])) {\n            $tpl_vars[ $varName ] = clone $from->tpl_vars[ $varName ];\n        } else {\n            $tpl_vars[ $varName ] = clone $tpl_vars[ $varName ];\n            $tpl_vars[ $varName ]->value = $from->tpl_vars[ $varName ]->value;\n        }\n    }\n\n    /**\n     * Update variable in template local variable stack\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param string|null               $varName variable name or null for config variables\n     */\n    public function _updateVarStack(Smarty_Internal_Template $tpl, $varName)\n    {\n        $i = 0;\n        while (isset($tpl->_cache[ 'varStack' ][ $i ])) {\n            $this->_updateVariableInOtherScope($tpl->_cache[ 'varStack' ][ $i ][ 'tpl' ], $tpl, $varName);\n            $i ++;\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_runtime_writefile.php",
    "content": "<?php\n/**\n * Smarty write file plugin\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Monte Ohrt\n */\n/**\n * Smarty Internal Write File Class\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n */\nclass Smarty_Internal_Runtime_WriteFile\n{\n    /**\n     * Writes file in a safe way to disk\n     *\n     * @param  string $_filepath complete filepath\n     * @param  string $_contents file content\n     * @param  Smarty $smarty    smarty instance\n     *\n     * @throws SmartyException\n     * @return boolean true\n     */\n    public function writeFile($_filepath, $_contents, Smarty $smarty)\n    {\n        $_error_reporting = error_reporting();\n        error_reporting($_error_reporting & ~E_NOTICE & ~E_WARNING);\n        $_file_perms = property_exists($smarty, '_file_perms') ? $smarty->_file_perms : 0644;\n        $_dir_perms =\n            property_exists($smarty, '_dir_perms') ? (isset($smarty->_dir_perms) ? $smarty->_dir_perms : 0777) : 0771;\n        if ($_file_perms !== null) {\n            $old_umask = umask(0);\n        }\n        $_dirpath = dirname($_filepath);\n        // if subdirs, create dir structure\n        if ($_dirpath !== '.') {\n            $i = 0;\n            // loop if concurrency problem occurs\n            // see https://bugs.php.net/bug.php?id=35326\n            while (!is_dir($_dirpath)) {\n                if (@mkdir($_dirpath, $_dir_perms, true)) {\n                    break;\n                }\n                clearstatcache();\n                if (++$i === 3) {\n                    error_reporting($_error_reporting);\n                    throw new SmartyException(\"unable to create directory {$_dirpath}\");\n                }\n                sleep(1);\n            }\n        }\n        // write to tmp file, then move to overt file lock race condition\n        $_tmp_file = $_dirpath . DIRECTORY_SEPARATOR . str_replace(array('.', ','), '_', uniqid('wrt', true));\n        if (!file_put_contents($_tmp_file, $_contents)) {\n            error_reporting($_error_reporting);\n            throw new SmartyException(\"unable to write file {$_tmp_file}\");\n        }\n        /*\n         * Windows' rename() fails if the destination exists,\n         * Linux' rename() properly handles the overwrite.\n         * Simply unlink()ing a file might cause other processes\n         * currently reading that file to fail, but linux' rename()\n         * seems to be smart enough to handle that for us.\n         */\n        if (Smarty::$_IS_WINDOWS) {\n            // remove original file\n            if (is_file($_filepath)) {\n                @unlink($_filepath);\n            }\n            // rename tmp file\n            $success = @rename($_tmp_file, $_filepath);\n        } else {\n            // rename tmp file\n            $success = @rename($_tmp_file, $_filepath);\n            if (!$success) {\n                // remove original file\n                if (is_file($_filepath)) {\n                    @unlink($_filepath);\n                }\n                // rename tmp file\n                $success = @rename($_tmp_file, $_filepath);\n            }\n        }\n        if (!$success) {\n            error_reporting($_error_reporting);\n            throw new SmartyException(\"unable to write file {$_filepath}\");\n        }\n        if ($_file_perms !== null) {\n            // set file permissions\n            chmod($_filepath, $_file_perms);\n            umask($old_umask);\n        }\n        error_reporting($_error_reporting);\n        return true;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_smartytemplatecompiler.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Smarty Template Compiler Base\n * This file contains the basic classes and methods for compiling Smarty templates with lexer/parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Class SmartyTemplateCompiler\n *\n * @package    Smarty\n * @subpackage Compiler\n */\nclass Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCompilerBase\n{\n    /**\n     * Lexer class name\n     *\n     * @var string\n     */\n    public $lexer_class;\n\n    /**\n     * Parser class name\n     *\n     * @var string\n     */\n    public $parser_class;\n\n    /**\n     * array of vars which can be compiled in local scope\n     *\n     * @var array\n     */\n    public $local_var = array();\n\n    /**\n     * array of callbacks called when the normal compile process of template is finished\n     *\n     * @var array\n     */\n    public $postCompileCallbacks = array();\n\n    /**\n     * prefix code\n     *\n     * @var string\n     */\n    public $prefixCompiledCode = '';\n\n    /**\n     * postfix code\n     *\n     * @var string\n     */\n    public $postfixCompiledCode = '';\n\n    /**\n     * Initialize compiler\n     *\n     * @param string $lexer_class  class name\n     * @param string $parser_class class name\n     * @param Smarty $smarty       global instance\n     */\n    public function __construct($lexer_class, $parser_class, Smarty $smarty)\n    {\n        parent::__construct($smarty);\n        // get required plugins\n        $this->lexer_class = $lexer_class;\n        $this->parser_class = $parser_class;\n    }\n\n    /**\n     * method to compile a Smarty template\n     *\n     * @param  mixed $_content template source\n     * @param bool   $isTemplateSource\n     *\n     * @return bool true if compiling succeeded, false if it failed\n     * @throws \\SmartyCompilerException\n     */\n    protected function doCompile($_content, $isTemplateSource = false)\n    {\n        /* here is where the compiling takes place. Smarty\n          tags in the templates are replaces with PHP code,\n          then written to compiled files. */\n        // init the lexer/parser to compile the template\n        $this->parser =\n            new $this->parser_class(new $this->lexer_class(str_replace(array(\"\\r\\n\",\n                                                                             \"\\r\"), \"\\n\", $_content), $this),\n                                    $this);\n        if ($isTemplateSource && $this->template->caching) {\n            $this->parser->insertPhpCode(\"<?php\\n\\$_smarty_tpl->compiled->nocache_hash = '{$this->nocache_hash}';\\n?>\\n\");\n        }\n        if (function_exists('mb_internal_encoding')\n            && function_exists('ini_get')\n            && ((int) ini_get('mbstring.func_overload')) & 2\n        ) {\n            $mbEncoding = mb_internal_encoding();\n            mb_internal_encoding('ASCII');\n        } else {\n            $mbEncoding = null;\n        }\n\n        if ($this->smarty->_parserdebug) {\n            $this->parser->PrintTrace();\n            $this->parser->lex->PrintTrace();\n        }\n        // get tokens from lexer and parse them\n        while ($this->parser->lex->yylex()) {\n            if ($this->smarty->_parserdebug) {\n                echo \"<pre>Line {$this->parser->lex->line} Parsing  {$this->parser->yyTokenName[$this->parser->lex->token]} Token \" .\n                     htmlentities($this->parser->lex->value) . \"</pre>\";\n            }\n            $this->parser->doParse($this->parser->lex->token, $this->parser->lex->value);\n        }\n\n        // finish parsing process\n        $this->parser->doParse(0, 0);\n        if ($mbEncoding) {\n            mb_internal_encoding($mbEncoding);\n        }\n        // check for unclosed tags\n        if (count($this->_tag_stack) > 0) {\n            // get stacked info\n            list($openTag, $_data) = array_pop($this->_tag_stack);\n            $this->trigger_template_error(\"unclosed {$this->smarty->left_delimiter}\" . $openTag .\n                                          \"{$this->smarty->right_delimiter} tag\");\n        }\n        // call post compile callbacks\n        foreach ($this->postCompileCallbacks as $cb) {\n            $parameter = $cb;\n            $parameter[ 0 ] = $this;\n            call_user_func_array($cb[ 0 ], $parameter);\n        }\n        // return compiled code\n        return $this->prefixCompiledCode . $this->parser->retvalue . $this->postfixCompiledCode;\n    }\n\n    /**\n     * Register a post compile callback\n     * - when the callback is called after template compiling the compiler object will be inserted as first parameter\n     *\n     * @param callback $callback\n     * @param array    $parameter optional parameter array\n     * @param string   $key       optional key for callback\n     * @param bool     $replace   if true replace existing keyed callback\n     *\n     */\n    public function registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)\n    {\n        array_unshift($parameter, $callback);\n        if (isset($key)) {\n            if ($replace || !isset($this->postCompileCallbacks[ $key ])) {\n                $this->postCompileCallbacks[ $key ] = $parameter;\n            }\n        } else {\n            $this->postCompileCallbacks[] = $parameter;\n        }\n    }\n\n    /**\n     * Remove a post compile callback\n     *\n     * @param string $key callback key\n     */\n    public function unregisterPostCompileCallback($key)\n    {\n        unset($this->postCompileCallbacks[ $key ]);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_template.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Template\n * This file contains the Smarty template engine\n *\n * @package    Smarty\n * @subpackage Template\n * @author     Uwe Tews\n */\n\n/**\n * Main class with template data structures and methods\n *\n * @package    Smarty\n * @subpackage Template\n *\n * @property Smarty_Template_Compiled             $compiled\n * @property Smarty_Template_Cached               $cached\n * @property Smarty_Internal_TemplateCompilerBase $compiler\n * @property mixed|\\Smarty_Template_Cached        registered_plugins\n *\n * The following methods will be dynamically loaded by the extension handler when they are called.\n * They are located in a corresponding Smarty_Internal_Method_xxxx class\n *\n * @method bool mustCompile()\n */\nclass Smarty_Internal_Template extends Smarty_Internal_TemplateBase\n{\n    /**\n     * This object type (Smarty = 1, template = 2, data = 4)\n     *\n     * @var int\n     */\n    public $_objType = 2;\n\n    /**\n     * Global smarty instance\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n\n    /**\n     * Source instance\n     *\n     * @var Smarty_Template_Source|Smarty_Template_Config\n     */\n    public $source = null;\n\n    /**\n     * Inheritance runtime extension\n     *\n     * @var Smarty_Internal_Runtime_Inheritance\n     */\n    public $inheritance = null;\n\n    /**\n     * Template resource\n     *\n     * @var string\n     */\n    public $template_resource = null;\n\n    /**\n     * flag if compiled template is invalid and must be (re)compiled\n     *\n     * @var bool\n     */\n    public $mustCompile = null;\n\n    /**\n     * Template Id\n     *\n     * @var null|string\n     */\n    public $templateId = null;\n\n    /**\n     * Scope in which variables shall be assigned\n     *\n     * @var int\n     */\n    public $scope = 0;\n\n    /**\n     * Flag which is set while rending a cache file\n     *\n     * @var bool\n     */\n    public $isRenderingCache = false;\n\n    /**\n     * Callbacks called before rendering template\n     *\n     * @var callback[]\n     */\n    public $startRenderCallbacks = array();\n\n    /**\n     * Callbacks called after rendering template\n     *\n     * @var callback[]\n     */\n    public $endRenderCallbacks = array();\n\n    /**\n     * Template object cache\n     *\n     * @var Smarty_Internal_Template[]\n     */\n    public static $tplObjCache = array();\n\n    /**\n     * Template object cache for Smarty::isCached() === true\n     *\n     * @var Smarty_Internal_Template[]\n     */\n    public static $isCacheTplObj = array();\n\n    /**\n     * Sub template Info Cache\n     * - index name\n     * - value use count\n     *\n     * @var int[]\n     */\n    public static $subTplInfo = array();\n\n    /**\n     * Create template data object\n     * Some of the global Smarty settings copied to template scope\n     * It load the required template resources and caching plugins\n     *\n     * @param string                                                       $template_resource template resource string\n     * @param Smarty                                                       $smarty            Smarty instance\n     * @param null|\\Smarty_Internal_Template|\\Smarty|\\Smarty_Internal_Data $_parent           back pointer to parent object\n     *                                                                                        with variables or null\n     * @param mixed                                                        $_cache_id         cache   id or null\n     * @param mixed                                                        $_compile_id       compile id or null\n     * @param bool|int|null                                                $_caching          use caching?\n     * @param int|null                                                     $_cache_lifetime   cache life-time in seconds\n     * @param bool                                                         $_isConfig\n     *\n     * @throws \\SmartyException\n     */\n    public function __construct($template_resource, Smarty $smarty, Smarty_Internal_Data $_parent = null,\n                                $_cache_id = null, $_compile_id = null, $_caching = null, $_cache_lifetime = null,\n                                $_isConfig = false)\n    {\n        $this->smarty = $smarty;\n        // Smarty parameter\n        $this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id;\n        $this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id;\n        $this->caching = (int)($_caching === null ? $this->smarty->caching : $_caching);\n        $this->cache_lifetime = $_cache_lifetime === null ? $this->smarty->cache_lifetime : $_cache_lifetime;\n        $this->compile_check = (int)$smarty->compile_check;\n        $this->parent = $_parent;\n        // Template resource\n        $this->template_resource = $template_resource;\n        $this->source = $_isConfig ? Smarty_Template_Config::load($this) : Smarty_Template_Source::load($this);\n        parent::__construct();\n        if ($smarty->security_policy && method_exists($smarty->security_policy, 'registerCallBacks')) {\n            $smarty->security_policy->registerCallBacks($this);\n        }\n    }\n\n    /**\n     * render template\n     *\n     * @param  bool      $no_output_filter if true do not run output filter\n     * @param  null|bool $display          true: display, false: fetch null: sub-template\n     *\n     * @return string\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function render($no_output_filter = true, $display = null)\n    {\n        if ($this->smarty->debugging) {\n            if (!isset($this->smarty->_debug)) {\n                $this->smarty->_debug = new Smarty_Internal_Debug();\n            }\n            $this->smarty->_debug->start_template($this, $display);\n        }\n        // checks if template exists\n        if (!$this->source->exists) {\n            throw new SmartyException(\"Unable to load template '{$this->source->type}:{$this->source->name}'\" .\n                                      ($this->_isSubTpl() ? \" in '{$this->parent->template_resource}'\" : ''));\n        }\n        // disable caching for evaluated code\n        if ($this->source->handler->recompiled) {\n            $this->caching = Smarty::CACHING_OFF;\n        }\n        // read from cache or render\n        if ($this->caching === Smarty::CACHING_LIFETIME_CURRENT || $this->caching === Smarty::CACHING_LIFETIME_SAVED) {\n            if (!isset($this->cached) || $this->cached->cache_id !== $this->cache_id ||\n                $this->cached->compile_id !== $this->compile_id\n            ) {\n                $this->loadCached(true);\n            }\n            $this->cached->render($this, $no_output_filter);\n        } else {\n            if (!isset($this->compiled) || $this->compiled->compile_id !== $this->compile_id) {\n                $this->loadCompiled(true);\n            }\n            $this->compiled->render($this);\n        }\n\n        // display or fetch\n        if ($display) {\n            if ($this->caching && $this->smarty->cache_modified_check) {\n                $this->smarty->ext->_cacheModify->cacheModifiedCheck($this->cached, $this,\n                                                                     isset($content) ? $content : ob_get_clean());\n            } else {\n                if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) &&\n                    !$no_output_filter && (isset($this->smarty->autoload_filters[ 'output' ]) ||\n                                           isset($this->smarty->registered_filters[ 'output' ]))\n                ) {\n                    echo $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this);\n                } else {\n                    echo ob_get_clean();\n                }\n            }\n            if ($this->smarty->debugging) {\n                $this->smarty->_debug->end_template($this);\n                // debug output\n                $this->smarty->_debug->display_debug($this, true);\n            }\n            return '';\n        } else {\n            if ($this->smarty->debugging) {\n                $this->smarty->_debug->end_template($this);\n                if ($this->smarty->debugging === 2 && $display === false) {\n                    $this->smarty->_debug->display_debug($this, true);\n                }\n            }\n            if (!$no_output_filter &&\n                (!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) &&\n                (isset($this->smarty->autoload_filters[ 'output' ]) ||\n                 isset($this->smarty->registered_filters[ 'output' ]))\n            ) {\n                return $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this);\n            }\n            // return cache content\n            return null;\n        }\n    }\n\n    /**\n     * Runtime function to render sub-template\n     *\n     * @param string  $template       template name\n     * @param mixed   $cache_id       cache id\n     * @param mixed   $compile_id     compile id\n     * @param integer $caching        cache mode\n     * @param integer $cache_lifetime life time of cache data\n     * @param array   $data           passed parameter template variables\n     * @param int     $scope          scope in which {include} should execute\n     * @param bool    $forceTplCache  cache template object\n     * @param string  $uid            file dependency uid\n     * @param string  $content_func   function name\n     *\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function _subTemplateRender($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $scope,\n                                       $forceTplCache, $uid = null, $content_func = null)\n    {\n        $tpl = clone $this;\n        $tpl->parent = $this;\n        $smarty = &$this->smarty;\n        $_templateId = $smarty->_getTemplateId($template, $cache_id, $compile_id, $caching, $tpl);\n        // recursive call ?\n        if (isset($tpl->templateId) ? $tpl->templateId : $tpl->_getTemplateId() !== $_templateId) {\n            // already in template cache?\n            if (isset(self::$tplObjCache[ $_templateId ])) {\n                // copy data from cached object\n                $cachedTpl = &self::$tplObjCache[ $_templateId ];\n                $tpl->templateId = $cachedTpl->templateId;\n                $tpl->template_resource = $cachedTpl->template_resource;\n                $tpl->cache_id = $cachedTpl->cache_id;\n                $tpl->compile_id = $cachedTpl->compile_id;\n                $tpl->source = $cachedTpl->source;\n                if (isset($cachedTpl->compiled)) {\n                    $tpl->compiled = $cachedTpl->compiled;\n                } else {\n                    unset($tpl->compiled);\n                }\n                if ($caching !== 9999 && isset($cachedTpl->cached)) {\n                    $tpl->cached = $cachedTpl->cached;\n                } else {\n                    unset($tpl->cached);\n                }\n            } else {\n                $tpl->templateId = $_templateId;\n                $tpl->template_resource = $template;\n                $tpl->cache_id = $cache_id;\n                $tpl->compile_id = $compile_id;\n                if (isset($uid)) {\n                    // for inline templates we can get all resource information from file dependency\n                    list($filepath, $timestamp, $type) = $tpl->compiled->file_dependency[ $uid ];\n                    $tpl->source = new Smarty_Template_Source($smarty, $filepath, $type, $filepath);\n                    $tpl->source->filepath = $filepath;\n                    $tpl->source->timestamp = $timestamp;\n                    $tpl->source->exists = true;\n                    $tpl->source->uid = $uid;\n                } else {\n                    $tpl->source = Smarty_Template_Source::load($tpl);\n                    unset($tpl->compiled);\n                }\n                if ($caching !== 9999) {\n                    unset($tpl->cached);\n                }\n            }\n        } else {\n            // on recursive calls force caching\n            $forceTplCache = true;\n        }\n        $tpl->caching = $caching;\n        $tpl->cache_lifetime = $cache_lifetime;\n        // set template scope\n        $tpl->scope = $scope;\n        if (!isset(self::$tplObjCache[ $tpl->templateId ]) && !$tpl->source->handler->recompiled) {\n            // check if template object should be cached\n            if ($forceTplCache || (isset(self::$subTplInfo[ $tpl->template_resource ]) &&\n                                   self::$subTplInfo[ $tpl->template_resource ] > 1) ||\n                ($tpl->_isSubTpl() &&  isset(self::$tplObjCache[ $tpl->parent->templateId ]))\n            ) {\n                self::$tplObjCache[ $tpl->templateId ] = $tpl;\n            }\n        }\n\n        if (!empty($data)) {\n            // set up variable values\n            foreach ($data as $_key => $_val) {\n                $tpl->tpl_vars[ $_key ] = new Smarty_Variable($_val, $this->isRenderingCache);\n            }\n        }\n        if ($tpl->caching === 9999) {\n            if (!isset($tpl->compiled)) {\n                $this->loadCompiled(true);\n            }\n            if ($tpl->compiled->has_nocache_code) {\n                $this->cached->hashes[ $tpl->compiled->nocache_hash ] = true;\n            }\n        }\n        $tpl->_cache = array();\n        if (isset($uid)) {\n            if ($smarty->debugging) {\n                if (!isset($smarty->_debug)) {\n                    $smarty->_debug = new Smarty_Internal_Debug();\n                }\n                $smarty->_debug->start_template($tpl);\n                $smarty->_debug->start_render($tpl);\n            }\n            $tpl->compiled->getRenderedTemplateCode($tpl, $content_func);\n            if ($smarty->debugging) {\n                $smarty->_debug->end_template($tpl);\n                $smarty->_debug->end_render($tpl);\n            }\n        } else {\n            if (isset($tpl->compiled)) {\n                $tpl->compiled->render($tpl);\n            } else {\n                $tpl->render();\n            }\n        }\n    }\n\n    /**\n     * Get called sub-templates and save call count\n     *\n     */\n    public function _subTemplateRegister()\n    {\n        foreach ($this->compiled->includes as $name => $count) {\n            if (isset(self::$subTplInfo[ $name ])) {\n                self::$subTplInfo[ $name ] += $count;\n            } else {\n                self::$subTplInfo[ $name ] = $count;\n            }\n        }\n    }\n\n    /**\n     * Check if this is a sub template\n     *\n     * @return bool true is sub template\n     */\n    public function _isSubTpl()\n    {\n        return isset($this->parent) && $this->parent->_isTplObj();\n    }\n\n    /**\n     * Assign variable in scope\n     *\n     * @param string $varName variable name\n     * @param mixed  $value   value\n     * @param bool   $nocache nocache flag\n     * @param int    $scope   scope into which variable shall be assigned\n     *\n     */\n    public function _assignInScope($varName, $value, $nocache = false, $scope = 0)\n    {\n        if (isset($this->tpl_vars[ $varName ])) {\n            $this->tpl_vars[ $varName ] = clone $this->tpl_vars[ $varName ];\n            $this->tpl_vars[ $varName ]->value = $value;\n            if ($nocache || $this->isRenderingCache) {\n                $this->tpl_vars[ $varName ]->nocache = true;\n            }\n        } else {\n            $this->tpl_vars[ $varName ] = new Smarty_Variable($value, $nocache || $this->isRenderingCache);\n        }\n        if ($scope >= 0) {\n            if ($scope > 0 || $this->scope > 0) {\n                $this->smarty->ext->_updateScope->_updateScope($this, $varName, $scope);\n            }\n        }\n    }\n\n    /**\n     * Check if plugins are callable require file otherwise\n     *\n     * @param array $plugins required plugins\n     *\n     * @throws \\SmartyException\n     */\n    public function _checkPlugins($plugins) {\n        static $checked = array();\n        foreach($plugins as $plugin) {\n            $name = join('::', (array)$plugin[ 'function' ]);\n            if (!isset($checked[$name])) {\n                if (!is_callable($plugin['function'])) {\n                    if (is_file($plugin['file'])) {\n                        require_once $plugin['file'];\n                        if (is_callable($plugin['function'])) {\n                            $checked[ $name ] = true;\n                        }\n                    }\n                } else {\n                    $checked[ $name ] = true;\n                }\n            }\n            if (!isset($checked[ $name ])) {\n                if (false !== $this->smarty->loadPlugin($name)) {\n                    $checked[ $name ] = true;\n                } else {\n                    throw new SmartyException(\"Plugin '{$name}' not callable\");\n                }\n            }\n        }\n    }\n\n    /**\n     * This function is executed automatically when a compiled or cached template file is included\n     * - Decode saved properties from compiled template and cache files\n     * - Check if compiled or cache file is valid\n     *\n     * @param \\Smarty_Internal_Template $tpl\n     * @param  array                    $properties special template properties\n     * @param  bool                     $cache      flag if called from cache file\n     *\n     * @return bool flag if compiled or cache file is valid\n     * @throws \\SmartyException\n     */\n    public function _decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)\n    {\n        // on cache resources other than file check version stored in cache code\n        if (!isset($properties[ 'version' ]) || Smarty::SMARTY_VERSION !== $properties[ 'version' ]) {\n            if ($cache) {\n                $tpl->smarty->clearAllCache();\n            } else {\n                $tpl->smarty->clearCompiledTemplate();\n            }\n            return false;\n        }\n        $is_valid = true;\n        if (!empty($properties[ 'file_dependency' ]) &&\n                  ((!$cache && $tpl->compile_check) || $tpl->compile_check === Smarty::COMPILECHECK_ON)\n        ) {\n            // check file dependencies at compiled code\n            foreach ($properties[ 'file_dependency' ] as $_file_to_check) {\n                if ($_file_to_check[ 2 ] === 'file' || $_file_to_check[ 2 ] === 'php') {\n                    if ($tpl->source->filepath === $_file_to_check[ 0 ]) {\n                        // do not recheck current template\n                        continue;\n                        //$mtime = $tpl->source->getTimeStamp();\n                    } else {\n                        // file and php types can be checked without loading the respective resource handlers\n                        $mtime = is_file($_file_to_check[ 0 ]) ? filemtime($_file_to_check[ 0 ]) : false;\n                    }\n                } else {\n                    $handler = Smarty_Resource::load($tpl->smarty, $_file_to_check[ 2 ]);\n                    if ($handler->checkTimestamps()) {\n                        $source = Smarty_Template_Source::load($tpl, $tpl->smarty, $_file_to_check[ 0 ]);\n                        $mtime = $source->getTimeStamp();\n                    } else {\n                        continue;\n                    }\n                }\n                if ($mtime === false || $mtime > $_file_to_check[ 1 ]) {\n                    $is_valid = false;\n                    break;\n                }\n            }\n        }\n        if ($cache) {\n            // CACHING_LIFETIME_SAVED cache expiry has to be validated here since otherwise we'd define the unifunc\n            if ($tpl->caching === Smarty::CACHING_LIFETIME_SAVED && $properties[ 'cache_lifetime' ] >= 0 &&\n                (time() > ($tpl->cached->timestamp + $properties[ 'cache_lifetime' ]))\n            ) {\n                $is_valid = false;\n            }\n            $tpl->cached->cache_lifetime = $properties[ 'cache_lifetime' ];\n            $tpl->cached->valid = $is_valid;\n            $resource = $tpl->cached;\n        } else {\n            $tpl->mustCompile = !$is_valid;\n            $resource = $tpl->compiled;\n            $resource->includes = isset($properties[ 'includes' ]) ? $properties[ 'includes' ] : array();\n        }\n        if ($is_valid) {\n            $resource->unifunc = $properties[ 'unifunc' ];\n            $resource->has_nocache_code = $properties[ 'has_nocache_code' ];\n            //            $tpl->compiled->nocache_hash = $properties['nocache_hash'];\n            $resource->file_dependency = $properties[ 'file_dependency' ];\n        }\n        return $is_valid && !function_exists($properties[ 'unifunc' ]);\n    }\n\n    /**\n     * Compiles the template\n     * If the template is not evaluated the compiled template is saved on disk\n     */\n    public function compileTemplateSource()\n    {\n        return $this->compiled->compileTemplateSource($this);\n    }\n\n    /**\n     * Writes the content to cache resource\n     *\n     * @param string $content\n     *\n     * @return bool\n     */\n    public function writeCachedContent($content)\n    {\n        return $this->smarty->ext->_updateCache->writeCachedContent($this, $content);\n    }\n\n    /**\n     * Get unique template id\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function _getTemplateId()\n    {\n        return isset($this->templateId) ? $this->templateId : $this->templateId =\n            $this->smarty->_getTemplateId($this->template_resource, $this->cache_id, $this->compile_id);\n    }\n\n    /**\n     * runtime error not matching capture tags\n     */\n    public function capture_error()\n    {\n        throw new SmartyException(\"Not matching {capture} open/close in '{$this->template_resource}'\");\n    }\n\n    /**\n     * Load compiled object\n     *\n     * @param bool $force force new compiled object\n     */\n    public function loadCompiled($force = false)\n    {\n        if ($force || !isset($this->compiled)) {\n            $this->compiled = Smarty_Template_Compiled::load($this);\n        }\n    }\n\n    /**\n     * Load cached object\n     *\n     * @param bool $force force new cached object\n     */\n    public function loadCached($force = false)\n    {\n        if ($force || !isset($this->cached)) {\n            $this->cached = Smarty_Template_Cached::load($this);\n        }\n    }\n\n    /**\n     * Load inheritance object\n     *\n     */\n    public function _loadInheritance()\n    {\n        if (!isset($this->inheritance)) {\n            $this->inheritance = new Smarty_Internal_Runtime_Inheritance();\n        }\n    }\n\n    /**\n     * Unload inheritance object\n     *\n     */\n    public function _cleanUp()\n    {\n        $this->startRenderCallbacks = array();\n        $this->endRenderCallbacks = array();\n        $this->inheritance = null;\n    }\n\n    /**\n     * Load compiler object\n     *\n     * @throws \\SmartyException\n     */\n    public function loadCompiler()\n    {\n        if (!class_exists($this->source->compiler_class)) {\n            $this->smarty->loadPlugin($this->source->compiler_class);\n        }\n        $this->compiler =\n            new $this->source->compiler_class($this->source->template_lexer_class, $this->source->template_parser_class,\n                                              $this->smarty);\n    }\n\n    /**\n     * Handle unknown class methods\n     *\n     * @param string $name unknown method-name\n     * @param array  $args argument array\n     *\n     * @return mixed\n     * @throws SmartyException\n     */\n    public function __call($name, $args)\n    {\n        // method of Smarty object?\n        if (method_exists($this->smarty, $name)) {\n            return call_user_func_array(array($this->smarty, $name), $args);\n        }\n        // parent\n        return parent::__call($name, $args);\n    }\n\n    /**\n     * set Smarty property in template context\n     *\n     * @param string $property_name property name\n     * @param mixed  $value         value\n     *\n     * @throws SmartyException\n     */\n    public function __set($property_name, $value)\n    {\n        switch ($property_name) {\n            case 'compiled':\n            case 'cached':\n            case 'compiler':\n                $this->$property_name = $value;\n                return;\n            default:\n                // Smarty property ?\n                if (property_exists($this->smarty, $property_name)) {\n                    $this->smarty->$property_name = $value;\n                    return;\n                }\n        }\n        throw new SmartyException(\"invalid template property '$property_name'.\");\n    }\n\n    /**\n     * get Smarty property in template context\n     *\n     * @param string $property_name property name\n     *\n     * @return mixed|Smarty_Template_Cached\n     * @throws SmartyException\n     */\n    public function __get($property_name)\n    {\n        switch ($property_name) {\n            case 'compiled':\n                $this->loadCompiled();\n                return $this->compiled;\n\n            case 'cached':\n                $this->loadCached();\n                return $this->cached;\n\n            case 'compiler':\n                $this->loadCompiler();\n                return $this->compiler;\n            default:\n                // Smarty property ?\n                if (property_exists($this->smarty, $property_name)) {\n                    return $this->smarty->$property_name;\n                }\n        }\n        throw new SmartyException(\"template property '$property_name' does not exist.\");\n    }\n\n    /**\n     * Template data object destructor\n     */\n    public function __destruct()\n    {\n        if ($this->smarty->cache_locking && isset($this->cached) && $this->cached->is_locked) {\n            $this->cached->handler->releaseLock($this->smarty, $this->cached);\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_templatebase.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Smarty Template  Base\n * This file contains the basic shared methods for template handling\n *\n * @package    Smarty\n * @subpackage Template\n * @author     Uwe Tews\n */\n\n/**\n * Class with shared smarty/template methods\n *\n * @package      Smarty\n * @subpackage   Template\n *\n * @property int $_objType\n *\n * The following methods will be dynamically loaded by the extension handler when they are called.\n * They are located in a corresponding Smarty_Internal_Method_xxxx class\n *\n * @method Smarty_Internal_TemplateBase addAutoloadFilters(mixed $filters, string $type = null)\n * @method Smarty_Internal_TemplateBase addDefaultModifier(mixed $modifiers)\n * @method Smarty_Internal_TemplateBase addLiterals(mixed $literals)\n * @method Smarty_Internal_TemplateBase createData(Smarty_Internal_Data $parent = null, string $name = null)\n * @method array getAutoloadFilters(string $type = null)\n * @method string getDebugTemplate()\n * @method array getDefaultModifier()\n * @method array getLiterals()\n * @method array getTags(mixed $template = null)\n * @method object getRegisteredObject(string $object_name)\n * @method Smarty_Internal_TemplateBase registerCacheResource(string $name, Smarty_CacheResource $resource_handler)\n * @method Smarty_Internal_TemplateBase registerClass(string $class_name, string $class_impl)\n * @method Smarty_Internal_TemplateBase registerDefaultConfigHandler(callback $callback)\n * @method Smarty_Internal_TemplateBase registerDefaultPluginHandler(callback $callback)\n * @method Smarty_Internal_TemplateBase registerDefaultTemplateHandler(callback $callback)\n * @method Smarty_Internal_TemplateBase registerResource(string $name, mixed $resource_handler)\n * @method Smarty_Internal_TemplateBase setAutoloadFilters(mixed $filters, string $type = null)\n * @method Smarty_Internal_TemplateBase setDebugTemplate(string $tpl_name)\n * @method Smarty_Internal_TemplateBase setDefaultModifiers(mixed $modifiers)\n * @method Smarty_Internal_TemplateBase setLiterals(mixed $literals)\n * @method Smarty_Internal_TemplateBase unloadFilter(string $type, string $name)\n * @method Smarty_Internal_TemplateBase unregisterCacheResource(string $name)\n * @method Smarty_Internal_TemplateBase unregisterObject(string $object_name)\n * @method Smarty_Internal_TemplateBase unregisterPlugin(string $type, string $name)\n * @method Smarty_Internal_TemplateBase unregisterFilter(string $type, mixed $callback)\n * @method Smarty_Internal_TemplateBase unregisterResource(string $name)\n */\nabstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data\n{\n    /**\n     * Set this if you want different sets of cache files for the same\n     * templates.\n     *\n     * @var string\n     */\n    public $cache_id = null;\n\n    /**\n     * Set this if you want different sets of compiled files for the same\n     * templates.\n     *\n     * @var string\n     */\n    public $compile_id = null;\n\n    /**\n     * caching enabled\n     *\n     * @var int\n     */\n    public $caching = Smarty::CACHING_OFF;\n\n    /**\n     * check template for modifications?\n     *\n     * @var int\n     */\n    public $compile_check = Smarty::COMPILECHECK_ON;\n\n    /**\n     * cache lifetime in seconds\n     *\n     * @var integer\n     */\n    public $cache_lifetime = 3600;\n\n    /**\n     * Array of source information for known template functions\n     *\n     * @var array\n     */\n    public $tplFunctions = array();\n\n    /**\n     * universal cache\n     *\n     * @var array()\n     */\n    public $_cache = array();\n\n    /**\n     * fetches a rendered Smarty template\n     *\n     * @param  string $template   the resource handle of the template file or template object\n     * @param  mixed  $cache_id   cache id to be used with this template\n     * @param  mixed  $compile_id compile id to be used with this template\n     * @param  object $parent     next higher level of Smarty variables\n     *\n     * @throws Exception\n     * @throws SmartyException\n     * @return string rendered template output\n     */\n    public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null)\n    {\n        $result = $this->_execute($template, $cache_id, $compile_id, $parent, 0);\n        return $result === null ? ob_get_clean() : $result;\n    }\n\n    /**\n     * displays a Smarty template\n     *\n     * @param string $template   the resource handle of the template file or template object\n     * @param mixed  $cache_id   cache id to be used with this template\n     * @param mixed  $compile_id compile id to be used with this template\n     * @param object $parent     next higher level of Smarty variables\n     *\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)\n    {\n        // display template\n        $this->_execute($template, $cache_id, $compile_id, $parent, 1);\n    }\n\n    /**\n     * test if cache is valid\n     *\n     * @api  Smarty::isCached()\n     * @link http://www.smarty.net/docs/en/api.is.cached.tpl\n     *\n     * @param  null|string|\\Smarty_Internal_Template $template   the resource handle of the template file or template object\n     * @param  mixed                                 $cache_id   cache id to be used with this template\n     * @param  mixed                                 $compile_id compile id to be used with this template\n     * @param  object                                $parent     next higher level of Smarty variables\n     *\n     * @return bool cache status\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null)\n    {\n        return $this->_execute($template, $cache_id, $compile_id, $parent, 2);\n    }\n\n    /**\n     * fetches a rendered Smarty template\n     *\n     * @param  string $template   the resource handle of the template file or template object\n     * @param  mixed  $cache_id   cache id to be used with this template\n     * @param  mixed  $compile_id compile id to be used with this template\n     * @param  object $parent     next higher level of Smarty variables\n     * @param  string $function   function type 0 = fetch,  1 = display, 2 = isCache\n     *\n     * @return mixed\n     * @throws \\Exception\n     * @throws \\SmartyException\n     */\n    private function _execute($template, $cache_id, $compile_id, $parent, $function)\n    {\n        $smarty = $this->_getSmartyObj();\n        $saveVars = true;\n        if ($template === null) {\n            if (!$this->_isTplObj()) {\n                throw new SmartyException($function . '():Missing \\'$template\\' parameter');\n            } else {\n                $template = $this;\n            }\n        } elseif (is_object($template)) {\n            /* @var Smarty_Internal_Template $template */\n            if (!isset($template->_objType) || !$template->_isTplObj()) {\n                throw new SmartyException($function . '():Template object expected');\n            }\n        } else {\n            // get template object\n            $saveVars = false;\n\n            $template = $smarty->createTemplate($template, $cache_id, $compile_id, $parent ? $parent : $this, false);\n            if ($this->_objType === 1) {\n                // set caching in template object\n                $template->caching = $this->caching;\n            }\n        }\n        // make sure we have integer values\n        $template->caching = (int)$template->caching;\n        // fetch template content\n        $level = ob_get_level();\n        try {\n            $_smarty_old_error_level =\n                isset($smarty->error_reporting) ? error_reporting($smarty->error_reporting) : null;\n            if ($this->_objType === 2) {\n                /* @var Smarty_Internal_Template $this */\n                $template->tplFunctions = $this->tplFunctions;\n                $template->inheritance = $this->inheritance;\n            }\n            /* @var Smarty_Internal_Template $parent */\n            if (isset($parent->_objType) && ($parent->_objType === 2) && !empty($parent->tplFunctions)) {\n                $template->tplFunctions = array_merge($parent->tplFunctions, $template->tplFunctions);\n            }\n            if ($function === 2) {\n                if ($template->caching) {\n                    // return cache status of template\n                    if (!isset($template->cached)) {\n                        $template->loadCached();\n                    }\n                    $result = $template->cached->isCached($template);\n                    Smarty_Internal_Template::$isCacheTplObj[ $template->_getTemplateId() ] = $template;\n                } else {\n                    return false;\n                }\n            } else {\n                if ($saveVars) {\n                    $savedTplVars = $template->tpl_vars;\n                    $savedConfigVars = $template->config_vars;\n                }\n                ob_start();\n                $template->_mergeVars();\n                if (!empty(Smarty::$global_tpl_vars)) {\n                    $template->tpl_vars = array_merge(Smarty::$global_tpl_vars, $template->tpl_vars);\n                }\n                $result = $template->render(false, $function);\n                $template->_cleanUp();\n                if ($saveVars) {\n                    $template->tpl_vars = $savedTplVars;\n                    $template->config_vars = $savedConfigVars;\n                } else {\n                    if (!$function && !isset(Smarty_Internal_Template::$tplObjCache[ $template->templateId ])) {\n                        $template->parent = null;\n                        $template->tpl_vars = $template->config_vars = array();\n                        Smarty_Internal_Template::$tplObjCache[ $template->templateId ] = $template;\n                    }\n                }\n            }\n            if (isset($_smarty_old_error_level)) {\n                error_reporting($_smarty_old_error_level);\n            }\n            return $result;\n        }\n        catch (Exception $e) {\n            while (ob_get_level() > $level) {\n                ob_end_clean();\n            }\n            if (isset($_smarty_old_error_level)) {\n                error_reporting($_smarty_old_error_level);\n            }\n            throw $e;\n        }\n    }\n\n    /**\n     * Registers plugin to be used in templates\n     *\n     * @api  Smarty::registerPlugin()\n     * @link http://www.smarty.net/docs/en/api.register.plugin.tpl\n     *\n     * @param  string   $type       plugin type\n     * @param  string   $name       name of template tag\n     * @param  callback $callback   PHP callback to register\n     * @param  bool     $cacheable  if true (default) this function is cache able\n     * @param  mixed    $cache_attr caching attributes if any\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws SmartyException              when the plugin tag is invalid\n     */\n    public function registerPlugin($type, $name, $callback, $cacheable = true, $cache_attr = null)\n    {\n        return $this->ext->registerPlugin->registerPlugin($this, $type, $name, $callback, $cacheable, $cache_attr);\n    }\n\n    /**\n     * load a filter of specified type and name\n     *\n     * @api  Smarty::loadFilter()\n     * @link http://www.smarty.net/docs/en/api.load.filter.tpl\n     *\n     * @param  string $type filter type\n     * @param  string $name filter name\n     *\n     * @return bool\n     * @throws SmartyException if filter could not be loaded\n     */\n    public function loadFilter($type, $name)\n    {\n        return $this->ext->loadFilter->loadFilter($this, $type, $name);\n    }\n\n    /**\n     * Registers a filter function\n     *\n     * @api  Smarty::registerFilter()\n     * @link http://www.smarty.net/docs/en/api.register.filter.tpl\n     *\n     * @param  string      $type filter type\n     * @param  callback    $callback\n     * @param  string|null $name optional filter name\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function registerFilter($type, $callback, $name = null)\n    {\n        return $this->ext->registerFilter->registerFilter($this, $type, $callback, $name);\n    }\n\n    /**\n     * Registers object to be used in templates\n     *\n     * @api  Smarty::registerObject()\n     * @link http://www.smarty.net/docs/en/api.register.object.tpl\n     *\n     * @param  string $object_name\n     * @param  object $object                     the referenced PHP object to register\n     * @param  array  $allowed_methods_properties list of allowed methods (empty = all)\n     * @param  bool   $format                     smarty argument format, else traditional\n     * @param  array  $block_methods              list of block-methods\n     *\n     * @return \\Smarty|\\Smarty_Internal_Template\n     * @throws \\SmartyException\n     */\n    public function registerObject($object_name, $object, $allowed_methods_properties = array(), $format = true,\n                                   $block_methods = array())\n    {\n        return $this->ext->registerObject->registerObject($this, $object_name, $object, $allowed_methods_properties,\n                                                          $format, $block_methods);\n    }\n\n    /**\n     * @param int $compile_check\n     */\n    public function setCompileCheck($compile_check)\n    {\n        $this->compile_check = (int)$compile_check;\n    }\n\n    /**\n     * @param int $caching\n     */\n    public function setCaching($caching)\n    {\n        $this->caching = (int)$caching;\n    }\n\n    /**\n     * @param int $cache_lifetime\n     */\n    public function setCacheLifetime($cache_lifetime)\n    {\n        $this->cache_lifetime = $cache_lifetime;\n    }\n\n    /**\n     * @param string $compile_id\n     */\n    public function setCompileId($compile_id)\n    {\n        $this->compile_id = $compile_id;\n    }\n\n    /**\n     * @param string $cache_id\n     */\n    public function setCacheId($cache_id)\n    {\n        $this->cache_id = $cache_id;\n    }\n\n}\n\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_templatecompilerbase.php",
    "content": "<?php\n/**\n * Smarty Internal Plugin Smarty Template Compiler Base\n * This file contains the basic classes and methods for compiling Smarty templates with lexer/parser\n *\n * @package    Smarty\n * @subpackage Compiler\n * @author     Uwe Tews\n */\n\n/**\n * Main abstract compiler class\n *\n * @package    Smarty\n * @subpackage Compiler\n *\n * @property Smarty_Internal_SmartyTemplateCompiler $prefixCompiledCode  = ''\n * @property Smarty_Internal_SmartyTemplateCompiler $postfixCompiledCode = ''\n * @method registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)\n * @method unregisterPostCompileCallback($key)\n */\nabstract class Smarty_Internal_TemplateCompilerBase\n{\n    /**\n     * compile tag objects cache\n     *\n     * @var array\n     */\n    static $_tag_objects = array();\n    /**\n     * counter for prefix variable number\n     *\n     * @var int\n     */\n    public static $prefixVariableNumber = 0;\n    /**\n     * Smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n    /**\n     * Parser object\n     *\n     * @var Smarty_Internal_Templateparser\n     */\n    public $parser = null;\n    /**\n     * hash for nocache sections\n     *\n     * @var mixed\n     */\n    public $nocache_hash = null;\n    /**\n     * suppress generation of nocache code\n     *\n     * @var bool\n     */\n    public $suppressNocacheProcessing = false;\n\n    /**\n     * caching enabled (copied from template object)\n     *\n     * @var int\n     */\n    public $caching = 0;\n\n    /**\n     * tag stack\n     *\n     * @var array\n     */\n    public $_tag_stack = array();\n    /**\n     * tag stack count\n     *\n     * @var array\n     */\n    public $_tag_stack_count = array();\n    /**\n     * Plugins used by template\n     *\n     * @var array\n     */\n    public $required_plugins = array('compiled' => array(), 'nocache' => array());\n    /**\n     * Required plugins stack\n     *\n     * @var array\n     */\n    public $required_plugins_stack = array();\n    /**\n     * current template\n     *\n     * @var Smarty_Internal_Template\n     */\n    public $template = null;\n    /**\n     * merged included sub template data\n     *\n     * @var array\n     */\n    public $mergedSubTemplatesData = array();\n    /**\n     * merged sub template code\n     *\n     * @var array\n     */\n    public $mergedSubTemplatesCode = array();\n    /**\n     * collected template properties during compilation\n     *\n     * @var array\n     */\n    public $templateProperties = array();\n    /**\n     * source line offset for error messages\n     *\n     * @var int\n     */\n    public $trace_line_offset = 0;\n    /**\n     * trace uid\n     *\n     * @var string\n     */\n    public $trace_uid = '';\n    /**\n     * trace file path\n     *\n     * @var string\n     */\n    public $trace_filepath = '';\n    /**\n     * stack for tracing file and line of nested {block} tags\n     *\n     * @var array\n     */\n    public $trace_stack = array();\n    /**\n     * plugins loaded by default plugin handler\n     *\n     * @var array\n     */\n    public $default_handler_plugins = array();\n    /**\n     * saved preprocessed modifier list\n     *\n     * @var mixed\n     */\n    public $default_modifier_list = null;\n    /**\n     * force compilation of complete template as nocache\n     *\n     * @var boolean\n     */\n    public $forceNocache = false;\n    /**\n     * flag if compiled template file shall we written\n     *\n     * @var bool\n     */\n    public $write_compiled_code = true;\n    /**\n     * Template functions\n     *\n     * @var array\n     */\n    public $tpl_function = array();\n    /**\n     * called sub functions from template function\n     *\n     * @var array\n     */\n    public $called_functions = array();\n    /**\n     * compiled template or block function code\n     *\n     * @var string\n     */\n    public $blockOrFunctionCode = '';\n    /**\n     * php_handling setting either from Smarty or security\n     *\n     * @var int\n     */\n    public $php_handling = 0;\n    /**\n     * flags for used modifier plugins\n     *\n     * @var array\n     */\n    public $modifier_plugins = array();\n    /**\n     * type of already compiled modifier\n     *\n     * @var array\n     */\n    public $known_modifier_type = array();\n    /**\n     * parent compiler object for merged subtemplates and template functions\n     *\n     * @var Smarty_Internal_TemplateCompilerBase\n     */\n    public $parent_compiler = null;\n    /**\n     * Flag true when compiling nocache section\n     *\n     * @var bool\n     */\n    public $nocache = false;\n    /**\n     * Flag true when tag is compiled as nocache\n     *\n     * @var bool\n     */\n    public $tag_nocache = false;\n    /**\n     * Compiled tag prefix code\n     *\n     * @var array\n     */\n    public $prefix_code = array();\n    /**\n     * used prefix variables by current compiled tag\n     *\n     * @var array\n     */\n    public $usedPrefixVariables = array();\n    /**\n     * Prefix code  stack\n     *\n     * @var array\n     */\n    public $prefixCodeStack = array();\n    /**\n     * Tag has compiled code\n     *\n     * @var bool\n     */\n    public $has_code = false;\n    /**\n     * A variable string was compiled\n     *\n     * @var bool\n     */\n    public $has_variable_string = false;\n\n    /**\n     * Stack for {setfilter} {/setfilter}\n     *\n     * @var array\n     */\n    public $variable_filter_stack = array();\n    /**\n     * variable filters for {setfilter} {/setfilter}\n     *\n     * @var array\n     */\n    public $variable_filters = array();\n    /**\n     * Nesting count of looping tags like {foreach}, {for}, {section}, {while}\n     *\n     * @var int\n     */\n    public $loopNesting = 0;\n    /**\n     * Strip preg pattern\n     *\n     * @var string\n     */\n    public $stripRegEx = '![\\t ]*[\\r\\n]+[\\t ]*!';\n    /**\n     * plugin search order\n     *\n     * @var array\n     */\n    public $plugin_search_order = array('function',\n                                        'block',\n                                        'compiler',\n                                        'class');\n    /**\n     * General storage area for tag compiler plugins\n     *\n     * @var array\n     */\n    public $_cache = array();\n    /**\n     * Lexer preg pattern for left delimiter\n     *\n     * @var string\n     */\n    private $ldelPreg = '[{]';\n    /**\n     * Lexer preg pattern for right delimiter\n     *\n     * @var string\n     */\n    private $rdelPreg = '[}]';\n    /**\n     * Length of right delimiter\n     *\n     * @var int\n     */\n    private $rdelLength = 0;\n    /**\n     * Length of left delimiter\n     *\n     * @var int\n     */\n    private $ldelLength = 0;\n    /**\n     * Lexer preg pattern for user literals\n     *\n     * @var string\n     */\n    private $literalPreg = '';\n\n    /**\n     * Initialize compiler\n     *\n     * @param Smarty $smarty global instance\n     */\n    public function __construct(Smarty $smarty)\n    {\n        $this->smarty = $smarty;\n        $this->nocache_hash = str_replace(array('.',\n                                                ','),\n                                          '_',\n                                          uniqid(rand(), true));\n    }\n\n    /**\n     * Method to compile a Smarty template\n     *\n     * @param  Smarty_Internal_Template                 $template template object to compile\n     * @param  bool                                     $nocache  true is shall be compiled in nocache mode\n     * @param null|Smarty_Internal_TemplateCompilerBase $parent_compiler\n     *\n     * @return bool true if compiling succeeded, false if it failed\n     * @throws \\Exception\n     */\n    public function compileTemplate(Smarty_Internal_Template $template,\n                                    $nocache = null,\n                                    Smarty_Internal_TemplateCompilerBase $parent_compiler = null)\n    {\n        // get code frame of compiled template\n        $_compiled_code = $template->smarty->ext->_codeFrame->create($template,\n                                                                     $this->compileTemplateSource($template,\n                                                                                                  $nocache,\n                                                                                                  $parent_compiler),\n                                                                     $this->postFilter($this->blockOrFunctionCode) .\n                                                                     join('', $this->mergedSubTemplatesCode),\n                                                                     false,\n                                                                     $this);\n        return $_compiled_code;\n    }\n\n    /**\n     * Compile template source and run optional post filter\n     *\n     * @param \\Smarty_Internal_Template             $template\n     * @param null|bool                             $nocache flag if template must be compiled in nocache mode\n     * @param \\Smarty_Internal_TemplateCompilerBase $parent_compiler\n     *\n     * @return string\n     * @throws \\Exception\n     */\n    public function compileTemplateSource(Smarty_Internal_Template $template,\n                                          $nocache = null,\n                                          Smarty_Internal_TemplateCompilerBase $parent_compiler = null)\n    {\n        try {\n            // save template object in compiler class\n            $this->template = $template;\n            if (property_exists($this->template->smarty, 'plugin_search_order')) {\n                $this->plugin_search_order = $this->template->smarty->plugin_search_order;\n            }\n            if ($this->smarty->debugging) {\n                if (!isset($this->smarty->_debug)) {\n                    $this->smarty->_debug = new Smarty_Internal_Debug();\n                }\n                $this->smarty->_debug->start_compile($this->template);\n            }\n            if (isset($this->template->smarty->security_policy)) {\n                $this->php_handling = $this->template->smarty->security_policy->php_handling;\n            } else {\n                $this->php_handling = $this->template->smarty->php_handling;\n            }\n            $this->parent_compiler = $parent_compiler ? $parent_compiler : $this;\n            $nocache = isset($nocache) ? $nocache : false;\n            if (empty($template->compiled->nocache_hash)) {\n                $template->compiled->nocache_hash = $this->nocache_hash;\n            } else {\n                $this->nocache_hash = $template->compiled->nocache_hash;\n            }\n            $this->caching = $template->caching;\n            // flag for nocache sections\n            $this->nocache = $nocache;\n            $this->tag_nocache = false;\n            // reset has nocache code flag\n            $this->template->compiled->has_nocache_code = false;\n            $this->has_variable_string = false;\n            $this->prefix_code = array();\n            // add file dependency\n            if ($this->smarty->merge_compiled_includes || $this->template->source->handler->checkTimestamps()) {\n                $this->parent_compiler->template->compiled->file_dependency[ $this->template->source->uid ] =\n                    array($this->template->source->filepath,\n                          $this->template->source->getTimeStamp(),\n                          $this->template->source->type,);\n            }\n            $this->smarty->_current_file = $this->template->source->filepath;\n            // get template source\n            if (!empty($this->template->source->components)) {\n                // we have array of inheritance templates by extends: resource\n                // generate corresponding source code sequence\n                $_content =\n                    Smarty_Internal_Compile_Extends::extendsSourceArrayCode($this->template);\n            } else {\n                // get template source\n                $_content = $this->template->source->getContent();\n            }\n            $_compiled_code = $this->postFilter($this->doCompile($this->preFilter($_content), true));\n        }\n        catch (Exception $e) {\n            if ($this->smarty->debugging) {\n                $this->smarty->_debug->end_compile($this->template);\n            }\n            $this->_tag_stack = array();\n            // free memory\n            $this->parent_compiler = null;\n            $this->template = null;\n            $this->parser = null;\n            throw $e;\n        }\n        if ($this->smarty->debugging) {\n            $this->smarty->_debug->end_compile($this->template);\n        }\n        $this->parent_compiler = null;\n        $this->parser = null;\n        return $_compiled_code;\n    }\n\n    /**\n     * Optionally process compiled code by post filter\n     *\n     * @param string $code compiled code\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function postFilter($code)\n    {\n        // run post filter if on code\n        if (!empty($code) &&\n            (isset($this->smarty->autoload_filters[ 'post' ]) || isset($this->smarty->registered_filters[ 'post' ]))\n        ) {\n            return $this->smarty->ext->_filterHandler->runFilter('post', $code, $this->template);\n        } else {\n            return $code;\n        }\n    }\n\n    /**\n     * Run optional prefilter\n     *\n     * @param string $_content template source\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function preFilter($_content)\n    {\n        // run pre filter if required\n        if ($_content !== '' &&\n            ((isset($this->smarty->autoload_filters[ 'pre' ]) || isset($this->smarty->registered_filters[ 'pre' ])))\n        ) {\n            return $this->smarty->ext->_filterHandler->runFilter('pre', $_content, $this->template);\n        } else {\n            return $_content;\n        }\n    }\n\n    /**\n     * Compile Tag\n     * This is a call back from the lexer/parser\n     *\n     * Save current prefix code\n     * Compile tag\n     * Merge tag prefix code with saved one\n     * (required nested tags in attributes)\n     *\n     * @param  string $tag       tag name\n     * @param  array  $args      array with tag attributes\n     * @param  array  $parameter array with compilation parameter\n     *\n     * @throws SmartyCompilerException\n     * @throws SmartyException\n     * @return string compiled code\n     */\n    public function compileTag($tag, $args, $parameter = array())\n    {\n        $this->prefixCodeStack[] = $this->prefix_code;\n        $this->prefix_code = array();\n        $result = $this->compileTag2($tag, $args, $parameter);\n        $this->prefix_code = array_merge($this->prefix_code, array_pop($this->prefixCodeStack));\n        return $result;\n    }\n\n    /**\n     * compile variable\n     *\n     * @param string $variable\n     *\n     * @return string\n     */\n    public function compileVariable($variable)\n    {\n        if (!strpos($variable, '(')) {\n            // not a variable variable\n            $var = trim($variable, '\\'');\n            $this->tag_nocache = $this->tag_nocache |\n                                 $this->template->ext->getTemplateVars->_getVariable($this->template,\n                                                                                     $var,\n                                                                                     null,\n                                                                                     true,\n                                                                                     false)->nocache;\n            // todo $this->template->compiled->properties['variables'][$var] = $this->tag_nocache | $this->nocache;\n        }\n        return '$_smarty_tpl->tpl_vars[' . $variable . ']->value';\n    }\n\n    /**\n     * compile config variable\n     *\n     * @param string $variable\n     *\n     * @return string\n     */\n    public function compileConfigVariable($variable)\n    {\n        // return '$_smarty_tpl->config_vars[' . $variable . ']';\n        return '$_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, ' . $variable . ')';\n    }\n\n    /**\n     * compile PHP function call\n     *\n     * @param string       $name\n     * @param        array $parameter\n     *\n     * @return string\n     * @throws \\SmartyCompilerException\n     */\n    public function compilePHPFunctionCall($name, $parameter)\n    {\n        if (!$this->smarty->security_policy || $this->smarty->security_policy->isTrustedPhpFunction($name, $this)) {\n            if (strcasecmp($name, 'isset') === 0 || strcasecmp($name, 'empty') === 0 ||\n                strcasecmp($name, 'array') === 0 || is_callable($name)\n            ) {\n                $func_name = strtolower($name);\n                $par = implode(',', $parameter);\n                $parHasFuction = strpos($par, '(') !== false;\n                if ($func_name === 'isset') {\n                    if (count($parameter) === 0) {\n                        $this->trigger_template_error('Illegal number of parameter in \"isset()\"');\n                    }\n                    if ($parHasFuction) {\n                        $pa = array();\n                        foreach ($parameter as $p) {\n                            $pa[] = (strpos($p, '(') === false) ? ('isset(' . $p . ')') : ('(' . $p . ' !== null )');\n                        }\n                        return '(' . implode(' && ', $pa) . ')';\n                    } else {\n                        $isset_par = str_replace(\"')->value\", \"',null,true,false)->value\", $par);\n                    }\n                    return $name . '(' . $isset_par . ')';\n                } else if (in_array($func_name,\n                                    array('empty',\n                                          'reset',\n                                          'current',\n                                          'end',\n                                          'prev',\n                                          'next'))) {\n                    if (count($parameter) !== 1) {\n                        $this->trigger_template_error(\"Illegal number of parameter in '{$func_name()}'\");\n                    }\n                    if ($func_name === 'empty') {\n                        if ($parHasFuction && version_compare(PHP_VERSION, '5.5.0', '<')) {\n                            return '(' . $parameter[ 0 ] . ' === false )';\n                        } else {\n                            return $func_name . '(' .\n                                   str_replace(\"')->value\", \"',null,true,false)->value\", $parameter[ 0 ]) . ')';\n                        }\n                    } else {\n                        return $func_name . '(' . $parameter[ 0 ] . ')';\n                    }\n                } else {\n                    return $name . '(' . implode(',', $parameter) . ')';\n                }\n            } else {\n                $this->trigger_template_error(\"unknown function '{$name}'\");\n            }\n        }\n    }\n\n    /**\n     * This method is called from parser to process a text content section\n     * - remove text from inheritance child templates as they may generate output\n     * - strip text if strip is enabled\n     *\n     * @param string $text\n     *\n     * @return null|\\Smarty_Internal_ParseTree_Text\n     */\n    public function processText($text)\n    {\n        if ((string)$text !== '') {\n            $store = array();\n            $_store = 0;\n            if ($this->parser->strip) {\n                if (strpos($text, '<') !== false) {\n                    // capture html elements not to be messed with\n                    $_offset = 0;\n                    if (preg_match_all('#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is',\n                                       $text,\n                                       $matches,\n                                       PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n                        foreach ($matches as $match) {\n                            $store[] = $match[ 0 ][ 0 ];\n                            $_length = strlen($match[ 0 ][ 0 ]);\n                            $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@';\n                            $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] - $_offset, $_length);\n                            $_offset += $_length - strlen($replace);\n                            ++$_store;\n                        }\n                    }\n                    $expressions = array(// replace multiple spaces between tags by a single space\n                                         '#(:SMARTY@!@|>)[\\040\\011]+(?=@!@SMARTY:|<)#s'                            => '\\1 \\2',\n                                         // remove newline between tags\n                                         '#(:SMARTY@!@|>)[\\040\\011]*[\\n]\\s*(?=@!@SMARTY:|<)#s'                     => '\\1\\2',\n                                         // remove multiple spaces between attributes (but not in attribute values!)\n                                         '#(([a-z0-9]\\s*=\\s*(\"[^\"]*?\")|(\\'[^\\']*?\\'))|<[a-z0-9_]+)\\s+([a-z/>])#is' => '\\1 \\5',\n                                         '#>[\\040\\011]+$#Ss'                                                       => '> ',\n                                         '#>[\\040\\011]*[\\n]\\s*$#Ss'                                                => '>',\n                                         $this->stripRegEx                                                         => '',);\n                    $text = preg_replace(array_keys($expressions), array_values($expressions), $text);\n                    $_offset = 0;\n                    if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is',\n                                       $text,\n                                       $matches,\n                                       PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n                        foreach ($matches as $match) {\n                            $_length = strlen($match[ 0 ][ 0 ]);\n                            $replace = $store[ $match[ 1 ][ 0 ] ];\n                            $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] + $_offset, $_length);\n                            $_offset += strlen($replace) - $_length;\n                            ++$_store;\n                        }\n                    }\n                } else {\n                    $text = preg_replace($this->stripRegEx, '', $text);\n                }\n            }\n            return new Smarty_Internal_ParseTree_Text($text);\n        }\n        return null;\n    }\n\n    /**\n     * lazy loads internal compile plugin for tag and calls the compile method\n     * compile objects cached for reuse.\n     * class name format:  Smarty_Internal_Compile_TagName\n     * plugin filename format: Smarty_Internal_TagName.php\n     *\n     * @param  string $tag    tag name\n     * @param  array  $args   list of tag attributes\n     * @param  mixed  $param1 optional parameter\n     * @param  mixed  $param2 optional parameter\n     * @param  mixed  $param3 optional parameter\n     *\n     * @return bool|string compiled code or false\n     * @throws \\SmartyCompilerException\n     */\n    public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)\n    {\n        /* @var Smarty_Internal_CompileBase $tagCompiler */\n        $tagCompiler = $this->getTagCompiler($tag);\n        // compile this tag\n        return $tagCompiler === false ? false : $tagCompiler->compile($args, $this, $param1, $param2, $param3);\n    }\n\n    /**\n     * lazy loads internal compile plugin for tag compile objects cached for reuse.\n     *\n     * class name format:  Smarty_Internal_Compile_TagName\n     * plugin filename format: Smarty_Internal_TagName.php\n     *\n     * @param  string $tag tag name\n     *\n     * @return bool|\\Smarty_Internal_CompileBase tag compiler object or false if not found\n     * @throws \\SmartyCompilerException\n     */\n    public function getTagCompiler($tag)\n    {\n        // re-use object if already exists\n        if (!isset(self::$_tag_objects[ $tag ])) {\n            // lazy load internal compiler plugin\n            $_tag = explode('_', $tag);\n            $_tag = array_map('ucfirst', $_tag);\n            $class_name = 'Smarty_Internal_Compile_' . implode('_', $_tag);\n            if (class_exists($class_name) &&\n                (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))\n            ) {\n                self::$_tag_objects[ $tag ] = new $class_name;\n            } else {\n                self::$_tag_objects[ $tag ] = false;\n            }\n        }\n        return self::$_tag_objects[ $tag ];\n    }\n\n    /**\n     * Check for plugins and return function name\n     *\n     * @param         $plugin_name\n     * @param  string $plugin_type type of plugin\n     *\n     * @return string call name of function\n     * @throws \\SmartyException\n     */\n    public function getPlugin($plugin_name, $plugin_type)\n    {\n        $function = null;\n        if ($this->caching && ($this->nocache || $this->tag_nocache)) {\n            if (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) {\n                $function =\n                    $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ];\n            } else if (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) {\n                $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ] =\n                    $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ];\n                $function =\n                    $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ];\n            }\n        } else {\n            if (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) {\n                $function =\n                    $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ];\n            } else if (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) {\n                $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ] =\n                    $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ];\n                $function =\n                    $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ];\n            }\n        }\n        if (isset($function)) {\n            if ($plugin_type === 'modifier') {\n                $this->modifier_plugins[ $plugin_name ] = true;\n            }\n            return $function;\n        }\n        // loop through plugin dirs and find the plugin\n        $function = 'smarty_' . $plugin_type . '_' . $plugin_name;\n        $file = $this->smarty->loadPlugin($function, false);\n        if (is_string($file)) {\n            if ($this->caching && ($this->nocache || $this->tag_nocache)) {\n                $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'file' ] =\n                    $file;\n                $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ] =\n                    $function;\n            } else {\n                $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'file' ] =\n                    $file;\n                $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ] =\n                    $function;\n            }\n            if ($plugin_type === 'modifier') {\n                $this->modifier_plugins[ $plugin_name ] = true;\n            }\n            return $function;\n        }\n        if (is_callable($function)) {\n            // plugin function is defined in the script\n            return $function;\n        }\n        return false;\n    }\n\n    /**\n     * Check for plugins by default plugin handler\n     *\n     * @param  string $tag         name of tag\n     * @param  string $plugin_type type of plugin\n     *\n     * @return bool true if found\n     * @throws \\SmartyCompilerException\n     */\n    public function getPluginFromDefaultHandler($tag, $plugin_type)\n    {\n        $callback = null;\n        $script = null;\n        $cacheable = true;\n        $result = call_user_func_array($this->smarty->default_plugin_handler_func,\n                                       array($tag,\n                                             $plugin_type,\n                                             $this->template,\n                                             &$callback,\n                                             &$script,\n                                             &$cacheable,));\n        if ($result) {\n            $this->tag_nocache = $this->tag_nocache || !$cacheable;\n            if ($script !== null) {\n                if (is_file($script)) {\n                    if ($this->caching && ($this->nocache || $this->tag_nocache)) {\n                        $this->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'file' ] =\n                            $script;\n                        $this->required_plugins[ 'nocache' ][ $tag ][ $plugin_type ][ 'function' ] =\n                            $callback;\n                    } else {\n                        $this->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'file' ] =\n                            $script;\n                        $this->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'function' ] =\n                            $callback;\n                    }\n                    require_once $script;\n                } else {\n                    $this->trigger_template_error(\"Default plugin handler: Returned script file '{$script}' for '{$tag}' not found\");\n                }\n            }\n            if (is_callable($callback)) {\n                $this->default_handler_plugins[ $plugin_type ][ $tag ] = array($callback,\n                                                                               true,\n                                                                               array());\n                return true;\n            } else {\n                $this->trigger_template_error(\"Default plugin handler: Returned callback for '{$tag}' not callable\");\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Append code segments and remove unneeded ?> <?php transitions\n     *\n     * @param string $left\n     * @param string $right\n     *\n     * @return string\n     */\n    public function appendCode($left, $right)\n    {\n        if (preg_match('/\\s*\\?>\\s?$/D', $left) && preg_match('/^<\\?php\\s+/', $right)) {\n            $left = preg_replace('/\\s*\\?>\\s?$/D', \"\\n\", $left);\n            $left .= preg_replace('/^<\\?php\\s+/', '', $right);\n        } else {\n            $left .= $right;\n        }\n        return $left;\n    }\n\n    /**\n     * Inject inline code for nocache template sections\n     * This method gets the content of each template element from the parser.\n     * If the content is compiled code and it should be not cached the code is injected\n     * into the rendered output.\n     *\n     * @param  string  $content content of template element\n     * @param  boolean $is_code true if content is compiled code\n     *\n     * @return string  content\n     */\n    public function processNocacheCode($content, $is_code)\n    {\n        // If the template is not evaluated and we have a nocache section and or a nocache tag\n        if ($is_code && !empty($content)) {\n            // generate replacement code\n            if ((!($this->template->source->handler->recompiled) || $this->forceNocache) && $this->caching &&\n                !$this->suppressNocacheProcessing && ($this->nocache || $this->tag_nocache)\n            ) {\n                $this->template->compiled->has_nocache_code = true;\n                $_output = addcslashes($content, '\\'\\\\');\n                $_output = str_replace('^#^', '\\'', $_output);\n                $_output = \"<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/{$_output}/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\\n\";\n                // make sure we include modifier plugins for nocache code\n                foreach ($this->modifier_plugins as $plugin_name => $dummy) {\n                    if (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ])) {\n                        $this->required_plugins[ 'nocache' ][ $plugin_name ][ 'modifier' ] =\n                            $this->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ];\n                    }\n                }\n            } else {\n                $_output = $content;\n            }\n        } else {\n            $_output = $content;\n        }\n        $this->modifier_plugins = array();\n        $this->suppressNocacheProcessing = false;\n        $this->tag_nocache = false;\n        return $_output;\n    }\n\n    /**\n     * Get Id\n     *\n     * @param string $input\n     *\n     * @return bool|string\n     */\n    public function getId($input)\n    {\n        if (preg_match('~^([\\'\"]*)([0-9]*[a-zA-Z_]\\w*)\\1$~', $input, $match)) {\n            return $match[ 2 ];\n        }\n        return false;\n    }\n\n    /**\n     * Get variable name from string\n     *\n     * @param string $input\n     *\n     * @return bool|string\n     */\n    public function getVariableName($input)\n    {\n        if (preg_match('~^[$]_smarty_tpl->tpl_vars\\[[\\'\"]*([0-9]*[a-zA-Z_]\\w*)[\\'\"]*\\]->value$~', $input, $match)) {\n            return $match[ 1 ];\n        }\n        return false;\n    }\n\n    /**\n     * Set nocache flag in variable or create new variable\n     *\n     * @param string $varName\n     */\n    public function setNocacheInVariable($varName)\n    {\n        // create nocache var to make it know for further compiling\n        if ($_var = $this->getId($varName)) {\n            if (isset($this->template->tpl_vars[ $_var ])) {\n                $this->template->tpl_vars[ $_var ] = clone $this->template->tpl_vars[ $_var ];\n                $this->template->tpl_vars[ $_var ]->nocache = true;\n            } else {\n                $this->template->tpl_vars[ $_var ] = new Smarty_Variable(null, true);\n            }\n        }\n    }\n\n    /**\n     * @param array $_attr tag attributes\n     * @param array $validScopes\n     *\n     * @return int|string\n     * @throws \\SmartyCompilerException\n     */\n    public function convertScope($_attr, $validScopes)\n    {\n        $_scope = 0;\n        if (isset($_attr[ 'scope' ])) {\n            $_scopeName = trim($_attr[ 'scope' ], '\\'\"');\n            if (is_numeric($_scopeName) && in_array($_scopeName, $validScopes)) {\n                $_scope = $_scopeName;\n            } else if (is_string($_scopeName)) {\n                $_scopeName = trim($_scopeName, '\\'\"');\n                $_scope = isset($validScopes[ $_scopeName ]) ? $validScopes[ $_scopeName ] : false;\n            } else {\n                $_scope = false;\n            }\n            if ($_scope === false) {\n                $err = var_export($_scopeName, true);\n                $this->trigger_template_error(\"illegal value '{$err}' for \\\"scope\\\" attribute\", null, true);\n            }\n        }\n        return $_scope;\n    }\n\n    /**\n     * Generate nocache code string\n     *\n     * @param string $code PHP code\n     *\n     * @return string\n     */\n    public function makeNocacheCode($code)\n    {\n        return \"echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/<?php \" .\n               str_replace('^#^', '\\'', addcslashes($code, '\\'\\\\')) .\n               \"?>/*/%%SmartyNocache:{$this->nocache_hash}%%*/';\\n\";\n    }\n\n    /**\n     * display compiler error messages without dying\n     * If parameter $args is empty it is a parser detected syntax error.\n     * In this case the parser is called to obtain information about expected tokens.\n     * If parameter $args contains a string this is used as error message\n     *\n     * @param  string   $args    individual error message or null\n     * @param  string   $line    line-number\n     * @param null|bool $tagline if true the line number of last tag\n     *\n     * @throws \\SmartyCompilerException when an unexpected token is found\n     */\n    public function trigger_template_error($args = null, $line = null, $tagline = null)\n    {\n        $lex = $this->parser->lex;\n        if ($tagline === true) {\n            // get line number of Tag\n            $line = $lex->taglineno;\n        } else if (!isset($line)) {\n            // get template source line which has error\n            $line = $lex->line;\n        } else {\n            $line = (int)$line;\n        }\n        if (in_array($this->template->source->type,\n                     array('eval',\n                           'string'))) {\n            $templateName = $this->template->source->type . ':' . trim(preg_replace('![\\t\\r\\n]+!',\n                                                                                    ' ',\n                                                                                    strlen($lex->data) > 40 ?\n                                                                                        substr($lex->data, 0, 40) .\n                                                                                        '...' : $lex->data));\n        } else {\n            $templateName = $this->template->source->type . ':' . $this->template->source->filepath;\n        }\n        //        $line += $this->trace_line_offset;\n        $match = preg_split(\"/\\n/\", $lex->data);\n        $error_text =\n            'Syntax error in template \"' . (empty($this->trace_filepath) ? $templateName : $this->trace_filepath) .\n            '\"  on line ' . ($line + $this->trace_line_offset) . ' \"' .\n            trim(preg_replace('![\\t\\r\\n]+!', ' ', $match[ $line - 1 ])) . '\" ';\n        if (isset($args)) {\n            // individual error message\n            $error_text .= $args;\n        } else {\n            $expect = array();\n            // expected token from parser\n            $error_text .= ' - Unexpected \"' . $lex->value . '\"';\n            if (count($this->parser->yy_get_expected_tokens($this->parser->yymajor)) <= 4) {\n                foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {\n                    $exp_token = $this->parser->yyTokenName[ $token ];\n                    if (isset($lex->smarty_token_names[ $exp_token ])) {\n                        // token type from lexer\n                        $expect[] = '\"' . $lex->smarty_token_names[ $exp_token ] . '\"';\n                    } else {\n                        // otherwise internal token name\n                        $expect[] = $this->parser->yyTokenName[ $token ];\n                    }\n                }\n                $error_text .= ', expected one of: ' . implode(' , ', $expect);\n            }\n        }\n        if ($this->smarty->_parserdebug) {\n            $this->parser->errorRunDown();\n            echo ob_get_clean();\n            flush();\n        }\n        $e = new SmartyCompilerException($error_text);\n        $e->line = $line;\n        $e->source = trim(preg_replace('![\\t\\r\\n]+!', ' ', $match[ $line - 1 ]));\n        $e->desc = $args;\n        $e->template = $this->template->source->filepath;\n        throw $e;\n    }\n\n    /**\n     * Return var_export() value with all white spaces removed\n     *\n     * @param  mixed $value\n     *\n     * @return string\n     */\n    public function getVarExport($value)\n    {\n        return preg_replace('/\\s/', '', var_export($value, true));\n    }\n\n    /**\n     *  enter double quoted string\n     *  - save tag stack count\n     */\n    public function enterDoubleQuote()\n    {\n        array_push($this->_tag_stack_count, $this->getTagStackCount());\n    }\n\n    /**\n     * Return tag stack count\n     *\n     * @return int\n     */\n    public function getTagStackCount()\n    {\n        return count($this->_tag_stack);\n    }\n\n    /**\n     * @param $lexerPreg\n     *\n     * @return mixed\n     */\n    public function replaceDelimiter($lexerPreg)\n    {\n        return str_replace(array('SMARTYldel', 'SMARTYliteral', 'SMARTYrdel', 'SMARTYautoliteral', 'SMARTYal'),\n                           array($this->ldelPreg, $this->literalPreg, $this->rdelPreg,\n                                 $this->smarty->getAutoLiteral() ? '{1,}' : '{9}',\n                                 $this->smarty->getAutoLiteral() ? '' : '\\\\s*'),\n                           $lexerPreg);\n    }\n\n    /**\n     * Build lexer regular expressions for left and right delimiter and user defined literals\n     */\n    public function initDelimiterPreg()\n    {\n        $ldel = $this->smarty->getLeftDelimiter();\n        $this->ldelLength = strlen($ldel);\n        $this->ldelPreg = '';\n        foreach (str_split($ldel, 1) as $chr) {\n            $this->ldelPreg .= '[' . ($chr === '\\\\' ? '\\\\' : '') . $chr . ']';\n        }\n        $rdel = $this->smarty->getRightDelimiter();\n        $this->rdelLength = strlen($rdel);\n        $this->rdelPreg = '';\n        foreach (str_split($rdel, 1) as $chr) {\n            $this->rdelPreg .= '[' . ($chr === '\\\\' ? '\\\\' : '') . $chr . ']';\n        }\n        $literals = $this->smarty->getLiterals();\n        if (!empty($literals)) {\n            foreach ($literals as $key => $literal) {\n                $literalPreg = '';\n                foreach (str_split($literal, 1) as $chr) {\n                    $literalPreg .= '[' . ($chr === '\\\\' ? '\\\\' : '') . $chr . ']';\n                }\n                $literals[ $key ] = $literalPreg;\n            }\n            $this->literalPreg = '|' . implode('|', $literals);\n        } else {\n            $this->literalPreg = '';\n        }\n    }\n\n    /**\n     *  leave double quoted string\n     *  - throw exception if block in string was not closed\n     *\n     * @throws \\SmartyCompilerException\n     */\n    public function leaveDoubleQuote()\n    {\n        if (array_pop($this->_tag_stack_count) !== $this->getTagStackCount()) {\n            $tag = $this->getOpenBlockTag();\n            $this->trigger_template_error(\"unclosed '{{$tag}}' in doubled quoted string\",\n                                          null,\n                                          true);\n        }\n    }\n\n    /**\n     * Get left delimiter preg\n     *\n     * @return string\n     */\n    public function getLdelPreg()\n    {\n        return $this->ldelPreg;\n    }\n\n    /**\n     * Get right delimiter preg\n     *\n     * @return string\n     */\n    public function getRdelPreg()\n    {\n        return $this->rdelPreg;\n    }\n\n    /**\n     * Get length of left delimiter\n     *\n     * @return int\n     */\n    public function getLdelLength()\n    {\n        return $this->ldelLength;\n    }\n\n    /**\n     * Get length of right delimiter\n     *\n     * @return int\n     */\n    public function getRdelLength()\n    {\n        return $this->rdelLength;\n    }\n\n    /**\n     * Get name of current open block tag\n     *\n     * @return string|boolean\n     */\n    public function getOpenBlockTag()\n    {\n        $tagCount = $this->getTagStackCount();\n        if ($tagCount) {\n            return $this->_tag_stack[ $tagCount - 1 ][ 0 ];\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * Check if $value contains variable elements\n     *\n     * @param mixed $value\n     *\n     * @return bool|int\n     */\n    public function isVariable($value)\n    {\n        if (is_string($value)) {\n            return preg_match('/[$(]/', $value);\n        }\n        if (is_bool($value) || is_numeric($value)) {\n            return false;\n        }\n        if (is_array($value)) {\n            foreach ($value as $k => $v) {\n                if ($this->isVariable($k) || $this->isVariable($v)) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        return false;\n    }\n\n    /**\n     * Get new prefix variable name\n     *\n     * @return string\n     */\n    public function getNewPrefixVariable()\n    {\n        ++self::$prefixVariableNumber;\n        return $this->getPrefixVariable();\n    }\n\n    /**\n     * Get current prefix variable name\n     *\n     * @return string\n     */\n    public function getPrefixVariable()\n    {\n        return '$_prefixVariable' . self::$prefixVariableNumber;\n    }\n\n    /**\n     * append  code to prefix buffer\n     *\n     * @param string $code\n     */\n    public function appendPrefixCode($code)\n    {\n        $this->prefix_code[] = $code;\n    }\n\n    /**\n     * get prefix code string\n     *\n     * @return string\n     */\n    public function getPrefixCode()\n    {\n        $code = '';\n        $prefixArray = array_merge($this->prefix_code, array_pop($this->prefixCodeStack));\n        $this->prefixCodeStack[] = array();\n        foreach ($prefixArray as $c) {\n            $code = $this->appendCode($code, $c);\n        }\n        $this->prefix_code = array();\n        return $code;\n    }\n\n    /**\n     * Save current required plugins\n     *\n     * @param bool $init if true init required plugins\n     */\n    public function saveRequiredPlugins($init=false)\n    {\n        $this->required_plugins_stack[] = $this->required_plugins;\n        if ($init) {\n            $this->required_plugins = array('compiled' => array(), 'nocache' => array());\n        }\n    }\n\n    /**\n     * Restore required plugins\n     */\n    public function restoreRequiredPlugins()\n    {\n        $this->required_plugins = array_pop($this->required_plugins_stack);\n    }\n\n    /**\n     * Compile code to call Smarty_Internal_Template::_checkPlugins()\n     * for required plugins\n     *\n     * @return string\n     */\n    public function compileRequiredPlugins()\n    {\n        $code = $this->compileCheckPlugins($this->required_plugins[ 'compiled' ]);\n        if ($this->caching && !empty($this->required_plugins[ 'nocache' ])) {\n            $code .= $this->makeNocacheCode($this->compileCheckPlugins($this->required_plugins[ 'nocache' ]));\n        }\n        return $code;\n    }\n\n    /**\n     * Compile code to call Smarty_Internal_Template::_checkPlugins\n     *   - checks if plugin is callable require otherwise\n     *\n     * @param $requiredPlugins\n     *\n     * @return string\n     */\n    public function compileCheckPlugins($requiredPlugins)\n    {\n        if (!empty($requiredPlugins)) {\n            $plugins = array();\n            foreach ($requiredPlugins as $plugin) {\n                foreach ($plugin as $data) {\n                    $plugins[] = $data;\n                }\n            }\n            return '$_smarty_tpl->_checkPlugins(' . $this->getVarExport($plugins) . ');' . \"\\n\";\n        } else {\n            return '';\n        }\n    }\n\n    /**\n     * method to compile a Smarty template\n     *\n     * @param mixed $_content template source\n     * @param bool  $isTemplateSource\n     *\n     * @return bool true if compiling succeeded, false if it failed\n     */\n    abstract protected function doCompile($_content, $isTemplateSource = false);\n\n    /**\n     * Compile Tag\n     *\n     * @param  string $tag       tag name\n     * @param  array  $args      array with tag attributes\n     * @param  array  $parameter array with compilation parameter\n     *\n     * @throws SmartyCompilerException\n     * @throws SmartyException\n     * @return string compiled code\n     */\n    private function compileTag2($tag, $args, $parameter)\n    {\n        $plugin_type = '';\n        // $args contains the attributes parsed and compiled by the lexer/parser\n        // assume that tag does compile into code, but creates no HTML output\n        $this->has_code = true;\n        // log tag/attributes\n        if (isset($this->smarty->_cache[ 'get_used_tags' ])) {\n            $this->template->_cache[ 'used_tags' ][] = array($tag,\n                                                             $args);\n        }\n        // check nocache option flag\n        foreach ($args as $arg) {\n            if (!is_array($arg)) {\n                if ($arg === \"'nocache'\" || $arg === 'nocache') {\n                    $this->tag_nocache = true;\n                }\n            } else {\n                foreach ($arg as $k => $v) {\n                    if (($k === \"'nocache'\" || $k === 'nocache') && (trim($v, \"'\\\" \") === 'true')) {\n                        $this->tag_nocache = true;\n                    }\n                }\n            }\n        }\n        // compile the smarty tag (required compile classes to compile the tag are auto loaded)\n        if (($_output = $this->callTagCompiler($tag, $args, $parameter)) === false) {\n            if (isset($this->parent_compiler->tpl_function[ $tag ]) ||\n                (isset ($this->template->smarty->ext->_tplFunction) &&\n                 $this->template->smarty->ext->_tplFunction->getTplFunction($this->template, $tag) !== false)\n            ) {\n                // template defined by {template} tag\n                $args[ '_attr' ][ 'name' ] = \"'{$tag}'\";\n                $_output = $this->callTagCompiler('call', $args, $parameter);\n            }\n        }\n        if ($_output !== false) {\n            if ($_output !== true) {\n                // did we get compiled code\n                if ($this->has_code) {\n                    // return compiled code\n                    return $_output;\n                }\n            }\n            // tag did not produce compiled code\n            return null;\n        } else {\n            // map_named attributes\n            if (isset($args[ '_attr' ])) {\n                foreach ($args[ '_attr' ] as $key => $attribute) {\n                    if (is_array($attribute)) {\n                        $args = array_merge($args, $attribute);\n                    }\n                }\n            }\n            // not an internal compiler tag\n            if (strlen($tag) < 6 || substr($tag, -5) !== 'close') {\n                // check if tag is a registered object\n                if (isset($this->smarty->registered_objects[ $tag ]) && isset($parameter[ 'object_method' ])) {\n                    $method = $parameter[ 'object_method' ];\n                    if (!in_array($method, $this->smarty->registered_objects[ $tag ][ 3 ]) &&\n                        (empty($this->smarty->registered_objects[ $tag ][ 1 ]) ||\n                         in_array($method, $this->smarty->registered_objects[ $tag ][ 1 ]))\n                    ) {\n                        return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $method);\n                    } else if (in_array($method, $this->smarty->registered_objects[ $tag ][ 3 ])) {\n                        return $this->callTagCompiler('private_object_block_function',\n                                                      $args,\n                                                      $parameter,\n                                                      $tag,\n                                                      $method);\n                    } else {\n                        // throw exception\n                        $this->trigger_template_error('not allowed method \"' . $method . '\" in registered object \"' .\n                                                      $tag . '\"',\n                                                      null,\n                                                      true);\n                    }\n                }\n                // check if tag is registered\n                foreach (array(Smarty::PLUGIN_COMPILER,\n                               Smarty::PLUGIN_FUNCTION,\n                               Smarty::PLUGIN_BLOCK,) as $plugin_type) {\n                    if (isset($this->smarty->registered_plugins[ $plugin_type ][ $tag ])) {\n                        // if compiler function plugin call it now\n                        if ($plugin_type === Smarty::PLUGIN_COMPILER) {\n                            $new_args = array();\n                            foreach ($args as $key => $mixed) {\n                                if (is_array($mixed)) {\n                                    $new_args = array_merge($new_args, $mixed);\n                                } else {\n                                    $new_args[ $key ] = $mixed;\n                                }\n                            }\n                            if (!$this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 1 ]) {\n                                $this->tag_nocache = true;\n                            }\n                            return call_user_func_array($this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ],\n                                                        array($new_args,\n                                                              $this));\n                        }\n                        // compile registered function or block function\n                        if ($plugin_type === Smarty::PLUGIN_FUNCTION || $plugin_type === Smarty::PLUGIN_BLOCK) {\n                            return $this->callTagCompiler('private_registered_' . $plugin_type,\n                                                          $args,\n                                                          $parameter,\n                                                          $tag);\n                        }\n                    }\n                }\n                // check plugins from plugins folder\n                foreach ($this->plugin_search_order as $plugin_type) {\n                    if ($plugin_type === Smarty::PLUGIN_COMPILER &&\n                        $this->smarty->loadPlugin('smarty_compiler_' . $tag) &&\n                        (!isset($this->smarty->security_policy) ||\n                         $this->smarty->security_policy->isTrustedTag($tag, $this))\n                    ) {\n                        $plugin = 'smarty_compiler_' . $tag;\n                        if (is_callable($plugin)) {\n                            // convert arguments format for old compiler plugins\n                            $new_args = array();\n                            foreach ($args as $key => $mixed) {\n                                if (is_array($mixed)) {\n                                    $new_args = array_merge($new_args, $mixed);\n                                } else {\n                                    $new_args[ $key ] = $mixed;\n                                }\n                            }\n                            return $plugin($new_args, $this->smarty);\n                        }\n                        if (class_exists($plugin, false)) {\n                            $plugin_object = new $plugin;\n                            if (method_exists($plugin_object, 'compile')) {\n                                return $plugin_object->compile($args, $this);\n                            }\n                        }\n                        throw new SmartyException(\"Plugin '{$tag}' not callable\");\n                    } else {\n                        if ($function = $this->getPlugin($tag, $plugin_type)) {\n                            if (!isset($this->smarty->security_policy) ||\n                                $this->smarty->security_policy->isTrustedTag($tag, $this)\n                            ) {\n                                return $this->callTagCompiler('private_' . $plugin_type . '_plugin',\n                                                              $args,\n                                                              $parameter,\n                                                              $tag,\n                                                              $function);\n                            }\n                        }\n                    }\n                }\n                if (is_callable($this->smarty->default_plugin_handler_func)) {\n                    $found = false;\n                    // look for already resolved tags\n                    foreach ($this->plugin_search_order as $plugin_type) {\n                        if (isset($this->default_handler_plugins[ $plugin_type ][ $tag ])) {\n                            $found = true;\n                            break;\n                        }\n                    }\n                    if (!$found) {\n                        // call default handler\n                        foreach ($this->plugin_search_order as $plugin_type) {\n                            if ($this->getPluginFromDefaultHandler($tag, $plugin_type)) {\n                                $found = true;\n                                break;\n                            }\n                        }\n                    }\n                    if ($found) {\n                        // if compiler function plugin call it now\n                        if ($plugin_type === Smarty::PLUGIN_COMPILER) {\n                            $new_args = array();\n                            foreach ($args as $key => $mixed) {\n                                if (is_array($mixed)) {\n                                    $new_args = array_merge($new_args, $mixed);\n                                } else {\n                                    $new_args[ $key ] = $mixed;\n                                }\n                            }\n                            return call_user_func_array($this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ],\n                                                        array($new_args,\n                                                              $this));\n                        } else {\n                            return $this->callTagCompiler('private_registered_' . $plugin_type,\n                                                          $args,\n                                                          $parameter,\n                                                          $tag);\n                        }\n                    }\n                }\n            } else {\n                // compile closing tag of block function\n                $base_tag = substr($tag, 0, -5);\n                // check if closing tag is a registered object\n                if (isset($this->smarty->registered_objects[ $base_tag ]) && isset($parameter[ 'object_method' ])) {\n                    $method = $parameter[ 'object_method' ];\n                    if (in_array($method, $this->smarty->registered_objects[ $base_tag ][ 3 ])) {\n                        return $this->callTagCompiler('private_object_block_function',\n                                                      $args,\n                                                      $parameter,\n                                                      $tag,\n                                                      $method);\n                    } else {\n                        // throw exception\n                        $this->trigger_template_error('not allowed closing tag method \"' . $method .\n                                                      '\" in registered object \"' . $base_tag . '\"',\n                                                      null,\n                                                      true);\n                    }\n                }\n                // registered block tag ?\n                if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $base_tag ]) ||\n                    isset($this->default_handler_plugins[ Smarty::PLUGIN_BLOCK ][ $base_tag ])\n                ) {\n                    return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag);\n                }\n                // registered function tag ?\n                if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ])) {\n                    return $this->callTagCompiler('private_registered_function', $args, $parameter, $tag);\n                }\n                // block plugin?\n                if ($function = $this->getPlugin($base_tag, Smarty::PLUGIN_BLOCK)) {\n                    return $this->callTagCompiler('private_block_plugin', $args, $parameter, $tag, $function);\n                }\n                // function plugin?\n                if ($function = $this->getPlugin($tag, Smarty::PLUGIN_FUNCTION)) {\n                    if (!isset($this->smarty->security_policy) ||\n                        $this->smarty->security_policy->isTrustedTag($tag, $this)\n                    ) {\n                        return $this->callTagCompiler('private_function_plugin', $args, $parameter, $tag, $function);\n                    }\n                }\n                // registered compiler plugin ?\n                if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ])) {\n                    // if compiler function plugin call it now\n                    $args = array();\n                    if (!$this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 1 ]) {\n                        $this->tag_nocache = true;\n                    }\n                    return call_user_func_array($this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ],\n                                                array($args,\n                                                      $this));\n                }\n                if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) {\n                    $plugin = 'smarty_compiler_' . $tag;\n                    if (is_callable($plugin)) {\n                        return $plugin($args, $this->smarty);\n                    }\n                    if (class_exists($plugin, false)) {\n                        $plugin_object = new $plugin;\n                        if (method_exists($plugin_object, 'compile')) {\n                            return $plugin_object->compile($args, $this);\n                        }\n                    }\n                    throw new SmartyException(\"Plugin '{$tag}' not callable\");\n                }\n            }\n            $this->trigger_template_error(\"unknown tag '{$tag}'\", null, true);\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_templatelexer.php",
    "content": "<?php\n/*\n * This file is part of Smarty.\n *\n * (c) 2015 Uwe Tews\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Smarty_Internal_Templatelexer\n * This is the template file lexer.\n * It is generated from the smarty_internal_templatelexer.plex file\n *\n *\n * @author Uwe Tews <uwe.tews@googlemail.com>\n */\nclass Smarty_Internal_Templatelexer\n{\n    const TEXT = 1;\n    const TAG = 2;\n    const TAGBODY = 3;\n    const LITERAL = 4;\n    const DOUBLEQUOTEDSTRING = 5;\n    /**\n     * Source\n     *\n     * @var string\n     */\n    public $data;\n    /**\n     * Source length\n     *\n     * @var int\n     */\n    public $dataLength = null;\n    /**\n     * byte counter\n     *\n     * @var int\n     */\n    public $counter;\n    /**\n     * token number\n     *\n     * @var int\n     */\n    public $token;\n    /**\n     * token value\n     *\n     * @var string\n     */\n    public $value;\n    /**\n     * current line\n     *\n     * @var int\n     */\n    public $line;\n    /**\n     * tag start line\n     *\n     * @var\n     */\n    public $taglineno;\n    /**\n     * php code type\n     *\n     * @var string\n     */\n    public $phpType = '';\n    /**\n     * state number\n     *\n     * @var int\n     */\n    public $state = 1;\n    /**\n     * Smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n    /**\n     * compiler object\n     *\n     * @var Smarty_Internal_TemplateCompilerBase\n     */\n    public $compiler = null;\n    /**\n     * trace file\n     *\n     * @var resource\n     */\n    public $yyTraceFILE;\n    /**\n     * trace prompt\n     *\n     * @var string\n     */\n    public $yyTracePrompt;\n    /**\n     * XML flag true while processing xml\n     *\n     * @var bool\n     */\n    public $is_xml = false;\n    /**\n     * state names\n     *\n     * @var array\n     */\n    public $state_name = array(1 => 'TEXT', 2 => 'TAG', 3 => 'TAGBODY', 4 => 'LITERAL', 5 => 'DOUBLEQUOTEDSTRING',);\n    /**\n     * token names\n     *\n     * @var array\n     */\n    public $smarty_token_names = array(        // Text for parser error messages\n                                               'NOT'         => '(!,not)',\n                                               'OPENP'       => '(',\n                                               'CLOSEP'      => ')',\n                                               'OPENB'       => '[',\n                                               'CLOSEB'      => ']',\n                                               'PTR'         => '->',\n                                               'APTR'        => '=>',\n                                               'EQUAL'       => '=',\n                                               'NUMBER'      => 'number',\n                                               'UNIMATH'     => '+\" , \"-',\n                                               'MATH'        => '*\" , \"/\" , \"%',\n                                               'INCDEC'      => '++\" , \"--',\n                                               'SPACE'       => ' ',\n                                               'DOLLAR'      => '$',\n                                               'SEMICOLON'   => ';',\n                                               'COLON'       => ':',\n                                               'DOUBLECOLON' => '::',\n                                               'AT'          => '@',\n                                               'HATCH'       => '#',\n                                               'QUOTE'       => '\"',\n                                               'BACKTICK'    => '`',\n                                               'VERT'        => '\"|\" modifier',\n                                               'DOT'         => '.',\n                                               'COMMA'       => '\",\"',\n                                               'QMARK'       => '\"?\"',\n                                               'ID'          => 'id, name',\n                                               'TEXT'        => 'text',\n                                               'LDELSLASH'   => '{/..} closing tag',\n                                               'LDEL'        => '{...} Smarty tag',\n                                               'COMMENT'     => 'comment',\n                                               'AS'          => 'as',\n                                               'TO'          => 'to',\n                                               'PHP'         => '\"<?php\", \"<%\", \"{php}\" tag',\n                                               'LOGOP'       => '\"<\", \"==\" ... logical operator',\n                                               'TLOGOP'      => '\"lt\", \"eq\" ... logical operator; \"is div by\" ... if condition',\n                                               'SCOND'       => '\"is even\" ... if condition',\n    );\n    /**\n     * literal tag nesting level\n     *\n     * @var int\n     */\n    private $literal_cnt = 0;\n    /**\n     * preg token pattern for state TEXT\n     *\n     * @var string\n     */\n    private $yy_global_pattern1 = null;\n    /**\n     * preg token pattern for state TAG\n     *\n     * @var string\n     */\n    private $yy_global_pattern2 = null;\n    /**\n     * preg token pattern for state TAGBODY\n     *\n     * @var string\n     */\n    private $yy_global_pattern3 = null;\n    /**\n     * preg token pattern for state LITERAL\n     *\n     * @var string\n     */\n    private $yy_global_pattern4 = null;\n    /**\n     * preg token pattern for state DOUBLEQUOTEDSTRING\n     *\n     * @var null\n     */\n    private $yy_global_pattern5 = null;\n    private $_yy_state = 1;\n    private $_yy_stack = array();\n\n    /**\n     * constructor\n     *\n     * @param   string                             $source template source\n     * @param Smarty_Internal_TemplateCompilerBase $compiler\n     */\n    function __construct($source, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $this->data = $source;\n        $this->dataLength = strlen($this->data);\n        $this->counter = 0;\n        if (preg_match('/^\\xEF\\xBB\\xBF/i', $this->data, $match)) {\n            $this->counter += strlen($match[ 0 ]);\n        }\n        $this->line = 1;\n        $this->smarty = $compiler->template->smarty;\n        $this->compiler = $compiler;\n        $this->compiler->initDelimiterPreg();\n        $this->smarty_token_names[ 'LDEL' ] = $this->smarty->getLeftDelimiter();\n        $this->smarty_token_names[ 'RDEL' ] = $this->smarty->getRightDelimiter();\n    }\n\n    /**\n     * open lexer/parser trace file\n     *\n     */\n    public function PrintTrace()\n    {\n        $this->yyTraceFILE = fopen('php://output', 'w');\n        $this->yyTracePrompt = '<br>';\n    }\n\n    /**\n     * replace placeholders with runtime preg  code\n     *\n     * @param string $preg\n     *\n     * @return string\n     */\n    public function replace($preg)\n    {\n        return $this->compiler->replaceDelimiter($preg);\n    }\n\n        /**\n     * check if current value is an autoliteral left delimiter\n     *\n     * @return bool\n     */\n    public function isAutoLiteral()\n    {\n        return $this->smarty->getAutoLiteral() && isset($this->value[ $this->compiler->getLdelLength() ]) ?\n            strpos(\" \\n\\t\\r\", $this->value[ $this->compiler->getLdelLength() ]) !== false : false;\n    } // end function\n\n    public function yylex()\n    {\n        return $this->{'yylex' . $this->_yy_state}();\n    }\n\n    public function yypushstate($state)\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState push %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n        array_push($this->_yy_stack, $this->_yy_state);\n        $this->_yy_state = $state;\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%snew State %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yypopstate()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState pop %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n        $this->_yy_state = array_pop($this->_yy_stack);\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%snew State %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\n    public function yybegin($state)\n    {\n        $this->_yy_state = $state;\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sState set %s\\n\",\n                    $this->yyTracePrompt,\n                    isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :\n                        $this->_yy_state);\n        }\n    }\n\npublic function yylex1()\n    {\n        if (!isset($this->yy_global_pattern1)) {\n            $this->yy_global_pattern1 =\n                $this->replace(\"/\\G([{][}])|\\G((SMARTYldel)SMARTYal[*])|\\G((SMARTYldel)SMARTYalphp([ ].*?)?SMARTYrdel|(SMARTYldel)SMARTYal[\\/]phpSMARTYrdel)|\\G((SMARTYldel)SMARTYautoliteral\\\\s+SMARTYliteral)|\\G((SMARTYldel)SMARTYalliteral\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/]literal\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal)|\\G([<][?]((php\\\\s+|=)|\\\\s+)|[<][%]|[<][?]xml\\\\s+|[<]script\\\\s+language\\\\s*=\\\\s*[\\\"']?\\\\s*php\\\\s*[\\\"']?\\\\s*[>]|[?][>]|[%][>])|\\G((.*?)(?=((SMARTYldel)SMARTYal|[<][?]((php\\\\s+|=)|\\\\s+)|[<][%]|[<][?]xml\\\\s+|[<]script\\\\s+language\\\\s*=\\\\s*[\\\"']?\\\\s*php\\\\s*[\\\"']?\\\\s*[>]|[?][>]|[%][>]SMARTYliteral))|[\\s\\S]+)/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state TEXT');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r1_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r1_1()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r1_2()\n    {\n        preg_match(\"/[*]{$this->compiler->getRdelPreg()}[\\n]?/\",\n                   $this->data,\n                   $match,\n                   PREG_OFFSET_CAPTURE,\n                   $this->counter);\n        if (isset($match[ 0 ][ 1 ])) {\n            $to = $match[ 0 ][ 1 ] + strlen($match[ 0 ][ 0 ]);\n        } else {\n            $this->compiler->trigger_template_error(\"missing or misspelled comment closing tag '{$this->smarty->getRightDelimiter()}'\");\n        }\n        $this->value = substr($this->data, $this->counter, $to - $this->counter);\n        return false;\n    }\n\n    function yy_r1_4()\n    {\n        $this->compiler->getTagCompiler('private_php')->parsePhp($this);\n    }\n\n    function yy_r1_8()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r1_10()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;\n        $this->yypushstate(self::LITERAL);\n    }\n\n        function yy_r1_12()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LITERALEND;\n        $this->yypushstate(self::LITERAL);\n    } // end function\n\n    function yy_r1_14()\n    {\n        $this->yypushstate(self::TAG);\n        return true;\n    }\n\n    function yy_r1_16()\n    {\n        $this->compiler->getTagCompiler('private_php')->parsePhp($this);\n    }\n\n    function yy_r1_19()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\npublic function yylex2()\n    {\n        if (!isset($this->yy_global_pattern2)) {\n            $this->yy_global_pattern2 =\n                $this->replace(\"/\\G((SMARTYldel)SMARTYal(if|elseif|else if|while)\\\\s+)|\\G((SMARTYldel)SMARTYalfor\\\\s+)|\\G((SMARTYldel)SMARTYalforeach(?![^\\s]))|\\G((SMARTYldel)SMARTYalsetfilter\\\\s+)|\\G((SMARTYldel)SMARTYalmake_nocache\\\\s+)|\\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\\\w*(\\\\s+nocache)?\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[$]smarty\\\\.block\\\\.(child|parent)\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/][0-9]*[a-zA-Z_]\\\\w*\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[$][0-9]*[a-zA-Z_]\\\\w*(\\\\s+nocache)?\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/])|\\G((SMARTYldel)SMARTYal)/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state TAG');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r2_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r2_1()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELIF;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_4()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_6()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_8()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_10()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELMAKENOCACHE;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_12()\n    {\n        $this->yypopstate();\n        $this->token = Smarty_Internal_Templateparser::TP_SIMPLETAG;\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_15()\n    {\n        $this->yypopstate();\n        $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT;\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_18()\n    {\n        $this->yypopstate();\n        $this->token = Smarty_Internal_Templateparser::TP_CLOSETAG;\n        $this->taglineno = $this->line;\n    }\n\n        function yy_r2_20()\n    {\n        if ($this->_yy_stack[ count($this->_yy_stack) - 1 ] === self::TEXT) {\n            $this->yypopstate();\n            $this->token = Smarty_Internal_Templateparser::TP_SIMPELOUTPUT;\n            $this->taglineno = $this->line;\n        } else {\n            $this->value = $this->smarty->getLeftDelimiter();\n            $this->token = Smarty_Internal_Templateparser::TP_LDEL;\n            $this->yybegin(self::TAGBODY);\n            $this->taglineno = $this->line;\n        }\n    } // end function\n\n    function yy_r2_23()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r2_25()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDEL;\n        $this->yybegin(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\npublic function yylex3()\n    {\n        if (!isset($this->yy_global_pattern3)) {\n            $this->yy_global_pattern3 =\n                $this->replace(\"/\\G(\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal)|\\G([\\\"])|\\G('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*')|\\G([$][0-9]*[a-zA-Z_]\\\\w*)|\\G([$])|\\G(\\\\s+is\\\\s+in\\\\s+)|\\G(\\\\s+as\\\\s+)|\\G(\\\\s+to\\\\s+)|\\G(\\\\s+step\\\\s+)|\\G(\\\\s+instanceof\\\\s+)|\\G(\\\\s*([!=][=]{1,2}|[<][=>]?|[>][=]?|[&|]{2})\\\\s*)|\\G(\\\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\\\\s+)|\\G(\\\\s+is\\\\s+(not\\\\s+)?(odd|even|div)\\\\s+by\\\\s+)|\\G(\\\\s+is\\\\s+(not\\\\s+)?(odd|even))|\\G([!]\\\\s*|not\\\\s+)|\\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\\\s*)|\\G(\\\\s*[(]\\\\s*)|\\G(\\\\s*[)])|\\G(\\\\[\\\\s*)|\\G(\\\\s*\\\\])|\\G(\\\\s*[-][>]\\\\s*)|\\G(\\\\s*[=][>]\\\\s*)|\\G(\\\\s*[=]\\\\s*)|\\G(([+]|[-]){2})|\\G(\\\\s*([+]|[-])\\\\s*)|\\G(\\\\s*([*]{1,2}|[%\\/^&]|[<>]{2})\\\\s*)|\\G([@])|\\G([#])|\\G(\\\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\\-:]*\\\\s*[=]\\\\s*)|\\G(([0-9]*[a-zA-Z_]\\\\w*)?(\\\\\\\\[0-9]*[a-zA-Z_]\\\\w*)+)|\\G([0-9]*[a-zA-Z_]\\\\w*)|\\G(\\\\d+)|\\G([`])|\\G([|][@]?)|\\G([.])|\\G(\\\\s*[,]\\\\s*)|\\G(\\\\s*[;]\\\\s*)|\\G([:]{2})|\\G(\\\\s*[:]\\\\s*)|\\G(\\\\s*[?]\\\\s*)|\\G(0[xX][0-9a-fA-F]+)|\\G(\\\\s+)|\\G([\\S\\s])/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state TAGBODY');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r3_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r3_1()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_RDEL;\n        $this->yypopstate();\n    }\n\n    function yy_r3_2()\n    {\n        $this->yypushstate(self::TAG);\n        return true;\n    }\n\n    function yy_r3_4()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_QUOTE;\n        $this->yypushstate(self::DOUBLEQUOTEDSTRING);\n        $this->compiler->enterDoubleQuote();\n    }\n\n    function yy_r3_5()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;\n    }\n\n    function yy_r3_6()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;\n    }\n\n    function yy_r3_7()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_DOLLAR;\n    }\n\n    function yy_r3_8()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_ISIN;\n    }\n\n    function yy_r3_9()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_AS;\n    }\n\n    function yy_r3_10()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TO;\n    }\n\n    function yy_r3_11()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_STEP;\n    }\n\n    function yy_r3_12()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;\n    }\n\n    function yy_r3_13()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LOGOP;\n    }\n\n    function yy_r3_15()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_SLOGOP;\n    }\n\n    function yy_r3_17()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TLOGOP;\n    }\n\n    function yy_r3_20()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_SINGLECOND;\n    }\n\n    function yy_r3_23()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_NOT;\n    }\n\n    function yy_r3_24()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TYPECAST;\n    }\n\n    function yy_r3_28()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_OPENP;\n    }\n\n    function yy_r3_29()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_CLOSEP;\n    }\n\n    function yy_r3_30()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_OPENB;\n    }\n\n    function yy_r3_31()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_CLOSEB;\n    }\n\n    function yy_r3_32()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_PTR;\n    }\n\n    function yy_r3_33()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_APTR;\n    }\n\n    function yy_r3_34()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_EQUAL;\n    }\n\n    function yy_r3_35()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_INCDEC;\n    }\n\n    function yy_r3_37()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_UNIMATH;\n    }\n\n    function yy_r3_39()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_MATH;\n    }\n\n    function yy_r3_41()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_AT;\n    }\n\n    function yy_r3_42()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_HATCH;\n    }\n\n    function yy_r3_43()\n    {\n        // resolve conflicts with shorttag and right_delimiter starting with '='\n        if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->compiler->getRdelLength()) ===\n            $this->smarty->getRightDelimiter()) {\n            preg_match('/\\s+/', $this->value, $match);\n            $this->value = $match[ 0 ];\n            $this->token = Smarty_Internal_Templateparser::TP_SPACE;\n        } else {\n            $this->token = Smarty_Internal_Templateparser::TP_ATTR;\n        }\n    }\n\n    function yy_r3_44()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_NAMESPACE;\n    }\n\n    function yy_r3_47()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_ID;\n    }\n\n    function yy_r3_48()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_INTEGER;\n    }\n\n    function yy_r3_49()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;\n        $this->yypopstate();\n    }\n\n    function yy_r3_50()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_VERT;\n    }\n\n    function yy_r3_51()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_DOT;\n    }\n\n    function yy_r3_52()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_COMMA;\n    }\n\n    function yy_r3_53()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;\n    }\n\n    function yy_r3_54()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;\n    }\n\n    function yy_r3_55()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_COLON;\n    }\n\n    function yy_r3_56()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_QMARK;\n    }\n\n    function yy_r3_57()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_HEX;\n    }\n\n        function yy_r3_58()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_SPACE;\n    } // end function\n\n    function yy_r3_59()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\npublic function yylex4()\n    {\n        if (!isset($this->yy_global_pattern4)) {\n            $this->yy_global_pattern4 =\n                $this->replace(\"/\\G((SMARTYldel)SMARTYalliteral\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/]literal\\\\s*SMARTYrdel)|\\G((.*?)(?=(SMARTYldel)SMARTYal[\\/]?literalSMARTYrdel))/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state LITERAL');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r4_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r4_1()\n    {\n        $this->literal_cnt++;\n        $this->token = Smarty_Internal_Templateparser::TP_LITERAL;\n    }\n\n    function yy_r4_3()\n    {\n        if ($this->literal_cnt) {\n            $this->literal_cnt--;\n            $this->token = Smarty_Internal_Templateparser::TP_LITERAL;\n        } else {\n            $this->token = Smarty_Internal_Templateparser::TP_LITERALEND;\n            $this->yypopstate();\n        }\n    }\n\n        function yy_r4_5()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LITERAL;\n    } // end function\n\npublic function yylex5()\n    {\n        if (!isset($this->yy_global_pattern5)) {\n            $this->yy_global_pattern5 =\n                $this->replace(\"/\\G((SMARTYldel)SMARTYautoliteral\\\\s+SMARTYliteral)|\\G((SMARTYldel)SMARTYalliteral\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/]literal\\\\s*SMARTYrdel)|\\G((SMARTYldel)SMARTYal[\\/])|\\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\\\w*)|\\G((SMARTYldel)SMARTYal)|\\G([\\\"])|\\G([`][$])|\\G([$][0-9]*[a-zA-Z_]\\\\w*)|\\G([$])|\\G(([^\\\"\\\\\\\\]*?)((?:\\\\\\\\.[^\\\"\\\\\\\\]*?)*?)(?=((SMARTYldel)SMARTYal|\\\\$|`\\\\$|\\\"SMARTYliteral)))/isS\");\n        }\n        if (!isset($this->dataLength)) {\n            $this->dataLength = strlen($this->data);\n        }\n        if ($this->counter >= $this->dataLength) {\n            return false; // end of input\n        }\n        do {\n            if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, 0, $this->counter)) {\n                if (!isset($yymatches[ 0 ][ 1 ])) {\n                    $yymatches = preg_grep(\"/(.|\\s)+/\", $yymatches);\n                } else {\n                    $yymatches = array_filter($yymatches);\n                }\n                if (empty($yymatches)) {\n                    throw new Exception('Error: lexing failed because a rule matched' .\n                                        ' an empty string.  Input \"' . substr($this->data,\n                                                                              $this->counter,\n                                                                              5) . '... state DOUBLEQUOTEDSTRING');\n                }\n                next($yymatches); // skip global match\n                $this->token = key($yymatches); // token number\n                $this->value = current($yymatches); // token value\n                $r = $this->{'yy_r5_' . $this->token}();\n                if ($r === null) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    // accept this token\n                    return true;\n                } else if ($r === true) {\n                    // we have changed state\n                    // process this token in the new state\n                    return $this->yylex();\n                } else if ($r === false) {\n                    $this->counter += strlen($this->value);\n                    $this->line += substr_count($this->value, \"\\n\");\n                    if ($this->counter >= $this->dataLength) {\n                        return false; // end of input\n                    }\n                    // skip this token\n                    continue;\n                }\n            } else {\n                throw new Exception('Unexpected input at line' . $this->line .\n                                    ': ' . $this->data[ $this->counter ]);\n            }\n            break;\n        } while (true);\n    }\n\n    function yy_r5_1()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r5_3()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r5_5()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r5_7()\n    {\n        $this->yypushstate(self::TAG);\n        return true;\n    }\n\n    function yy_r5_9()\n    {\n        $this->yypushstate(self::TAG);\n        return true;\n    }\n\n    function yy_r5_11()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_LDEL;\n        $this->taglineno = $this->line;\n        $this->yypushstate(self::TAGBODY);\n    }\n\n    function yy_r5_13()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_QUOTE;\n        $this->yypopstate();\n    }\n\n    function yy_r5_14()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;\n        $this->value = substr($this->value, 0, -1);\n        $this->yypushstate(self::TAGBODY);\n        $this->taglineno = $this->line;\n    }\n\n    function yy_r5_15()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;\n    }\n\n    function yy_r5_16()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n\n    function yy_r5_17()\n    {\n        $this->token = Smarty_Internal_Templateparser::TP_TEXT;\n    }\n}\n\n     "
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_templateparser.php",
    "content": "<?php\n\nclass TP_yyStackEntry\n{\n    public $stateno;       /* The state-number */\n    public $major;         /* The major token value.  This is the code\n                     ** number for the token at this stack level */\n    public $minor; /* The user-supplied minor token value.  This\n                     ** is the value of the token  */\n}\n\n;\n#line 11 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n/**\n * Smarty Template Parser Class\n *\n * This is the template parser.\n * It is generated from the smarty_internal_templateparser.y file\n *\n * @author Uwe Tews <uwe.tews@googlemail.com>\n */\nclass Smarty_Internal_Templateparser\n{\n    #line 23 \"../smarty/lexer/smarty_internal_templateparser.y\"\n    const Err1 = 'Security error: Call to private object member not allowed';\n    const Err2 = 'Security error: Call to dynamic object member not allowed';\n    const Err3 = 'PHP in template not allowed. Use SmartyBC to enable it';\n    const TP_VERT                   = 1;\n    const TP_COLON                  = 2;\n    const TP_UNIMATH                = 3;\n    const TP_PHP                    = 4;\n    const TP_TEXT                   = 5;\n    const TP_STRIPON                = 6;\n    const TP_STRIPOFF               = 7;\n    const TP_LITERALSTART           = 8;\n    const TP_LITERALEND             = 9;\n    const TP_LITERAL                = 10;\n    const TP_SIMPELOUTPUT           = 11;\n    const TP_SIMPLETAG              = 12;\n    const TP_SMARTYBLOCKCHILDPARENT = 13;\n    const TP_LDEL                   = 14;\n    const TP_RDEL                   = 15;\n    const TP_DOLLARID               = 16;\n    const TP_EQUAL                  = 17;\n    const TP_ID                     = 18;\n    const TP_PTR                    = 19;\n    const TP_LDELMAKENOCACHE        = 20;\n    const TP_LDELIF                 = 21;\n    const TP_LDELFOR                = 22;\n    const TP_SEMICOLON              = 23;\n    const TP_INCDEC                 = 24;\n    const TP_TO                     = 25;\n    const TP_STEP                   = 26;\n    const TP_LDELFOREACH            = 27;\n    const TP_SPACE                  = 28;\n    const TP_AS                     = 29;\n    const TP_APTR                   = 30;\n    const TP_LDELSETFILTER          = 31;\n    const TP_CLOSETAG               = 32;\n    const TP_LDELSLASH              = 33;\n    const TP_ATTR                   = 34;\n    const TP_INTEGER                = 35;\n    const TP_COMMA                  = 36;\n    const TP_OPENP                  = 37;\n    const TP_CLOSEP                 = 38;\n    const TP_MATH                   = 39;\n    const TP_ISIN                   = 40;\n    const TP_QMARK                  = 41;\n    const TP_NOT                    = 42;\n    const TP_TYPECAST               = 43;\n    const TP_HEX                    = 44;\n    const TP_DOT                    = 45;\n    const TP_INSTANCEOF             = 46;\n    const TP_SINGLEQUOTESTRING      = 47;\n    const TP_DOUBLECOLON            = 48;\n    const TP_NAMESPACE              = 49;\n    const TP_AT                     = 50;\n    const TP_HATCH                  = 51;\n    const TP_OPENB                  = 52;\n    const TP_CLOSEB                 = 53;\n    const TP_DOLLAR                 = 54;\n    const TP_LOGOP                  = 55;\n    const TP_SLOGOP                 = 56;\n    const TP_TLOGOP                 = 57;\n    const TP_SINGLECOND             = 58;\n    const TP_QUOTE                  = 59;\n    const TP_BACKTICK               = 60;\n    const YY_NO_ACTION              = 511;\n    const YY_ACCEPT_ACTION          = 510;\n    const YY_ERROR_ACTION           = 509;\n    const YY_SZ_ACTTAB = 2178;\n    const YY_SHIFT_USE_DFLT = -23;\n    const YY_SHIFT_MAX      = 227;\n    const YY_REDUCE_USE_DFLT = -68;\n    const YY_REDUCE_MAX      = 176;\n    const YYNOCODE      = 108;\n    const YYSTACKDEPTH  = 500;\n    const YYNSTATE      = 323;\n    const YYNRULE       = 186;\n    const YYERRORSYMBOL = 61;\n    const YYERRSYMDT    = 'yy0';\n    const YYFALLBACK    = 0;\n    /**\n     * result status\n     *\n     * @var bool\n     */\n    public $successful = true;\n    /**\n     * return value\n     *\n     * @var mixed\n     */\n    public $retvalue = 0;\n    /**\n     * @var\n     */\n    public $yymajor;\n    /**\n     * last index of array variable\n     *\n     * @var mixed\n     */\n    public $last_index;\n    /**\n     * last variable name\n     *\n     * @var string\n     */\n    public $last_variable;\n    /**\n     * root parse tree buffer\n     *\n     * @var Smarty_Internal_ParseTree\n     */\n    public $root_buffer;\n    /**\n     * current parse tree object\n     *\n     * @var Smarty_Internal_ParseTree\n     */\n    public $current_buffer;\n    /**\n     * lexer object\n     *\n     * @var Smarty_Internal_Templatelexer\n     */\n    public $lex;\n    /**\n     * internal error flag\n     *\n     * @var bool\n     */\n    private $internalError = false;\n    /**\n     * {strip} status\n     *\n     * @var bool\n     */\n    public $strip = false;\n    /**\n     * compiler object\n     *\n     * @var Smarty_Internal_TemplateCompilerBase\n     */\n    public $compiler = null;\n    /**\n     * smarty object\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n    /**\n     * template object\n     *\n     * @var Smarty_Internal_Template\n     */\n    public $template = null;\n    /**\n     * block nesting level\n     *\n     * @var int\n     */\n    public $block_nesting_level = 0;\n    /**\n     * security object\n     *\n     * @var Smarty_Security\n     */\n    public $security = null;\n    /**\n     * template prefix array\n     *\n     * @var \\Smarty_Internal_ParseTree[]\n     */\n    public $template_prefix = array();\n    /**\n     * template prefix array\n     *\n     * @var \\Smarty_Internal_ParseTree[]\n     */\n    public $template_postfix = array();\n    static public $yy_action    = array(\n        43, 266, 267, 379, 115, 203, 33, 201, 274, 275,\n        281, 1, 13, 124, 93, 183, 379, 217, 6, 79,\n        253, 89, 379, 16, 102, 425, 304, 252, 218, 249,\n        211, 129, 190, 302, 26, 213, 425, 33, 11, 39,\n        42, 283, 209, 13, 223, 385, 195, 233, 77, 3,\n        236, 290, 43, 385, 170, 385, 75, 17, 385, 94,\n        274, 275, 281, 1, 385, 128, 385, 196, 385, 217,\n        6, 79, 80, 298, 158, 210, 102, 156, 174, 133,\n        218, 249, 211, 85, 208, 290, 28, 264, 101, 264,\n        199, 39, 42, 283, 209, 31, 312, 182, 195, 259,\n        77, 3, 43, 290, 23, 172, 239, 174, 75, 288,\n        274, 275, 281, 1, 167, 127, 256, 196, 248, 217,\n        6, 79, 345, 40, 20, 305, 102, 248, 345, 157,\n        218, 249, 211, 83, 208, 290, 26, 8, 174, 264,\n        74, 39, 42, 283, 209, 131, 312, 292, 195, 74,\n        77, 3, 43, 290, 295, 99, 243, 174, 75, 345,\n        274, 275, 281, 1, 15, 126, 86, 196, 248, 217,\n        6, 79, 345, 322, 161, 289, 102, 87, 345, 165,\n        218, 249, 211, 290, 208, 115, 26, 128, 255, 221,\n        74, 39, 42, 283, 209, 93, 312, 210, 195, 162,\n        77, 3, 43, 290, 254, 235, 247, 304, 75, 27,\n        274, 275, 281, 1, 172, 127, 425, 177, 248, 217,\n        6, 79, 77, 174, 250, 290, 102, 425, 198, 14,\n        218, 249, 211, 248, 208, 34, 26, 222, 206, 139,\n        74, 39, 42, 283, 209, 198, 312, 23, 195, 291,\n        77, 3, 43, 290, 300, 74, 198, 438, 75, 346,\n        274, 275, 281, 1, 438, 127, 176, 196, 267, 217,\n        6, 79, 346, 161, 289, 290, 102, 23, 346, 238,\n        218, 249, 211, 33, 178, 263, 26, 160, 289, 13,\n        37, 39, 42, 283, 209, 198, 312, 212, 195, 250,\n        77, 3, 43, 290, 216, 189, 155, 97, 75, 381,\n        274, 275, 281, 1, 149, 127, 264, 179, 18, 217,\n        6, 79, 381, 94, 97, 237, 102, 140, 381, 251,\n        218, 249, 211, 4, 194, 94, 26, 264, 198, 37,\n        30, 39, 42, 283, 209, 198, 312, 212, 195, 129,\n        77, 3, 43, 290, 219, 172, 11, 97, 75, 378,\n        274, 275, 281, 1, 101, 127, 438, 186, 210, 217,\n        6, 79, 378, 438, 12, 163, 102, 220, 378, 425,\n        218, 249, 211, 302, 208, 213, 26, 225, 215, 187,\n        425, 39, 42, 283, 209, 234, 312, 7, 195, 212,\n        77, 3, 43, 290, 134, 9, 240, 425, 75, 97,\n        274, 275, 281, 1, 264, 91, 109, 76, 425, 217,\n        6, 79, 253, 293, 426, 16, 102, 251, 198, 252,\n        218, 249, 211, 198, 208, 426, 26, 148, 198, 135,\n        132, 39, 42, 283, 209, 143, 312, 264, 195, 264,\n        77, 3, 43, 290, 138, 264, 205, 24, 75, 166,\n        274, 275, 281, 1, 264, 125, 276, 196, 19, 217,\n        6, 79, 454, 153, 13, 454, 102, 168, 290, 454,\n        218, 249, 211, 174, 208, 314, 5, 136, 210, 251,\n        152, 39, 42, 283, 209, 268, 312, 213, 195, 308,\n        77, 3, 43, 290, 94, 169, 111, 144, 75, 251,\n        274, 275, 281, 1, 229, 128, 7, 196, 313, 217,\n        6, 79, 510, 90, 175, 111, 102, 164, 289, 174,\n        218, 249, 211, 101, 208, 265, 28, 32, 128, 150,\n        261, 39, 42, 283, 209, 10, 312, 317, 195, 224,\n        77, 21, 269, 290, 232, 230, 282, 114, 75, 307,\n        214, 213, 279, 22, 84, 103, 246, 181, 92, 64,\n        260, 262, 454, 77, 93, 454, 290, 257, 316, 454,\n        438, 228, 311, 197, 309, 78, 304, 271, 272, 273,\n        270, 121, 258, 310, 274, 275, 281, 1, 17, 280,\n        110, 284, 81, 217, 6, 79, 438, 146, 94, 438,\n        102, 454, 151, 438, 218, 249, 211, 307, 214, 213,\n        279, 278, 84, 103, 104, 180, 92, 56, 263, 159,\n        130, 152, 93, 295, 137, 257, 316, 295, 251, 88,\n        311, 197, 309, 82, 304, 307, 295, 213, 303, 295,\n        100, 295, 295, 193, 105, 59, 295, 295, 295, 295,\n        93, 295, 295, 257, 316, 295, 295, 295, 311, 197,\n        309, 307, 304, 213, 277, 295, 100, 103, 295, 181,\n        92, 64, 200, 297, 295, 253, 93, 295, 16, 257,\n        316, 295, 252, 295, 311, 197, 309, 295, 304, 295,\n        299, 295, 295, 295, 295, 295, 274, 275, 281, 2,\n        295, 301, 295, 295, 295, 217, 6, 79, 253, 295,\n        295, 16, 102, 299, 204, 252, 218, 249, 211, 274,\n        275, 281, 2, 295, 301, 33, 295, 154, 217, 6,\n        79, 13, 295, 295, 295, 102, 295, 295, 295, 218,\n        249, 211, 295, 295, 286, 25, 307, 295, 213, 295,\n        295, 100, 295, 295, 193, 105, 59, 295, 295, 295,\n        295, 93, 295, 295, 257, 316, 295, 287, 25, 311,\n        197, 309, 307, 304, 213, 295, 454, 100, 295, 454,\n        193, 118, 67, 454, 296, 253, 295, 93, 16, 295,\n        257, 316, 252, 295, 295, 311, 197, 309, 295, 304,\n        295, 295, 307, 295, 213, 295, 188, 100, 295, 295,\n        193, 118, 67, 295, 295, 454, 295, 93, 295, 295,\n        257, 316, 295, 295, 226, 311, 197, 309, 295, 304,\n        295, 295, 307, 295, 213, 295, 192, 100, 295, 295,\n        193, 118, 67, 295, 295, 295, 295, 93, 295, 295,\n        257, 316, 295, 295, 295, 311, 197, 309, 295, 304,\n        295, 295, 307, 295, 213, 295, 191, 98, 295, 295,\n        193, 118, 46, 295, 108, 295, 295, 93, 295, 295,\n        257, 316, 295, 295, 295, 311, 197, 309, 307, 304,\n        213, 295, 295, 98, 295, 295, 193, 118, 47, 295,\n        219, 295, 295, 93, 295, 295, 257, 316, 295, 295,\n        295, 311, 197, 309, 307, 304, 213, 295, 295, 100,\n        295, 295, 193, 118, 45, 295, 295, 295, 295, 93,\n        295, 295, 257, 316, 295, 295, 295, 311, 197, 309,\n        295, 304, 295, 295, 307, 295, 213, 295, 295, 100,\n        295, 295, 193, 118, 70, 295, 295, 295, 295, 93,\n        295, 295, 257, 316, 295, 295, 295, 311, 197, 309,\n        307, 304, 213, 295, 295, 100, 295, 295, 193, 118,\n        49, 295, 295, 295, 295, 93, 295, 295, 257, 316,\n        295, 295, 295, 311, 197, 309, 307, 304, 213, 295,\n        295, 100, 295, 295, 193, 96, 66, 295, 295, 295,\n        295, 93, 295, 295, 257, 316, 295, 295, 295, 311,\n        197, 309, 295, 304, 295, 295, 307, 295, 213, 295,\n        295, 100, 295, 295, 193, 118, 44, 295, 295, 295,\n        295, 93, 295, 295, 257, 316, 295, 295, 295, 311,\n        197, 309, 307, 304, 213, 295, 295, 100, 295, 295,\n        193, 118, 58, 295, 295, 295, 295, 93, 295, 295,\n        257, 316, 295, 295, 295, 311, 197, 309, 307, 304,\n        213, 295, 295, 100, 295, 295, 193, 118, 54, 295,\n        295, 295, 295, 93, 295, 295, 257, 316, 295, 295,\n        295, 311, 197, 309, 295, 304, 295, 295, 307, 295,\n        213, 295, 295, 100, 295, 295, 193, 118, 71, 295,\n        295, 295, 295, 93, 295, 295, 257, 316, 295, 295,\n        295, 311, 197, 309, 307, 304, 213, 295, 295, 100,\n        295, 295, 193, 118, 65, 295, 295, 295, 295, 93,\n        295, 295, 257, 316, 295, 295, 295, 311, 197, 309,\n        307, 304, 213, 295, 295, 100, 295, 295, 193, 96,\n        57, 295, 295, 295, 295, 93, 295, 295, 257, 316,\n        295, 295, 295, 311, 197, 309, 295, 304, 295, 295,\n        307, 295, 213, 295, 295, 100, 295, 295, 185, 106,\n        53, 295, 295, 295, 295, 93, 295, 295, 257, 316,\n        295, 295, 295, 311, 197, 309, 307, 304, 213, 295,\n        295, 100, 295, 295, 193, 118, 60, 295, 295, 295,\n        295, 93, 295, 295, 257, 316, 295, 295, 295, 311,\n        197, 309, 307, 304, 213, 295, 295, 100, 295, 295,\n        193, 118, 73, 295, 295, 295, 295, 93, 295, 295,\n        257, 316, 295, 295, 295, 311, 197, 309, 295, 304,\n        295, 295, 307, 295, 213, 295, 295, 100, 295, 295,\n        193, 118, 55, 295, 295, 295, 295, 93, 295, 295,\n        257, 316, 295, 295, 295, 311, 197, 309, 307, 304,\n        213, 295, 295, 100, 295, 295, 193, 95, 68, 295,\n        295, 295, 295, 93, 295, 295, 257, 316, 295, 295,\n        295, 311, 197, 309, 307, 304, 213, 295, 295, 100,\n        295, 295, 193, 118, 69, 295, 295, 295, 295, 93,\n        295, 295, 257, 316, 295, 295, 295, 311, 197, 309,\n        295, 304, 295, 295, 307, 295, 213, 295, 295, 100,\n        295, 295, 193, 118, 51, 295, 295, 295, 295, 93,\n        295, 295, 257, 316, 295, 295, 295, 311, 197, 309,\n        307, 304, 213, 295, 295, 100, 295, 295, 184, 118,\n        52, 295, 295, 295, 295, 93, 295, 295, 257, 316,\n        295, 295, 295, 311, 197, 309, 307, 304, 213, 295,\n        295, 100, 295, 295, 193, 118, 47, 295, 295, 295,\n        295, 93, 295, 295, 257, 316, 295, 295, 295, 311,\n        197, 309, 295, 304, 295, 295, 307, 295, 213, 295,\n        295, 100, 295, 295, 193, 118, 50, 295, 295, 295,\n        295, 93, 295, 295, 257, 316, 295, 295, 295, 311,\n        197, 309, 307, 304, 213, 295, 295, 100, 295, 295,\n        193, 118, 62, 295, 295, 295, 295, 93, 295, 295,\n        257, 316, 295, 295, 295, 311, 197, 309, 307, 304,\n        213, 295, 295, 100, 295, 295, 193, 118, 63, 295,\n        295, 295, 295, 93, 295, 295, 257, 316, 295, 295,\n        295, 311, 197, 309, 295, 304, 295, 295, 307, 295,\n        213, 295, 295, 100, 295, 295, 193, 118, 61, 295,\n        295, 295, 295, 93, 295, 295, 257, 316, 295, 295,\n        295, 311, 197, 309, 307, 304, 213, 295, 295, 100,\n        295, 295, 193, 118, 48, 295, 295, 295, 295, 93,\n        295, 295, 257, 316, 391, 391, 391, 311, 197, 309,\n        307, 304, 213, 295, 295, 100, 295, 295, 193, 118,\n        72, 295, 295, 295, 295, 93, 295, 295, 257, 316,\n        295, 295, 295, 311, 197, 309, 295, 304, 295, 295,\n        425, 295, 391, 391, 295, 295, 295, 295, 307, 295,\n        213, 425, 198, 100, 38, 295, 193, 112, 391, 391,\n        391, 391, 38, 93, 295, 295, 295, 306, 295, 295,\n        295, 311, 197, 309, 295, 304, 295, 35, 307, 33,\n        213, 295, 295, 100, 295, 13, 193, 120, 295, 295,\n        41, 36, 198, 93, 38, 295, 295, 231, 41, 36,\n        295, 311, 197, 309, 295, 304, 319, 318, 315, 245,\n        295, 207, 295, 295, 319, 318, 315, 245, 295, 33,\n        454, 295, 295, 454, 295, 13, 207, 454, 438, 295,\n        41, 36, 295, 295, 295, 454, 295, 295, 454, 295,\n        295, 14, 454, 438, 295, 295, 319, 318, 315, 245,\n        295, 198, 295, 38, 438, 295, 295, 438, 307, 454,\n        213, 438, 320, 100, 295, 241, 193, 122, 295, 438,\n        295, 295, 438, 93, 454, 295, 438, 295, 198, 295,\n        38, 311, 197, 309, 295, 304, 307, 295, 213, 41,\n        36, 100, 295, 295, 193, 117, 295, 295, 295, 295,\n        295, 93, 295, 295, 295, 319, 318, 315, 245, 311,\n        197, 309, 207, 304, 295, 295, 41, 36, 295, 295,\n        295, 454, 295, 295, 454, 295, 295, 4, 454, 438,\n        295, 295, 319, 318, 315, 245, 295, 294, 295, 295,\n        295, 307, 295, 213, 295, 295, 100, 295, 295, 193,\n        123, 295, 295, 295, 295, 438, 93, 295, 438, 141,\n        454, 295, 438, 167, 311, 197, 309, 295, 304, 264,\n        295, 295, 40, 20, 305, 295, 295, 307, 295, 213,\n        295, 198, 100, 38, 295, 193, 116, 174, 307, 295,\n        213, 295, 93, 100, 295, 295, 193, 113, 295, 295,\n        311, 197, 309, 93, 304, 295, 198, 295, 38, 295,\n        295, 311, 197, 309, 295, 304, 307, 295, 213, 41,\n        36, 100, 295, 295, 193, 119, 295, 295, 295, 295,\n        295, 93, 295, 321, 145, 319, 318, 315, 245, 311,\n        197, 309, 207, 304, 41, 36, 295, 295, 295, 295,\n        295, 454, 295, 295, 454, 295, 295, 295, 454, 438,\n        319, 318, 315, 245, 198, 295, 38, 295, 198, 295,\n        38, 295, 198, 295, 38, 295, 295, 295, 242, 295,\n        295, 295, 285, 295, 295, 438, 171, 295, 438, 295,\n        454, 295, 438, 295, 295, 295, 295, 454, 295, 295,\n        454, 295, 41, 36, 454, 438, 41, 36, 295, 295,\n        41, 36, 198, 295, 38, 295, 295, 295, 319, 318,\n        315, 245, 319, 318, 315, 245, 319, 318, 315, 245,\n        295, 438, 295, 147, 438, 295, 454, 167, 438, 295,\n        295, 295, 295, 264, 295, 295, 40, 20, 305, 227,\n        41, 36, 295, 295, 295, 295, 295, 295, 295, 295,\n        295, 174, 295, 295, 295, 295, 319, 318, 315, 245,\n        198, 295, 38, 295, 198, 295, 38, 142, 198, 295,\n        38, 167, 295, 295, 173, 295, 295, 264, 295, 295,\n        40, 20, 305, 295, 295, 295, 107, 295, 198, 29,\n        38, 295, 198, 295, 38, 174, 295, 295, 41, 36,\n        295, 295, 41, 36, 295, 244, 41, 36, 295, 295,\n        295, 295, 295, 295, 319, 318, 315, 245, 319, 318,\n        315, 245, 319, 318, 315, 245, 41, 36, 295, 295,\n        41, 36, 295, 295, 295, 295, 295, 295, 295, 295,\n        295, 295, 319, 318, 315, 245, 319, 318, 315, 245,\n        198, 295, 295, 295, 295, 295, 295, 295, 295, 295,\n        295, 295, 295, 295, 349, 295, 295, 295, 202, 295,\n        295, 295, 295, 295, 295, 295, 295, 33, 295, 295,\n        295, 295, 295, 13, 295, 295, 425, 295, 295, 295,\n        295, 295, 295, 295, 295, 295, 295, 425,\n    );\n    static public $yy_lookahead = array(\n        3, 9, 10, 15, 71, 17, 28, 74, 11, 12,\n        13, 14, 34, 16, 81, 18, 28, 20, 21, 22,\n        11, 82, 34, 14, 27, 37, 93, 18, 31, 32,\n        33, 45, 35, 66, 37, 68, 48, 28, 52, 42,\n        43, 44, 45, 34, 47, 15, 49, 16, 51, 52,\n        53, 54, 3, 23, 77, 25, 59, 17, 28, 19,\n        11, 12, 13, 14, 34, 16, 36, 18, 38, 20,\n        21, 22, 105, 106, 94, 45, 27, 73, 101, 73,\n        31, 32, 33, 77, 35, 54, 37, 83, 48, 83,\n        65, 42, 43, 44, 45, 14, 47, 16, 49, 18,\n        51, 52, 3, 54, 36, 101, 38, 101, 59, 15,\n        11, 12, 13, 14, 77, 16, 35, 18, 24, 20,\n        21, 22, 28, 86, 87, 88, 27, 24, 34, 73,\n        31, 32, 33, 77, 35, 54, 37, 36, 101, 83,\n        46, 42, 43, 44, 45, 16, 47, 70, 49, 46,\n        51, 52, 3, 54, 53, 81, 53, 101, 59, 15,\n        11, 12, 13, 14, 23, 16, 37, 18, 24, 20,\n        21, 22, 28, 99, 97, 98, 27, 36, 34, 82,\n        31, 32, 33, 54, 35, 71, 37, 16, 74, 18,\n        46, 42, 43, 44, 45, 81, 47, 45, 49, 77,\n        51, 52, 3, 54, 90, 53, 18, 93, 59, 30,\n        11, 12, 13, 14, 101, 16, 37, 18, 24, 20,\n        21, 22, 51, 101, 102, 54, 27, 48, 1, 17,\n        31, 32, 33, 24, 35, 14, 37, 16, 50, 18,\n        46, 42, 43, 44, 45, 1, 47, 36, 49, 38,\n        51, 52, 3, 54, 60, 46, 1, 45, 59, 15,\n        11, 12, 13, 14, 52, 16, 8, 18, 10, 20,\n        21, 22, 28, 97, 98, 54, 27, 36, 34, 38,\n        31, 32, 33, 28, 35, 95, 37, 97, 98, 34,\n        2, 42, 43, 44, 45, 1, 47, 71, 49, 102,\n        51, 52, 3, 54, 78, 79, 73, 81, 59, 15,\n        11, 12, 13, 14, 71, 16, 83, 18, 17, 20,\n        21, 22, 28, 19, 81, 24, 27, 73, 34, 96,\n        31, 32, 33, 17, 35, 19, 37, 83, 1, 2,\n        17, 42, 43, 44, 45, 1, 47, 71, 49, 45,\n        51, 52, 3, 54, 78, 101, 52, 81, 59, 15,\n        11, 12, 13, 14, 48, 16, 45, 18, 45, 20,\n        21, 22, 28, 52, 14, 16, 27, 18, 34, 37,\n        31, 32, 33, 66, 35, 68, 37, 45, 64, 65,\n        48, 42, 43, 44, 45, 53, 47, 37, 49, 71,\n        51, 52, 3, 54, 73, 37, 78, 37, 59, 81,\n        11, 12, 13, 14, 83, 16, 48, 18, 48, 20,\n        21, 22, 11, 106, 37, 14, 27, 96, 1, 18,\n        31, 32, 33, 1, 35, 48, 37, 73, 1, 73,\n        16, 42, 43, 44, 45, 73, 47, 83, 49, 83,\n        51, 52, 3, 54, 73, 83, 19, 30, 59, 77,\n        11, 12, 13, 14, 83, 16, 70, 18, 28, 20,\n        21, 22, 11, 94, 34, 14, 27, 82, 54, 18,\n        31, 32, 33, 101, 35, 53, 37, 94, 45, 96,\n        94, 42, 43, 44, 45, 66, 47, 68, 49, 92,\n        51, 52, 3, 54, 19, 77, 99, 94, 59, 96,\n        11, 12, 13, 14, 38, 16, 37, 18, 92, 20,\n        21, 22, 62, 63, 18, 99, 27, 97, 98, 101,\n        31, 32, 33, 48, 35, 16, 37, 25, 16, 51,\n        18, 42, 43, 44, 45, 37, 47, 18, 49, 18,\n        51, 41, 9, 54, 53, 53, 15, 18, 59, 66,\n        67, 68, 69, 2, 71, 72, 18, 74, 75, 76,\n        18, 49, 11, 51, 81, 14, 54, 84, 85, 18,\n        19, 18, 89, 90, 91, 18, 93, 4, 5, 6,\n        7, 8, 18, 35, 11, 12, 13, 14, 17, 15,\n        18, 35, 81, 20, 21, 22, 45, 51, 19, 48,\n        27, 50, 94, 52, 31, 32, 33, 66, 67, 68,\n        69, 83, 71, 72, 80, 74, 75, 76, 95, 94,\n        81, 94, 81, 107, 94, 84, 85, 107, 96, 94,\n        89, 90, 91, 81, 93, 66, 107, 68, 98, 107,\n        71, 107, 107, 74, 75, 76, 107, 107, 107, 107,\n        81, 107, 107, 84, 85, 107, 107, 107, 89, 90,\n        91, 66, 93, 68, 69, 107, 71, 72, 107, 74,\n        75, 76, 103, 104, 107, 11, 81, 107, 14, 84,\n        85, 107, 18, 107, 89, 90, 91, 107, 93, 107,\n        5, 107, 107, 107, 107, 107, 11, 12, 13, 14,\n        107, 16, 107, 107, 107, 20, 21, 22, 11, 107,\n        107, 14, 27, 5, 50, 18, 31, 32, 33, 11,\n        12, 13, 14, 107, 16, 28, 107, 30, 20, 21,\n        22, 34, 107, 107, 107, 27, 107, 107, 107, 31,\n        32, 33, 107, 107, 59, 60, 66, 107, 68, 107,\n        107, 71, 107, 107, 74, 75, 76, 107, 107, 107,\n        107, 81, 107, 107, 84, 85, 107, 59, 60, 89,\n        90, 91, 66, 93, 68, 107, 11, 71, 107, 14,\n        74, 75, 76, 18, 104, 11, 107, 81, 14, 107,\n        84, 85, 18, 107, 107, 89, 90, 91, 107, 93,\n        107, 107, 66, 107, 68, 107, 100, 71, 107, 107,\n        74, 75, 76, 107, 107, 50, 107, 81, 107, 107,\n        84, 85, 107, 107, 50, 89, 90, 91, 107, 93,\n        107, 107, 66, 107, 68, 107, 100, 71, 107, 107,\n        74, 75, 76, 107, 107, 107, 107, 81, 107, 107,\n        84, 85, 107, 107, 107, 89, 90, 91, 107, 93,\n        107, 107, 66, 107, 68, 107, 100, 71, 107, 107,\n        74, 75, 76, 107, 78, 107, 107, 81, 107, 107,\n        84, 85, 107, 107, 107, 89, 90, 91, 66, 93,\n        68, 107, 107, 71, 107, 107, 74, 75, 76, 107,\n        78, 107, 107, 81, 107, 107, 84, 85, 107, 107,\n        107, 89, 90, 91, 66, 93, 68, 107, 107, 71,\n        107, 107, 74, 75, 76, 107, 107, 107, 107, 81,\n        107, 107, 84, 85, 107, 107, 107, 89, 90, 91,\n        107, 93, 107, 107, 66, 107, 68, 107, 107, 71,\n        107, 107, 74, 75, 76, 107, 107, 107, 107, 81,\n        107, 107, 84, 85, 107, 107, 107, 89, 90, 91,\n        66, 93, 68, 107, 107, 71, 107, 107, 74, 75,\n        76, 107, 107, 107, 107, 81, 107, 107, 84, 85,\n        107, 107, 107, 89, 90, 91, 66, 93, 68, 107,\n        107, 71, 107, 107, 74, 75, 76, 107, 107, 107,\n        107, 81, 107, 107, 84, 85, 107, 107, 107, 89,\n        90, 91, 107, 93, 107, 107, 66, 107, 68, 107,\n        107, 71, 107, 107, 74, 75, 76, 107, 107, 107,\n        107, 81, 107, 107, 84, 85, 107, 107, 107, 89,\n        90, 91, 66, 93, 68, 107, 107, 71, 107, 107,\n        74, 75, 76, 107, 107, 107, 107, 81, 107, 107,\n        84, 85, 107, 107, 107, 89, 90, 91, 66, 93,\n        68, 107, 107, 71, 107, 107, 74, 75, 76, 107,\n        107, 107, 107, 81, 107, 107, 84, 85, 107, 107,\n        107, 89, 90, 91, 107, 93, 107, 107, 66, 107,\n        68, 107, 107, 71, 107, 107, 74, 75, 76, 107,\n        107, 107, 107, 81, 107, 107, 84, 85, 107, 107,\n        107, 89, 90, 91, 66, 93, 68, 107, 107, 71,\n        107, 107, 74, 75, 76, 107, 107, 107, 107, 81,\n        107, 107, 84, 85, 107, 107, 107, 89, 90, 91,\n        66, 93, 68, 107, 107, 71, 107, 107, 74, 75,\n        76, 107, 107, 107, 107, 81, 107, 107, 84, 85,\n        107, 107, 107, 89, 90, 91, 107, 93, 107, 107,\n        66, 107, 68, 107, 107, 71, 107, 107, 74, 75,\n        76, 107, 107, 107, 107, 81, 107, 107, 84, 85,\n        107, 107, 107, 89, 90, 91, 66, 93, 68, 107,\n        107, 71, 107, 107, 74, 75, 76, 107, 107, 107,\n        107, 81, 107, 107, 84, 85, 107, 107, 107, 89,\n        90, 91, 66, 93, 68, 107, 107, 71, 107, 107,\n        74, 75, 76, 107, 107, 107, 107, 81, 107, 107,\n        84, 85, 107, 107, 107, 89, 90, 91, 107, 93,\n        107, 107, 66, 107, 68, 107, 107, 71, 107, 107,\n        74, 75, 76, 107, 107, 107, 107, 81, 107, 107,\n        84, 85, 107, 107, 107, 89, 90, 91, 66, 93,\n        68, 107, 107, 71, 107, 107, 74, 75, 76, 107,\n        107, 107, 107, 81, 107, 107, 84, 85, 107, 107,\n        107, 89, 90, 91, 66, 93, 68, 107, 107, 71,\n        107, 107, 74, 75, 76, 107, 107, 107, 107, 81,\n        107, 107, 84, 85, 107, 107, 107, 89, 90, 91,\n        107, 93, 107, 107, 66, 107, 68, 107, 107, 71,\n        107, 107, 74, 75, 76, 107, 107, 107, 107, 81,\n        107, 107, 84, 85, 107, 107, 107, 89, 90, 91,\n        66, 93, 68, 107, 107, 71, 107, 107, 74, 75,\n        76, 107, 107, 107, 107, 81, 107, 107, 84, 85,\n        107, 107, 107, 89, 90, 91, 66, 93, 68, 107,\n        107, 71, 107, 107, 74, 75, 76, 107, 107, 107,\n        107, 81, 107, 107, 84, 85, 107, 107, 107, 89,\n        90, 91, 107, 93, 107, 107, 66, 107, 68, 107,\n        107, 71, 107, 107, 74, 75, 76, 107, 107, 107,\n        107, 81, 107, 107, 84, 85, 107, 107, 107, 89,\n        90, 91, 66, 93, 68, 107, 107, 71, 107, 107,\n        74, 75, 76, 107, 107, 107, 107, 81, 107, 107,\n        84, 85, 107, 107, 107, 89, 90, 91, 66, 93,\n        68, 107, 107, 71, 107, 107, 74, 75, 76, 107,\n        107, 107, 107, 81, 107, 107, 84, 85, 107, 107,\n        107, 89, 90, 91, 107, 93, 107, 107, 66, 107,\n        68, 107, 107, 71, 107, 107, 74, 75, 76, 107,\n        107, 107, 107, 81, 107, 107, 84, 85, 107, 107,\n        107, 89, 90, 91, 66, 93, 68, 107, 107, 71,\n        107, 107, 74, 75, 76, 107, 107, 107, 107, 81,\n        107, 107, 84, 85, 1, 2, 3, 89, 90, 91,\n        66, 93, 68, 107, 107, 71, 107, 107, 74, 75,\n        76, 107, 107, 107, 107, 81, 107, 107, 84, 85,\n        107, 107, 107, 89, 90, 91, 107, 93, 107, 107,\n        37, 107, 39, 40, 107, 107, 107, 107, 66, 107,\n        68, 48, 1, 71, 3, 107, 74, 75, 55, 56,\n        57, 58, 3, 81, 107, 107, 107, 85, 107, 107,\n        107, 89, 90, 91, 107, 93, 107, 26, 66, 28,\n        68, 107, 107, 71, 107, 34, 74, 75, 107, 107,\n        39, 40, 1, 81, 3, 107, 107, 85, 39, 40,\n        107, 89, 90, 91, 107, 93, 55, 56, 57, 58,\n        107, 2, 107, 107, 55, 56, 57, 58, 107, 28,\n        11, 107, 107, 14, 107, 34, 2, 18, 19, 107,\n        39, 40, 107, 107, 107, 11, 107, 107, 14, 107,\n        107, 17, 18, 19, 107, 107, 55, 56, 57, 58,\n        107, 1, 107, 3, 45, 107, 107, 48, 66, 50,\n        68, 52, 53, 71, 107, 15, 74, 75, 107, 45,\n        107, 107, 48, 81, 50, 107, 52, 107, 1, 107,\n        3, 89, 90, 91, 107, 93, 66, 107, 68, 39,\n        40, 71, 107, 107, 74, 75, 107, 107, 107, 107,\n        107, 81, 107, 107, 107, 55, 56, 57, 58, 89,\n        90, 91, 2, 93, 107, 107, 39, 40, 107, 107,\n        107, 11, 107, 107, 14, 107, 107, 17, 18, 19,\n        107, 107, 55, 56, 57, 58, 107, 60, 107, 107,\n        107, 66, 107, 68, 107, 107, 71, 107, 107, 74,\n        75, 107, 107, 107, 107, 45, 81, 107, 48, 73,\n        50, 107, 52, 77, 89, 90, 91, 107, 93, 83,\n        107, 107, 86, 87, 88, 107, 107, 66, 107, 68,\n        107, 1, 71, 3, 107, 74, 75, 101, 66, 107,\n        68, 107, 81, 71, 107, 107, 74, 75, 107, 107,\n        89, 90, 91, 81, 93, 107, 1, 107, 3, 107,\n        107, 89, 90, 91, 107, 93, 66, 107, 68, 39,\n        40, 71, 107, 107, 74, 75, 107, 107, 107, 107,\n        107, 81, 107, 53, 29, 55, 56, 57, 58, 89,\n        90, 91, 2, 93, 39, 40, 107, 107, 107, 107,\n        107, 11, 107, 107, 14, 107, 107, 107, 18, 19,\n        55, 56, 57, 58, 1, 107, 3, 107, 1, 107,\n        3, 107, 1, 107, 3, 107, 107, 107, 15, 107,\n        107, 107, 15, 107, 107, 45, 15, 107, 48, 107,\n        50, 107, 52, 107, 107, 107, 107, 11, 107, 107,\n        14, 107, 39, 40, 18, 19, 39, 40, 107, 107,\n        39, 40, 1, 107, 3, 107, 107, 107, 55, 56,\n        57, 58, 55, 56, 57, 58, 55, 56, 57, 58,\n        107, 45, 107, 73, 48, 107, 50, 77, 52, 107,\n        107, 107, 107, 83, 107, 107, 86, 87, 88, 38,\n        39, 40, 107, 107, 107, 107, 107, 107, 107, 107,\n        107, 101, 107, 107, 107, 107, 55, 56, 57, 58,\n        1, 107, 3, 107, 1, 107, 3, 73, 1, 107,\n        3, 77, 107, 107, 15, 107, 107, 83, 107, 107,\n        86, 87, 88, 107, 107, 107, 23, 107, 1, 2,\n        3, 107, 1, 107, 3, 101, 107, 107, 39, 40,\n        107, 107, 39, 40, 107, 38, 39, 40, 107, 107,\n        107, 107, 107, 107, 55, 56, 57, 58, 55, 56,\n        57, 58, 55, 56, 57, 58, 39, 40, 107, 107,\n        39, 40, 107, 107, 107, 107, 107, 107, 107, 107,\n        107, 107, 55, 56, 57, 58, 55, 56, 57, 58,\n        1, 107, 107, 107, 107, 107, 107, 107, 107, 107,\n        107, 107, 107, 107, 15, 107, 107, 107, 19, 107,\n        107, 107, 107, 107, 107, 107, 107, 28, 107, 107,\n        107, 107, 107, 34, 107, 107, 37, 107, 107, 107,\n        107, 107, 107, 107, 107, 107, 107, 48,\n    );\n    static public $yy_shift_ofst = array(\n        -23, 399, 399, 349, 99, 449, 449, 99, 349, 99,\n        99, -3, 99, 99, 249, 99, 99, 99, 99, 299,\n        99, 149, 199, 99, 99, 99, 99, 99, 99, 99,\n        99, 99, 99, 299, 99, 99, 49, 49, 499, 499,\n        499, 499, 499, 499, 1621, 1661, 1661, 1981, 2067, 2039,\n        2047, 2043, 1747, 1850, 1720, 1941, 1937, 1875, 1933, 2071,\n        2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071,\n        2071, 2071, 1629, 1629, 522, 695, 2129, 171, 255, 129,\n        718, 707, 9, 255, 316, 255, 129, 129, 304, 337,\n        583, 1780, 244, 784, 221, 344, 294, 411, 40, 411,\n        485, 359, 440, -22, -22, 427, 432, 424, -22, 359,\n        437, 589, 227, 227, 227, 589, 227, 227, 227, 227,\n        -23, -23, -23, -23, 1679, 1694, 561, 1910, 1956, 81,\n        674, 212, 461, -22, -22, -22, -14, -14, -22, 360,\n        -22, -22, -22, -22, -14, 31, 321, -22, -22, 301,\n        321, -14, -14, -14, 31, -22, -22, -22, -14, -14,\n        589, 589, 227, 508, 589, 288, 227, 227, 288, 227,\n        227, -23, -23, -23, -23, -23, -23, 1573, 30, -12,\n        94, 144, 775, 342, 194, 103, 179, 258, 211, 141,\n        152, 68, 241, 209, 323, 387, 370, 368, 188, -8,\n        101, 556, 567, 563, 552, 539, 548, 574, 443, 558,\n        566, 582, 581, 584, 541, 543, 512, 519, 506, 476,\n        479, 488, 508, 502, 501, 531, 529, 510,\n    );\n    static public $yy_reduce_ofst   = array(\n        460, 493, 551, 579, 605, 832, 806, 776, 690, 746,\n        716, 1134, 1216, 1242, 1160, 1298, 1022, 1052, 1078, 1104,\n        1268, 1488, 1514, 1432, 1462, 1324, 1350, 1406, 1380, 1186,\n        888, 996, 970, 940, 914, 858, 1552, 1582, 1745, 1690,\n        1781, 1820, 1792, 1662, 1974, 1930, 1756, 37, 37, 37,\n        37, 37, 37, 37, 37, 37, 37, 37, 37, 37,\n        37, 37, 37, 37, 37, 37, 37, 37, 37, 37,\n        37, 37, 37, 37, 114, -33, 6, -67, 56, 226,\n        317, 233, 331, 254, 77, 4, 276, 328, 190, 122,\n        429, 396, -23, 393, 74, -23, -23, 393, 176, 413,\n        176, 407, 381, 366, 364, -23, -23, 243, 372, 426,\n        428, 430, -23, -23, 382, 176, -23, -23, -23, -23,\n        -23, 324, -23, -23, 537, 537, 537, 537, 537, 549,\n        542, 537, 537, 538, 538, 538, 533, 533, 538, 540,\n        538, 538, 538, 538, 533, 521, 518, 538, 538, 544,\n        535, 533, 533, 533, 562, 538, 538, 538, 533, 533,\n        550, 550, 113, 545, 550, 197, 113, 113, 197, 113,\n        113, 379, 395, -20, 97, -61, 25,\n    );\n    static public $yyExpectedTokens = array(\n        array(),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 53, 54,\n              59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,),\n        array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 54, 59,),\n        array(1, 3, 26, 28, 34, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 28, 34, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 28, 34, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 38, 39, 40, 55, 56, 57, 58,),\n        array(1, 2, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 15, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 38, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 23, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58, 60,),\n        array(1, 3, 39, 40, 53, 55, 56, 57, 58,),\n        array(1, 3, 15, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 15, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 15, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 29, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 15, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(1, 3, 39, 40, 55, 56, 57, 58,),\n        array(3, 39, 40, 55, 56, 57, 58,),\n        array(3, 39, 40, 55, 56, 57, 58,),\n        array(16, 18, 49, 51, 54,),\n        array(5, 11, 12, 13, 14, 16, 20, 21, 22, 27, 31, 32, 33, 59, 60,),\n        array(1, 15, 19, 28, 34, 37, 48,),\n        array(16, 18, 51, 54,),\n        array(1, 28, 34,),\n        array(16, 37, 54,),\n        array(5, 11, 12, 13, 14, 16, 20, 21, 22, 27, 31, 32, 33, 59, 60,),\n        array(11, 14, 18, 28, 30, 34,),\n        array(11, 14, 18, 28, 34,),\n        array(1, 28, 34,),\n        array(17, 19, 48,),\n        array(1, 28, 34,),\n        array(16, 37, 54,),\n        array(16, 37, 54,),\n        array(19, 45, 52,),\n        array(1, 2,),\n        array(4, 5, 6, 7, 8, 11, 12, 13, 14, 20, 21, 22, 27, 31, 32, 33,),\n        array(2, 11, 14, 17, 18, 19, 45, 48, 50, 52,),\n        array(1, 15, 28, 34,),\n        array(11, 14, 18, 50,),\n        array(14, 16, 18, 54,),\n        array(1, 15, 28, 34,),\n        array(1, 15, 28, 34,),\n        array(11, 14, 18,),\n        array(17, 19, 48,),\n        array(11, 14, 18,),\n        array(19, 48,),\n        array(16, 18,),\n        array(28, 34,),\n        array(28, 34,),\n        array(28, 34,),\n        array(1, 30,),\n        array(1, 53,),\n        array(16, 54,),\n        array(28, 34,),\n        array(16, 18,),\n        array(1, 19,),\n        array(19,),\n        array(1,),\n        array(1,),\n        array(1,),\n        array(19,),\n        array(1,),\n        array(1,),\n        array(1,),\n        array(1,),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(2, 11, 14, 18, 19, 45, 48, 50, 52, 53,),\n        array(2, 11, 14, 17, 18, 19, 45, 48, 50, 52,),\n        array(2, 11, 14, 18, 19, 45, 48, 50, 52,),\n        array(2, 11, 14, 18, 19, 45, 48, 50, 52,),\n        array(11, 14, 18, 19, 45, 48, 50, 52,),\n        array(14, 16, 18, 35, 54,),\n        array(11, 14, 18, 50,),\n        array(17, 45, 52,),\n        array(11, 14, 18,),\n        array(28, 34,),\n        array(28, 34,),\n        array(28, 34,),\n        array(45, 52,),\n        array(45, 52,),\n        array(28, 34,),\n        array(14, 37,),\n        array(28, 34,),\n        array(28, 34,),\n        array(28, 34,),\n        array(28, 34,),\n        array(45, 52,),\n        array(16, 54,),\n        array(45, 52,),\n        array(28, 34,),\n        array(28, 34,),\n        array(17, 24,),\n        array(45, 52,),\n        array(45, 52,),\n        array(45, 52,),\n        array(45, 52,),\n        array(16, 54,),\n        array(28, 34,),\n        array(28, 34,),\n        array(28, 34,),\n        array(45, 52,),\n        array(45, 52,),\n        array(19,),\n        array(19,),\n        array(1,),\n        array(37,),\n        array(19,),\n        array(2,),\n        array(1,),\n        array(1,),\n        array(2,),\n        array(1,),\n        array(1,),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(1, 2, 3, 37, 39, 40, 48, 55, 56, 57, 58,),\n        array(15, 23, 25, 28, 34, 36, 38, 45,),\n        array(15, 17, 28, 34, 37, 48,),\n        array(15, 24, 28, 34, 46,),\n        array(15, 24, 28, 34, 46,),\n        array(11, 14, 18, 50,),\n        array(37, 45, 48, 53,),\n        array(24, 46, 60,),\n        array(24, 46, 53,),\n        array(30, 37, 48,),\n        array(8, 10,),\n        array(36, 38,),\n        array(23, 36,),\n        array(45, 53,),\n        array(36, 38,),\n        array(36, 38,),\n        array(24, 46,),\n        array(17, 45,),\n        array(37, 48,),\n        array(37, 48,),\n        array(37, 48,),\n        array(18, 50,),\n        array(9, 10,),\n        array(36, 53,),\n        array(51,),\n        array(18,),\n        array(18,),\n        array(18,),\n        array(18,),\n        array(18,),\n        array(18,),\n        array(45,),\n        array(35,),\n        array(35,),\n        array(18,),\n        array(17,),\n        array(15,),\n        array(15,),\n        array(9,),\n        array(25,),\n        array(16,),\n        array(18,),\n        array(38,),\n        array(37,),\n        array(51,),\n        array(37,),\n        array(53,),\n        array(53,),\n        array(18,),\n        array(18,),\n        array(41,),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n        array(),\n    );\n    static public $yy_default       = array(\n        334, 509, 509, 494, 509, 509, 509, 473, 509, 473,\n        473, 509, 509, 509, 509, 509, 509, 509, 509, 509,\n        509, 509, 509, 509, 509, 509, 509, 509, 509, 509,\n        509, 509, 509, 509, 509, 509, 509, 509, 509, 509,\n        509, 509, 509, 509, 375, 375, 354, 509, 509, 509,\n        509, 509, 509, 509, 509, 509, 347, 380, 509, 497,\n        386, 495, 496, 471, 347, 359, 380, 472, 377, 397,\n        382, 387, 401, 402, 509, 509, 413, 509, 375, 509,\n        509, 375, 375, 375, 428, 375, 509, 509, 485, 366,\n        323, 427, 389, 438, 509, 389, 389, 438, 428, 438,\n        428, 509, 375, 375, 375, 389, 389, 509, 356, 509,\n        369, 482, 400, 406, 371, 428, 396, 405, 389, 392,\n        480, 332, 404, 393, 427, 427, 427, 427, 427, 509,\n        440, 454, 438, 348, 364, 344, 436, 463, 365, 438,\n        352, 355, 361, 357, 464, 509, 433, 362, 358, 509,\n        431, 434, 435, 466, 509, 363, 350, 351, 465, 432,\n        486, 460, 367, 438, 483, 475, 372, 395, 474, 370,\n        422, 438, 479, 438, 479, 479, 332, 413, 409, 413,\n        403, 403, 439, 413, 403, 403, 413, 330, 509, 509,\n        409, 509, 509, 403, 409, 423, 413, 509, 509, 509,\n        509, 509, 509, 509, 509, 509, 509, 509, 409, 509,\n        411, 509, 509, 509, 509, 509, 383, 509, 509, 509,\n        484, 509, 454, 418, 509, 509, 509, 415, 376, 388,\n        447, 481, 446, 454, 445, 448, 453, 360, 468, 469,\n        384, 459, 444, 450, 415, 490, 476, 477, 407, 368,\n        478, 456, 457, 458, 416, 417, 443, 390, 391, 442,\n        441, 425, 426, 437, 374, 353, 329, 331, 333, 328,\n        327, 324, 325, 326, 335, 336, 341, 343, 373, 340,\n        339, 337, 338, 408, 410, 506, 498, 499, 505, 461,\n        455, 470, 342, 500, 503, 491, 493, 492, 501, 508,\n        502, 504, 507, 462, 430, 398, 399, 421, 420, 419,\n        412, 414, 418, 424, 451, 489, 394, 429, 488, 487,\n        449, 452, 467,\n    );\n    public static $yyFallback = array();\n    public $yyTraceFILE;\n    public $yyTracePrompt;\npublic $yyidx;\npublic $yyerrcnt;\npublic $yystack = array();\n    public $yyTokenName = array(\n        '$', 'VERT', 'COLON', 'UNIMATH',\n        'PHP', 'TEXT', 'STRIPON', 'STRIPOFF',\n        'LITERALSTART', 'LITERALEND', 'LITERAL', 'SIMPELOUTPUT',\n        'SIMPLETAG', 'SMARTYBLOCKCHILDPARENT', 'LDEL', 'RDEL',\n        'DOLLARID', 'EQUAL', 'ID', 'PTR',\n        'LDELMAKENOCACHE', 'LDELIF', 'LDELFOR', 'SEMICOLON',\n        'INCDEC', 'TO', 'STEP', 'LDELFOREACH',\n        'SPACE', 'AS', 'APTR', 'LDELSETFILTER',\n        'CLOSETAG', 'LDELSLASH', 'ATTR', 'INTEGER',\n        'COMMA', 'OPENP', 'CLOSEP', 'MATH',\n        'ISIN', 'QMARK', 'NOT', 'TYPECAST',\n        'HEX', 'DOT', 'INSTANCEOF', 'SINGLEQUOTESTRING',\n        'DOUBLECOLON', 'NAMESPACE', 'AT', 'HATCH',\n        'OPENB', 'CLOSEB', 'DOLLAR', 'LOGOP',\n        'SLOGOP', 'TLOGOP', 'SINGLECOND', 'QUOTE',\n        'BACKTICK', 'error', 'start', 'template',\n        'literal_e2', 'literal_e1', 'smartytag', 'tagbody',\n        'tag', 'outattr', 'eqoutattr', 'varindexed',\n        'output', 'attributes', 'variable', 'value',\n        'expr', 'modifierlist', 'statement', 'statements',\n        'foraction', 'varvar', 'modparameters', 'attribute',\n        'ternary', 'array', 'tlop', 'lop',\n        'scond', 'function', 'ns1', 'doublequoted_with_quotes',\n        'static_class_access', 'object', 'arrayindex', 'indexdef',\n        'varvarele', 'objectchain', 'objectelement', 'method',\n        'params', 'modifier', 'modparameter', 'arrayelements',\n        'arrayelement', 'doublequoted', 'doublequotedcontent',\n    );\n    public static $yyRuleName = array(\n        'start ::= template',\n        'template ::= template PHP',\n        'template ::= template TEXT',\n        'template ::= template STRIPON',\n        'template ::= template STRIPOFF',\n        'template ::= template LITERALSTART literal_e2 LITERALEND',\n        'literal_e2 ::= literal_e1 LITERALSTART literal_e1 LITERALEND',\n        'literal_e2 ::= literal_e1',\n        'literal_e1 ::= literal_e1 LITERAL',\n        'literal_e1 ::=',\n        'template ::= template smartytag',\n        'template ::=',\n        'smartytag ::= SIMPELOUTPUT',\n        'smartytag ::= SIMPLETAG',\n        'smartytag ::= SMARTYBLOCKCHILDPARENT',\n        'smartytag ::= LDEL tagbody RDEL',\n        'smartytag ::= tag RDEL',\n        'tagbody ::= outattr',\n        'tagbody ::= DOLLARID eqoutattr',\n        'tagbody ::= varindexed eqoutattr',\n        'eqoutattr ::= EQUAL outattr',\n        'outattr ::= output attributes',\n        'output ::= variable',\n        'output ::= value',\n        'output ::= expr',\n        'tag ::= LDEL ID attributes',\n        'tag ::= LDEL ID',\n        'tag ::= LDEL ID modifierlist attributes',\n        'tag ::= LDEL ID PTR ID attributes',\n        'tag ::= LDEL ID PTR ID modifierlist attributes',\n        'tag ::= LDELMAKENOCACHE DOLLARID',\n        'tag ::= LDELIF expr',\n        'tag ::= LDELIF expr attributes',\n        'tag ::= LDELIF statement',\n        'tag ::= LDELIF statement attributes',\n        'tag ::= LDELFOR statements SEMICOLON expr SEMICOLON varindexed foraction attributes',\n        'foraction ::= EQUAL expr',\n        'foraction ::= INCDEC',\n        'tag ::= LDELFOR statement TO expr attributes',\n        'tag ::= LDELFOR statement TO expr STEP expr attributes',\n        'tag ::= LDELFOREACH SPACE expr AS varvar attributes',\n        'tag ::= LDELFOREACH SPACE expr AS varvar APTR varvar attributes',\n        'tag ::= LDELFOREACH attributes',\n        'tag ::= LDELSETFILTER ID modparameters',\n        'tag ::= LDELSETFILTER ID modparameters modifierlist',\n        'smartytag ::= CLOSETAG',\n        'tag ::= LDELSLASH ID',\n        'tag ::= LDELSLASH ID modifierlist',\n        'tag ::= LDELSLASH ID PTR ID',\n        'tag ::= LDELSLASH ID PTR ID modifierlist',\n        'attributes ::= attributes attribute',\n        'attributes ::= attribute',\n        'attributes ::=',\n        'attribute ::= SPACE ID EQUAL ID',\n        'attribute ::= ATTR expr',\n        'attribute ::= ATTR value',\n        'attribute ::= SPACE ID',\n        'attribute ::= SPACE expr',\n        'attribute ::= SPACE value',\n        'attribute ::= SPACE INTEGER EQUAL expr',\n        'statements ::= statement',\n        'statements ::= statements COMMA statement',\n        'statement ::= DOLLARID EQUAL INTEGER',\n        'statement ::= DOLLARID EQUAL expr',\n        'statement ::= varindexed EQUAL expr',\n        'statement ::= OPENP statement CLOSEP',\n        'expr ::= value',\n        'expr ::= ternary',\n        'expr ::= DOLLARID COLON ID',\n        'expr ::= expr MATH value',\n        'expr ::= expr UNIMATH value',\n        'expr ::= array',\n        'expr ::= expr modifierlist',\n        'expr ::= expr tlop value',\n        'expr ::= expr lop expr',\n        'expr ::= expr scond',\n        'expr ::= expr ISIN array',\n        'expr ::= expr ISIN value',\n        'ternary ::= OPENP expr CLOSEP QMARK DOLLARID COLON expr',\n        'ternary ::= OPENP expr CLOSEP QMARK expr COLON expr',\n        'value ::= variable',\n        'value ::= UNIMATH value',\n        'value ::= NOT value',\n        'value ::= TYPECAST value',\n        'value ::= variable INCDEC',\n        'value ::= HEX',\n        'value ::= INTEGER',\n        'value ::= INTEGER DOT INTEGER',\n        'value ::= INTEGER DOT',\n        'value ::= DOT INTEGER',\n        'value ::= ID',\n        'value ::= function',\n        'value ::= OPENP expr CLOSEP',\n        'value ::= variable INSTANCEOF ns1',\n        'value ::= variable INSTANCEOF variable',\n        'value ::= SINGLEQUOTESTRING',\n        'value ::= doublequoted_with_quotes',\n        'value ::= varindexed DOUBLECOLON static_class_access',\n        'value ::= smartytag',\n        'value ::= value modifierlist',\n        'value ::= NAMESPACE',\n        'value ::= ns1 DOUBLECOLON static_class_access',\n        'ns1 ::= ID',\n        'ns1 ::= NAMESPACE',\n        'variable ::= DOLLARID',\n        'variable ::= varindexed',\n        'variable ::= varvar AT ID',\n        'variable ::= object',\n        'variable ::= HATCH ID HATCH',\n        'variable ::= HATCH ID HATCH arrayindex',\n        'variable ::= HATCH variable HATCH',\n        'variable ::= HATCH variable HATCH arrayindex',\n        'varindexed ::= DOLLARID arrayindex',\n        'varindexed ::= varvar arrayindex',\n        'arrayindex ::= arrayindex indexdef',\n        'arrayindex ::=',\n        'indexdef ::= DOT DOLLARID',\n        'indexdef ::= DOT varvar',\n        'indexdef ::= DOT varvar AT ID',\n        'indexdef ::= DOT ID',\n        'indexdef ::= DOT INTEGER',\n        'indexdef ::= DOT LDEL expr RDEL',\n        'indexdef ::= OPENB ID CLOSEB',\n        'indexdef ::= OPENB ID DOT ID CLOSEB',\n        'indexdef ::= OPENB SINGLEQUOTESTRING CLOSEB',\n        'indexdef ::= OPENB INTEGER CLOSEB',\n        'indexdef ::= OPENB DOLLARID CLOSEB',\n        'indexdef ::= OPENB variable CLOSEB',\n        'indexdef ::= OPENB value CLOSEB',\n        'indexdef ::= OPENB expr CLOSEB',\n        'indexdef ::= OPENB CLOSEB',\n        'varvar ::= DOLLARID',\n        'varvar ::= DOLLAR',\n        'varvar ::= varvar varvarele',\n        'varvarele ::= ID',\n        'varvarele ::= SIMPELOUTPUT',\n        'varvarele ::= LDEL expr RDEL',\n        'object ::= varindexed objectchain',\n        'objectchain ::= objectelement',\n        'objectchain ::= objectchain objectelement',\n        'objectelement ::= PTR ID arrayindex',\n        'objectelement ::= PTR varvar arrayindex',\n        'objectelement ::= PTR LDEL expr RDEL arrayindex',\n        'objectelement ::= PTR ID LDEL expr RDEL arrayindex',\n        'objectelement ::= PTR method',\n        'function ::= ns1 OPENP params CLOSEP',\n        'method ::= ID OPENP params CLOSEP',\n        'method ::= DOLLARID OPENP params CLOSEP',\n        'params ::= params COMMA expr',\n        'params ::= expr',\n        'params ::=',\n        'modifierlist ::= modifierlist modifier modparameters',\n        'modifierlist ::= modifier modparameters',\n        'modifier ::= VERT AT ID',\n        'modifier ::= VERT ID',\n        'modparameters ::= modparameters modparameter',\n        'modparameters ::=',\n        'modparameter ::= COLON value',\n        'modparameter ::= COLON array',\n        'static_class_access ::= method',\n        'static_class_access ::= method objectchain',\n        'static_class_access ::= ID',\n        'static_class_access ::= DOLLARID arrayindex',\n        'static_class_access ::= DOLLARID arrayindex objectchain',\n        'lop ::= LOGOP',\n        'lop ::= SLOGOP',\n        'tlop ::= TLOGOP',\n        'scond ::= SINGLECOND',\n        'array ::= OPENB arrayelements CLOSEB',\n        'arrayelements ::= arrayelement',\n        'arrayelements ::= arrayelements COMMA arrayelement',\n        'arrayelements ::=',\n        'arrayelement ::= value APTR expr',\n        'arrayelement ::= ID APTR expr',\n        'arrayelement ::= expr',\n        'doublequoted_with_quotes ::= QUOTE QUOTE',\n        'doublequoted_with_quotes ::= QUOTE doublequoted QUOTE',\n        'doublequoted ::= doublequoted doublequotedcontent',\n        'doublequoted ::= doublequotedcontent',\n        'doublequotedcontent ::= BACKTICK variable BACKTICK',\n        'doublequotedcontent ::= BACKTICK expr BACKTICK',\n        'doublequotedcontent ::= DOLLARID',\n        'doublequotedcontent ::= LDEL variable RDEL',\n        'doublequotedcontent ::= LDEL expr RDEL',\n        'doublequotedcontent ::= smartytag',\n        'doublequotedcontent ::= TEXT',\n    );\n    public static $yyRuleInfo = array(\n        array(0 => 62, 1 => 1),\n        array(0 => 63, 1 => 2),\n        array(0 => 63, 1 => 2),\n        array(0 => 63, 1 => 2),\n        array(0 => 63, 1 => 2),\n        array(0 => 63, 1 => 4),\n        array(0 => 64, 1 => 4),\n        array(0 => 64, 1 => 1),\n        array(0 => 65, 1 => 2),\n        array(0 => 65, 1 => 0),\n        array(0 => 63, 1 => 2),\n        array(0 => 63, 1 => 0),\n        array(0 => 66, 1 => 1),\n        array(0 => 66, 1 => 1),\n        array(0 => 66, 1 => 1),\n        array(0 => 66, 1 => 3),\n        array(0 => 66, 1 => 2),\n        array(0 => 67, 1 => 1),\n        array(0 => 67, 1 => 2),\n        array(0 => 67, 1 => 2),\n        array(0 => 70, 1 => 2),\n        array(0 => 69, 1 => 2),\n        array(0 => 72, 1 => 1),\n        array(0 => 72, 1 => 1),\n        array(0 => 72, 1 => 1),\n        array(0 => 68, 1 => 3),\n        array(0 => 68, 1 => 2),\n        array(0 => 68, 1 => 4),\n        array(0 => 68, 1 => 5),\n        array(0 => 68, 1 => 6),\n        array(0 => 68, 1 => 2),\n        array(0 => 68, 1 => 2),\n        array(0 => 68, 1 => 3),\n        array(0 => 68, 1 => 2),\n        array(0 => 68, 1 => 3),\n        array(0 => 68, 1 => 8),\n        array(0 => 80, 1 => 2),\n        array(0 => 80, 1 => 1),\n        array(0 => 68, 1 => 5),\n        array(0 => 68, 1 => 7),\n        array(0 => 68, 1 => 6),\n        array(0 => 68, 1 => 8),\n        array(0 => 68, 1 => 2),\n        array(0 => 68, 1 => 3),\n        array(0 => 68, 1 => 4),\n        array(0 => 66, 1 => 1),\n        array(0 => 68, 1 => 2),\n        array(0 => 68, 1 => 3),\n        array(0 => 68, 1 => 4),\n        array(0 => 68, 1 => 5),\n        array(0 => 73, 1 => 2),\n        array(0 => 73, 1 => 1),\n        array(0 => 73, 1 => 0),\n        array(0 => 83, 1 => 4),\n        array(0 => 83, 1 => 2),\n        array(0 => 83, 1 => 2),\n        array(0 => 83, 1 => 2),\n        array(0 => 83, 1 => 2),\n        array(0 => 83, 1 => 2),\n        array(0 => 83, 1 => 4),\n        array(0 => 79, 1 => 1),\n        array(0 => 79, 1 => 3),\n        array(0 => 78, 1 => 3),\n        array(0 => 78, 1 => 3),\n        array(0 => 78, 1 => 3),\n        array(0 => 78, 1 => 3),\n        array(0 => 76, 1 => 1),\n        array(0 => 76, 1 => 1),\n        array(0 => 76, 1 => 3),\n        array(0 => 76, 1 => 3),\n        array(0 => 76, 1 => 3),\n        array(0 => 76, 1 => 1),\n        array(0 => 76, 1 => 2),\n        array(0 => 76, 1 => 3),\n        array(0 => 76, 1 => 3),\n        array(0 => 76, 1 => 2),\n        array(0 => 76, 1 => 3),\n        array(0 => 76, 1 => 3),\n        array(0 => 84, 1 => 7),\n        array(0 => 84, 1 => 7),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 2),\n        array(0 => 75, 1 => 2),\n        array(0 => 75, 1 => 2),\n        array(0 => 75, 1 => 2),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 2),\n        array(0 => 75, 1 => 2),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 3),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 2),\n        array(0 => 75, 1 => 1),\n        array(0 => 75, 1 => 3),\n        array(0 => 90, 1 => 1),\n        array(0 => 90, 1 => 1),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 3),\n        array(0 => 74, 1 => 1),\n        array(0 => 74, 1 => 3),\n        array(0 => 74, 1 => 4),\n        array(0 => 74, 1 => 3),\n        array(0 => 74, 1 => 4),\n        array(0 => 71, 1 => 2),\n        array(0 => 71, 1 => 2),\n        array(0 => 94, 1 => 2),\n        array(0 => 94, 1 => 0),\n        array(0 => 95, 1 => 2),\n        array(0 => 95, 1 => 2),\n        array(0 => 95, 1 => 4),\n        array(0 => 95, 1 => 2),\n        array(0 => 95, 1 => 2),\n        array(0 => 95, 1 => 4),\n        array(0 => 95, 1 => 3),\n        array(0 => 95, 1 => 5),\n        array(0 => 95, 1 => 3),\n        array(0 => 95, 1 => 3),\n        array(0 => 95, 1 => 3),\n        array(0 => 95, 1 => 3),\n        array(0 => 95, 1 => 3),\n        array(0 => 95, 1 => 3),\n        array(0 => 95, 1 => 2),\n        array(0 => 81, 1 => 1),\n        array(0 => 81, 1 => 1),\n        array(0 => 81, 1 => 2),\n        array(0 => 96, 1 => 1),\n        array(0 => 96, 1 => 1),\n        array(0 => 96, 1 => 3),\n        array(0 => 93, 1 => 2),\n        array(0 => 97, 1 => 1),\n        array(0 => 97, 1 => 2),\n        array(0 => 98, 1 => 3),\n        array(0 => 98, 1 => 3),\n        array(0 => 98, 1 => 5),\n        array(0 => 98, 1 => 6),\n        array(0 => 98, 1 => 2),\n        array(0 => 89, 1 => 4),\n        array(0 => 99, 1 => 4),\n        array(0 => 99, 1 => 4),\n        array(0 => 100, 1 => 3),\n        array(0 => 100, 1 => 1),\n        array(0 => 100, 1 => 0),\n        array(0 => 77, 1 => 3),\n        array(0 => 77, 1 => 2),\n        array(0 => 101, 1 => 3),\n        array(0 => 101, 1 => 2),\n        array(0 => 82, 1 => 2),\n        array(0 => 82, 1 => 0),\n        array(0 => 102, 1 => 2),\n        array(0 => 102, 1 => 2),\n        array(0 => 92, 1 => 1),\n        array(0 => 92, 1 => 2),\n        array(0 => 92, 1 => 1),\n        array(0 => 92, 1 => 2),\n        array(0 => 92, 1 => 3),\n        array(0 => 87, 1 => 1),\n        array(0 => 87, 1 => 1),\n        array(0 => 86, 1 => 1),\n        array(0 => 88, 1 => 1),\n        array(0 => 85, 1 => 3),\n        array(0 => 103, 1 => 1),\n        array(0 => 103, 1 => 3),\n        array(0 => 103, 1 => 0),\n        array(0 => 104, 1 => 3),\n        array(0 => 104, 1 => 3),\n        array(0 => 104, 1 => 1),\n        array(0 => 91, 1 => 2),\n        array(0 => 91, 1 => 3),\n        array(0 => 105, 1 => 2),\n        array(0 => 105, 1 => 1),\n        array(0 => 106, 1 => 3),\n        array(0 => 106, 1 => 3),\n        array(0 => 106, 1 => 1),\n        array(0 => 106, 1 => 3),\n        array(0 => 106, 1 => 3),\n        array(0 => 106, 1 => 1),\n        array(0 => 106, 1 => 1),\n    );\n        public static $yyReduceMap = array(\n        0   => 0,\n        1   => 1,\n        2   => 2,\n        3   => 3,\n        4   => 4,\n        5   => 5,\n        6   => 6,\n        7   => 7,\n        22  => 7,\n        23  => 7,\n        24  => 7,\n        37  => 7,\n        57  => 7,\n        58  => 7,\n        66  => 7,\n        67  => 7,\n        71  => 7,\n        80  => 7,\n        85  => 7,\n        86  => 7,\n        91  => 7,\n        95  => 7,\n        96  => 7,\n        100 => 7,\n        102 => 7,\n        107 => 7,\n        169 => 7,\n        174 => 7,\n        8   => 8,\n        9   => 9,\n        10  => 10,\n        12  => 12,\n        13  => 13,\n        14  => 14,\n        15  => 15,\n        16  => 16,\n        17  => 17,\n        18  => 18,\n        19  => 19,\n        20  => 20,\n        21  => 21,\n        25  => 25,\n        26  => 26,\n        27  => 27,\n        28  => 28,\n        29  => 29,\n        30  => 30,\n        31  => 31,\n        32  => 32,\n        34  => 32,\n        33  => 33,\n        35  => 35,\n        36  => 36,\n        38  => 38,\n        39  => 39,\n        40  => 40,\n        41  => 41,\n        42  => 42,\n        43  => 43,\n        44  => 44,\n        45  => 45,\n        46  => 46,\n        47  => 47,\n        48  => 48,\n        49  => 49,\n        50  => 50,\n        51  => 51,\n        60  => 51,\n        149 => 51,\n        153 => 51,\n        157 => 51,\n        158 => 51,\n        52  => 52,\n        150 => 52,\n        156 => 52,\n        53  => 53,\n        54  => 54,\n        55  => 54,\n        56  => 56,\n        134 => 56,\n        59  => 59,\n        61  => 61,\n        62  => 62,\n        63  => 62,\n        64  => 64,\n        65  => 65,\n        68  => 68,\n        69  => 69,\n        70  => 69,\n        72  => 72,\n        99  => 72,\n        73  => 73,\n        74  => 74,\n        75  => 75,\n        76  => 76,\n        77  => 77,\n        78  => 78,\n        79  => 79,\n        81  => 81,\n        83  => 81,\n        84  => 81,\n        114 => 81,\n        82  => 82,\n        87  => 87,\n        88  => 88,\n        89  => 89,\n        90  => 90,\n        92  => 92,\n        93  => 93,\n        94  => 93,\n        97  => 97,\n        98  => 98,\n        101 => 101,\n        103 => 103,\n        104 => 104,\n        105 => 105,\n        106 => 106,\n        108 => 108,\n        109 => 109,\n        110 => 110,\n        111 => 111,\n        112 => 112,\n        113 => 113,\n        115 => 115,\n        171 => 115,\n        116 => 116,\n        117 => 117,\n        118 => 118,\n        119 => 119,\n        120 => 120,\n        121 => 121,\n        129 => 121,\n        122 => 122,\n        123 => 123,\n        124 => 124,\n        125 => 124,\n        127 => 124,\n        128 => 124,\n        126 => 126,\n        130 => 130,\n        131 => 131,\n        132 => 132,\n        175 => 132,\n        133 => 133,\n        135 => 135,\n        136 => 136,\n        137 => 137,\n        138 => 138,\n        139 => 139,\n        140 => 140,\n        141 => 141,\n        142 => 142,\n        143 => 143,\n        144 => 144,\n        145 => 145,\n        146 => 146,\n        147 => 147,\n        148 => 148,\n        151 => 151,\n        152 => 152,\n        154 => 154,\n        155 => 155,\n        159 => 159,\n        160 => 160,\n        161 => 161,\n        162 => 162,\n        163 => 163,\n        164 => 164,\n        165 => 165,\n        166 => 166,\n        167 => 167,\n        168 => 168,\n        170 => 170,\n        172 => 172,\n        173 => 173,\n        176 => 176,\n        177 => 177,\n        178 => 178,\n        179 => 179,\n        182 => 179,\n        180 => 180,\n        183 => 180,\n        181 => 181,\n        184 => 184,\n        185 => 185,\n    );                    /* Index of top element in stack */\n        private $_retvalue;                 /* Shifts left before out of the error */\n\n    /**\n     * constructor\n     *\n     * @param Smarty_Internal_Templatelexer        $lex\n     * @param Smarty_Internal_TemplateCompilerBase $compiler\n     */\n    function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_TemplateCompilerBase $compiler)\n    {\n        $this->lex = $lex;\n        $this->compiler = $compiler;\n        $this->template = $this->compiler->template;\n        $this->smarty = $this->template->smarty;\n        $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false;\n        $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template();\n    }  /* The parser's stack */\n\n    /**\n     * insert PHP code in current buffer\n     *\n     * @param string $code\n     */\n    public function insertPhpCode($code)\n    {\n        $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code));\n    }\n\n    /**\n     * error rundown\n     *\n     */\n    public function errorRunDown()\n    {\n        while ($this->yystack !== array()) {\n            $this->yy_pop_parser_stack();\n        }\n        if (is_resource($this->yyTraceFILE)) {\n            fclose($this->yyTraceFILE);\n        }\n    }\n\n    /**\n     *  merge PHP code with prefix code and return parse tree tag object\n     *\n     * @param string $code\n     *\n     * @return Smarty_Internal_ParseTree_Tag\n     */\n    public function mergePrefixCode($code)\n    {\n        $tmp = '';\n        foreach ($this->compiler->prefix_code as $preCode) {\n            $tmp .= $preCode;\n        }\n        $this->compiler->prefix_code = array();\n        $tmp .= $code;\n        return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true));\n    }\n\n    public function Trace($TraceFILE, $zTracePrompt)\n    {\n        if (!$TraceFILE) {\n            $zTracePrompt = 0;\n        } else if (!$zTracePrompt) {\n            $TraceFILE = 0;\n        }\n        $this->yyTraceFILE = $TraceFILE;\n        $this->yyTracePrompt = $zTracePrompt;\n    }\n\n    public function PrintTrace()\n    {\n        $this->yyTraceFILE = fopen('php://output', 'w');\n        $this->yyTracePrompt = '<br>';\n    }\n\n    public function tokenName($tokenType)\n    {\n        if ($tokenType === 0) {\n            return 'End of Input';\n        }\n        if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {\n            return $this->yyTokenName[ $tokenType ];\n        } else {\n            return 'Unknown';\n        }\n    }\n\n    public static function yy_destructor($yymajor, $yypminor)\n    {\n        switch ($yymajor) {\n            default:\n                break;   /* If no destructor action specified: do nothing */\n        }\n    }\n\n    public function yy_pop_parser_stack()\n    {\n        if (empty($this->yystack)) {\n            return;\n        }\n        $yytos = array_pop($this->yystack);\n        if ($this->yyTraceFILE && $this->yyidx >= 0) {\n            fwrite($this->yyTraceFILE,\n                   $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] .\n                   \"\\n\");\n        }\n        $yymajor = $yytos->major;\n        self::yy_destructor($yymajor, $yytos->minor);\n        $this->yyidx--;\n        return $yymajor;\n    }\n\n    public function __destruct()\n    {\n        while ($this->yystack !== Array()) {\n            $this->yy_pop_parser_stack();\n        }\n        if (is_resource($this->yyTraceFILE)) {\n            fclose($this->yyTraceFILE);\n        }\n    }\n\n    public function yy_get_expected_tokens($token)\n    {\n        static $res3 = array();\n        static $res4 = array();\n        $state = $this->yystack[ $this->yyidx ]->stateno;\n        $expected = self::$yyExpectedTokens[ $state ];\n        if (isset($res3[ $state ][ $token ])) {\n            if ($res3[ $state ][ $token ]) {\n                return $expected;\n            }\n        } else {\n            if ($res3[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) {\n                return $expected;\n            }\n        }\n        $stack = $this->yystack;\n        $yyidx = $this->yyidx;\n        do {\n            $yyact = $this->yy_find_shift_action($token);\n            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n                // reduce action\n                $done = 0;\n                do {\n                    if ($done++ === 100) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // too much recursion prevents proper detection\n                        // so give up\n                        return array_unique($expected);\n                    }\n                    $yyruleno = $yyact - self::YYNSTATE;\n                    $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ];\n                    $nextstate = $this->yy_find_reduce_action(\n                        $this->yystack[ $this->yyidx ]->stateno,\n                        self::$yyRuleInfo[ $yyruleno ][ 0 ]);\n                    if (isset(self::$yyExpectedTokens[ $nextstate ])) {\n                        $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]);\n                        if (isset($res4[ $nextstate ][ $token ])) {\n                            if ($res4[ $nextstate ][ $token ]) {\n                                $this->yyidx = $yyidx;\n                                $this->yystack = $stack;\n                                return array_unique($expected);\n                            }\n                        } else {\n                            if ($res4[ $nextstate ][ $token ] =\n                                in_array($token, self::$yyExpectedTokens[ $nextstate ], true)) {\n                                $this->yyidx = $yyidx;\n                                $this->yystack = $stack;\n                                return array_unique($expected);\n                            }\n                        }\n                    }\n                    if ($nextstate < self::YYNSTATE) {\n                        // we need to shift a non-terminal\n                        $this->yyidx++;\n                        $x = new TP_yyStackEntry;\n                        $x->stateno = $nextstate;\n                        $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n                        $this->yystack[ $this->yyidx ] = $x;\n                        continue 2;\n                    } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // the last token was just ignored, we can't accept\n                        // by ignoring input, this is in essence ignoring a\n                        // syntax error!\n                        return array_unique($expected);\n                    } else if ($nextstate === self::YY_NO_ACTION) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // input accepted, but not shifted (I guess)\n                        return $expected;\n                    } else {\n                        $yyact = $nextstate;\n                    }\n                } while (true);\n            }\n            break;\n        } while (true);\n        $this->yyidx = $yyidx;\n        $this->yystack = $stack;\n        return array_unique($expected);\n    }\n\n    public function yy_is_expected_token($token)\n    {\n        static $res = array();\n        static $res2 = array();\n        if ($token === 0) {\n            return true; // 0 is not part of this\n        }\n        $state = $this->yystack[ $this->yyidx ]->stateno;\n        if (isset($res[ $state ][ $token ])) {\n            if ($res[ $state ][ $token ]) {\n                return true;\n            }\n        } else {\n            if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) {\n                return true;\n            }\n        }\n        $stack = $this->yystack;\n        $yyidx = $this->yyidx;\n        do {\n            $yyact = $this->yy_find_shift_action($token);\n            if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n                // reduce action\n                $done = 0;\n                do {\n                    if ($done++ === 100) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // too much recursion prevents proper detection\n                        // so give up\n                        return true;\n                    }\n                    $yyruleno = $yyact - self::YYNSTATE;\n                    $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ];\n                    $nextstate = $this->yy_find_reduce_action(\n                        $this->yystack[ $this->yyidx ]->stateno,\n                        self::$yyRuleInfo[ $yyruleno ][ 0 ]);\n                    if (isset($res2[ $nextstate ][ $token ])) {\n                        if ($res2[ $nextstate ][ $token ]) {\n                            $this->yyidx = $yyidx;\n                            $this->yystack = $stack;\n                            return true;\n                        }\n                    } else {\n                        if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) &&\n                                                             in_array($token,\n                                                                      self::$yyExpectedTokens[ $nextstate ],\n                                                                      true))) {\n                            $this->yyidx = $yyidx;\n                            $this->yystack = $stack;\n                            return true;\n                        }\n                    }\n                    if ($nextstate < self::YYNSTATE) {\n                        // we need to shift a non-terminal\n                        $this->yyidx++;\n                        $x = new TP_yyStackEntry;\n                        $x->stateno = $nextstate;\n                        $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n                        $this->yystack[ $this->yyidx ] = $x;\n                        continue 2;\n                    } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        if (!$token) {\n                            // end of input: this is valid\n                            return true;\n                        }\n                        // the last token was just ignored, we can't accept\n                        // by ignoring input, this is in essence ignoring a\n                        // syntax error!\n                        return false;\n                    } else if ($nextstate === self::YY_NO_ACTION) {\n                        $this->yyidx = $yyidx;\n                        $this->yystack = $stack;\n                        // input accepted, but not shifted (I guess)\n                        return true;\n                    } else {\n                        $yyact = $nextstate;\n                    }\n                } while (true);\n            }\n            break;\n        } while (true);\n        $this->yyidx = $yyidx;\n        $this->yystack = $stack;\n        return true;\n    }\n\n    public function yy_find_shift_action($iLookAhead)\n    {\n        $stateno = $this->yystack[ $this->yyidx ]->stateno;\n        /* if ($this->yyidx < 0) return self::YY_NO_ACTION;  */\n        if (!isset(self::$yy_shift_ofst[ $stateno ])) {\n            // no shift actions\n            return self::$yy_default[ $stateno ];\n        }\n        $i = self::$yy_shift_ofst[ $stateno ];\n        if ($i === self::YY_SHIFT_USE_DFLT) {\n            return self::$yy_default[ $stateno ];\n        }\n        if ($iLookAhead === self::YYNOCODE) {\n            return self::YY_NO_ACTION;\n        }\n        $i += $iLookAhead;\n        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||\n            self::$yy_lookahead[ $i ] != $iLookAhead) {\n            if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)\n                && ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0) {\n                if ($this->yyTraceFILE) {\n                    fwrite($this->yyTraceFILE,\n                           $this->yyTracePrompt . 'FALLBACK ' .\n                           $this->yyTokenName[ $iLookAhead ] . ' => ' .\n                           $this->yyTokenName[ $iFallback ] . \"\\n\");\n                }\n                return $this->yy_find_shift_action($iFallback);\n            }\n            return self::$yy_default[ $stateno ];\n        } else {\n            return self::$yy_action[ $i ];\n        }\n    }\n\n    public function yy_find_reduce_action($stateno, $iLookAhead)\n    {\n        /* $stateno = $this->yystack[$this->yyidx]->stateno; */\n        if (!isset(self::$yy_reduce_ofst[ $stateno ])) {\n            return self::$yy_default[ $stateno ];\n        }\n        $i = self::$yy_reduce_ofst[ $stateno ];\n        if ($i === self::YY_REDUCE_USE_DFLT) {\n            return self::$yy_default[ $stateno ];\n        }\n        if ($iLookAhead === self::YYNOCODE) {\n            return self::YY_NO_ACTION;\n        }\n        $i += $iLookAhead;\n        if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||\n            self::$yy_lookahead[ $i ] != $iLookAhead) {\n            return self::$yy_default[ $stateno ];\n        } else {\n            return self::$yy_action[ $i ];\n        }\n    }\n\n    #line 234 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    public function yy_shift($yyNewState, $yyMajor, $yypMinor)\n    {\n        $this->yyidx++;\n        if ($this->yyidx >= self::YYSTACKDEPTH) {\n            $this->yyidx--;\n            if ($this->yyTraceFILE) {\n                fprintf($this->yyTraceFILE, \"%sStack Overflow!\\n\", $this->yyTracePrompt);\n            }\n            while ($this->yyidx >= 0) {\n                $this->yy_pop_parser_stack();\n            }\n            #line 221 \"../smarty/lexer/smarty_internal_templateparser.y\"\n            $this->internalError = true;\n            $this->compiler->trigger_template_error('Stack overflow in template parser');\n            return;\n        }\n        $yytos = new TP_yyStackEntry;\n        $yytos->stateno = $yyNewState;\n        $yytos->major = $yyMajor;\n        $yytos->minor = $yypMinor;\n        $this->yystack[] = $yytos;\n        if ($this->yyTraceFILE && $this->yyidx > 0) {\n            fprintf($this->yyTraceFILE,\n                    \"%sShift %d\\n\",\n                    $this->yyTracePrompt,\n                    $yyNewState);\n            fprintf($this->yyTraceFILE, \"%sStack:\", $this->yyTracePrompt);\n            for ($i = 1; $i <= $this->yyidx; $i++) {\n                fprintf($this->yyTraceFILE,\n                        \" %s\",\n                        $this->yyTokenName[ $this->yystack[ $i ]->major ]);\n            }\n            fwrite($this->yyTraceFILE, \"\\n\");\n        }\n    }\n\n    #line 242 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r0()\n    {\n        $this->root_buffer->prepend_array($this, $this->template_prefix);\n        $this->root_buffer->append_array($this, $this->template_postfix);\n        $this->_retvalue = $this->root_buffer->to_smarty_php($this);\n    }\n\n    #line 251 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r1()\n    {\n        $code = $this->compiler->compileTag('private_php',\n                                            array(array('code' => $this->yystack[ $this->yyidx + 0 ]->minor),\n                                                  array('type' => $this->lex->phpType)),\n                                            array());\n        if ($this->compiler->has_code && !empty($code)) {\n            $tmp = '';\n            foreach ($this->compiler->prefix_code as $code) {\n                $tmp .= $code;\n            }\n            $this->compiler->prefix_code = array();\n            $this->current_buffer->append_subtree($this,\n                                                  new Smarty_Internal_ParseTree_Tag($this,\n                                                                                    $this->compiler->processNocacheCode($tmp .\n                                                                                                                        $code,\n                                                                                                                        true)));\n        }\n    }\n\n    #line 255 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r2()\n    {\n        $this->current_buffer->append_subtree($this,\n                                              $this->compiler->processText($this->yystack[ $this->yyidx + 0 ]->minor));\n    }\n\n    #line 259 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r3()\n    {\n        $this->strip = true;\n    }\n\n    #line 264 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r4()\n    {\n        $this->strip = false;\n    }\n\n    #line 269 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r5()\n    {\n        $this->current_buffer->append_subtree($this,\n                                              new Smarty_Internal_ParseTree_Text($this->yystack[ $this->yyidx +\n                                                                                                 -1 ]->minor));\n    }\n\n    #line 272 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r6()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -3 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 276 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r7()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 281 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r8()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 285 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r9()\n    {\n        $this->_retvalue = '';\n    }\n\n    #line 297 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r10()\n    {\n        if ($this->compiler->has_code) {\n            $this->current_buffer->append_subtree($this,\n                                                  $this->mergePrefixCode($this->yystack[ $this->yyidx + 0 ]->minor));\n        }\n        $this->compiler->has_variable_string = false;\n        $this->block_nesting_level = count($this->compiler->_tag_stack);\n    }\n\n    #line 307 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r12()\n    {\n        $var = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor,\n                           $this->compiler->getLdelLength(),\n                           -$this->compiler->getRdelLength()),\n                    ' $');\n        if (preg_match('/^(.*)(\\s+nocache)$/', $var, $match)) {\n            $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                           array('nocache'),\n                                                           array('value' => $this->compiler->compileVariable('\\'' .\n                                                                                                             $match[ 1 ] .\n                                                                                                             '\\'')));\n        } else {\n            $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                           array(),\n                                                           array('value' => $this->compiler->compileVariable('\\'' .\n                                                                                                             $var .\n                                                                                                             '\\'')));\n        }\n    }\n\n    #line 328 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r13()\n    {\n        $tag = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor,\n                           $this->compiler->getLdelLength(),\n                           -$this->compiler->getRdelLength()));\n        if ($tag == 'strip') {\n            $this->strip = true;\n            $this->_retvalue = null;;\n        } else {\n            if (defined($tag)) {\n                if ($this->security) {\n                    $this->security->isTrustedConstant($tag, $this->compiler);\n                }\n                $this->_retvalue =\n                    $this->compiler->compileTag('private_print_expression', array(), array('value' => $tag));\n            } else {\n                if (preg_match('/^(.*)(\\s+nocache)$/', $tag, $match)) {\n                    $this->_retvalue = $this->compiler->compileTag($match[ 1 ], array('\\'nocache\\''));\n                } else {\n                    $this->_retvalue = $this->compiler->compileTag($tag, array());\n                }\n            }\n        }\n    }\n\n    #line 339 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r14()\n    {\n        $j = strrpos($this->yystack[ $this->yyidx + 0 ]->minor, '.');\n        if ($this->yystack[ $this->yyidx + 0 ]->minor[ $j + 1 ] == 'c') {\n            // {$smarty.block.child}\n            $this->_retvalue =\n                $this->compiler->compileTag('child', array(), array($this->yystack[ $this->yyidx + 0 ]->minor));;\n        } else {\n            // {$smarty.block.parent}\n            $this->_retvalue =\n                $this->compiler->compileTag('parent', array(), array($this->yystack[ $this->yyidx + 0 ]->minor));;\n        }\n    }\n\n    #line 343 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r15()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 347 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r16()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 356 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r17()\n    {\n        $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                       $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ],\n                                                       array('value' => $this->yystack[ $this->yyidx +\n                                                                                        0 ]->minor[ 0 ]));\n    }\n\n    #line 360 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r18()\n    {\n        $this->_retvalue = $this->compiler->compileTag('assign',\n                                                       array_merge(array(array('value' => $this->yystack[ $this->yyidx +\n                                                                                                          0 ]->minor[ 0 ]),\n                                                                         array('var' => '\\'' .\n                                                                                        substr($this->yystack[ $this->yyidx +\n                                                                                                               -1 ]->minor,\n                                                                                               1) . '\\'')),\n                                                                   $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]));\n    }\n\n    #line 364 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r19()\n    {\n        $this->_retvalue = $this->compiler->compileTag('assign',\n                                                       array_merge(array(array('value' => $this->yystack[ $this->yyidx +\n                                                                                                          0 ]->minor[ 0 ]),\n                                                                         array('var' => $this->yystack[ $this->yyidx +\n                                                                                                        -1 ]->minor[ 'var' ])),\n                                                                   $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]),\n                                                       array('smarty_internal_index' => $this->yystack[ $this->yyidx +\n                                                                                                        -1 ]->minor[ 'smarty_internal_index' ]));\n    }\n\n    #line 368 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r20()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 383 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r21()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 393 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r25()\n    {\n        if (defined($this->yystack[ $this->yyidx + -1 ]->minor)) {\n            if ($this->security) {\n                $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler);\n            }\n            $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                           $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                           array('value' => $this->yystack[ $this->yyidx +\n                                                                                            -1 ]->minor));\n        } else {\n            $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor,\n                                                           $this->yystack[ $this->yyidx + 0 ]->minor);\n        }\n    }\n\n    #line 406 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r26()\n    {\n        if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) {\n            if ($this->security) {\n                $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler);\n            }\n            $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                           array(),\n                                                           array('value' => $this->yystack[ $this->yyidx + 0 ]->minor));\n        } else {\n            $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor, array());\n        }\n    }\n\n    #line 418 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r27()\n    {\n        if (defined($this->yystack[ $this->yyidx + -2 ]->minor)) {\n            if ($this->security) {\n                $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -2 ]->minor, $this->compiler);\n            }\n            $this->_retvalue = $this->compiler->compileTag('private_print_expression',\n                                                           $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                           array('value'        => $this->yystack[ $this->yyidx +\n                                                                                                   -2 ]->minor,\n                                                                 'modifierlist' => $this->yystack[ $this->yyidx +\n                                                                                                   -1 ]->minor));\n        } else {\n            $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor,\n                                                           $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                           array('modifierlist' => $this->yystack[ $this->yyidx +\n                                                                                                   -1 ]->minor));\n        }\n    }\n\n    #line 423 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r28()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor,\n                                                       $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                       array('object_method' => $this->yystack[ $this->yyidx +\n                                                                                                -1 ]->minor));\n    }\n\n    #line 428 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r29()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -4 ]->minor,\n                                                       $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                       array('modifierlist'  => $this->yystack[ $this->yyidx +\n                                                                                                -1 ]->minor,\n                                                             'object_method' => $this->yystack[ $this->yyidx +\n                                                                                                -2 ]->minor));\n    }\n\n    #line 433 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r30()\n    {\n        $this->_retvalue = $this->compiler->compileTag('make_nocache',\n                                                       array(array('var' => '\\'' . substr($this->yystack[ $this->yyidx +\n                                                                                                          0 ]->minor,\n                                                                                          1) . '\\'')));\n    }\n\n    #line 438 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r31()\n    {\n        $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler->getLdelLength()));\n        $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag,\n                                                       array(),\n                                                       array('if condition' => $this->yystack[ $this->yyidx +\n                                                                                               0 ]->minor));\n    }\n\n    #line 443 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r32()\n    {\n        $tag = trim(substr($this->yystack[ $this->yyidx + -2 ]->minor, $this->compiler->getLdelLength()));\n        $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag,\n                                                       $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                       array('if condition' => $this->yystack[ $this->yyidx +\n                                                                                               -1 ]->minor));\n    }\n\n    #line 454 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r33()\n    {\n        $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler->getLdelLength()));\n        $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag,\n                                                       array(),\n                                                       array('if condition' => $this->yystack[ $this->yyidx +\n                                                                                               0 ]->minor));\n    }\n\n    #line 458 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r35()\n    {\n        $this->_retvalue = $this->compiler->compileTag('for',\n                                                       array_merge($this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                   array(array('start' => $this->yystack[ $this->yyidx +\n                                                                                                          -6 ]->minor),\n                                                                         array('ifexp' => $this->yystack[ $this->yyidx +\n                                                                                                          -4 ]->minor),\n                                                                         array('var' => $this->yystack[ $this->yyidx +\n                                                                                                        -2 ]->minor),\n                                                                         array('step' => $this->yystack[ $this->yyidx +\n                                                                                                         -1 ]->minor))),\n                                                       1);\n    }\n\n    #line 466 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r36()\n    {\n        $this->_retvalue = '=' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 470 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r38()\n    {\n        $this->_retvalue = $this->compiler->compileTag('for',\n                                                       array_merge($this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                   array(array('start' => $this->yystack[ $this->yyidx +\n                                                                                                          -3 ]->minor),\n                                                                         array('to' => $this->yystack[ $this->yyidx +\n                                                                                                       -1 ]->minor))),\n                                                       0);\n    }\n\n    #line 475 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r39()\n    {\n        $this->_retvalue = $this->compiler->compileTag('for',\n                                                       array_merge($this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                   array(array('start' => $this->yystack[ $this->yyidx +\n                                                                                                          -5 ]->minor),\n                                                                         array('to' => $this->yystack[ $this->yyidx +\n                                                                                                       -3 ]->minor),\n                                                                         array('step' => $this->yystack[ $this->yyidx +\n                                                                                                         -1 ]->minor))),\n                                                       0);\n    }\n\n    #line 479 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r40()\n    {\n        $this->_retvalue = $this->compiler->compileTag('foreach',\n                                                       array_merge($this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                   array(array('from' => $this->yystack[ $this->yyidx +\n                                                                                                         -3 ]->minor),\n                                                                         array('item' => $this->yystack[ $this->yyidx +\n                                                                                                         -1 ]->minor))));\n    }\n\n    #line 482 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r41()\n    {\n        $this->_retvalue = $this->compiler->compileTag('foreach',\n                                                       array_merge($this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                   array(array('from' => $this->yystack[ $this->yyidx +\n                                                                                                         -5 ]->minor),\n                                                                         array('item' => $this->yystack[ $this->yyidx +\n                                                                                                         -1 ]->minor),\n                                                                         array('key' => $this->yystack[ $this->yyidx +\n                                                                                                        -3 ]->minor))));\n    }\n\n    #line 487 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r42()\n    {\n        $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 491 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r43()\n    {\n        $this->_retvalue = $this->compiler->compileTag('setfilter',\n                                                       array(),\n                                                       array('modifier_list' => array(array_merge(array($this->yystack[ $this->yyidx +\n                                                                                                                        -1 ]->minor),\n                                                                                                  $this->yystack[ $this->yyidx +\n                                                                                                                  0 ]->minor))));\n    }\n\n    #line 497 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r44()\n    {\n        $this->_retvalue = $this->compiler->compileTag('setfilter',\n                                                       array(),\n                                                       array('modifier_list' => array_merge(array(array_merge(array($this->yystack[ $this->yyidx +\n                                                                                                                                    -2 ]->minor),\n                                                                                                              $this->yystack[ $this->yyidx +\n                                                                                                                              -1 ]->minor)),\n                                                                                            $this->yystack[ $this->yyidx +\n                                                                                                            0 ]->minor)));\n    }\n\n    #line 506 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r45()\n    {\n        $tag = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor,\n                           $this->compiler->getLdelLength(),\n                           -$this->compiler->getRdelLength()),\n                    ' /');\n        if ($tag === 'strip') {\n            $this->strip = false;\n            $this->_retvalue = null;\n        } else {\n            $this->_retvalue = $this->compiler->compileTag($tag . 'close', array());\n        }\n    }\n\n    #line 510 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r46()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor . 'close', array());\n    }\n\n    #line 515 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r47()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor . 'close',\n                                                       array(),\n                                                       array('modifier_list' => $this->yystack[ $this->yyidx +\n                                                                                                0 ]->minor));\n    }\n\n    #line 519 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r48()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor . 'close',\n                                                       array(),\n                                                       array('object_method' => $this->yystack[ $this->yyidx +\n                                                                                                0 ]->minor));\n    }\n\n    #line 527 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r49()\n    {\n        $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor . 'close',\n                                                       array(),\n                                                       array('object_method' => $this->yystack[ $this->yyidx +\n                                                                                                -1 ]->minor,\n                                                             'modifier_list' => $this->yystack[ $this->yyidx +\n                                                                                                0 ]->minor));\n    }\n\n    #line 533 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r50()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n        $this->_retvalue[] = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 538 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r51()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 543 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r52()\n    {\n        $this->_retvalue = array();\n    }\n\n    #line 554 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r53()\n    {\n        if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) {\n            if ($this->security) {\n                $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler);\n            }\n            $this->_retvalue =\n                array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor);\n        } else {\n            $this->_retvalue =\n                array($this->yystack[ $this->yyidx + -2 ]->minor => '\\'' . $this->yystack[ $this->yyidx + 0 ]->minor .\n                                                                    '\\'');\n        }\n    }\n\n    #line 562 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r54()\n    {\n        $this->_retvalue =\n            array(trim($this->yystack[ $this->yyidx + -1 ]->minor, \" =\\n\\r\\t\") => $this->yystack[ $this->yyidx +\n                                                                                                  0 ]->minor);\n    }\n\n    #line 574 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r56()\n    {\n        $this->_retvalue = '\\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\\'';\n    }\n\n    #line 587 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r59()\n    {\n        $this->_retvalue =\n            array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 592 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r61()\n    {\n        $this->yystack[ $this->yyidx + -2 ]->minor[] = $this->yystack[ $this->yyidx + 0 ]->minor;\n        $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor;\n    }\n\n    #line 599 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r62()\n    {\n        $this->_retvalue = array('var'   => '\\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '\\'',\n                                 'value' => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 603 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r64()\n    {\n        $this->_retvalue = array('var'   => $this->yystack[ $this->yyidx + -2 ]->minor,\n                                 'value' => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 623 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r65()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 628 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r68()\n    {\n        $this->_retvalue =\n            '$_smarty_tpl->getStreamVariable(\\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '://' .\n            $this->yystack[ $this->yyidx + 0 ]->minor . '\\')';\n    }\n\n    #line 642 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r69()\n    {\n        $this->_retvalue =\n            $this->yystack[ $this->yyidx + -2 ]->minor . trim($this->yystack[ $this->yyidx + -1 ]->minor) .\n            $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 648 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r72()\n    {\n        $this->_retvalue = $this->compiler->compileTag('private_modifier',\n                                                       array(),\n                                                       array('value'        => $this->yystack[ $this->yyidx +\n                                                                                               -1 ]->minor,\n                                                             'modifierlist' => $this->yystack[ $this->yyidx +\n                                                                                               0 ]->minor));\n    }\n\n    #line 652 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r73()\n    {\n        $this->_retvalue =\n            $this->yystack[ $this->yyidx + -1 ]->minor[ 'pre' ] . $this->yystack[ $this->yyidx + -2 ]->minor .\n            $this->yystack[ $this->yyidx + -1 ]->minor[ 'op' ] . $this->yystack[ $this->yyidx + 0 ]->minor . ')';\n    }\n\n    #line 656 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r74()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor .\n                           $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 660 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r75()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . ')';\n    }\n\n    #line 664 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r76()\n    {\n        $this->_retvalue =\n            'in_array(' . $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor .\n            ')';\n    }\n\n    #line 672 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r77()\n    {\n        $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + -2 ]->minor . ',(array)' .\n                           $this->yystack[ $this->yyidx + 0 ]->minor . ')';\n    }\n\n    #line 676 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r78()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -5 ]->minor . ' ? ' . $this->compiler->compileVariable('\\'' .\n                                                                                                                 substr($this->yystack[ $this->yyidx +\n                                                                                                                                        -2 ]->minor,\n                                                                                                                        1) .\n                                                                                                                 '\\'') .\n                           ' : ' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 686 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r79()\n    {\n        $this->_retvalue =\n            $this->yystack[ $this->yyidx + -5 ]->minor . ' ? ' . $this->yystack[ $this->yyidx + -2 ]->minor . ' : ' .\n            $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 691 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r81()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 712 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r82()\n    {\n        $this->_retvalue = '!' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 716 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r87()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 720 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r88()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.';\n    }\n\n    #line 725 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r89()\n    {\n        $this->_retvalue = '.' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 742 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r90()\n    {\n        if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) {\n            if ($this->security) {\n                $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler);\n            }\n            $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n        } else {\n            $this->_retvalue = '\\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\\'';\n        }\n    }\n\n    #line 746 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r92()\n    {\n        $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')';\n    }\n\n    #line 764 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r93()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor .\n                           $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 775 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r97()\n    {\n        $prefixVar = $this->compiler->getNewPrefixVariable();\n        if ($this->yystack[ $this->yyidx + -2 ]->minor[ 'var' ] === '\\'smarty\\'') {\n            $this->compiler->appendPrefixCode(\"<?php {$prefixVar} = \" .\n                                              $this->compiler->compileTag('private_special_variable',\n                                                                          array(),\n                                                                          $this->yystack[ $this->yyidx +\n                                                                                          -2 ]->minor[ 'smarty_internal_index' ]) .\n                                              ';?>');\n        } else {\n            $this->compiler->appendPrefixCode(\"<?php  {$prefixVar} = \" .\n                                              $this->compiler->compileVariable($this->yystack[ $this->yyidx +\n                                                                                               -2 ]->minor[ 'var' ]) .\n                                              $this->yystack[ $this->yyidx + -2 ]->minor[ 'smarty_internal_index' ] .\n                                              ';?>');\n        }\n        $this->_retvalue = $prefixVar . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] .\n                           $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ];\n    }\n\n    #line 792 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r98()\n    {\n        $prefixVar = $this->compiler->getNewPrefixVariable();\n        $tmp = $this->compiler->appendCode('<?php ob_start();?>', $this->yystack[ $this->yyidx + 0 ]->minor);\n        $this->compiler->appendPrefixCode($this->compiler->appendCode($tmp, \"<?php {$prefixVar} = ob_get_clean();?>\"));\n        $this->_retvalue = $prefixVar;\n    }\n\n    #line 811 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r101()\n    {\n        if (!in_array(strtolower($this->yystack[ $this->yyidx + -2 ]->minor), array('self', 'parent')) &&\n            (!$this->security || $this->security->isTrustedStaticClassAccess($this->yystack[ $this->yyidx + -2 ]->minor,\n                                                                             $this->yystack[ $this->yyidx + 0 ]->minor,\n                                                                             $this->compiler))) {\n            if (isset($this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ])) {\n                $this->_retvalue =\n                    $this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ] . '::' .\n                    $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ];\n            } else {\n                $this->_retvalue =\n                    $this->yystack[ $this->yyidx + -2 ]->minor . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] .\n                    $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ];\n            }\n        } else {\n            $this->compiler->trigger_template_error('static class \\'' . $this->yystack[ $this->yyidx + -2 ]->minor .\n                                                    '\\' is undefined or not allowed by security setting');\n        }\n    }\n\n    #line 822 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r103()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 825 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r104()\n    {\n        $this->_retvalue =\n            $this->compiler->compileVariable('\\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\\'');\n    }\n\n    #line 838 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r105()\n    {\n        if ($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ] === '\\'smarty\\'') {\n            $smarty_var = $this->compiler->compileTag('private_special_variable',\n                                                      array(),\n                                                      $this->yystack[ $this->yyidx +\n                                                                      0 ]->minor[ 'smarty_internal_index' ]);\n            $this->_retvalue = $smarty_var;\n        } else {\n            // used for array reset,next,prev,end,current\n            $this->last_variable = $this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ];\n            $this->last_index = $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ];\n            $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]) .\n                               $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ];\n        }\n    }\n\n    #line 848 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r106()\n    {\n        $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[ $this->yyidx + -2 ]->minor . ']->' .\n                           $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 852 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r108()\n    {\n        $this->_retvalue =\n            $this->compiler->compileConfigVariable('\\'' . $this->yystack[ $this->yyidx + -1 ]->minor . '\\'');\n    }\n\n    #line 856 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r109()\n    {\n        $this->_retvalue = '(is_array($tmp = ' .\n                           $this->compiler->compileConfigVariable('\\'' . $this->yystack[ $this->yyidx + -2 ]->minor .\n                                                                  '\\'') . ') ? $tmp' .\n                           $this->yystack[ $this->yyidx + 0 ]->minor . ' :null)';\n    }\n\n    #line 860 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r110()\n    {\n        $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -1 ]->minor);\n    }\n\n    #line 864 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r111()\n    {\n        $this->_retvalue =\n            '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -2 ]->minor) .\n            ') ? $tmp' . $this->yystack[ $this->yyidx + 0 ]->minor . ' : null)';\n    }\n\n    #line 867 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r112()\n    {\n        $this->_retvalue = array('var' => '\\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\\'',\n                                 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 880 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r113()\n    {\n        $this->_retvalue = array('var'                   => $this->yystack[ $this->yyidx + -1 ]->minor,\n                                 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 886 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r115()\n    {\n        return;\n    }\n\n    #line 889 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r116()\n    {\n        $this->_retvalue =\n            '[' . $this->compiler->compileVariable('\\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\\'') .\n            ']';\n    }\n\n    #line 893 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r117()\n    {\n        $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor) . ']';\n    }\n\n    #line 897 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r118()\n    {\n        $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + -2 ]->minor) . '->' .\n                           $this->yystack[ $this->yyidx + 0 ]->minor . ']';\n    }\n\n    #line 901 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r119()\n    {\n        $this->_retvalue = '[\\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\\']';\n    }\n\n    #line 906 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r120()\n    {\n        $this->_retvalue = '[' . $this->yystack[ $this->yyidx + 0 ]->minor . ']';\n    }\n\n    #line 911 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r121()\n    {\n        $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']';\n    }\n\n    #line 915 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r122()\n    {\n        $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable',\n                                                             array(),\n                                                             '[\\'section\\'][\\'' .\n                                                             $this->yystack[ $this->yyidx + -1 ]->minor .\n                                                             '\\'][\\'index\\']') . ']';\n    }\n\n    #line 918 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r123()\n    {\n        $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable',\n                                                             array(),\n                                                             '[\\'section\\'][\\'' .\n                                                             $this->yystack[ $this->yyidx + -3 ]->minor . '\\'][\\'' .\n                                                             $this->yystack[ $this->yyidx + -1 ]->minor . '\\']') . ']';\n    }\n\n    #line 924 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r124()\n    {\n        $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']';\n    }\n\n    #line 940 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r126()\n    {\n        $this->_retvalue = '[' . $this->compiler->compileVariable('\\'' .\n                                                                  substr($this->yystack[ $this->yyidx + -1 ]->minor,\n                                                                         1) . '\\'') . ']';;\n    }\n\n    #line 950 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r130()\n    {\n        $this->_retvalue = '[]';\n    }\n\n    #line 954 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r131()\n    {\n        $this->_retvalue = '\\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\\'';\n    }\n\n    #line 959 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r132()\n    {\n        $this->_retvalue = '\\'\\'';\n    }\n\n    #line 967 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r133()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 973 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r135()\n    {\n        $var = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor,\n                           $this->compiler->getLdelLength(),\n                           -$this->compiler->getRdelLength()),\n                    ' $');\n        $this->_retvalue = $this->compiler->compileVariable('\\'' . $var . '\\'');\n    }\n\n    #line 980 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r136()\n    {\n        $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')';\n    }\n\n    #line 989 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r137()\n    {\n        if ($this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ] === '\\'smarty\\'') {\n            $this->_retvalue = $this->compiler->compileTag('private_special_variable',\n                                                           array(),\n                                                           $this->yystack[ $this->yyidx +\n                                                                           -1 ]->minor[ 'smarty_internal_index' ]) .\n                               $this->yystack[ $this->yyidx + 0 ]->minor;\n        } else {\n            $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ]) .\n                               $this->yystack[ $this->yyidx + -1 ]->minor[ 'smarty_internal_index' ] .\n                               $this->yystack[ $this->yyidx + 0 ]->minor;\n        }\n    }\n\n    #line 994 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r138()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 999 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r139()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1006 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r140()\n    {\n        if ($this->security && substr($this->yystack[ $this->yyidx + -1 ]->minor, 0, 1) === '_') {\n            $this->compiler->trigger_template_error(self::Err1);\n        }\n        $this->_retvalue =\n            '->' . $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1013 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r141()\n    {\n        if ($this->security) {\n            $this->compiler->trigger_template_error(self::Err2);\n        }\n        $this->_retvalue = '->{' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor) .\n                           $this->yystack[ $this->yyidx + 0 ]->minor . '}';\n    }\n\n    #line 1020 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r142()\n    {\n        if ($this->security) {\n            $this->compiler->trigger_template_error(self::Err2);\n        }\n        $this->_retvalue =\n            '->{' . $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}';\n    }\n\n    #line 1028 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r143()\n    {\n        if ($this->security) {\n            $this->compiler->trigger_template_error(self::Err2);\n        }\n        $this->_retvalue =\n            '->{\\'' . $this->yystack[ $this->yyidx + -4 ]->minor . '\\'.' . $this->yystack[ $this->yyidx + -2 ]->minor .\n            $this->yystack[ $this->yyidx + 0 ]->minor . '}';\n    }\n\n    #line 1036 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r144()\n    {\n        $this->_retvalue = '->' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1044 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r145()\n    {\n        $this->_retvalue = $this->compiler->compilePHPFunctionCall($this->yystack[ $this->yyidx + -3 ]->minor,\n                                                                   $this->yystack[ $this->yyidx + -1 ]->minor);\n    }\n\n    #line 1051 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r146()\n    {\n        if ($this->security && substr($this->yystack[ $this->yyidx + -3 ]->minor, 0, 1) === '_') {\n            $this->compiler->trigger_template_error(self::Err1);\n        }\n        $this->_retvalue = $this->yystack[ $this->yyidx + -3 ]->minor . '(' .\n                           implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ')';\n    }\n\n    #line 1062 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r147()\n    {\n        if ($this->security) {\n            $this->compiler->trigger_template_error(self::Err2);\n        }\n        $prefixVar = $this->compiler->getNewPrefixVariable();\n        $this->compiler->appendPrefixCode(\"<?php {$prefixVar} = \" . $this->compiler->compileVariable('\\'' .\n                                                                                                     substr($this->yystack[ $this->yyidx +\n                                                                                                                            -3 ]->minor,\n                                                                                                            1) . '\\'') .\n                                          ';?>');\n        $this->_retvalue = $prefixVar . '(' . implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ')';\n    }\n\n    #line 1079 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r148()\n    {\n        $this->_retvalue =\n            array_merge($this->yystack[ $this->yyidx + -2 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor));\n    }\n\n    #line 1083 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r151()\n    {\n        $this->_retvalue = array_merge($this->yystack[ $this->yyidx + -2 ]->minor,\n                                       array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor,\n                                                         $this->yystack[ $this->yyidx + 0 ]->minor)));\n    }\n\n    #line 1091 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r152()\n    {\n        $this->_retvalue =\n            array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor));\n    }\n\n    #line 1099 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r154()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 1118 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r155()\n    {\n        $this->_retvalue =\n            array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 1123 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r159()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, '', 'method');\n    }\n\n    #line 1128 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r160()\n    {\n        $this->_retvalue =\n            array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'method');\n    }\n\n    #line 1133 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r161()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, '');\n    }\n\n    #line 1138 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r162()\n    {\n        $this->_retvalue =\n            array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'property');\n    }\n\n    #line 1144 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r163()\n    {\n        $this->_retvalue = array($this->yystack[ $this->yyidx + -2 ]->minor,\n                                 $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor,\n                                 'property');\n    }\n\n    #line 1148 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r164()\n    {\n        $this->_retvalue = ' ' . trim($this->yystack[ $this->yyidx + 0 ]->minor) . ' ';\n    }\n\n    #line 1167 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r165()\n    {\n        static $lops = array(\n            'eq'  => ' == ',\n            'ne'  => ' != ',\n            'neq' => ' != ',\n            'gt'  => ' > ',\n            'ge'  => ' >= ',\n            'gte' => ' >= ',\n            'lt'  => ' < ',\n            'le'  => ' <= ',\n            'lte' => ' <= ',\n            'mod' => ' % ',\n            'and' => ' && ',\n            'or'  => ' || ',\n            'xor' => ' xor ',\n        );\n        $op = strtolower(preg_replace('/\\s*/', '', $this->yystack[ $this->yyidx + 0 ]->minor));\n        $this->_retvalue = $lops[ $op ];\n    }\n\n    #line 1180 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r166()\n    {\n        static $tlops = array(\n            'isdivby'     => array('op' => ' % ', 'pre' => '!('),\n            'isnotdivby'  => array('op' => ' % ', 'pre' => '('),\n            'isevenby'    => array('op' => ' / ', 'pre' => '!(1 & '),\n            'isnotevenby' => array('op' => ' / ', 'pre' => '(1 & '),\n            'isoddby'     => array('op' => ' / ', 'pre' => '(1 & '),\n            'isnotoddby'  => array('op' => ' / ', 'pre' => '!(1 & '),\n        );\n        $op = strtolower(preg_replace('/\\s*/', '', $this->yystack[ $this->yyidx + 0 ]->minor));\n        $this->_retvalue = $tlops[ $op ];\n    }\n\n    #line 1194 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r167()\n    {\n        static $scond = array(\n            'iseven'    => '!(1 & ',\n            'isnoteven' => '(1 & ',\n            'isodd'     => '(1 & ',\n            'isnotodd'  => '!(1 & ',\n        );\n        $op = strtolower(str_replace(' ', '', $this->yystack[ $this->yyidx + 0 ]->minor));\n        $this->_retvalue = $scond[ $op ];\n    }\n\n    #line 1202 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r168()\n    {\n        $this->_retvalue = 'array(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')';\n    }\n\n    #line 1210 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r170()\n    {\n        $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1214 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r172()\n    {\n        $this->_retvalue =\n            $this->yystack[ $this->yyidx + -2 ]->minor . '=>' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1230 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r173()\n    {\n        $this->_retvalue =\n            '\\'' . $this->yystack[ $this->yyidx + -2 ]->minor . '\\'=>' . $this->yystack[ $this->yyidx + 0 ]->minor;\n    }\n\n    #line 1236 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r176()\n    {\n        $this->compiler->leaveDoubleQuote();\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor->to_smarty_php($this);\n    }\n\n    #line 1241 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r177()\n    {\n        $this->yystack[ $this->yyidx + -1 ]->minor->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor);\n        $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor;\n    }\n\n    #line 1245 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r178()\n    {\n        $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    #line 1249 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r179()\n    {\n        $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)' . $this->yystack[ $this->yyidx + -1 ]->minor);\n    }\n\n    #line 1253 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r180()\n    {\n        $this->_retvalue =\n            new Smarty_Internal_ParseTree_Code('(string)(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')');\n    }\n\n    #line 1265 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r181()\n    {\n        $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)$_smarty_tpl->tpl_vars[\\'' .\n                                                              substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) .\n                                                              '\\']->value');\n    }\n\n    #line 1269 \"../smarty/lexer/smarty_internal_templateparser.y\"\n\n    function yy_r184()\n    {\n        $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    function yy_r185()\n    {\n        $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor);\n    }\n\n    public function yy_reduce($yyruleno)\n    {\n        if ($this->yyTraceFILE && $yyruleno >= 0\n            && $yyruleno < count(self::$yyRuleName)) {\n            fprintf($this->yyTraceFILE,\n                    \"%sReduce (%d) [%s].\\n\",\n                    $this->yyTracePrompt,\n                    $yyruleno,\n                    self::$yyRuleName[ $yyruleno ]);\n        }\n        $this->_retvalue = $yy_lefthand_side = null;\n        if (isset(self::$yyReduceMap[ $yyruleno ])) {\n            // call the action\n            $this->_retvalue = null;\n            $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}();\n            $yy_lefthand_side = $this->_retvalue;\n        }\n        $yygoto = self::$yyRuleInfo[ $yyruleno ][ 0 ];\n        $yysize = self::$yyRuleInfo[ $yyruleno ][ 1 ];\n        $this->yyidx -= $yysize;\n        for ($i = $yysize; $i; $i--) {\n            // pop all of the right-hand side parameters\n            array_pop($this->yystack);\n        }\n        $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto);\n        if ($yyact < self::YYNSTATE) {\n            if (!$this->yyTraceFILE && $yysize) {\n                $this->yyidx++;\n                $x = new TP_yyStackEntry;\n                $x->stateno = $yyact;\n                $x->major = $yygoto;\n                $x->minor = $yy_lefthand_side;\n                $this->yystack[ $this->yyidx ] = $x;\n            } else {\n                $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);\n            }\n        } else if ($yyact === self::YYNSTATE + self::YYNRULE + 1) {\n            $this->yy_accept();\n        }\n    }\n\n    public function yy_parse_failed()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE, \"%sFail!\\n\", $this->yyTracePrompt);\n        }\n        while ($this->yyidx >= 0) {\n            $this->yy_pop_parser_stack();\n        }\n    }\n\n    public function yy_syntax_error($yymajor, $TOKEN)\n    {\n        #line 214 \"../smarty/lexer/smarty_internal_templateparser.y\"\n        $this->internalError = true;\n        $this->yymajor = $yymajor;\n        $this->compiler->trigger_template_error();\n    }\n\n    public function yy_accept()\n    {\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE, \"%sAccept!\\n\", $this->yyTracePrompt);\n        }\n        while ($this->yyidx >= 0) {\n            $this->yy_pop_parser_stack();\n        }\n        #line 207 \"../smarty/lexer/smarty_internal_templateparser.y\"\n        $this->successful = !$this->internalError;\n        $this->internalError = false;\n        $this->retvalue = $this->_retvalue;\n    }\n\n    public function doParse($yymajor, $yytokenvalue)\n    {\n        $yyerrorhit = 0;   /* True if yymajor has invoked an error */\n        if ($this->yyidx === null || $this->yyidx < 0) {\n            $this->yyidx = 0;\n            $this->yyerrcnt = -1;\n            $x = new TP_yyStackEntry;\n            $x->stateno = 0;\n            $x->major = 0;\n            $this->yystack = array();\n            $this->yystack[] = $x;\n        }\n        $yyendofinput = ($yymajor == 0);\n        if ($this->yyTraceFILE) {\n            fprintf($this->yyTraceFILE,\n                    \"%sInput %s\\n\",\n                    $this->yyTracePrompt,\n                    $this->yyTokenName[ $yymajor ]);\n        }\n        do {\n            $yyact = $this->yy_find_shift_action($yymajor);\n            if ($yymajor < self::YYERRORSYMBOL &&\n                !$this->yy_is_expected_token($yymajor)) {\n                // force a syntax error\n                $yyact = self::YY_ERROR_ACTION;\n            }\n            if ($yyact < self::YYNSTATE) {\n                $this->yy_shift($yyact, $yymajor, $yytokenvalue);\n                $this->yyerrcnt--;\n                if ($yyendofinput && $this->yyidx >= 0) {\n                    $yymajor = 0;\n                } else {\n                    $yymajor = self::YYNOCODE;\n                }\n            } else if ($yyact < self::YYNSTATE + self::YYNRULE) {\n                $this->yy_reduce($yyact - self::YYNSTATE);\n            } else if ($yyact === self::YY_ERROR_ACTION) {\n                if ($this->yyTraceFILE) {\n                    fprintf($this->yyTraceFILE,\n                            \"%sSyntax Error!\\n\",\n                            $this->yyTracePrompt);\n                }\n                if (self::YYERRORSYMBOL) {\n                    if ($this->yyerrcnt < 0) {\n                        $this->yy_syntax_error($yymajor, $yytokenvalue);\n                    }\n                    $yymx = $this->yystack[ $this->yyidx ]->major;\n                    if ($yymx === self::YYERRORSYMBOL || $yyerrorhit) {\n                        if ($this->yyTraceFILE) {\n                            fprintf($this->yyTraceFILE,\n                                    \"%sDiscard input token %s\\n\",\n                                    $this->yyTracePrompt,\n                                    $this->yyTokenName[ $yymajor ]);\n                        }\n                        $this->yy_destructor($yymajor, $yytokenvalue);\n                        $yymajor = self::YYNOCODE;\n                    } else {\n                        while ($this->yyidx >= 0 &&\n                               $yymx !== self::YYERRORSYMBOL &&\n                               ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE\n                        ) {\n                            $this->yy_pop_parser_stack();\n                        }\n                        if ($this->yyidx < 0 || $yymajor == 0) {\n                            $this->yy_destructor($yymajor, $yytokenvalue);\n                            $this->yy_parse_failed();\n                            $yymajor = self::YYNOCODE;\n                        } else if ($yymx !== self::YYERRORSYMBOL) {\n                            $u2 = 0;\n                            $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);\n                        }\n                    }\n                    $this->yyerrcnt = 3;\n                    $yyerrorhit = 1;\n                } else {\n                    if ($this->yyerrcnt <= 0) {\n                        $this->yy_syntax_error($yymajor, $yytokenvalue);\n                    }\n                    $this->yyerrcnt = 3;\n                    $this->yy_destructor($yymajor, $yytokenvalue);\n                    if ($yyendofinput) {\n                        $this->yy_parse_failed();\n                    }\n                    $yymajor = self::YYNOCODE;\n                }\n            } else {\n                $this->yy_accept();\n                $yymajor = self::YYNOCODE;\n            }\n        } while ($yymajor !== self::YYNOCODE && $this->yyidx >= 0);\n    }\n}\n\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_testinstall.php",
    "content": "<?php\n/**\n * Smarty Internal TestInstall\n * Test Smarty installation\n *\n * @package    Smarty\n * @subpackage Utilities\n * @author     Uwe Tews\n */\n\n/**\n * TestInstall class\n *\n * @package    Smarty\n * @subpackage Utilities\n */\nclass Smarty_Internal_TestInstall\n{\n    /**\n     * diagnose Smarty setup\n     * If $errors is secified, the diagnostic report will be appended to the array, rather than being output.\n     *\n     * @param \\Smarty $smarty\n     * @param  array  $errors array to push results into rather than outputting them\n     *\n     * @return bool status, true if everything is fine, false else\n     */\n    public static function testInstall(Smarty $smarty, &$errors = null)\n    {\n        $status = true;\n        if ($errors === null) {\n            echo \"<PRE>\\n\";\n            echo \"Smarty Installation test...\\n\";\n            echo \"Testing template directory...\\n\";\n        }\n        $_stream_resolve_include_path = function_exists('stream_resolve_include_path');\n        // test if all registered template_dir are accessible\n        foreach ($smarty->getTemplateDir() as $template_dir) {\n            $_template_dir = $template_dir;\n            $template_dir = realpath($template_dir);\n            // resolve include_path or fail existence\n            if (!$template_dir) {\n                if ($smarty->use_include_path && !preg_match('/^([\\/\\\\\\\\]|[a-zA-Z]:[\\/\\\\\\\\])/', $_template_dir)) {\n                    // try PHP include_path\n                    if ($_stream_resolve_include_path) {\n                        $template_dir = stream_resolve_include_path($_template_dir);\n                    } else {\n                        $template_dir = $smarty->ext->_getIncludePath->getIncludePath($_template_dir, null, $smarty);\n                    }\n                    if ($template_dir !== false) {\n                        if ($errors === null) {\n                            echo \"$template_dir is OK.\\n\";\n                        }\n                        continue;\n                    } else {\n                        $status = false;\n                        $message =\n                            \"FAILED: $_template_dir does not exist (and couldn't be found in include_path either)\";\n                        if ($errors === null) {\n                            echo $message . \".\\n\";\n                        } else {\n                            $errors[ 'template_dir' ] = $message;\n                        }\n                        continue;\n                    }\n                } else {\n                    $status = false;\n                    $message = \"FAILED: $_template_dir does not exist\";\n                    if ($errors === null) {\n                        echo $message . \".\\n\";\n                    } else {\n                        $errors[ 'template_dir' ] = $message;\n                    }\n                    continue;\n                }\n            }\n            if (!is_dir($template_dir)) {\n                $status = false;\n                $message = \"FAILED: $template_dir is not a directory\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'template_dir' ] = $message;\n                }\n            } else if (!is_readable($template_dir)) {\n                $status = false;\n                $message = \"FAILED: $template_dir is not readable\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'template_dir' ] = $message;\n                }\n            } else {\n                if ($errors === null) {\n                    echo \"$template_dir is OK.\\n\";\n                }\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing compile directory...\\n\";\n        }\n        // test if registered compile_dir is accessible\n        $__compile_dir = $smarty->getCompileDir();\n        $_compile_dir = realpath($__compile_dir);\n        if (!$_compile_dir) {\n            $status = false;\n            $message = \"FAILED: {$__compile_dir} does not exist\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'compile_dir' ] = $message;\n            }\n        } else if (!is_dir($_compile_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_compile_dir} is not a directory\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'compile_dir' ] = $message;\n            }\n        } else if (!is_readable($_compile_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_compile_dir} is not readable\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'compile_dir' ] = $message;\n            }\n        } else if (!is_writable($_compile_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_compile_dir} is not writable\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'compile_dir' ] = $message;\n            }\n        } else {\n            if ($errors === null) {\n                echo \"{$_compile_dir} is OK.\\n\";\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing plugins directory...\\n\";\n        }\n        // test if all registered plugins_dir are accessible\n        // and if core plugins directory is still registered\n        $_core_plugins_dir = realpath(dirname(__FILE__) . '/../plugins');\n        $_core_plugins_available = false;\n        foreach ($smarty->getPluginsDir() as $plugin_dir) {\n            $_plugin_dir = $plugin_dir;\n            $plugin_dir = realpath($plugin_dir);\n            // resolve include_path or fail existence\n            if (!$plugin_dir) {\n                if ($smarty->use_include_path && !preg_match('/^([\\/\\\\\\\\]|[a-zA-Z]:[\\/\\\\\\\\])/', $_plugin_dir)) {\n                    // try PHP include_path\n                    if ($_stream_resolve_include_path) {\n                        $plugin_dir = stream_resolve_include_path($_plugin_dir);\n                    } else {\n                        $plugin_dir = $smarty->ext->_getIncludePath->getIncludePath($_plugin_dir, null, $smarty);\n                    }\n                    if ($plugin_dir !== false) {\n                        if ($errors === null) {\n                            echo \"$plugin_dir is OK.\\n\";\n                        }\n                        continue;\n                    } else {\n                        $status = false;\n                        $message = \"FAILED: $_plugin_dir does not exist (and couldn't be found in include_path either)\";\n                        if ($errors === null) {\n                            echo $message . \".\\n\";\n                        } else {\n                            $errors[ 'plugins_dir' ] = $message;\n                        }\n                        continue;\n                    }\n                } else {\n                    $status = false;\n                    $message = \"FAILED: $_plugin_dir does not exist\";\n                    if ($errors === null) {\n                        echo $message . \".\\n\";\n                    } else {\n                        $errors[ 'plugins_dir' ] = $message;\n                    }\n                    continue;\n                }\n            }\n            if (!is_dir($plugin_dir)) {\n                $status = false;\n                $message = \"FAILED: $plugin_dir is not a directory\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'plugins_dir' ] = $message;\n                }\n            } else if (!is_readable($plugin_dir)) {\n                $status = false;\n                $message = \"FAILED: $plugin_dir is not readable\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'plugins_dir' ] = $message;\n                }\n            } else if ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) {\n                $_core_plugins_available = true;\n                if ($errors === null) {\n                    echo \"$plugin_dir is OK.\\n\";\n                }\n            } else {\n                if ($errors === null) {\n                    echo \"$plugin_dir is OK.\\n\";\n                }\n            }\n        }\n        if (!$_core_plugins_available) {\n            $status = false;\n            $message = \"WARNING: Smarty's own libs/plugins is not available\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else if (!isset($errors[ 'plugins_dir' ])) {\n                $errors[ 'plugins_dir' ] = $message;\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing cache directory...\\n\";\n        }\n        // test if all registered cache_dir is accessible\n        $__cache_dir = $smarty->getCacheDir();\n        $_cache_dir = realpath($__cache_dir);\n        if (!$_cache_dir) {\n            $status = false;\n            $message = \"FAILED: {$__cache_dir} does not exist\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'cache_dir' ] = $message;\n            }\n        } else if (!is_dir($_cache_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_cache_dir} is not a directory\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'cache_dir' ] = $message;\n            }\n        } else if (!is_readable($_cache_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_cache_dir} is not readable\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'cache_dir' ] = $message;\n            }\n        } else if (!is_writable($_cache_dir)) {\n            $status = false;\n            $message = \"FAILED: {$_cache_dir} is not writable\";\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'cache_dir' ] = $message;\n            }\n        } else {\n            if ($errors === null) {\n                echo \"{$_cache_dir} is OK.\\n\";\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing configs directory...\\n\";\n        }\n        // test if all registered config_dir are accessible\n        foreach ($smarty->getConfigDir() as $config_dir) {\n            $_config_dir = $config_dir;\n            // resolve include_path or fail existence\n            if (!$config_dir) {\n                if ($smarty->use_include_path && !preg_match('/^([\\/\\\\\\\\]|[a-zA-Z]:[\\/\\\\\\\\])/', $_config_dir)) {\n                    // try PHP include_path\n                    if ($_stream_resolve_include_path) {\n                        $config_dir = stream_resolve_include_path($_config_dir);\n                    } else {\n                        $config_dir = $smarty->ext->_getIncludePath->getIncludePath($_config_dir, null, $smarty);\n                    }\n                    if ($config_dir !== false) {\n                        if ($errors === null) {\n                            echo \"$config_dir is OK.\\n\";\n                        }\n                        continue;\n                    } else {\n                        $status = false;\n                        $message = \"FAILED: $_config_dir does not exist (and couldn't be found in include_path either)\";\n                        if ($errors === null) {\n                            echo $message . \".\\n\";\n                        } else {\n                            $errors[ 'config_dir' ] = $message;\n                        }\n                        continue;\n                    }\n                } else {\n                    $status = false;\n                    $message = \"FAILED: $_config_dir does not exist\";\n                    if ($errors === null) {\n                        echo $message . \".\\n\";\n                    } else {\n                        $errors[ 'config_dir' ] = $message;\n                    }\n                    continue;\n                }\n            }\n            if (!is_dir($config_dir)) {\n                $status = false;\n                $message = \"FAILED: $config_dir is not a directory\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'config_dir' ] = $message;\n                }\n            } else if (!is_readable($config_dir)) {\n                $status = false;\n                $message = \"FAILED: $config_dir is not readable\";\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'config_dir' ] = $message;\n                }\n            } else {\n                if ($errors === null) {\n                    echo \"$config_dir is OK.\\n\";\n                }\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing sysplugin files...\\n\";\n        }\n        // test if sysplugins are available\n        $source = SMARTY_SYSPLUGINS_DIR;\n        if (is_dir($source)) {\n            $expectedSysplugins = array('smartycompilerexception.php'                               => true,\n                                        'smartyexception.php'                                       => true,\n                                        'smarty_cacheresource.php'                                  => true,\n                                        'smarty_cacheresource_custom.php'                           => true,\n                                        'smarty_cacheresource_keyvaluestore.php'                    => true,\n                                        'smarty_data.php'                                           => true,\n                                        'smarty_internal_block.php'                                 => true,\n                                        'smarty_internal_cacheresource_file.php'                    => true,\n                                        'smarty_internal_compilebase.php'                           => true,\n                                        'smarty_internal_compile_append.php'                        => true,\n                                        'smarty_internal_compile_assign.php'                        => true,\n                                        'smarty_internal_compile_block.php'                         => true,\n                                        'smarty_internal_compile_block_child.php'                   => true,\n                                        'smarty_internal_compile_block_parent.php'                  => true,\n                                        'smarty_internal_compile_child.php'                   => true,\n                                        'smarty_internal_compile_parent.php'                  => true,\n                                        'smarty_internal_compile_break.php'                         => true,\n                                        'smarty_internal_compile_call.php'                          => true,\n                                        'smarty_internal_compile_capture.php'                       => true,\n                                        'smarty_internal_compile_config_load.php'                   => true,\n                                        'smarty_internal_compile_continue.php'                      => true,\n                                        'smarty_internal_compile_debug.php'                         => true,\n                                        'smarty_internal_compile_eval.php'                          => true,\n                                        'smarty_internal_compile_extends.php'                       => true,\n                                        'smarty_internal_compile_for.php'                           => true,\n                                        'smarty_internal_compile_foreach.php'                       => true,\n                                        'smarty_internal_compile_function.php'                      => true,\n                                        'smarty_internal_compile_if.php'                            => true,\n                                        'smarty_internal_compile_include.php'                       => true,\n                                        'smarty_internal_compile_include_php.php'                   => true,\n                                        'smarty_internal_compile_insert.php'                        => true,\n                                        'smarty_internal_compile_ldelim.php'                        => true,\n                                        'smarty_internal_compile_make_nocache.php'                  => true,\n                                        'smarty_internal_compile_nocache.php'                       => true,\n                                        'smarty_internal_compile_private_block_plugin.php'          => true,\n                                        'smarty_internal_compile_private_foreachsection.php'        => true,\n                                        'smarty_internal_compile_private_function_plugin.php'       => true,\n                                        'smarty_internal_compile_private_modifier.php'              => true,\n                                        'smarty_internal_compile_private_object_block_function.php' => true,\n                                        'smarty_internal_compile_private_object_function.php'       => true,\n                                        'smarty_internal_compile_private_php.php'                   => true,\n                                        'smarty_internal_compile_private_print_expression.php'      => true,\n                                        'smarty_internal_compile_private_registered_block.php'      => true,\n                                        'smarty_internal_compile_private_registered_function.php'   => true,\n                                        'smarty_internal_compile_private_special_variable.php'      => true,\n                                        'smarty_internal_compile_rdelim.php'                        => true,\n                                        'smarty_internal_compile_section.php'                       => true,\n                                        'smarty_internal_compile_setfilter.php'                     => true,\n                                        'smarty_internal_compile_shared_inheritance.php'            => true,\n                                        'smarty_internal_compile_while.php'                         => true,\n                                        'smarty_internal_configfilelexer.php'                       => true,\n                                        'smarty_internal_configfileparser.php'                      => true,\n                                        'smarty_internal_config_file_compiler.php'                  => true,\n                                        'smarty_internal_data.php'                                  => true,\n                                        'smarty_internal_debug.php'                                 => true,\n                                        'smarty_internal_errorhandler.php'                          => true,\n                                        'smarty_internal_extension_handler.php'                     => true,\n                                        'smarty_internal_method_addautoloadfilters.php'             => true,\n                                        'smarty_internal_method_adddefaultmodifiers.php'            => true,\n                                        'smarty_internal_method_append.php'                         => true,\n                                        'smarty_internal_method_appendbyref.php'                    => true,\n                                        'smarty_internal_method_assignbyref.php'                    => true,\n                                        'smarty_internal_method_assignglobal.php'                   => true,\n                                        'smarty_internal_method_clearallassign.php'                 => true,\n                                        'smarty_internal_method_clearallcache.php'                  => true,\n                                        'smarty_internal_method_clearassign.php'                    => true,\n                                        'smarty_internal_method_clearcache.php'                     => true,\n                                        'smarty_internal_method_clearcompiledtemplate.php'          => true,\n                                        'smarty_internal_method_clearconfig.php'                    => true,\n                                        'smarty_internal_method_compileallconfig.php'               => true,\n                                        'smarty_internal_method_compilealltemplates.php'            => true,\n                                        'smarty_internal_method_configload.php'                     => true,\n                                        'smarty_internal_method_createdata.php'                     => true,\n                                        'smarty_internal_method_getautoloadfilters.php'             => true,\n                                        'smarty_internal_method_getconfigvariable.php'              => true,\n                                        'smarty_internal_method_getconfigvars.php'                  => true,\n                                        'smarty_internal_method_getdebugtemplate.php'               => true,\n                                        'smarty_internal_method_getdefaultmodifiers.php'            => true,\n                                        'smarty_internal_method_getglobal.php'                      => true,\n                                        'smarty_internal_method_getregisteredobject.php'            => true,\n                                        'smarty_internal_method_getstreamvariable.php'              => true,\n                                        'smarty_internal_method_gettags.php'                        => true,\n                                        'smarty_internal_method_gettemplatevars.php'                => true,\n                                        'smarty_internal_method_literals.php'                       => true,\n                                        'smarty_internal_method_loadfilter.php'                     => true,\n                                        'smarty_internal_method_loadplugin.php'                     => true,\n                                        'smarty_internal_method_mustcompile.php'                    => true,\n                                        'smarty_internal_method_registercacheresource.php'          => true,\n                                        'smarty_internal_method_registerclass.php'                  => true,\n                                        'smarty_internal_method_registerdefaultconfighandler.php'   => true,\n                                        'smarty_internal_method_registerdefaultpluginhandler.php'   => true,\n                                        'smarty_internal_method_registerdefaulttemplatehandler.php' => true,\n                                        'smarty_internal_method_registerfilter.php'                 => true,\n                                        'smarty_internal_method_registerobject.php'                 => true,\n                                        'smarty_internal_method_registerplugin.php'                 => true,\n                                        'smarty_internal_method_registerresource.php'               => true,\n                                        'smarty_internal_method_setautoloadfilters.php'             => true,\n                                        'smarty_internal_method_setdebugtemplate.php'               => true,\n                                        'smarty_internal_method_setdefaultmodifiers.php'            => true,\n                                        'smarty_internal_method_unloadfilter.php'                   => true,\n                                        'smarty_internal_method_unregistercacheresource.php'        => true,\n                                        'smarty_internal_method_unregisterfilter.php'               => true,\n                                        'smarty_internal_method_unregisterobject.php'               => true,\n                                        'smarty_internal_method_unregisterplugin.php'               => true,\n                                        'smarty_internal_method_unregisterresource.php'             => true,\n                                        'smarty_internal_nocache_insert.php'                        => true,\n                                        'smarty_internal_parsetree.php'                             => true,\n                                        'smarty_internal_parsetree_code.php'                        => true,\n                                        'smarty_internal_parsetree_dq.php'                          => true,\n                                        'smarty_internal_parsetree_dqcontent.php'                   => true,\n                                        'smarty_internal_parsetree_tag.php'                         => true,\n                                        'smarty_internal_parsetree_template.php'                    => true,\n                                        'smarty_internal_parsetree_text.php'                        => true,\n                                        'smarty_internal_resource_eval.php'                         => true,\n                                        'smarty_internal_resource_extends.php'                      => true,\n                                        'smarty_internal_resource_file.php'                         => true,\n                                        'smarty_internal_resource_php.php'                          => true,\n                                        'smarty_internal_resource_registered.php'                   => true,\n                                        'smarty_internal_resource_stream.php'                       => true,\n                                        'smarty_internal_resource_string.php'                       => true,\n                                        'smarty_internal_runtime_cachemodify.php'                   => true,\n                                        'smarty_internal_runtime_cacheresourcefile.php'             => true,\n                                        'smarty_internal_runtime_capture.php'                       => true,\n                                        'smarty_internal_runtime_codeframe.php'                     => true,\n                                        'smarty_internal_runtime_filterhandler.php'                 => true,\n                                        'smarty_internal_runtime_foreach.php'                       => true,\n                                        'smarty_internal_runtime_getincludepath.php'                => true,\n                                        'smarty_internal_runtime_inheritance.php'                   => true,\n                                        'smarty_internal_runtime_make_nocache.php'                  => true,\n                                        'smarty_internal_runtime_tplfunction.php'                   => true,\n                                        'smarty_internal_runtime_updatecache.php'                   => true,\n                                        'smarty_internal_runtime_updatescope.php'                   => true,\n                                        'smarty_internal_runtime_writefile.php'                     => true,\n                                        'smarty_internal_smartytemplatecompiler.php'                => true,\n                                        'smarty_internal_template.php'                              => true,\n                                        'smarty_internal_templatebase.php'                          => true,\n                                        'smarty_internal_templatecompilerbase.php'                  => true,\n                                        'smarty_internal_templatelexer.php'                         => true,\n                                        'smarty_internal_templateparser.php'                        => true,\n                                        'smarty_internal_testinstall.php'                           => true,\n                                        'smarty_internal_undefined.php'                             => true,\n                                        'smarty_resource.php'                                       => true,\n                                        'smarty_resource_custom.php'                                => true,\n                                        'smarty_resource_recompiled.php'                            => true,\n                                        'smarty_resource_uncompiled.php'                            => true,\n                                        'smarty_security.php'                                       => true,\n                                        'smarty_template_cached.php'                                => true,\n                                        'smarty_template_compiled.php'                              => true,\n                                        'smarty_template_config.php'                                => true,\n                                        'smarty_template_resource_base.php'                         => true,\n                                        'smarty_template_source.php'                                => true,\n                                        'smarty_undefined_variable.php'                             => true,\n                                        'smarty_variable.php'                                       => true,);\n            $iterator = new DirectoryIterator($source);\n            foreach ($iterator as $file) {\n                if (!$file->isDot()) {\n                    $filename = $file->getFilename();\n                    if (isset($expectedSysplugins[ $filename ])) {\n                        unset($expectedSysplugins[ $filename ]);\n                    }\n                }\n            }\n            if ($expectedSysplugins) {\n                $status = false;\n                $message = \"FAILED: files missing from libs/sysplugins: \" . join(', ', array_keys($expectedSysplugins));\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'sysplugins' ] = $message;\n                }\n            } else if ($errors === null) {\n                echo \"... OK\\n\";\n            }\n        } else {\n            $status = false;\n            $message = \"FAILED: \" . SMARTY_SYSPLUGINS_DIR . ' is not a directory';\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'sysplugins_dir_constant' ] = $message;\n            }\n        }\n        if ($errors === null) {\n            echo \"Testing plugin files...\\n\";\n        }\n        // test if core plugins are available\n        $source = SMARTY_PLUGINS_DIR;\n        if (is_dir($source)) {\n            $expectedPlugins = array(\n                'block.textformat.php'                  => true,\n                'function.counter.php'                  => true,\n                'function.cycle.php'                    => true,\n                'function.fetch.php'                    => true,\n                'function.html_checkboxes.php'          => true,\n                'function.html_image.php'               => true,\n                'function.html_options.php'             => true,\n                'function.html_radios.php'              => true,\n                'function.html_select_date.php'         => true,\n                'function.html_select_time.php'         => true,\n                'function.html_table.php'               => true,\n                'function.mailto.php'                   => true,\n                'function.math.php'                     => true,\n                'modifier.capitalize.php'               => true,\n                'modifier.date_format.php'              => true,\n                'modifier.debug_print_var.php'          => true,\n                'modifier.escape.php'                   => true,\n                'modifier.mb_wordwrap.php'              => true,\n                'modifier.regex_replace.php'            => true,\n                'modifier.replace.php'                  => true,\n                'modifier.spacify.php'                  => true,\n                'modifier.truncate.php'                 => true,\n                'modifiercompiler.cat.php'              => true,\n                'modifiercompiler.count_characters.php' => true,\n                'modifiercompiler.count_paragraphs.php' => true,\n                'modifiercompiler.count_sentences.php'  => true,\n                'modifiercompiler.count_words.php'      => true,\n                'modifiercompiler.default.php'          => true,\n                'modifiercompiler.escape.php'           => true,\n                'modifiercompiler.from_charset.php'     => true,\n                'modifiercompiler.indent.php'           => true,\n                'modifiercompiler.lower.php'            => true,\n                'modifiercompiler.noprint.php'          => true,\n                'modifiercompiler.string_format.php'    => true,\n                'modifiercompiler.strip.php'            => true,\n                'modifiercompiler.strip_tags.php'       => true,\n                'modifiercompiler.to_charset.php'       => true,\n                'modifiercompiler.unescape.php'         => true,\n                'modifiercompiler.upper.php'            => true,\n                'modifiercompiler.wordwrap.php'         => true,\n                'outputfilter.trimwhitespace.php'       => true,\n                'shared.escape_special_chars.php'       => true,\n                'shared.literal_compiler_param.php'     => true,\n                'shared.make_timestamp.php'             => true,\n                'shared.mb_str_replace.php'             => true,\n                'shared.mb_unicode.php'                 => true,\n                'variablefilter.htmlspecialchars.php'   => true,\n            );\n            $iterator = new DirectoryIterator($source);\n            foreach ($iterator as $file) {\n                if (!$file->isDot()) {\n                    $filename = $file->getFilename();\n                    if (isset($expectedPlugins[ $filename ])) {\n                        unset($expectedPlugins[ $filename ]);\n                    }\n                }\n            }\n            if ($expectedPlugins) {\n                $status = false;\n                $message = \"FAILED: files missing from libs/plugins: \" . join(', ', array_keys($expectedPlugins));\n                if ($errors === null) {\n                    echo $message . \".\\n\";\n                } else {\n                    $errors[ 'plugins' ] = $message;\n                }\n            } else if ($errors === null) {\n                echo \"... OK\\n\";\n            }\n        } else {\n            $status = false;\n            $message = \"FAILED: \" . SMARTY_PLUGINS_DIR . ' is not a directory';\n            if ($errors === null) {\n                echo $message . \".\\n\";\n            } else {\n                $errors[ 'plugins_dir_constant' ] = $message;\n            }\n        }\n        if ($errors === null) {\n            echo \"Tests complete.\\n\";\n            echo \"</PRE>\\n\";\n        }\n        return $status;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_internal_undefined.php",
    "content": "<?php\n\n/**\n * Smarty Internal Undefined\n *\n * Class to handle undefined method calls or calls to obsolete runtime extensions\n *\n * @package    Smarty\n * @subpackage PluginsInternal\n * @author     Uwe Tews\n */\nclass Smarty_Internal_Undefined\n{\n\n    /**\n     * Name of undefined extension class\n     *\n     * @var string|null\n     */\n    public $class = null;\n\n    /**\n     * Smarty_Internal_Undefined constructor.\n     *\n     * @param null|string $class name of undefined extension class\n     */\n    public function __construct($class = null)\n    {\n        $this->class = $class;\n    }\n\n    /**\n     * Wrapper for obsolete class Smarty_Internal_Runtime_ValidateCompiled\n     *\n     * @param  \\Smarty_Internal_Template $tpl\n     * @param  array                     $properties special template properties\n     * @param  bool                      $cache      flag if called from cache file\n     *\n     * @return bool false\n     */\n    public function decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)\n    {\n        if ($cache) {\n            $tpl->cached->valid = false;\n        } else {\n            $tpl->mustCompile = true;\n        }\n        return false;\n    }\n\n    /**\n     * Call error handler for undefined method\n     *\n     * @param string $name unknown method-name\n     * @param array  $args argument array\n     *\n     * @return mixed\n     * @throws SmartyException\n     */\n    public function __call($name, $args)\n    {\n        if (isset($this->class)) {\n            throw new SmartyException(\"undefined extension class '{$this->class}'\");\n        } else {\n            throw new SmartyException(get_class($args[ 0 ]) . \"->{$name}() undefined method\");\n        }\n    }\n}"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_resource.php",
    "content": "<?php\n/**\n * Smarty Resource Plugin\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Resource Plugin\n * Base implementation for resource plugins\n *\n * @package    Smarty\n * @subpackage TemplateResources\n *\n * @method renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template)\n * @method populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)\n * @method process(Smarty_Internal_Template $_smarty_tpl)\n */\nabstract class Smarty_Resource\n{\n    /**\n     * resource types provided by the core\n     *\n     * @var array\n     */\n    public static $sysplugins = array('file'    => 'smarty_internal_resource_file.php',\n                                      'string'  => 'smarty_internal_resource_string.php',\n                                      'extends' => 'smarty_internal_resource_extends.php',\n                                      'stream'  => 'smarty_internal_resource_stream.php',\n                                      'eval'    => 'smarty_internal_resource_eval.php',\n                                      'php'     => 'smarty_internal_resource_php.php');\n    /**\n     * Source is bypassing compiler\n     *\n     * @var boolean\n     */\n    public $uncompiled = false;\n    /**\n     * Source must be recompiled on every occasion\n     *\n     * @var boolean\n     */\n    public $recompiled = false;\n    /**\n     * Flag if resource does implement populateCompiledFilepath() method\n     *\n     * @var bool\n     */\n    public $hasCompiledHandler = false;\n\n    /**\n     * Load Resource Handler\n     *\n     * @param  Smarty $smarty smarty object\n     * @param  string $type   name of the resource\n     *\n     * @throws SmartyException\n     * @return Smarty_Resource Resource Handler\n     */\n    public static function load(Smarty $smarty, $type)\n    {\n        // try smarty's cache\n        if (isset($smarty->_cache[ 'resource_handlers' ][ $type ])) {\n            return $smarty->_cache[ 'resource_handlers' ][ $type ];\n        }\n        // try registered resource\n        if (isset($smarty->registered_resources[ $type ])) {\n            return $smarty->_cache[ 'resource_handlers' ][ $type ] =\n                $smarty->registered_resources[ $type ] instanceof Smarty_Resource ?\n                    $smarty->registered_resources[ $type ] : new Smarty_Internal_Resource_Registered();\n        }\n        // try sysplugins dir\n        if (isset(self::$sysplugins[ $type ])) {\n            $_resource_class = 'Smarty_Internal_Resource_' . ucfirst($type);\n            return $smarty->_cache[ 'resource_handlers' ][ $type ] = new $_resource_class();\n        }\n        // try plugins dir\n        $_resource_class = 'Smarty_Resource_' . ucfirst($type);\n        if ($smarty->loadPlugin($_resource_class)) {\n            if (class_exists($_resource_class, false)) {\n                return $smarty->_cache[ 'resource_handlers' ][ $type ] = new $_resource_class();\n            } else {\n                $smarty->registerResource($type,\n                                          array(\"smarty_resource_{$type}_source\", \"smarty_resource_{$type}_timestamp\",\n                                                \"smarty_resource_{$type}_secure\", \"smarty_resource_{$type}_trusted\"));\n                // give it another try, now that the resource is registered properly\n                return self::load($smarty, $type);\n            }\n        }\n        // try streams\n        $_known_stream = stream_get_wrappers();\n        if (in_array($type, $_known_stream)) {\n            // is known stream\n            if (is_object($smarty->security_policy)) {\n                $smarty->security_policy->isTrustedStream($type);\n            }\n            return $smarty->_cache[ 'resource_handlers' ][ $type ] = new Smarty_Internal_Resource_Stream();\n        }\n        // TODO: try default_(template|config)_handler\n        // give up\n        throw new SmartyException(\"Unknown resource type '{$type}'\");\n    }\n\n    /**\n     * extract resource_type and resource_name from template_resource and config_resource\n     * @note \"C:/foo.tpl\" was forced to file resource up till Smarty 3.1.3 (including).\n     *\n     * @param  string $resource_name    template_resource or config_resource to parse\n     * @param  string $default_resource the default resource_type defined in $smarty\n     *\n     * @return array with parsed resource name and type\n     */\n    public static function parseResourceName($resource_name, $default_resource)\n    {\n        if (preg_match('/^([A-Za-z0-9_\\-]{2,})[:]/', $resource_name, $match)) {\n            $type = $match[ 1 ];\n            $name = substr($resource_name, strlen($match[ 0 ]));\n        } else {\n            // no resource given, use default\n            // or single character before the colon is not a resource type, but part of the filepath\n            $type = $default_resource;\n            $name = $resource_name;\n        }\n        return array($name, $type);\n    }\n\n    /**\n     * modify template_resource according to resource handlers specifications\n     *\n     * @param  \\Smarty_Internal_Template|\\Smarty $obj               Smarty instance\n     * @param  string                            $template_resource template_resource to extract resource handler and name of\n     *\n     * @return string unique resource name\n     * @throws \\SmartyException\n     */\n    public static function getUniqueTemplateName($obj, $template_resource)\n    {\n        $smarty = $obj->_getSmartyObj();\n        list($name, $type) = self::parseResourceName($template_resource, $smarty->default_resource_type);\n        // TODO: optimize for Smarty's internal resource types\n        $resource = Smarty_Resource::load($smarty, $type);\n        // go relative to a given template?\n        $_file_is_dotted = $name[ 0 ] === '.' && ($name[ 1 ] === '.' || $name[ 1 ] === '/');\n        if ($obj->_isTplObj() && $_file_is_dotted &&\n            ($obj->source->type === 'file' || $obj->parent->source->type === 'extends')\n        ) {\n            $name = $smarty->_realpath(dirname($obj->parent->source->filepath) . DIRECTORY_SEPARATOR . $name);\n        }\n        return $resource->buildUniqueResourceName($smarty, $name);\n    }\n\n    /**\n     * initialize Source Object for given resource\n     * wrapper for backward compatibility to versions < 3.1.22\n     * Either [$_template] or [$smarty, $template_resource] must be specified\n     *\n     * @param  Smarty_Internal_Template $_template         template object\n     * @param  Smarty                   $smarty            smarty object\n     * @param  string                   $template_resource resource identifier\n     *\n     * @return \\Smarty_Template_Source Source Object\n     * @throws \\SmartyException\n     */\n    public static function source(Smarty_Internal_Template $_template = null,\n                                  Smarty $smarty = null,\n                                  $template_resource = null)\n    {\n        return Smarty_Template_Source::load($_template, $smarty, $template_resource);\n    }\n\n    /**\n     * Load template's source into current template object\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     * @throws SmartyException        if source cannot be loaded\n     */\n    abstract public function getContent(Smarty_Template_Source $source);\n\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param Smarty_Template_Source   $source    source object\n     * @param Smarty_Internal_Template $_template template object\n     */\n    abstract public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null);\n\n    /**\n     * populate Source Object with timestamp and exists from Resource\n     *\n     * @param Smarty_Template_Source $source source object\n     */\n    public function populateTimestamp(Smarty_Template_Source $source)\n    {\n        // intentionally left blank\n    }\n\n    /**\n     * modify resource_name according to resource handlers specifications\n     *\n     * @param  Smarty  $smarty        Smarty instance\n     * @param  string  $resource_name resource_name to make unique\n     * @param  boolean $isConfig      flag for config resource\n     *\n     * @return string unique resource name\n     */\n    public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false)\n    {\n        if ($isConfig) {\n            if (!isset($smarty->_joined_config_dir)) {\n                $smarty->getTemplateDir(null, true);\n            }\n            return get_class($this) . '#' . $smarty->_joined_config_dir . '#' . $resource_name;\n        } else {\n            if (!isset($smarty->_joined_template_dir)) {\n                $smarty->getTemplateDir();\n            }\n            return get_class($this) . '#' . $smarty->_joined_template_dir . '#' . $resource_name;\n        }\n    }\n\n    /*\n     * Check if resource must check time stamps when when loading complied or cached templates.\n     * Resources like 'extends' which use source components my disable timestamp checks on own resource.\n     *\n     * @return bool\n     */\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return basename(preg_replace('![^\\w]+!', '_', $source->name));\n    }\n\n    /**\n     * @return bool\n     */\n    public function checkTimestamps()\n    {\n        return true;\n    }\n}\n\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_resource_custom.php",
    "content": "<?php\n/**\n * Smarty Resource Plugin\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Resource Plugin\n * Wrapper Implementation for custom resource plugins\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nabstract class Smarty_Resource_Custom extends Smarty_Resource\n{\n    /**\n     * fetch template and its modification time from data source\n     *\n     * @param string  $name    template name\n     * @param string  &$source template source\n     * @param integer &$mtime  template modification timestamp (epoch)\n     */\n    abstract protected function fetch($name, &$source, &$mtime);\n\n    /**\n     * Fetch template's modification timestamp from data source\n     * {@internal implementing this method is optional.\n     *  Only implement it if modification times can be accessed faster than loading the complete template source.}}\n     *\n     * @param  string $name template name\n     *\n     * @return integer|boolean timestamp (epoch) the template was modified, or false if not found\n     */\n    protected function fetchTimestamp($name)\n    {\n        return null;\n    }\n\n    /**\n     * populate Source Object with meta data from Resource\n     *\n     * @param Smarty_Template_Source   $source    source object\n     * @param Smarty_Internal_Template $_template template object\n     */\n    public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)\n    {\n        $source->filepath = $source->type . ':' . substr(preg_replace('/[^A-Za-z0-9.]/','',$source->name),0,25);\n        $source->uid = sha1($source->type . ':' . $source->name);\n\n        $mtime = $this->fetchTimestamp($source->name);\n        if ($mtime !== null) {\n            $source->timestamp = $mtime;\n        } else {\n            $this->fetch($source->name, $content, $timestamp);\n            $source->timestamp = isset($timestamp) ? $timestamp : false;\n            if (isset($content)) {\n                $source->content = $content;\n            }\n        }\n        $source->exists = !!$source->timestamp;\n    }\n\n    /**\n     * Load template's source into current template object\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 template source\n     * @throws SmartyException        if source cannot be loaded\n     */\n    public function getContent(Smarty_Template_Source $source)\n    {\n        $this->fetch($source->name, $content, $timestamp);\n        if (isset($content)) {\n            return $content;\n        }\n\n        throw new SmartyException(\"Unable to read template {$source->type} '{$source->name}'\");\n    }\n\n    /**\n     * Determine basename for compiled filename\n     *\n     * @param  Smarty_Template_Source $source source object\n     *\n     * @return string                 resource's basename\n     */\n    public function getBasename(Smarty_Template_Source $source)\n    {\n        return basename(substr(preg_replace('/[^A-Za-z0-9.]/','',$source->name),0,25));\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_resource_recompiled.php",
    "content": "<?php\n/**\n * Smarty Resource Plugin\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Resource Plugin\n * Base implementation for resource plugins that don't compile cache\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nabstract class Smarty_Resource_Recompiled extends Smarty_Resource\n{\n    /**\n     * Flag that it's an recompiled resource\n     *\n     * @var bool\n     */\n    public $recompiled = true;\n\n    /**\n     * Resource does implement populateCompiledFilepath() method\n     *\n     * @var bool\n     */\n    public $hasCompiledHandler = true;\n\n    /**\n     * compile template from source\n     *\n     * @param Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     *\n     * @throws Exception\n     */\n    public function process(Smarty_Internal_Template $_smarty_tpl)\n    {\n        $compiled = &$_smarty_tpl->compiled;\n        $compiled->file_dependency = array();\n        $compiled->includes = array();\n        $compiled->nocache_hash = null;\n        $compiled->unifunc = null;\n        $level = ob_get_level();\n        ob_start();\n        $_smarty_tpl->loadCompiler();\n        // call compiler\n        try {\n            eval('?>' . $_smarty_tpl->compiler->compileTemplate($_smarty_tpl));\n        }\n        catch (Exception $e) {\n            unset($_smarty_tpl->compiler);\n            while (ob_get_level() > $level) {\n                ob_end_clean();\n            }\n            throw $e;\n        }\n        // release compiler object to free memory\n        unset($_smarty_tpl->compiler);\n        ob_get_clean();\n        $compiled->timestamp = time();\n        $compiled->exists = true;\n    }\n\n    /**\n     * populate Compiled Object with compiled filepath\n     *\n     * @param  Smarty_Template_Compiled $compiled  compiled object\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return void\n     */\n    public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)\n    {\n        $compiled->filepath = false;\n        $compiled->timestamp = false;\n        $compiled->exists = false;\n    }\n\n    /*\n       * Disable timestamp checks for recompiled resource.\n       *\n       * @return bool\n       */\n    /**\n     * @return bool\n     */\n    public function checkTimestamps()\n    {\n        return false;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_resource_uncompiled.php",
    "content": "<?php\n/**\n * Smarty Resource Plugin\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\n\n/**\n * Smarty Resource Plugin\n * Base implementation for resource plugins that don't use the compiler\n *\n * @package    Smarty\n * @subpackage TemplateResources\n */\nabstract class Smarty_Resource_Uncompiled extends Smarty_Resource\n{\n    /**\n     * Flag that it's an uncompiled resource\n     *\n     * @var bool\n     */\n    public $uncompiled = true;\n\n    /**\n     * Resource does implement populateCompiledFilepath() method\n     *\n     * @var bool\n     */\n    public $hasCompiledHandler = true;\n\n    /**\n     * populate compiled object with compiled filepath\n     *\n     * @param Smarty_Template_Compiled $compiled  compiled object\n     * @param Smarty_Internal_Template $_template template object\n     */\n    public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)\n    {\n        $compiled->filepath = $_template->source->filepath;\n        $compiled->timestamp = $_template->source->timestamp;\n        $compiled->exists = $_template->source->exists;\n        if ($_template->smarty->merge_compiled_includes || $_template->source->handler->checkTimestamps()) {\n            $compiled->file_dependency[ $_template->source->uid ] =\n                array($compiled->filepath, $compiled->timestamp, $_template->source->type,);\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_security.php",
    "content": "<?php\n/**\n * Smarty plugin\n *\n * @package    Smarty\n * @subpackage Security\n * @author     Uwe Tews\n */\n\n/*\n * FIXME: Smarty_Security API\n *      - getter and setter instead of public properties would allow cultivating an internal cache properly\n *      - current implementation of isTrustedResourceDir() assumes that Smarty::$template_dir and Smarty::$config_dir are immutable\n *        the cache is killed every time either of the variables change. That means that two distinct Smarty objects with differing\n *        $template_dir or $config_dir should NOT share the same Smarty_Security instance,\n *        as this would lead to (severe) performance penalty! how should this be handled?\n */\n\n/**\n * This class does contain the security settings\n */\nclass Smarty_Security\n{\n    /**\n     * This determines how Smarty handles \"<?php ... ?>\" tags in templates.\n     * possible values:\n     * <ul>\n     *   <li>Smarty::PHP_PASSTHRU -> echo PHP tags as they are</li>\n     *   <li>Smarty::PHP_QUOTE    -> escape tags as entities</li>\n     *   <li>Smarty::PHP_REMOVE   -> remove php tags</li>\n     *   <li>Smarty::PHP_ALLOW    -> execute php tags</li>\n     * </ul>\n     *\n     * @var integer\n     */\n    public $php_handling = Smarty::PHP_PASSTHRU;\n\n    /**\n     * This is the list of template directories that are considered secure.\n     * $template_dir is in this list implicitly.\n     *\n     * @var array\n     */\n    public $secure_dir = array();\n\n    /**\n     * This is an array of directories where trusted php scripts reside.\n     * {@link $security} is disabled during their inclusion/execution.\n     *\n     * @var array\n     */\n    public $trusted_dir = array();\n\n    /**\n     * List of regular expressions (PCRE) that include trusted URIs\n     *\n     * @var array\n     */\n    public $trusted_uri = array();\n\n    /**\n     * List of trusted constants names\n     *\n     * @var array\n     */\n    public $trusted_constants = array();\n\n    /**\n     * This is an array of trusted static classes.\n     * If empty access to all static classes is allowed.\n     * If set to 'none' none is allowed.\n     *\n     * @var array\n     */\n    public $static_classes = array();\n\n    /**\n     * This is an nested array of trusted classes and static methods.\n     * If empty access to all static classes and methods is allowed.\n     * Format:\n     * array (\n     *         'class_1' => array('method_1', 'method_2'), // allowed methods listed\n     *         'class_2' => array(),                       // all methods of class allowed\n     *       )\n     * If set to null none is allowed.\n     *\n     * @var array\n     */\n    public $trusted_static_methods = array();\n\n    /**\n     * This is an array of trusted static properties.\n     * If empty access to all static classes and properties is allowed.\n     * Format:\n     * array (\n     *         'class_1' => array('prop_1', 'prop_2'), // allowed properties listed\n     *         'class_2' => array(),                   // all properties of class allowed\n     *       )\n     * If set to null none is allowed.\n     *\n     * @var array\n     */\n    public $trusted_static_properties = array();\n\n    /**\n     * This is an array of trusted PHP functions.\n     * If empty all functions are allowed.\n     * To disable all PHP functions set $php_functions = null.\n     *\n     * @var array\n     */\n    public $php_functions = array('isset', 'empty', 'count', 'sizeof', 'in_array', 'is_array', 'time',);\n\n    /**\n     * This is an array of trusted PHP modifiers.\n     * If empty all modifiers are allowed.\n     * To disable all modifier set $php_modifiers = null.\n     *\n     * @var array\n     */\n    public $php_modifiers = array('escape', 'count', 'nl2br',);\n\n    /**\n     * This is an array of allowed tags.\n     * If empty no restriction by allowed_tags.\n     *\n     * @var array\n     */\n    public $allowed_tags = array();\n\n    /**\n     * This is an array of disabled tags.\n     * If empty no restriction by disabled_tags.\n     *\n     * @var array\n     */\n    public $disabled_tags = array();\n\n    /**\n     * This is an array of allowed modifier plugins.\n     * If empty no restriction by allowed_modifiers.\n     *\n     * @var array\n     */\n    public $allowed_modifiers = array();\n\n    /**\n     * This is an array of disabled modifier plugins.\n     * If empty no restriction by disabled_modifiers.\n     *\n     * @var array\n     */\n    public $disabled_modifiers = array();\n\n    /**\n     * This is an array of disabled special $smarty variables.\n     *\n     * @var array\n     */\n    public $disabled_special_smarty_vars = array();\n\n    /**\n     * This is an array of trusted streams.\n     * If empty all streams are allowed.\n     * To disable all streams set $streams = null.\n     *\n     * @var array\n     */\n    public $streams = array('file');\n\n    /**\n     * + flag if constants can be accessed from template\n     *\n     * @var boolean\n     */\n    public $allow_constants = true;\n\n    /**\n     * + flag if super globals can be accessed from template\n     *\n     * @var boolean\n     */\n    public $allow_super_globals = true;\n\n    /**\n     * max template nesting level\n     *\n     * @var int\n     */\n    public $max_template_nesting = 0;\n\n    /**\n     * current template nesting level\n     *\n     * @var int\n     */\n    private $_current_template_nesting = 0;\n\n    /**\n     * Cache for $resource_dir lookup\n     *\n     * @var array\n     */\n    protected $_resource_dir = array();\n\n    /**\n     * Cache for $template_dir lookup\n     *\n     * @var array\n     */\n    protected $_template_dir = array();\n\n    /**\n     * Cache for $config_dir lookup\n     *\n     * @var array\n     */\n    protected $_config_dir = array();\n\n    /**\n     * Cache for $secure_dir lookup\n     *\n     * @var array\n     */\n    protected $_secure_dir = array();\n\n    /**\n     * Cache for $php_resource_dir lookup\n     *\n     * @var array\n     */\n    protected $_php_resource_dir = null;\n\n    /**\n     * Cache for $trusted_dir lookup\n     *\n     * @var array\n     */\n    protected $_trusted_dir = null;\n\n    /**\n     * Cache for include path status\n     *\n     * @var bool\n     */\n    protected $_include_path_status = false;\n\n    /**\n     * Cache for $_include_array lookup\n     *\n     * @var array\n     */\n    protected $_include_dir = array();\n\n    /**\n     * @param Smarty $smarty\n     */\n    public function __construct($smarty)\n    {\n        $this->smarty = $smarty;\n        $this->smarty->_cache[ 'template_dir_new' ] = true;\n        $this->smarty->_cache[ 'config_dir_new' ] = true;\n    }\n\n    /**\n     * Check if PHP function is trusted.\n     *\n     * @param  string $function_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if function is trusted\n     * @throws SmartyCompilerException if php function is not trusted\n     */\n    public function isTrustedPhpFunction($function_name, $compiler)\n    {\n        if (isset($this->php_functions) &&\n            (empty($this->php_functions) || in_array($function_name, $this->php_functions))\n        ) {\n            return true;\n        }\n\n        $compiler->trigger_template_error(\"PHP function '{$function_name}' not allowed by security setting\");\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if static class is trusted.\n     *\n     * @param  string $class_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if class is trusted\n     * @throws SmartyCompilerException if static class is not trusted\n     */\n    public function isTrustedStaticClass($class_name, $compiler)\n    {\n        if (isset($this->static_classes) &&\n            (empty($this->static_classes) || in_array($class_name, $this->static_classes))\n        ) {\n            return true;\n        }\n\n        $compiler->trigger_template_error(\"access to static class '{$class_name}' not allowed by security setting\");\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if static class method/property is trusted.\n     *\n     * @param  string $class_name\n     * @param  string $params\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if class method is trusted\n     * @throws SmartyCompilerException if static class method is not trusted\n     */\n    public function isTrustedStaticClassAccess($class_name, $params, $compiler)\n    {\n        if (!isset($params[ 2 ])) {\n            // fall back\n            return $this->isTrustedStaticClass($class_name, $compiler);\n        }\n        if ($params[ 2 ] === 'method') {\n            $allowed = $this->trusted_static_methods;\n            $name = substr($params[ 0 ], 0, strpos($params[ 0 ], '('));\n        } else {\n            $allowed = $this->trusted_static_properties;\n            // strip '$'\n            $name = substr($params[ 0 ], 1);\n        }\n        if (isset($allowed)) {\n            if (empty($allowed)) {\n                // fall back\n                return $this->isTrustedStaticClass($class_name, $compiler);\n            }\n            if (isset($allowed[ $class_name ]) &&\n                (empty($allowed[ $class_name ]) || in_array($name, $allowed[ $class_name ]))\n            ) {\n                return true;\n            }\n        }\n        $compiler->trigger_template_error(\"access to static class '{$class_name}' {$params[2]} '{$name}' not allowed by security setting\");\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if PHP modifier is trusted.\n     *\n     * @param  string $modifier_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if modifier is trusted\n     * @throws SmartyCompilerException if modifier is not trusted\n     */\n    public function isTrustedPhpModifier($modifier_name, $compiler)\n    {\n        if (isset($this->php_modifiers) &&\n            (empty($this->php_modifiers) || in_array($modifier_name, $this->php_modifiers))\n        ) {\n            return true;\n        }\n\n        $compiler->trigger_template_error(\"modifier '{$modifier_name}' not allowed by security setting\");\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if tag is trusted.\n     *\n     * @param  string $tag_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if tag is trusted\n     * @throws SmartyCompilerException if modifier is not trusted\n     */\n    public function isTrustedTag($tag_name, $compiler)\n    {\n        // check for internal always required tags\n        if (in_array($tag_name,\n                     array('assign', 'call', 'private_filter', 'private_block_plugin', 'private_function_plugin',\n                           'private_object_block_function', 'private_object_function', 'private_registered_function',\n                           'private_registered_block', 'private_special_variable', 'private_print_expression',\n                           'private_modifier'))) {\n            return true;\n        }\n        // check security settings\n        if (empty($this->allowed_tags)) {\n            if (empty($this->disabled_tags) || !in_array($tag_name, $this->disabled_tags)) {\n                return true;\n            } else {\n                $compiler->trigger_template_error(\"tag '{$tag_name}' disabled by security setting\", null, true);\n            }\n        } elseif (in_array($tag_name, $this->allowed_tags) && !in_array($tag_name, $this->disabled_tags)) {\n            return true;\n        } else {\n            $compiler->trigger_template_error(\"tag '{$tag_name}' not allowed by security setting\", null, true);\n        }\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if special $smarty variable is trusted.\n     *\n     * @param  string $var_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if tag is trusted\n     * @throws SmartyCompilerException if modifier is not trusted\n     */\n    public function isTrustedSpecialSmartyVar($var_name, $compiler)\n    {\n        if (!in_array($var_name, $this->disabled_special_smarty_vars)) {\n            return true;\n        } else {\n            $compiler->trigger_template_error(\"special variable '\\$smarty.{$var_name}' not allowed by security setting\",\n                                              null, true);\n        }\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if modifier plugin is trusted.\n     *\n     * @param  string $modifier_name\n     * @param  object $compiler compiler object\n     *\n     * @return boolean                 true if tag is trusted\n     * @throws SmartyCompilerException if modifier is not trusted\n     */\n    public function isTrustedModifier($modifier_name, $compiler)\n    {\n        // check for internal always allowed modifier\n        if (in_array($modifier_name, array('default'))) {\n            return true;\n        }\n        // check security settings\n        if (empty($this->allowed_modifiers)) {\n            if (empty($this->disabled_modifiers) || !in_array($modifier_name, $this->disabled_modifiers)) {\n                return true;\n            } else {\n                $compiler->trigger_template_error(\"modifier '{$modifier_name}' disabled by security setting\", null,\n                                                  true);\n            }\n        } elseif (in_array($modifier_name, $this->allowed_modifiers) &&\n                  !in_array($modifier_name, $this->disabled_modifiers)\n        ) {\n            return true;\n        } else {\n            $compiler->trigger_template_error(\"modifier '{$modifier_name}' not allowed by security setting\", null,\n                                              true);\n        }\n\n        return false; // should not, but who knows what happens to the compiler in the future?\n    }\n\n    /**\n     * Check if constants are enabled or trusted\n     *\n     * @param  string $const    constant name\n     * @param  object $compiler compiler object\n     *\n     * @return bool\n     */\n    public function isTrustedConstant($const, $compiler)\n    {\n        if (in_array($const, array('true', 'false', 'null'))) {\n            return true;\n        }\n        if (!empty($this->trusted_constants)) {\n            if (!in_array(strtolower($const), $this->trusted_constants)) {\n                $compiler->trigger_template_error(\"Security: access to constant '{$const}' not permitted\");\n                return false;\n            }\n            return true;\n        }\n        if ($this->allow_constants) {\n            return true;\n        }\n        $compiler->trigger_template_error(\"Security: access to constants not permitted\");\n        return false;\n    }\n\n    /**\n     * Check if stream is trusted.\n     *\n     * @param  string $stream_name\n     *\n     * @return boolean         true if stream is trusted\n     * @throws SmartyException if stream is not trusted\n     */\n    public function isTrustedStream($stream_name)\n    {\n        if (isset($this->streams) && (empty($this->streams) || in_array($stream_name, $this->streams))) {\n            return true;\n        }\n\n        throw new SmartyException(\"stream '{$stream_name}' not allowed by security setting\");\n    }\n\n    /**\n     * Check if directory of file resource is trusted.\n     *\n     * @param  string   $filepath\n     * @param null|bool $isConfig\n     *\n     * @return bool true if directory is trusted\n     * @throws \\SmartyException if directory is not trusted\n     */\n    public function isTrustedResourceDir($filepath, $isConfig = null)\n    {\n        if ($this->_include_path_status !== $this->smarty->use_include_path) {\n            $_dir = $this->smarty->use_include_path ? $this->smarty->ext->_getIncludePath->getIncludePathDirs($this->smarty) : array();\n            if ($this->_include_dir !== $_dir) {\n                $this->_updateResourceDir($this->_include_dir, $_dir);\n                $this->_include_dir = $_dir;\n            }\n            $this->_include_path_status = $this->smarty->use_include_path;\n        }\n        if ($isConfig !== true) {\n            $_dir = $this->smarty->getTemplateDir();\n            if ($this->_template_dir !== $_dir) {\n                $this->_updateResourceDir($this->_template_dir, $_dir);\n                $this->_template_dir = $_dir;\n            }\n        }\n        if ($isConfig !== false) {\n            $_dir = $this->smarty->getConfigDir();\n            if ($this->_config_dir !== $_dir) {\n                $this->_updateResourceDir($this->_config_dir, $_dir);\n                $this->_config_dir = $_dir;\n            }\n        }\n        if ($this->_secure_dir !== $this->secure_dir) {\n            $this->secure_dir = (array)$this->secure_dir;\n            foreach($this->secure_dir as $k => $d) {\n                $this->secure_dir[$k] = $this->smarty->_realpath($d.DIRECTORY_SEPARATOR,true);\n            }\n            $this->_updateResourceDir($this->_secure_dir, $this->secure_dir);\n            $this->_secure_dir = $this->secure_dir;\n        }\n        $addPath =  $this->_checkDir($filepath, $this->_resource_dir);\n        if ($addPath !== false) {\n           $this->_resource_dir = array_merge($this->_resource_dir, $addPath);\n        }\n        return true;\n    }\n\n    /**\n     * Check if URI (e.g. {fetch} or {html_image}) is trusted\n     * To simplify things, isTrustedUri() resolves all input to \"{$PROTOCOL}://{$HOSTNAME}\".\n     * So \"http://username:password@hello.world.example.org:8080/some-path?some=query-string\"\n     * is reduced to \"http://hello.world.example.org\" prior to applying the patters from {@link $trusted_uri}.\n     *\n     * @param  string $uri\n     *\n     * @return boolean         true if URI is trusted\n     * @throws SmartyException if URI is not trusted\n     * @uses $trusted_uri for list of patterns to match against $uri\n     */\n    public function isTrustedUri($uri)\n    {\n        $_uri = parse_url($uri);\n        if (!empty($_uri[ 'scheme' ]) && !empty($_uri[ 'host' ])) {\n            $_uri = $_uri[ 'scheme' ] . '://' . $_uri[ 'host' ];\n            foreach ($this->trusted_uri as $pattern) {\n                if (preg_match($pattern, $_uri)) {\n                    return true;\n                }\n            }\n        }\n\n        throw new SmartyException(\"URI '{$uri}' not allowed by security setting\");\n    }\n\n    /**\n     * Check if directory of file resource is trusted.\n     *\n     * @param  string $filepath\n     *\n     * @return boolean         true if directory is trusted\n     * @throws SmartyException if PHP directory is not trusted\n     */\n    public function isTrustedPHPDir($filepath)\n    {\n        if (empty($this->trusted_dir)) {\n            throw new SmartyException(\"directory '{$filepath}' not allowed by security setting (no trusted_dir specified)\");\n        }\n\n        // check if index is outdated\n        if (!$this->_trusted_dir || $this->_trusted_dir !== $this->trusted_dir) {\n            $this->_php_resource_dir = array();\n\n            $this->_trusted_dir = $this->trusted_dir;\n            foreach ((array) $this->trusted_dir as $directory) {\n                $directory = $this->smarty->_realpath($directory . DIRECTORY_SEPARATOR, true);\n                $this->_php_resource_dir[ $directory ] = true;\n            }\n        }\n        $addPath =  $this->_checkDir($filepath, $this->_php_resource_dir);\n        if ($addPath !== false) {\n           $this->_php_resource_dir = array_merge($this->_php_resource_dir, $addPath);\n        }\n         return true;\n    }\n\n    /**\n     * Remove old directories and its sub folders, add new directories\n     *\n     * @param array $oldDir\n     * @param array $newDir\n     */\n    private function _updateResourceDir($oldDir, $newDir) {\n        foreach ($oldDir as $directory) {\n            $directory = $this->smarty->_realpath($directory, true);\n            $length = strlen($directory);\n            foreach ($this->_resource_dir as $dir) {\n                if (substr($dir, 0,$length) === $directory) {\n                    unset($this->_resource_dir[ $dir ]);\n                }\n            }\n        }\n        foreach ($newDir as $directory) {\n            $directory = $this->smarty->_realpath($directory, true);\n            $this->_resource_dir[ $directory ] = true;\n        }\n    }\n    /**\n     * Check if file is inside a valid directory\n     *\n     * @param string $filepath\n     * @param array  $dirs valid directories\n     *\n     * @return array|bool\n     * @throws \\SmartyException\n     */\n    private function _checkDir($filepath, $dirs)\n    {\n        $directory = dirname($filepath) . DIRECTORY_SEPARATOR;\n        if (isset($dirs[ $directory ])) {\n            return false;\n        }\n        $filepath = $this->smarty->_realpath($filepath, true);\n        $directory = dirname($filepath) . DIRECTORY_SEPARATOR;\n        $_directory = array();\n        while (true) {\n             // test if the directory is trusted\n            if (isset($dirs[ $directory ])) {\n               return $_directory;\n            }\n            // abort if we've reached root\n            if (!preg_match('#[\\\\\\/][^\\\\\\/]+[\\\\\\/]$#', $directory)) {\n                break;\n            }\n            // remember the directory to add it to _resource_dir in case we're successful\n            $_directory[ $directory ] = true;\n           // bubble up one level\n            $directory = preg_replace('#[\\\\\\/][^\\\\\\/]+[\\\\\\/]$#', DIRECTORY_SEPARATOR, $directory);\n        }\n\n        // give up\n        throw new SmartyException(\"directory '{$filepath}' not allowed by security setting\");\n    }\n\n    /**\n     * Loads security class and enables security\n     *\n     * @param \\Smarty                 $smarty\n     * @param  string|Smarty_Security $security_class if a string is used, it must be class-name\n     *\n     * @return \\Smarty current Smarty instance for chaining\n     * @throws \\SmartyException when an invalid class name is provided\n     */\n    public static function enableSecurity(Smarty $smarty, $security_class)\n    {\n        if ($security_class instanceof Smarty_Security) {\n            $smarty->security_policy = $security_class;\n            return $smarty;\n        } elseif (is_object($security_class)) {\n            throw new SmartyException(\"Class '\" . get_class($security_class) . \"' must extend Smarty_Security.\");\n        }\n        if ($security_class === null) {\n            $security_class = $smarty->security_class;\n        }\n        if (!class_exists($security_class)) {\n            throw new SmartyException(\"Security class '$security_class' is not defined\");\n        } elseif ($security_class !== 'Smarty_Security' && !is_subclass_of($security_class, 'Smarty_Security')) {\n            throw new SmartyException(\"Class '$security_class' must extend Smarty_Security.\");\n        } else {\n            $smarty->security_policy = new $security_class($smarty);\n        }\n        return $smarty;\n    }\n    /**\n     * Start template processing\n     *\n     * @param $template\n     *\n     * @throws SmartyException\n     */\n    public function startTemplate($template)\n    {\n        if ($this->max_template_nesting > 0 && $this->_current_template_nesting ++ >= $this->max_template_nesting) {\n            throw new SmartyException(\"maximum template nesting level of '{$this->max_template_nesting}' exceeded when calling '{$template->template_resource}'\");\n        }\n    }\n\n    /**\n     * Exit template processing\n     *\n     */\n    public function endTemplate()\n    {\n        if ($this->max_template_nesting > 0) {\n            $this->_current_template_nesting --;\n        }\n    }\n\n    /**\n     * Register callback functions call at start/end of template rendering\n     *\n     * @param \\Smarty_Internal_Template $template\n     */\n    public function registerCallBacks(Smarty_Internal_Template $template)\n    {\n        $template->startRenderCallbacks[] = array($this, 'startTemplate');\n        $template->endRenderCallbacks[] = array($this, 'endTemplate');\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_template_cached.php",
    "content": "<?php\n/**\n * Created by PhpStorm.\n * User: Uwe Tews\n * Date: 04.12.2014\n * Time: 06:08\n */\n\n/**\n * Smarty Resource Data Object\n * Cache Data Container for Template Files\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\nclass Smarty_Template_Cached extends Smarty_Template_Resource_Base\n{\n    /**\n     * Cache Is Valid\n     *\n     * @var boolean\n     */\n    public $valid = null;\n\n    /**\n     * CacheResource Handler\n     *\n     * @var Smarty_CacheResource\n     */\n    public $handler = null;\n\n    /**\n     * Template Cache Id (Smarty_Internal_Template::$cache_id)\n     *\n     * @var string\n     */\n    public $cache_id = null;\n\n    /**\n     * saved cache lifetime in seconds\n     *\n     * @var integer\n     */\n    public $cache_lifetime = 0;\n\n    /**\n     * Id for cache locking\n     *\n     * @var string\n     */\n    public $lock_id = null;\n\n    /**\n     * flag that cache is locked by this instance\n     *\n     * @var bool\n     */\n    public $is_locked = false;\n\n    /**\n     * Source Object\n     *\n     * @var Smarty_Template_Source\n     */\n    public $source = null;\n\n    /**\n     * Nocache hash codes of processed compiled templates\n     *\n     * @var array\n     */\n    public $hashes = array();\n\n    /**\n     * Flag if this is a cache resource\n     *\n     * @var bool\n     */\n    public $isCache = true;\n\n    /**\n     * create Cached Object container\n     *\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @throws \\SmartyException\n     */\n    public function __construct(Smarty_Internal_Template $_template)\n    {\n        $this->compile_id = $_template->compile_id;\n        $this->cache_id = $_template->cache_id;\n        $this->source = $_template->source;\n        if (!class_exists('Smarty_CacheResource', false)) {\n            require SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php';\n        }\n        $this->handler = Smarty_CacheResource::load($_template->smarty);\n    }\n\n    /**\n     * @param Smarty_Internal_Template $_template\n     *\n     * @return Smarty_Template_Cached\n     */\n    static function load(Smarty_Internal_Template $_template)\n    {\n        $_template->cached = new Smarty_Template_Cached($_template);\n        $_template->cached->handler->populate($_template->cached, $_template);\n        // caching enabled ?\n        if (!$_template->caching || $_template->source->handler->recompiled\n        ) {\n            $_template->cached->valid = false;\n        }\n        return $_template->cached;\n    }\n\n    /**\n     * Render cache template\n     *\n     * @param \\Smarty_Internal_Template $_template\n     * @param  bool                     $no_output_filter\n     *\n     * @throws \\Exception\n     */\n    public function render(Smarty_Internal_Template $_template, $no_output_filter = true)\n    {\n        if ($this->isCached($_template)) {\n            if ($_template->smarty->debugging) {\n                if (!isset($_template->smarty->_debug)) {\n                    $_template->smarty->_debug = new Smarty_Internal_Debug();\n                }\n                $_template->smarty->_debug->start_cache($_template);\n            }\n            if (!$this->processed) {\n                $this->process($_template);\n            }\n            $this->getRenderedTemplateCode($_template);\n            if ($_template->smarty->debugging) {\n                $_template->smarty->_debug->end_cache($_template);\n            }\n            return;\n        } else {\n            $_template->smarty->ext->_updateCache->updateCache($this, $_template, $no_output_filter);\n        }\n    }\n\n    /**\n     * Check if cache is valid, lock cache if required\n     *\n     * @param \\Smarty_Internal_Template $_template\n     *\n     * @return bool flag true if cache is valid\n     */\n    public function isCached(Smarty_Internal_Template $_template)\n    {\n        if ($this->valid !== null) {\n            return $this->valid;\n        }\n        while (true) {\n            while (true) {\n                if ($this->exists === false || $_template->smarty->force_compile || $_template->smarty->force_cache) {\n                    $this->valid = false;\n                } else {\n                    $this->valid = true;\n                }\n                if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_CURRENT &&\n                    $_template->cache_lifetime >= 0 && time() > ($this->timestamp + $_template->cache_lifetime)\n                ) {\n                    // lifetime expired\n                    $this->valid = false;\n                }\n                if ($this->valid && $_template->compile_check === Smarty::COMPILECHECK_ON &&\n                    $_template->source->getTimeStamp() > $this->timestamp\n                ) {\n                    $this->valid = false;\n                }\n                if ($this->valid || !$_template->smarty->cache_locking) {\n                    break;\n                }\n                if (!$this->handler->locked($_template->smarty, $this)) {\n                    $this->handler->acquireLock($_template->smarty, $this);\n                    break 2;\n                }\n                $this->handler->populate($this, $_template);\n            }\n            if ($this->valid) {\n                if (!$_template->smarty->cache_locking || $this->handler->locked($_template->smarty, $this) === null) {\n                    // load cache file for the following checks\n                    if ($_template->smarty->debugging) {\n                        $_template->smarty->_debug->start_cache($_template);\n                    }\n                    if ($this->handler->process($_template, $this) === false) {\n                        $this->valid = false;\n                    } else {\n                        $this->processed = true;\n                    }\n                    if ($_template->smarty->debugging) {\n                        $_template->smarty->_debug->end_cache($_template);\n                    }\n                } else {\n                    $this->is_locked = true;\n                    continue;\n                }\n            } else {\n                return $this->valid;\n            }\n            if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_SAVED &&\n                $_template->cached->cache_lifetime >= 0 &&\n                (time() > ($_template->cached->timestamp + $_template->cached->cache_lifetime))\n            ) {\n                $this->valid = false;\n            }\n            if ($_template->smarty->cache_locking) {\n                if (!$this->valid) {\n                    $this->handler->acquireLock($_template->smarty, $this);\n                } elseif ($this->is_locked) {\n                    $this->handler->releaseLock($_template->smarty, $this);\n                }\n            }\n            return $this->valid;\n        }\n        return $this->valid;\n    }\n\n    /**\n     * Process cached template\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param bool                     $update    flag if called because cache update\n     */\n    public function process(Smarty_Internal_Template $_template, $update = false)\n    {\n        if ($this->handler->process($_template, $this, $update) === false) {\n            $this->valid = false;\n        }\n        if ($this->valid) {\n            $this->processed = true;\n        } else {\n            $this->processed = false;\n        }\n    }\n\n    /**\n     * Read cache content from handler\n     *\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return string|false content\n     */\n    public function read(Smarty_Internal_Template $_template)\n    {\n        if (!$_template->source->handler->recompiled) {\n            return $this->handler->readCachedContent($_template);\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_template_compiled.php",
    "content": "<?php\n\n/**\n * Smarty Resource Data Object\n * Meta Data Container for Template Files\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n * @property string $content compiled content\n */\nclass Smarty_Template_Compiled extends Smarty_Template_Resource_Base\n{\n    /**\n     * nocache hash\n     *\n     * @var string|null\n     */\n    public $nocache_hash = null;\n\n    /**\n     * get a Compiled Object of this source\n     *\n     * @param  Smarty_Internal_Template $_template template object\n     *\n     * @return Smarty_Template_Compiled compiled object\n     */\n    static function load($_template)\n    {\n        $compiled = new Smarty_Template_Compiled();\n        if ($_template->source->handler->hasCompiledHandler) {\n            $_template->source->handler->populateCompiledFilepath($compiled, $_template);\n        } else {\n            $compiled->populateCompiledFilepath($_template);\n        }\n        return $compiled;\n    }\n\n    /**\n     * populate Compiled Object with compiled filepath\n     *\n     * @param Smarty_Internal_Template $_template template object\n     **/\n    public function populateCompiledFilepath(Smarty_Internal_Template $_template)\n    {\n        $source = &$_template->source;\n        $smarty = &$_template->smarty;\n        $this->filepath = $smarty->getCompileDir();\n        if (isset($_template->compile_id)) {\n            $this->filepath .= preg_replace('![^\\w]+!', '_', $_template->compile_id) .\n                               ($smarty->use_sub_dirs ? DIRECTORY_SEPARATOR : '^');\n        }\n        // if use_sub_dirs, break file into directories\n        if ($smarty->use_sub_dirs) {\n            $this->filepath .= $source->uid[ 0 ] . $source->uid[ 1 ] . DIRECTORY_SEPARATOR . $source->uid[ 2 ] .\n                               $source->uid[ 3 ] . DIRECTORY_SEPARATOR . $source->uid[ 4 ] . $source->uid[ 5 ] .\n                               DIRECTORY_SEPARATOR;\n        }\n        $this->filepath .= $source->uid . '_';\n        if ($source->isConfig) {\n            $this->filepath .= (int)$smarty->config_read_hidden + (int)$smarty->config_booleanize * 2 +\n                               (int)$smarty->config_overwrite * 4;\n        } else {\n            $this->filepath .= (int)$smarty->merge_compiled_includes + (int)$smarty->escape_html * 2 +\n                               (($smarty->merge_compiled_includes && $source->type === 'extends') ?\n                                   (int)$smarty->extends_recursion * 4 : 0);\n        }\n        $this->filepath .= '.' . $source->type;\n        $basename = $source->handler->getBasename($source);\n        if (!empty($basename)) {\n            $this->filepath .= '.' . $basename;\n        }\n        if ($_template->caching) {\n            $this->filepath .= '.cache';\n        }\n        $this->filepath .= '.php';\n        $this->timestamp = $this->exists = is_file($this->filepath);\n        if ($this->exists) {\n            $this->timestamp = filemtime($this->filepath);\n        }\n    }\n\n    /**\n     * render compiled template code\n     *\n     * @param Smarty_Internal_Template $_template\n     *\n     * @return string\n     * @throws Exception\n     */\n    public function render(Smarty_Internal_Template $_template)\n    {\n        // checks if template exists\n        if (!$_template->source->exists) {\n            $type = $_template->source->isConfig ? 'config' : 'template';\n            throw new SmartyException(\"Unable to load {$type} '{$_template->source->type}:{$_template->source->name}'\");\n        }\n        if ($_template->smarty->debugging) {\n            if (!isset($_template->smarty->_debug)) {\n                $_template->smarty->_debug = new Smarty_Internal_Debug();\n            }\n            $_template->smarty->_debug->start_render($_template);\n        }\n        if (!$this->processed) {\n            $this->process($_template);\n        }\n        if (isset($_template->cached)) {\n            $_template->cached->file_dependency =\n                array_merge($_template->cached->file_dependency, $this->file_dependency);\n        }\n        if ($_template->source->handler->uncompiled) {\n            $_template->source->handler->renderUncompiled($_template->source, $_template);\n        } else {\n            $this->getRenderedTemplateCode($_template);\n        }\n        if ($_template->caching && $this->has_nocache_code) {\n            $_template->cached->hashes[ $this->nocache_hash ] = true;\n        }\n        if ($_template->smarty->debugging) {\n            $_template->smarty->_debug->end_render($_template);\n        }\n    }\n\n    /**\n     * load compiled template or compile from source\n     *\n     * @param Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     *\n     * @throws Exception\n     */\n    public function process(Smarty_Internal_Template $_smarty_tpl)\n    {\n        $source = &$_smarty_tpl->source;\n        $smarty = &$_smarty_tpl->smarty;\n        if ($source->handler->recompiled) {\n            $source->handler->process($_smarty_tpl);\n        } else if (!$source->handler->uncompiled) {\n            if (!$this->exists || $smarty->force_compile ||\n                ($_smarty_tpl->compile_check && $source->getTimeStamp() > $this->getTimeStamp())\n            ) {\n                $this->compileTemplateSource($_smarty_tpl);\n                $compileCheck = $_smarty_tpl->compile_check;\n                $_smarty_tpl->compile_check = Smarty::COMPILECHECK_OFF;\n                $this->loadCompiledTemplate($_smarty_tpl);\n                $_smarty_tpl->compile_check = $compileCheck;\n            } else {\n                $_smarty_tpl->mustCompile = true;\n                @include($this->filepath);\n                if ($_smarty_tpl->mustCompile) {\n                    $this->compileTemplateSource($_smarty_tpl);\n                    $compileCheck = $_smarty_tpl->compile_check;\n                    $_smarty_tpl->compile_check = Smarty::COMPILECHECK_OFF;\n                    $this->loadCompiledTemplate($_smarty_tpl);\n                    $_smarty_tpl->compile_check = $compileCheck;\n                }\n            }\n            $_smarty_tpl->_subTemplateRegister();\n            $this->processed = true;\n        }\n    }\n\n    /**\n     * compile template from source\n     *\n     * @param Smarty_Internal_Template $_template\n     *\n     * @throws Exception\n     */\n    public function compileTemplateSource(Smarty_Internal_Template $_template)\n    {\n        $this->file_dependency = array();\n        $this->includes = array();\n        $this->nocache_hash = null;\n        $this->unifunc = null;\n        // compile locking\n        if ($saved_timestamp = (!$_template->source->handler->recompiled && is_file($this->filepath))) {\n            $saved_timestamp = $this->getTimeStamp();\n            touch($this->filepath);\n        }\n        // compile locking\n        try {\n            // call compiler\n            $_template->loadCompiler();\n            $this->write($_template, $_template->compiler->compileTemplate($_template));\n        }\n        catch (Exception $e) {\n            // restore old timestamp in case of error\n            if ($saved_timestamp && is_file($this->filepath)) {\n                touch($this->filepath, $saved_timestamp);\n            }\n            unset($_template->compiler);\n            throw $e;\n        }\n        // release compiler object to free memory\n        unset($_template->compiler);\n    }\n\n    /**\n     * Write compiled code by handler\n     *\n     * @param Smarty_Internal_Template $_template template object\n     * @param string                   $code      compiled code\n     *\n     * @return bool success\n     * @throws \\SmartyException\n     */\n    public function write(Smarty_Internal_Template $_template, $code)\n    {\n        if (!$_template->source->handler->recompiled) {\n            if ($_template->smarty->ext->_writeFile->writeFile($this->filepath, $code, $_template->smarty) === true) {\n                $this->timestamp = $this->exists = is_file($this->filepath);\n                if ($this->exists) {\n                    $this->timestamp = filemtime($this->filepath);\n                    return true;\n                }\n            }\n            return false;\n        }\n        return true;\n    }\n\n    /**\n     * Read compiled content from handler\n     *\n     * @param Smarty_Internal_Template $_template template object\n     *\n     * @return string content\n     */\n    public function read(Smarty_Internal_Template $_template)\n    {\n        if (!$_template->source->handler->recompiled) {\n            return file_get_contents($this->filepath);\n        }\n        return isset($this->content) ? $this->content : false;\n    }\n\n    /**\n     * Load fresh compiled template by including the PHP file\n     * HHVM requires a work around because of a PHP incompatibility\n     *\n     * @param \\Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template\n     */\n    private function loadCompiledTemplate(Smarty_Internal_Template $_smarty_tpl)\n    {\n        if (function_exists('opcache_invalidate')\n            && (!function_exists('ini_get') || strlen(ini_get(\"opcache.restrict_api\")) < 1)\n        ) {\n            opcache_invalidate($this->filepath, true);\n        } else if (function_exists('apc_compile_file')) {\n            apc_compile_file($this->filepath);\n        }\n        if (defined('HHVM_VERSION')) {\n            eval('?>' . file_get_contents($this->filepath));\n        } else {\n            include($this->filepath);\n        }\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_template_config.php",
    "content": "<?php\n/**\n * Smarty Config Source Plugin\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n */\n\n/**\n * Smarty Config Resource Data Object\n * Meta Data Container for Template Files\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Uwe Tews\n *\n */\nclass Smarty_Template_Config extends Smarty_Template_Source\n{\n    /**\n     * array of section names, single section or null\n     *\n     * @var null|string|array\n     */\n    public $config_sections = null;\n\n    /**\n     * scope into which the config variables shall be loaded\n     *\n     * @var int\n     */\n    public $scope = 0;\n\n    /**\n     * Flag that source is a config file\n     *\n     * @var bool\n     */\n    public $isConfig = true;\n\n    /**\n     * Name of the Class to compile this resource's contents with\n     *\n     * @var string\n     */\n    public $compiler_class = 'Smarty_Internal_Config_File_Compiler';\n\n    /**\n     * Name of the Class to tokenize this resource's contents with\n     *\n     * @var string\n     */\n    public $template_lexer_class = 'Smarty_Internal_Configfilelexer';\n\n    /**\n     * Name of the Class to parse this resource's contents with\n     *\n     * @var string\n     */\n    public $template_parser_class = 'Smarty_Internal_Configfileparser';\n\n    /**\n     * initialize Source Object for given resource\n     * Either [$_template] or [$smarty, $template_resource] must be specified\n     *\n     * @param  Smarty_Internal_Template $_template         template object\n     * @param  Smarty                   $smarty            smarty object\n     * @param  string                   $template_resource resource identifier\n     *\n     * @return Smarty_Template_Config Source Object\n     * @throws SmartyException\n     */\n    public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null,\n                                $template_resource = null)\n    {\n        static $_incompatible_resources = array('extends' => true, 'php' => true);\n        if ($_template) {\n            $smarty = $_template->smarty;\n            $template_resource = $_template->template_resource;\n        }\n        if (empty($template_resource)) {\n            throw new SmartyException('Source: Missing  name');\n        }\n         // parse resource_name, load resource handler\n        list($name, $type) = Smarty_Resource::parseResourceName($template_resource, $smarty->default_config_type);\n        // make sure configs are not loaded via anything smarty can't handle\n        if (isset($_incompatible_resources[ $type ])) {\n            throw new SmartyException (\"Unable to use resource '{$type}' for config\");\n        }\n        $source = new Smarty_Template_Config($smarty, $template_resource, $type, $name);\n        $source->handler->populate($source, $_template);\n        if (!$source->exists && isset($smarty->default_config_handler_func)) {\n            Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source);\n            $source->handler->populate($source, $_template);\n        }\n        return $source;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_template_resource_base.php",
    "content": "<?php\n\n/**\n * Smarty Template Resource Base Object\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n */\nabstract class Smarty_Template_Resource_Base\n{\n    /**\n     * Compiled Filepath\n     *\n     * @var string\n     */\n    public $filepath = null;\n\n    /**\n     * Compiled Timestamp\n     *\n     * @var integer|bool\n     */\n    public $timestamp = false;\n\n    /**\n     * Compiled Existence\n     *\n     * @var boolean\n     */\n    public $exists = false;\n\n    /**\n     * Template Compile Id (Smarty_Internal_Template::$compile_id)\n     *\n     * @var string\n     */\n    public $compile_id = null;\n\n    /**\n     * Compiled Content Loaded\n     *\n     * @var boolean\n     */\n    public $processed = false;\n\n    /**\n     * unique function name for compiled template code\n     *\n     * @var string\n     */\n    public $unifunc = '';\n\n    /**\n     * flag if template does contain nocache code sections\n     *\n     * @var bool\n     */\n    public $has_nocache_code = false;\n\n    /**\n     * resource file dependency\n     *\n     * @var array\n     */\n    public $file_dependency = array();\n\n    /**\n     * Content buffer\n     *\n     * @var string\n     */\n    public $content = null;\n\n    /**\n     * Included sub templates\n     * - index name\n     * - value use count\n     *\n     * @var int[]\n     */\n    public $includes = array();\n\n    /**\n     * Flag if this is a cache resource\n     *\n     * @var bool\n     */\n    public $isCache = false;\n\n    /**\n     * Process resource\n     *\n     * @param Smarty_Internal_Template $_template template object\n     */\n    abstract public function process(Smarty_Internal_Template $_template);\n\n    /**\n     * get rendered template content by calling compiled or cached template code\n     *\n     * @param \\Smarty_Internal_Template $_template\n     * @param string                    $unifunc function with template code\n     *\n     * @throws \\Exception\n     */\n    public function getRenderedTemplateCode(Smarty_Internal_Template $_template, $unifunc = null)\n    {\n        $smarty = &$_template->smarty;\n        $_template->isRenderingCache = $this->isCache;\n        $level = ob_get_level();\n        try {\n            if (!isset($unifunc)) {\n                $unifunc = $this->unifunc;\n            }\n            if (empty($unifunc) || !function_exists($unifunc)) {\n                throw new SmartyException(\"Invalid compiled template for '{$_template->template_resource}'\");\n            }\n            if ($_template->startRenderCallbacks) {\n                foreach ($_template->startRenderCallbacks as $callback) {\n                    call_user_func($callback, $_template);\n                }\n            }\n            $unifunc($_template);\n            foreach ($_template->endRenderCallbacks as $callback) {\n                call_user_func($callback, $_template);\n            }\n            $_template->isRenderingCache = false;\n        }\n        catch (Exception $e) {\n            $_template->isRenderingCache = false;\n            while (ob_get_level() > $level) {\n                ob_end_clean();\n            }\n            if (isset($smarty->security_policy)) {\n                $smarty->security_policy->endTemplate();\n            }\n            throw $e;\n        }\n    }\n\n    /**\n     * Get compiled time stamp\n     *\n     * @return int\n     */\n    public function getTimeStamp()\n    {\n        if ($this->exists && !$this->timestamp) {\n            $this->timestamp = filemtime($this->filepath);\n        }\n        return $this->timestamp;\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_template_source.php",
    "content": "<?php\n\n/**\n * Smarty Resource Data Object\n * Meta Data Container for Template Files\n *\n * @package    Smarty\n * @subpackage TemplateResources\n * @author     Rodney Rehm\n *\n */\nclass Smarty_Template_Source\n{\n    /**\n     * Unique Template ID\n     *\n     * @var string\n     */\n    public $uid = null;\n\n    /**\n     * Template Resource (Smarty_Internal_Template::$template_resource)\n     *\n     * @var string\n     */\n    public $resource = null;\n\n    /**\n     * Resource Type\n     *\n     * @var string\n     */\n    public $type = null;\n\n    /**\n     * Resource Name\n     *\n     * @var string\n     */\n    public $name = null;\n\n    /**\n     * Source Filepath\n     *\n     * @var string\n     */\n    public $filepath = null;\n\n    /**\n     * Source Timestamp\n     *\n     * @var integer\n     */\n    public $timestamp = null;\n\n    /**\n     * Source Existence\n     *\n     * @var boolean\n     */\n    public $exists = false;\n\n    /**\n     * Source File Base name\n     *\n     * @var string\n     */\n    public $basename = null;\n\n    /**\n     * The Components an extended template is made of\n     *\n     * @var \\Smarty_Template_Source[]\n     */\n    public $components = null;\n\n    /**\n     * Resource Handler\n     *\n     * @var \\Smarty_Resource\n     */\n    public $handler = null;\n\n    /**\n     * Smarty instance\n     *\n     * @var Smarty\n     */\n    public $smarty = null;\n\n    /**\n     * Resource is source\n     *\n     * @var bool\n     */\n    public $isConfig = false;\n\n    /**\n     * Template source content eventually set by default handler\n     *\n     * @var string\n     */\n    public $content = null;\n\n    /**\n     * Name of the Class to compile this resource's contents with\n     *\n     * @var string\n     */\n    public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';\n\n    /**\n     * Name of the Class to tokenize this resource's contents with\n     *\n     * @var string\n     */\n    public $template_lexer_class = 'Smarty_Internal_Templatelexer';\n\n    /**\n     * Name of the Class to parse this resource's contents with\n     *\n     * @var string\n     */\n    public $template_parser_class = 'Smarty_Internal_Templateparser';\n\n    /**\n     * create Source Object container\n     *\n     * @param Smarty $smarty   Smarty instance this source object belongs to\n     * @param string $resource full template_resource\n     * @param string $type     type of resource\n     * @param string $name     resource name\n     *\n     * @throws \\SmartyException\n     * @internal param \\Smarty_Resource $handler Resource Handler this source object communicates with\n     */\n    public function __construct(Smarty $smarty, $resource, $type, $name)\n    {\n        $this->handler =\n            isset($smarty->_cache[ 'resource_handlers' ][ $type ]) ? $smarty->_cache[ 'resource_handlers' ][ $type ] :\n                Smarty_Resource::load($smarty, $type);\n        $this->smarty = $smarty;\n        $this->resource = $resource;\n        $this->type = $type;\n        $this->name = $name;\n    }\n\n    /**\n     * initialize Source Object for given resource\n     * Either [$_template] or [$smarty, $template_resource] must be specified\n     *\n     * @param  Smarty_Internal_Template $_template         template object\n     * @param  Smarty                   $smarty            smarty object\n     * @param  string                   $template_resource resource identifier\n     *\n     * @return Smarty_Template_Source Source Object\n     * @throws SmartyException\n     */\n    public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null,\n                                $template_resource = null)\n    {\n        if ($_template) {\n            $smarty = $_template->smarty;\n            $template_resource = $_template->template_resource;\n        }\n        if (empty($template_resource)) {\n            throw new SmartyException('Source: Missing  name');\n        }\n        // parse resource_name, load resource handler, identify unique resource name\n        if (preg_match('/^([A-Za-z0-9_\\-]{2,})[:]([\\s\\S]*)$/', $template_resource, $match)) {\n            $type = $match[ 1 ];\n            $name = $match[ 2 ];\n        } else {\n            // no resource given, use default\n            // or single character before the colon is not a resource type, but part of the filepath\n            $type = $smarty->default_resource_type;\n            $name = $template_resource;\n        }\n        // create new source  object\n        $source = new Smarty_Template_Source($smarty, $template_resource, $type, $name);\n        $source->handler->populate($source, $_template);\n        if (!$source->exists && isset($_template->smarty->default_template_handler_func)) {\n            Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source);\n            $source->handler->populate($source, $_template);\n        }\n        return $source;\n    }\n\n    /**\n     * Get source time stamp\n     *\n     * @return int\n     */\n    public function getTimeStamp()\n    {\n        if (!isset($this->timestamp)) {\n            $this->handler->populateTimestamp($this);\n        }\n        return $this->timestamp;\n    }\n\n    /**\n     * Get source content\n     *\n     * @return string\n     * @throws \\SmartyException\n     */\n    public function getContent()\n    {\n        return isset($this->content) ? $this->content : $this->handler->getContent($this);\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_undefined_variable.php",
    "content": "<?php\n\n/**\n * class for undefined variable object\n * This class defines an object for undefined variable handling\n *\n * @package    Smarty\n * @subpackage Template\n */\nclass Smarty_Undefined_Variable extends Smarty_Variable\n{\n    /**\n     * Returns null for not existing properties\n     *\n     * @param  string $name\n     *\n     * @return null\n     */\n    public function __get($name)\n    {\n            return null;\n    }\n\n    /**\n     * Always returns an empty string.\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return '';\n    }\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smarty_variable.php",
    "content": "<?php\n\n/**\n * class for the Smarty variable object\n * This class defines the Smarty variable object\n *\n * @package    Smarty\n * @subpackage Template\n */\nclass Smarty_Variable\n{\n    /**\n     * template variable\n     *\n     * @var mixed\n     */\n    public $value = null;\n\n    /**\n     * if true any output of this variable will be not cached\n     *\n     * @var boolean\n     */\n    public $nocache = false;\n\n    /**\n     * create Smarty variable object\n     *\n     * @param mixed   $value   the value to assign\n     * @param boolean $nocache if true any output of this variable will be not cached\n     */\n    public function __construct($value = null, $nocache = false)\n    {\n        $this->value = $value;\n        $this->nocache = $nocache;\n    }\n\n    /**\n     * <<magic>> String conversion\n     *\n     * @return string\n     */\n    public function __toString()\n    {\n        return (string) $this->value;\n    }\n}\n\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smartycompilerexception.php",
    "content": "<?php\n\n/**\n * Smarty compiler exception class\n *\n * @package Smarty\n */\nclass SmartyCompilerException extends SmartyException\n{\n    /**\n     * @return string\n     */\n    public function __toString()\n    {\n        return ' --> Smarty Compiler: ' . $this->message . ' <-- ';\n    }\n\n    /**\n     * The line number of the template error\n     *\n     * @type int|null\n     */\n    public $line = null;\n\n    /**\n     * The template source snippet relating to the error\n     *\n     * @type string|null\n     */\n    public $source = null;\n\n    /**\n     * The raw text of the error message\n     *\n     * @type string|null\n     */\n    public $desc = null;\n\n    /**\n     * The resource identifier or template name\n     *\n     * @type string|null\n     */\n    public $template = null;\n}\n"
  },
  {
    "path": "Tool/smarty-3.1.32/libs/sysplugins/smartyexception.php",
    "content": "<?php\n\n/**\n * Smarty exception class\n *\n * @package Smarty\n */\nclass SmartyException extends Exception\n{\n    public static $escape = false;\n\n    /**\n     * @return string\n     */\n    public function __toString()\n    {\n        return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- ';\n    }\n}\n"
  },
  {
    "path": "book.sql",
    "content": "-- phpMyAdmin SQL Dump\n-- version 4.8.3\n-- https://www.phpmyadmin.net/\n--\n-- 主机： 127.0.0.1\n-- 生成日期： 2018-10-18 11:18:56\n-- 服务器版本： 5.7.23\n-- PHP 版本： 7.2.9\n\nSET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\nSET AUTOCOMMIT = 0;\nSTART TRANSACTION;\nSET time_zone = \"+00:00\";\n\n\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n/*!40101 SET NAMES utf8mb4 */;\n\n--\n-- 数据库： `mybook`\n--\nCREATE DATABASE IF NOT EXISTS `mybook` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;\nUSE `mybook`;\n\n-- --------------------------------------------------------\n\n--\n-- 表的结构 `book_info`\n--\n\nCREATE TABLE `book_info` (\n  `id` int(11) NOT NULL,\n  `name` char(30) NOT NULL,\n  `author` char(30) NOT NULL,\n  `press` char(20) NOT NULL,\n  `press_time` char(10) NOT NULL,\n  `price` char(10) NOT NULL,\n  `ISBN` char(13) NOT NULL,\n  `desc` text\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\n--\n-- 转存表中的数据 `book_info`\n--\n\nINSERT INTO `book_info` (`id`, `name`, `author`, `press`, `press_time`, `price`, `ISBN`, `desc`) VALUES\n(1, '追风筝的人', '[美]卡勒德·胡赛尼', '上海人民出版社', '2006-5', '29.00', '9787208061644', '12岁的阿富汗富家少爷阿米尔与仆人哈桑情同手足。然而，在一场风筝比赛后，发生了一件悲惨不堪的事，阿米尔为自己的懦弱感到自责和痛苦，逼走了哈桑，不久，自己也跟随父亲逃往美国。'),\n(2, '解忧杂货店', '[日]东野圭吾', '南海出版公司', '2014-5', '39.50', '9787544270878', '现代人内心流失的东西，这家杂货店能帮你找回——'),\n(3, '小王子', '[法]圣埃克苏佩里', '人民文学出版社', '2003-8', '22.00', '9787020042494', '小王子是一个超凡脱俗的仙童，他住在一颗只比他大一丁点儿的小行星上。陪伴他的是一朵他非常喜爱的小玫瑰花。但玫瑰花的虚荣心伤害了小王子对她的感情。小王子告别小行星，开始了遨游太空的旅行。他先后访问了六个行星，各种见闻使他陷入忧伤，他感到大人们荒唐可笑、太不正常。只有在其中一个点灯人的星球上，小王子才找到一个可以作为朋友的人。但点灯人的天地又十分狭小，除了点灯人他自己，不能容下第二个人。在地理学家的指点下，孤单的小王子来到人类居住的地球。'),\n(4, '白夜行', '[日]东野圭吾', '南海出版公司', '2008-9', '29.80', '9787544242516', '“只希望能手牵手在太阳下散步”，这个象征故事内核的绝望念想，有如一个美丽的幌子，随着无数凌乱、压抑、悲凉的故事片段像纪录片一样一一还原：没有痴痴相思，没有海枯石烂，只剩下一个冰冷绝望的诡计，最后一丝温情也被完全抛弃，万千读者在一曲救赎罪恶的凄苦爱情中悲切动容……'),\n(5, '围城', '钱钟书', '人民文学出版社', '1991-2', '19.00', '9787020024759', '《围城》是钱钟书所著的长篇小说。第一版于1947年由上海晨光出版公司出版。1949年之后，由于政治等方面的原因，本书长期无法在中国大陆和台湾重印，仅在香港出现过盗印本。1980年由作者重新修订之后，在中国大陆地区由人民文学出版社刊印。此后作者又曾小幅修改过几次。《围城》 自从出版以来，就受到许多人的推崇。由于1949年后长期无法重印，这本书逐渐淡出人们的视野。1960年代，旅美汉学家夏志清在《中国现代小说史》(A History of Modern Chinese Fiction)中对本书作出很高的评价，这才重新引起人们对它的关注。人们对它的评价一般集中在两方面，幽默的语言和对生活深刻的观察。从1990年代开始，也有人提出对本书的不同看法，认为这是一部被“拔高”的小说，并不是一部出色的作品。很多人认为这是一部幽默作品。除了各具特色的人物语言之外，作者...'),\n(6, '三体', '刘慈欣', '重庆出版社', '2008-1', '23.00', '9787536692930', '文化大革命如火如荼进行的同时。军方探寻外星文明的绝秘计划“红岸工程”取得了突破性进展。但在按下发射键的那一刻，历经劫难的叶文洁没有意识到，她彻底改变了人类的命运。地球文明向宇宙发出的第一声啼鸣，以太阳为中心，以光速向宇宙深处飞驰……'),\n(7, '挪威的森林', '[日]村上春树', '上海译文出版社', '2001-2', '18.80', '9787532725694', '这是一部动人心弦的、平缓舒雅的、略带感伤的恋爱小说。小说主人公渡边以第一人称展开他同两个女孩间的爱情纠葛。渡边的第一个恋人直子原是他高中要好同学木月的女友，后来木月自杀了。一年后渡边同直子不期而遇并开始交往。此时的直子已变得娴静腼腆，美丽晶莹的眸子里不时掠过一丝难以捕捉的阴翳。两人只是日复一日地在落叶飘零的东京街头漫无目标地或前或后或并肩行走不止。直子20岁生日的晚上两人发生了性关系，不料第二天直子便不知去向。几个月后直子来信说她住进一家远在深山里的精神疗养院。渡边前去探望时发现直子开始带有成熟女性的丰腴与娇美。晚间两人虽同处一室，但渡边约束了自己，分手前表示永远等待直子。返校不久，由于一次偶然相遇，渡边开始与低年级的绿子交往。绿子同内向的直子截然相反，“简直就像迎着春天的晨光蹦跳到世界上来的一头小鹿”。这期间，渡边内心十分苦闷彷徨。一方面念念不忘直...'),\n(8, '嫌疑人X的献身', '[日]东野圭吾', '南海出版公司', '2008-9', '28.00', '9787544241694', '百年一遇的数学天才石神，每天唯一的乐趣，便是去固定的便当店买午餐，只为看一眼在便当店做事的邻居靖子。'),\n(9, '活着', '余华', '南海出版公司', '1998-5', '12.00', '9787544210966', '地主少爷福贵嗜赌成性，终于赌光了家业一贫如洗，穷困之中的福贵因为母亲生病前去求医，没想到半路上被国民党部队抓了壮丁，后被解放军所俘虏，回到家乡他才知道母亲已经去世，妻子家珍含辛茹苦带大了一双儿女，但女儿不幸变成了聋哑人，儿子机灵活泼……'),\n(10, '红楼梦', '中国古典文学读本丛书', '人民文学出版社', '1996-12', '59.70', '9787020002207', '《红楼梦》是一部百科全书式的长篇小说。以宝黛爱情悲剧为主线，以四大家族的荣辱兴衰为背景，描绘出18世纪中国封建社会的方方面面，以及封建专制下新兴资本主义民主思想的萌动。结构宏大、情节委婉、细节精致，人物形象栩栩如生，声口毕现，堪称中国古代小说中的经 典。'),\n(11, '百年孤独', '[哥伦比亚]加西亚·马尔克斯', '南海出版公司', '2011-6', '39.50', '9787544253994', '《百年孤独》是魔幻现实主义文学的代表作，描写了布恩迪亚家族七代人的传奇故事，以及加勒比海沿岸小镇马孔多的百年兴衰，反映了拉丁美洲一个世纪以来风云变幻的历史。作品融入神话传说、民间故事、宗教典故等神秘因素，巧妙地糅合了现实与虚幻，展现出一个瑰丽的想象世界，成为20世纪最重要的经典文学巨著之一。1982年加西亚•马尔克斯获得诺贝尔文学奖，奠定世界级文学大师的地位，很大程度上乃是凭借《百年孤独》的巨大影响。'),\n(12, '看见', '柴静', '广西师范大学出版社', '2013-1-1', '39.80', '9787549529322', '《看见》是知名记者和主持人柴静讲述央视十年历程的自传性作品，既是柴静个人的成长告白书，某种程度上亦可视作中国社会十年变迁的备忘录。十年前她被选择成为国家电视台新闻主播，却因毫无经验而遭遇挫败，非典时期成为现场记者后，现实生活犬牙交错的切肤之感，让她一点一滴脱离外在与自我的束缚，对生活与人性有了更为宽广与深厚的理解。十年之间，非典、汶川地震、两会报道、北京奥运……在每个重大事件现场，几乎都能发现柴静的身影，而如华南虎照、征地等刚性的调查报道她也多有制作。在书中，她记录下淹没在宏大叙事中的动人细节，为时代留下私人的注脚。一如既往，柴静看见并记录下新闻中给她留下强烈生命印象的个人，每个人都深嵌在世界之中，没有人可以只是一个旁观者，他人经受的，我必经受。书中记录下的人与事，是他们的生活，也是你和我的生活。'),\n(13, '不能承受的生命之轻', '[捷克]米兰·昆德拉', '上海译文出版社', '2003-7', '23.00', '9787532731077', '《不能承受的生命之轻》是米兰·昆德拉最负盛名的作品。小说描写了托马斯与特丽莎、萨丽娜之间的感情生活。但它不是一个男人和两个女人的三角性爱故事，它是一部哲理小说，小说从“永恒轮回”的讨论开始，把读者带入了对一系列问题的思考中，比如轻与重、灵与肉。'),\n(14, '达·芬奇密码', '[美]丹·布朗', '上海人民出版社', '2004-2', '28.00', '9787208050037', '哈佛大学的符号学专家罗伯特·兰登在法国巴黎出差期间的一个午夜接到一个紧急电话，得知卢浮宫博物馆年迈的馆长被人杀害在卢浮宫的博物馆里，人们在他的尸体旁边发现了一个难以捉摸的密码。兰登与法国一位颇有天分的密码破译专家索菲·奈芙，在对一大堆怪异的密码进行整理的过程当中，发现一连串的线索就隐藏在达芬奇的艺术作品当中，深感震惊。这些线索，大家都清楚可见，然而却被画家巧妙地隐藏起来。兰登无意之中非常震惊地发现，已故的博物馆馆长是峋山隐修会（Priory of sion）的成员--这是一个真实存在的秘密组织，其成员包括艾撒克・牛顿爵士、波提切利、维克多·雨果与达芬奇，这无疑给他们增加了风险。兰登感觉到他们是在找寻一个石破天惊的历史秘密，这是个数世纪以来就证明了的既能给人启迪又很危险的秘密。在这场足迹遍及巴黎以及伦敦的追逐中，兰登与奈芙发现他们在跟一位始终不露面的幕...'),\n(15, '平凡的世界（全三部）', '路遥', '人民文学出版社', '2005-1', '64.00', '9787020049295', '《平凡的世界》是一部现实主义小说，也是一部小说形式的家族史。作者浓缩了中国西北农村的历史变迁过程，在小说中全景式地表现了中国当代城乡的社会生活。在近十年的广阔背景下，通过复杂的矛盾纠葛，刻划社会各阶层众多普通人的形象。劳动与爱情，挫折与追求，痛苦与欢乐，日常生活与巨大社会冲突，纷繁地交织在一起，深刻地展示了普通人在大时代历史进程中所走过的艰难曲折的道路。'),\n(16, '三体Ⅱ', '刘慈欣', '重庆出版社', '2008-5', '32.00', '9787536693968', '三体人在利用魔法般的科技锁死了地球人的科学之后，庞大的宇宙舰队杀气腾腾地直扑太阳系，意欲清除地球文明。'),\n(17, '三体Ⅲ', '科幻世界·中国科幻基石丛书', '重庆出版社', '2010-11', '38.00', '9787229030933', '与三体文明的战争使人类第一次看到了宇宙黑暗的真相，地球文明像一个恐惧的孩子，熄灭了寻友的篝火，在暗夜中发抖。自以为历经沧桑，其实刚刚蹒跚学步；自以为悟出了生存竞争的秘密，其实还远没有竞争的资格。'),\n(18, '简爱（英文全本）', '[英]夏洛蒂·勃朗特', '世界图书出版公司', '2003-11', '18.00', '9787506261579', '《简爱》是英国女作家夏洛蒂·勃朗特的代表作品。女主人公简爱是一个追赶求平等与自主的知识女性形象，小说以其感人的对于一位“灰姑娘式”人物奋斗史的刻划取胜，《简爱》也是女性文学的代表作品。'),\n(19, '哈利·波特与魔法石', '[英]J·K·罗琳', '人民文学出版社', '2000-9', '19.50', '9787020033430', '《哈利·波特与魔法石》是“哈利·波特”系列的第一部。'),\n(20, '天才在左 疯子在右', '高铭', '武汉大学出版社', '2010-2', '29.80', '9787307075429', '本书以访谈录的形式记载了生活在另一个角落的人群（精神病患者、心理障碍者等边缘人）深刻、视角独特的所思所想，让人们可以了解到疯子抑或天才真正的内心世界。此书是国内第一本具有人文情怀的精神病患谈访录。内容涉及生理学、心理学、佛学、宗教、量子物理、符号学以及玛雅文明和预言等众多领域。'),\n(21, '我们仨', '杨绛', '生活·读书·新知三联书店', '2003-7', '18.80', '9787108018809', '《我们仨》是钱钟书夫人杨绛撰写的家庭生活回忆录。1998年，钱钟书逝世，而他和杨绛唯一的女儿钱瑗已于此前（1997年）先他们而去。在人生的伴侣离去四年后，杨绛在92岁高龄的时候用心记述了他们这个特殊家庭63年的风风雨雨、点点滴滴，结成回忆录《我们仨》。'),\n(22, '傲慢与偏见', '[英]简·奥斯汀', '人民文学出版社', '1993-7', '13.00', '9787020040179', '《傲慢与偏见》是简·奥斯汀的代表作，是一部描写爱情与婚姻的经典小说。作品以男女主人公达西和伊丽莎白由于傲慢和偏见而产生的爱情纠葛为线索，共写了四起姻缘：伊丽莎白与达西、简与宾利、莉迪亚与威克姆、夏洛蒂与柯林斯。伊丽莎白、简和莉迪亚是贝内特家五个女儿中的三个姐妹，而夏洛蒂则是她们的邻居，也是伊丽莎白的朋友。男主人公达西与宾利是好友，且与威克姆一起长大，而柯林斯则是贝内特家的远房亲戚。'),\n(23, '送你一颗子弹', '刘瑜', '上海三联书店', '2010-1', '25.00', '9787542631664', '这本书里记录的是作者2005—2009年左右(尤其是2006—2007年)生活里的点点滴滴。在这本书里，被“审视”的东西杂七杂八，有街上的疯老头，有同宿舍的室友，有爱情、电影和书，大到制度，小到老鼠。由于我写这些东西的时候，出发点并不是写一本书，所以不同文章往往风格迥异，长短不一，质量不均，随着社会形势、荷尔蒙周期以及我逃避生活的力度而起伏。'),\n(24, '飘', '[美]玛格丽特·米切尔', '译林出版社', '2000-9', '40.00', '9787806570920', '小说中的故事发生在1861年美国南北战争前夕。生活在南方的少女郝思嘉从小深受南方文化传统的熏陶，可在她的血液里却流淌着野性的叛逆因素。随着战火的蔓廷和生活环境的恶化，郝思嘉的叛逆个性越来越丰满，越鲜明，在一系列的的挫折中她改造了自我，改变了个人甚至整个家族的命运，成为时代时势造就的新女性的形象。'),\n(25, '明朝那些事儿（壹）', '当年明月', '中国友谊出版公司', '2006-9', '24.80', '9787505722460', '从朱元璋的出身开始写起，到永乐大帝夺位的靖难之役结束为止。叙述了明朝最艰苦卓绝的开国过程。朱元璋pk陈友谅，谁堪问鼎天下？战太平、太湖大决战。卧榻之侧埋恶虎，铲除张士诚。徐达、常遇春等不世名将乘胜逐北破北元。更有明朝最大的谜团——永乐夺位、建文失踪的靖难之役。'),\n(26, '倾城之恋', '张爱玲', '花城出版社', '1997-3-1', '11.00', '9787536023918', '一对现实庸俗的男女，在战争的兵荒马乱之中被命运掷骰子般地掷到了一起，于“一刹那”体会到了“一对平凡的夫妻”之间的“一点真心”⋯⋯张爱玲是作为中国现代文学史上的一位杰出作家，而不是作为一个怪人、异人而存在的。也许她将不仅仅属于现代文学史。遥想几十年、几百年后，她会像她欣赏的李清照一样，在整个中国文学史上占据一个稳定的位置也说不定，而我们知道，那时候今天为我们所熟知的许多现代作家肯定都将被忽略不计了。'),\n(27, '目送', '龙应台', '生活·读书·新知三联书店', '2009-10', '39.00', '9787108032911', '目送共由七十四篇散文组成，是为一本极具亲情、感人至深的文集。由父亲的逝世、母亲的苍老、儿子的离开、朋友的牵挂、兄弟的携手共行，写出失败和脆弱、失落和放手，写出缠绵不舍和绝然的虚无。正如作者所说：“我慢慢地、慢慢地了解到，所谓父女母子一场，只不过意味着，你和他的缘分就是今生今世不断地在目送他的背影渐行渐远。你站在小路的这一端，看着他逐渐消失在小路转弯的地方，而且，他用背影默默地告诉你，不用追。”'),\n(28, '月亮和六便士', '[英]威廉·萨默塞特·毛姆', '上海译文出版社', '2006-8', '15.00', '9787532739547', '一个英国证券交易所的经纪人，本已有牢靠的职业和地位、美满的家庭，但却迷恋上绘画，像“被魔鬼附了体”，突然弃家出走，到巴黎去追求绘画的理想。他的行径没有人能够理解。他在异国不仅肉体受着贫穷和饥饿煎熬，而且为了寻找表现手法，精神亦在忍受痛苦折磨。经过一番离奇的遭遇后，主人公最后离开文明世界，远遁到与世隔绝的塔希提岛上。他终于找到灵魂的宁静和适合自己艺术气质的氛围。他同一个土著女子同居，创作出一幅又一幅使后世震惊的杰作。在他染上麻风病双目失明之前，曾在自己住房四壁画了一幅表现伊甸园的伟大作品。但在逝世之前，他却命令土著女子在他死后把这幅画作付之一炬。通过这样一个一心追求艺术、不通人性世故的怪才，毛姆探索了艺术的产生与本质、个性与天才的关系、艺术家与社会的矛盾等等引人深思的问题。同时这本书也引发了人们对摆脱世俗束缚逃离世俗社会寻找心灵家园这一话题的思考，而关...'),\n(29, '情人', '[法]玛格丽特·杜拉斯', '上海译文出版社', '2005-7', '20.00', '9787532736874', '杜拉斯代表作之一，自传性质的小说，获一九八四年法国龚古尔文学奖。全书以法国殖民者在越南的生活为背景，描写贫穷的法国女孩与富有的中国少爷之间深沉而无望的爱情。'),\n(30, '恶意', '[日]东野圭吾', '南海出版公司', '2009-6', '18.00', '9787544244428', '畅销书作家在出国的前一晚于家中被杀。凶手很快落网，对罪行供认不讳、但求速死，却对作案动机语焉不详。'),\n(31, '霍乱时期的爱情', '[哥伦比亚]加西亚·马尔克斯', '南海出版公司', '2012-9-1', '39.50', '9787544258975', '★马尔克斯唯一正式授权，首次完整翻译'),\n(32, '哈利·波特与阿兹卡班的囚徒', '[英]J·K·罗琳', '人民文学出版社', '2000-9', '26.50', '9787020033454', '《哈利·波特与阿兹卡班的囚徒》是“哈利·波特”系列的第三部。'),\n(33, '狼图腾', '姜戎', '长江文艺出版社', '2004-4', '32.00', '9787535427304', '《狼图腾》由几十个有机连贯的“狼故事”组成，情节紧张激烈而又新奇神秘。读者可从书中每一篇章、每个细节中攫取强烈的阅读快感，令人欲罢不能。那些精灵一般的蒙古草原狼随时从书中呼啸而出：狼的每一次侦察、布阵、伏击、奇袭的高超战术;狼对气象、地形的巧妙利用；狼的视死如归和不屈不挠；狼族中的友爱亲情；狼与草原万物的关系；倔强可爱的小狼在失去自由后艰难的成长过程——无不使我们联想到人类，进而思考人类历史中那些迄今县置未解的一个个疑问：当年区区十几万蒙古骑兵为什么能够横扫欧亚大陆？中华民族今日辽阔疆土由来的深层原因？历史上究竟是华夏文明征服了游牧民族，还是游牧民族一次次为汉民族输血才使中华文明得以延续？为什么中国马背上的民族，从古至今不崇拜马图腾而信奉狼图腾？中华文明从未中断的原因，是否在于中国还存在着一个从未中断的狼图腾文化？于是，我们不能不追思遥想，不能不面对...'),\n(34, '哈利·波特与火焰杯', '[英]J·K·罗琳', '人民文学出版社', '2001-5', '39.80', '9787020034635', '《哈利·波特与火焰杯》是“哈利·波特”系列的第四部。'),\n(35, '1Q84 BOOK 1', '[日]村上春树', '南海出版公司', '2010-5', '36.00', '9787544247269', '1Q84简体中文版官方网站：http://www.douban.com/minisite/1q84/'),\n(36, '边城', '沈从文', '北岳文艺出版社', '2002-4', '12.00', '9787537823425', '《边城》是沈从文的代表作，写于一九三三年至一九三四年初。这篇作品如沈从文的其他湘西作品，着眼于普通人、善良人的命运变迁，描摹了湘女翠翠阴差阳错的生活悲剧，诚如作者所言：“一切充满了善，然而到处是不凑巧。既然是不凑巧，因之素朴的善终难免产生悲剧。”'),\n(37, '哈利·波特与密室', '[英]J·K·罗琳', '人民文学出版社', '2000-9', '22.00', '9787020033447', '《哈利·波特与密室》是“哈利·波特”系列的第二部。'),\n(38, '穆斯林的葬礼', '霍达', '北京十月文艺出版社', '1988-12-1', '32.00', '9787530201244', '一个穆斯林家族，六十年间的兴衰，三代人命运的沉浮，两个发生在不同时代、有着不同内容却又交错扭结的爱情悲剧。'),\n(39, '许三观卖血记', '余华', '南海出版公司', '1998-9', '16.80', '9787544211765', '《许三观卖血记》是余华1995年创作的一部长篇小说，它以博大的温情描绘了磨难中的人生，以激烈的故事形式表达了人在面对厄运时求生的欲望。小说讲述了许三观靠着卖血渡过了人生的一个个难关，战胜了命运强加给他的惊涛骇浪，而当他老了，知道自己的血再也没有人要时，精神却崩溃了。'),\n(40, '撒哈拉的故事', '三毛', '皇冠出版社', '1976', '160', '9789573305545', '三毛作品中最膾炙人口的《撒哈拉的故事》﹐'),\n(41, '万历十五年', '[美]黄仁宇', '生活·读书·新知三联书店', '1997-5', '18.00', '9787108009821', '万历十五年，亦即公元1587年，在西欧历史上为西班牙舰队全部出动征英的前一年；而在中国，这平平淡淡的一年中，发生了若干为历史学家所易于忽视的事件。这些事件，表面看来虽似末端小节，但实质上却是以前发生大事的症结，也是将在以后掀起波澜的机缘。在历史学家黄仁宇的眼中，其间的关系因果，恰为历史的重点，而我们的大历史之旅，也自此开始……'),\n(42, '莲花', '安妮宝贝（庆山）', '作家出版社', '2006-3', '25.00', '9787506335867', '全书收录安妮墨脱之行所拍八张图片，皆沿途所见。'),\n(43, '向左走·向右走', '幾米', '生活·读书·新知三联书店', '2002-8', '16.00', '9787108017444', '“她习惯向左走，他习惯向右走，他们始终不曾相遇。”《向左走·向右走》是几米首次表现男女感情的长篇图文创作。男女主角彼此在生活中的巧妙关系，构成了整个故事的设计。在页面的衔接上，有许多的巧思安排，在线条与上色上，作了更细致的处理，手法俐落有变化，是几米相当成熟的作品，也是代表作之一。'),\n(44, '哈利·波特与混血王子', '[英]J·K·罗琳', '人民文学出版社', '2005-10', '58.00', '9787020053230', '《哈利·波特与“混血王子”》是“哈利·波特”系列的第六部。'),\n(45, '盗墓笔记', '南派三叔', '中国友谊出版公司', '2007-1', '26.80', '9787505722835', '五十年前，一群长沙土夫子（盗墓贼）挖到一部战国帛书，残篇中记载了一座奇特的战国古墓的位置，但那群土夫子在地下碰上了诡异事件，几乎全部身亡。'),\n(46, '黄金时代', '王小波', '花城出版社', '1999-3', '19.00', '9787536025080', '《黄金时代》是《时代三部曲》之一。  这是以文革时期为背景的系列作品构成的长篇。发生“文化大革命”的二十世纪六七十年代，正是我们国家和民族的灾难年代。那时，知识分子群体无能为力而极“左”政治泛滥横行。作为倍受歧视的知识分子，往往丧失了自我意志和个人尊严。在这组系列作品里面，名叫“王二”的男主人公处于恐怖和荒谬的环境，遭到各种不公正待遇，但他却摆脱了传统文化人的悲愤心态，创造出一种反抗和超越的方式：既然不能证明自己无辜，便倾向于证明自己不无辜。于是他以性爱作为对抗外部世界的最后据点，将性爱表现得既放浪形骸又纯'),\n(47, '窗边的小豆豆', '新经典文库·巴学园', '南海出版公司', '2003-1', '20.00', '9787544222976', '《窗边的小豆豆》讲述了作者上小学时的一段真实的故事。作者因淘气被原学校退学后，来到巴学园。在小林校长的爱护和引导下，让一般人眼里“怪怪”的小豆豆逐渐成了一个大家都能接受的孩子，并奠定了她一生的基础。这本书不仅带给世界几千万读者无数的笑声和感动，而且为现代教育的发展注入了新的活力。'),\n(48, '天龙八部', '金庸', '生活.读书.新知三联书店', '1994-5', '96.0', '9787108006721', '天龙八部乃金笔下的一部长篇小说，与《射雕》，《神雕》等    几部长篇小说一起被称为可读性最高的金庸小说。《天龙》的故事情节曲折，内容丰富，也曾多次被改编为电视作品。是金庸作品中集大成的一部。故事以南宋末年动荡的社会环境为背景，展开波澜壮阔的历史画卷，塑造了乔峰、段誉、虚竹、慕容复等形象鲜明的人物，成为武侠史上的经典之作。故事精彩纷呈，人物命运悲壮多变，是可读性很强的作品，具有震撼人心的力量'),\n(49, '三国演义（全二册）', '罗贯中', '人民文学出版社', '1998-05', '39.50', '9787020008728', '《三国演义》又名《三国志演义》、《三国志通俗演义》，是我国小说史上最著名最杰出的长篇章回体历史小说。 《三国演义》的作者是元末明初人罗贯中，由毛纶，毛宗岗父子批改。在其成书前，“三国故事”已经历了数百年的历史发展过程。在唐代，三国故事已广为流传，连儿童都很熟悉。随着市民文艺的发展，宋代的“说话”艺人，已有专门说三国故事的，当时称为“说三分”。元代出现的《三国志平话》，实际上是从说书人使用的本子，虽较简略粗糙，但已初肯《三国演义》的规模。罗贯中在群众传说和民间艺人创作的基础上，又依据陈寿《三国志》及裴松之注中所征引的资料（还包括《世说新语》及注中的资料），经过巨大的创作劳动，写在了规模宏伟的巨著——《三国志通俗演义》全书24卷，240回。后来经过毛纶，毛宗岗父子批改，形成我们现在所见的《三国演义》120回版\\r'),\n(50, '哈利·波特与凤凰社', '[英]J·K·罗琳', '人民文学出版社', '2003-9', '59.00', '9787020043279', '《哈利·波特与凤凰社》是“哈利·波特”系列的第五部。'),\n(51, '悟空传', '今何在', '光明日报出版社', '2001-4', '14.80', '9787801453648', '猪八戒和孙悟空虽然都神通广大，但在命运面前终究是软弱无力的小人物。顶天立地的美猴王实际上仍然是那个充满惊恐的小猴子，而决心与命运抗争的天蓬若非紧急也终究不肯以猪的面目见阿月。神仙尚且如此，何况吾辈生来渺小的小人物呢？随着年纪的增长，少年时素怀的“愿乘长风破万里浪”的豪情 壮志早已经烟消云散，只剩下一个行尸走肉的家伙还在苟延残喘。自己何尝不是一只因为知道自己身份而在午夜对月痛哭的猪啊！但他们最终战胜了命运，而我呢？'),\n(52, '牧羊少年奇幻之旅', '[巴西]保罗·柯艾略', '南海出版公司', '2009-3-1', '25.00', '9787544244190', '牧羊少年圣地亚哥接连两次做了同一个梦，梦见埃及金字塔附近藏有一批宝藏。少年卖掉羊群，历尽千辛万苦一路向南，跨海来到非洲，穿越“死亡之海”撒哈拉大沙漠……期间奇遇不断，在一位炼金术士的指引下，他终于到达金字塔前，悟出了宝藏的真正所在……'),\n(53, '哈利·波特与死亡圣器', '[英]J·K·罗琳', '人民文学出版社', '2007-10', '66.00', '9787020063659', '《哈利·波特与死亡圣器》是“哈利·波特”系列的第七部，也就是最后一部。'),\n(54, '海边的卡夫卡', '[日]村上春树', '上海译文出版社', '2003-4', '25.00', '9787532734191', '小说的主人公是一位自称名叫田村卡夫卡——作者始终未交代其真名——的少年。他在十五岁生日前夜独自离家出走，乘坐夜行长途巴士远赴四国。出走的原因是为了逃避父亲所作的比俄底浦斯王还要可怕的预言：尔将弑父，将与尔母、尔姐交合。卡夫卡四岁时，母亲突然失踪，带走了比卡夫卡年长四岁、其实是田村家养女的姐姐，不知何故却将亲生儿子抛弃。他从未见过母亲的照片，甚至连名字也不知道。仿佛是运命在冥冥之中引导，他偶然来到某私立图书馆，遂栖身于此。馆长佐伯女士是位四十多岁气质高雅的美妇，有着波澜曲折的神秘身世。卡夫卡疑心她是自己的生母，佐伯却对此不置可否。卡夫卡恋上了佐伯，并与之发生肉体关系。小说还另设一条副线，副线的主角是老人中田，他在二战期间读小学时，经历过一次神秘的昏迷事件，从此丧失了记忆，将学过的知识完全忘记，甚至不会认字计数，却获得了与猫对话的神秘能力。中田在神智失控...'),\n(55, '灿烂千阳', '[美]卡勒德·胡赛尼', '上海人民出版社', '2007-9', '28.00', '9787208072107', '私生女玛丽雅姆在父亲的宅院门口苦苦守候，回到家却看到因绝望而上吊自杀的母亲。那天是她十五岁的生日，而童年嘎然而止。玛丽雅姆随后由父亲安排远嫁喀布尔四十多岁的鞋匠拉希德，几经流产，终因无法生子而长期生活在家暴阴影之下。'),\n(56, '呼啸山庄', '世界文学名著文库', '人民文学出版社', '1999-01-01', '27.30', '9787020027606', '夏洛蒂和传记作者告诉我们，爱米丽生性独立、豁达、纯真、刚毅、热情而又内向。她颇有男儿气概，酷爱自己生长其间的荒原，平素在离群索居中，除去手足情谊，最喜与大自然为友，从她的诗和一生行为，都可见她天人合一宇宙观与人生观的表现，有人因此而将她视为神秘主义者。其实人与自然的关系，从来就是人类文明史上重要的命题，爱米丽不过是步历代哲人、隐者、科学家、艺术家后尘，通过生活和创作，身体力行地探寻人与自然的关系。'),\n(57, '兄弟（上）', '余华', '上海文艺出版社', '2005-8', '16.00', '9787532129027', '《兄弟》讲述了江南小镇两兄弟李光头和宋钢的人生。李光头的父亲不怎么光彩地意外身亡，而同一天李光头出生。宋钢的父亲宋凡平在众人的嘲笑声中挺身而出，帮助了李光头的母亲李兰，被后者视为恩人。几年后宋钢的母亲也亡故，李兰和宋凡平在互相帮助中相爱并结婚，虽然这场婚姻遭到了镇上人们的鄙夷和嘲弄，但两人依然相爱甚笃，而李光头和宋钢这对没有血缘关系的兄弟也十分投缘。'),\n(58, '老人与海', '[美]欧内斯特·海明威', '上海译文出版社', '1999-10', '8.20', '9787532723447', '本书讲述了一个渔夫的故事。古巴老渔夫圣地亚哥在连续八十四天没捕到鱼的情况下，终于独自钓上了一条大马林鱼，但这鱼实在大，把他的小船在海上拖了三天才筋疲力尽，被他杀死了绑在小船的一边。在归程中，他再遭到一条鲨鱼的袭击，最后回港时只剩鱼头鱼尾和一条脊骨。而在老圣地亚哥出海的日子里，他的忘年好友一直在海边忠诚地等待，满怀信心地迎接着他的归来。'),\n(59, '少有人走的路', '[美]斯科特·派克', '吉林文史出版社', '2007-1', '26.00', '9787807023777', '这本书处处透露出沟通与理解的意味，它跨越时代限制，帮助我们探索爱的本质，引导我们过上崭新，宁静而丰富的生活；它帮助我们学习爱，也学习独立；它教诲我们成为更称职的、更有理解心的父母。归根到底，它告诉我们怎样找到真正的自我。'),\n(60, '基督山伯爵', '[法]大仲马', '上海译文出版社', '1991-12-1', '43.90', '9787532712243', '小说以法国波旁王朝和七月王朝两大时期为背景，描写了一个报恩复仇的故事。法老号大副唐泰斯受船长的临终嘱托，为拿破仑送了一封信，受到两个对他嫉妒的小人的陷害，被打入死牢，狱友法里亚神甫向他传授了各种知识，还在临终前把一批宝藏的秘密告诉了他。他设法越狱后找到了宝藏，成为巨富。从此他化名为基督山伯爵，经过精心策划，报答了他的恩人，惩罚了三个一心想置他于死地的仇人。'),\n(61, '人类简史', '[以色列]尤瓦尔·赫拉利', '中信出版社', '2014-11-1', 'CNY', '9787508647357', '十万年前，地球上至少有六种不同的人'),\n(62, '1984', '[英]乔治·奥威尔', '北京十月文艺出版社', '2010-4-1', '28.00', '9787530210291', '★村上春树以《1Q84》向本书致敬'),\n(63, '笑傲江湖（全四册）', '金庸', '生活·读书·新知三联书店', '1994-5', '76.80', '9787108006639', '《笑傲江湖》是金庸1967年写的一部武侠小说，属于金庸的后期作品。'),\n(64, '民主的细节', '刘瑜', '上海三联书店', '2009-6', '25.00', '9787542629586', '这本书是作者过去几年给一些期刊报纸写的专栏文章结集，其中主要是给《南方人物周刊》的文章。全书中以讲故事的形式，把“美国的民主”这样一个概念性的东西拆解成点点滴滴的事件、政策和人物去描述。'),\n(65, '福尔摩斯探案全集（上中下）', '[英]阿·柯南道尔', '群众出版社', '1981-8', '53.00元/68.', '9787501408580', '最经典的群众出版社的翻译版本，一经出版，立即风靡成千上万的中国人。离奇的情节，扣人的悬念，世界上最聪明的侦探，人间最诡秘的案情，福尔摩斯不但让罪犯无处藏身，也让你的脑细胞热情激荡，本套书获第一届全国优秀外国文学图书奖。'),\n(66, '人间失格', '草月译谭', '吉林出版集团有限责任公司', '2009年9月', '16.00', '9787546302393', '《人间失格》是日本著名小说家太宰治最具影响力的小说作品，同时也是糸色望（注：动漫《再见！绝望先生》的主角）老师日常生活必备的读物之一。另外在日本轻小说《文学少女》第一卷中被大量提及。《人间失格》（又名《丧失为人的资格》）发表于1948年，是一部自传体的小说，纤细的自传体中透露出极致的颓废，毁灭式的绝笔之作。太宰治巧妙地将自己的人生与思想，隐藏于主角叶藏的人生遭遇，藉由叶藏的独白，窥探太宰治的内心世界，一个“充满了可耻的一生”。在发表这部作品的同年，太宰治就自杀身亡。'),\n(67, '无声告白', '读客', '江苏凤凰文艺出版社', '2015-7', '35.00', '9787539982830', '我们终此一生，就是要摆脱他人的期待，找到真正的自己。'),\n(68, '遇见未知的自己', '张德芬', '华夏出版社', '2008-1', '29.00', '9787508044019', '故事从“冬天的雨夜，在荒郊野外的山区，一个没有手机、没有汽油的孤单女人”开始。'),\n(69, '情书', '[日]岩井俊二', '天津人民出版社', '2004-7', '18.00', '9787201048161', '日本神户，渡边博子在未婚夫藤井树的三周年祭日上又一次陷入到悲痛和思念之中。博子在藤井树的中学同学录里找到了他在小樽市读书时的地址。由于抑制不住对爱人的怀念，博子按着这个地址给远在天国的藤井树寄去了一封充满问候和思念的书信。'),\n(70, '茶花女', '[法]小仲马', '外国文学出版社', '1997-3', '9.00', '9787501600069', '《茶花女》为我们塑造了一些生动、鲜明的艺术形象，而其中最突出、最令人难忘的自然是女主人公茶花女玛格丽特。读者们切莫把玛格丽特和阿尔丰西娜·普莱西小姐混为一谈，阿尔丰西娜的身世固然值得同情，但她的的确确是个堕落的女人，用小仲马的话来说，她“既是一个纯洁无瑕的贞女，又是_个彻头彻尾的娼妇”。但玛格丽特却不同，她美丽、聪明而又善良j 虽然沦落风尘，但依旧保持着一颗纯洁、高尚的心灵。她充满热情和希望地去追求真正的爱情生活，而当这种希望破灭之后，又甘愿自我牺牲去成全他人。'),\n(71, '白鹿原', '陈忠实', '人民文学出版社', '1997-12', '28.00', '9787020026906', '这是一部渭河平原五十年变迁的雄奇史诗，一轴中国农村班斓多彩、触目惊心的长幅画卷。主人公六娶六丧，神秘的序曲预示着不祥。一个家族两代子孙，为争夺白鹿原的统治代代争斗不已，上演了一幕幕惊心动魄的活剧：巧取风水地，恶施美人计，孝子为匪，亲翁杀媳，兄弟相煎，情人反目……大革命、日寇入侵、三年内战，白鹿原翻云覆雨，王旗变幻，家仇国恨交错缠结，冤冤相报代代不已……古老的土地在新生的阵痛中颤栗。厚重深邃的思想内容，复杂多变的人物性格，跌宕曲折的故事情节，绚丽多彩的风土人情，形成作品鲜明的艺术特色和令人震撼的真实感。'),\n(72, '一个陌生女人的来信', '[奥地利]斯蒂芬·茨威格', '上海译文出版社', '2007-7', '20.00', '9787532741571', '这是一部短篇小说集，除《一个陌生女人的来信》，亦按时间顺序收录了《火烧火燎的秘密》、《马来狂人》等名篇，作者的创作历程一目了然。'),\n(73, '神雕侠侣', '金庸', '生活·读书·新知三联书店', '1994-5', '76.80', '9787108006660', '《神雕侠侣》是金庸作品集之一。其主人公杨过自然而然地走上了非正统的人生道路，入了“道流”。其特点是“至情至性，实现自我”，即把个人的利益、情感、个性及人格尊严置于人生首位，作为首要目标，亦作为待人处事，评价是非的首要原则。书中将杨过对郭靖的杀父之仇与疼惜之恩难以取舍的复杂心理刻画得维妙维肖；他与“姑姑”小龙女的情感纠葛和他对江湖世事的渴望又令他挣扎不已……'),\n(74, '沉默的大多数', '王小波', '中国青年出版社', '1997-10', '27.00', '9787500627098', '这本杂文随笔集包括思想文化方面的文章，涉及知识分子的处境及思考，社会道德伦理，文化论争，国学与新儒家，民族主义等问题；包括从日常生活中发掘出来的各种真知灼见，涉及科学与邪道，女权主义等；包括对社会科学研究的评论，涉及性问题，生育问题，同性恋问题，社会研究的伦理问题和方法问题等；包括创作谈和文论，如写作的动机，作者的师承，作者对小说艺术的看法，作者对文体格调的看法，对影视的看法等；包括少量的书评，其中既有对文学经典的评论，也有对当代作家作品的一些看法；最后，还包括一些域外生活的杂感以及对某些社会现象的评点。'),\n(75, '当我谈跑步时我谈些什么', '[日]村上春树', '南海出版公司', '2009-1', '25.00', '9787544242820', '他以文字名满全球。'),\n(76, '东方快车谋杀案', '[英]阿加莎·克里斯蒂', '人民文学出版社', '2006-5', '18.00', '9787020056309', '午夜过后，一场大雪迫使东方快车停了下来。这辆豪华列车整年都处于满员状态。但那天早上却发现少了一名乘客。一个美国人死在了他的包厢里，他被刺了十二刀，可他包厢的门却是反锁着的。'),\n(77, '这些人，那些事', '吴念真', '译林出版社', '2011-9', '28.00', '9787544717731', '吴念真累积多年、珍藏心底的体会与感动。'),\n(78, '肖申克的救赎', '[美]斯蒂芬·金', '人民文学出版社', '2006-7', '29.90', '9787020054985', '这本书收入斯蒂芬·金的四部中篇小说，是他作品中的杰出代表作。其英文版一经推出，即登上《纽约时报》畅销书排行榜的冠军之位，当年在美国狂销二十八万册。目前，这本书已经被翻译成三十一种语言，同时创下了收录的四篇小说中有三篇被改编成轰动一时的电影的记录。'),\n(79, '鲁滨逊漂流记', '[英]丹尼尔·笛福', '广西民族出版社', '2002-1', '9.20', '9787536340497', '《鲁滨逊飘流记》是18世纪英国作家达尼尔·笛福的代表作品，也是一部具有广泛的世界性影响的作品。'),\n(80, '这些都是你给我的爱', '这些都是你给我的爱', '长江文艺出版社', '2010-3', '24.80', '9787535442215', '《这些都是你给我的爱》讲述兔子男孩安东尼失恋后，为找寻曾经恋人一心向往的那棵“开满鲜花的树”，而环游旅行的故事。延续安东尼一贯深受读者青睐的无标点文字风格，用淡淡的语言，倾吐少年恋慕和成长的酸涩心事。'),\n(81, '局外人', '[法]阿尔贝·加缪', '上海译文出版社', '2010-9', '22.00', '9787532751471', '《局外人》是加缪小说的成名作和代表作之一，堪称20世纪整个西方文坛最具有划时代意义最著名小说之一，“局外人”也由此成为整个西方文学-哲学中最经典的人物形象和最重要的关键词之一。'),\n(82, '巴黎圣母院', '[法]雨果', '人民文学出版社', '1982-6', '22.50', '9787020032044', '《巴黎圣母院》是法国文豪维克多·雨果第一部引起轰动效应的浪漫派小说。小说以十五世纪路易十一统治下的法国为背景，通过一个纯洁无辜的波希米亚女郎惨遭迫害的故事，揭露了教士的阴险卑鄙，宗教法庭的野蛮残忍，贵族的荒淫无耻和国王的专横残暴。作品鲜明地体现了反封建、反教会的意识和对人民群众的赞颂。'),\n(83, '羊脂球', '[法]居伊·德·莫泊桑', '北京燕山出版社', '2007-6', '13.50', '9787540211998', '莫泊桑短篇小说的代表作。写普法战争时，法国的一群贵族、政客、商人、修女等高贵者，和一个叫作羊脂球的妓女，同乘一辆马车逃离普军占区，在一关卡受阻。普鲁士军官要求同羊脂球过夜，遭到羊脂球拒绝，高贵者们也深表气愤。但马车被扣留后，高贵者们竟施展各种伎俩迫使羊脂球就范，而羊脂球最终得到的却是高贵者们的轻蔑。小说反衬鲜明，悬念迭生，引人入胜，写出了法国各阶层在占领者面前的不同态度，揭露了贵族资产阶级的自私、虚伪和无耻，赞扬了羊脂球的牺牲精神。'),\n(84, '喜宝', '[加拿大]亦舒', '新世界出版社', '2007-2', '22.00', '9787802282674', '读书就是这样好，无论心不在焉，板着长脸，只要考试及格，就是一个及格的人。你试着拉长脸到社会去试一试。这是一个卖笑的社会。除非能够找到高贵的职业，而高贵的职业需要高贵的学历支持，高贵的学历需要金钱，始终兜回来。'),\n(85, '陪安东尼度过漫长岁月', '安东尼', '长江文艺出版社', '2008-3', '18.00', '9787535436740', '《陪安东尼度过漫长岁月》收集了作者安东尼在《最小说》上刊登过的部分散文，以及50%以上的最新作品。安东尼以一个普通男生的口吻，讲述了从20到23、从大学到工作、从国内到国外的真诚记载。其中既有生活的零散片段、自言自语，也有对生活的感悟。以时间为载体，散文为格式，将日记、随笔，甚至是墙上的便条联系到一起。带领每位读者陪安东尼度过遥远的旅行、孤独的时刻，以及漫长的岁月。'),\n(86, '呐喊', '鲁迅作品集', '人民文学出版社', '1973年3月', '0.36', '', '《呐喊》收录作者1918年至1922年所作小说十四篇。1923年8月由北京新潮社出版，原收十五篇，列为该社《文艺丛书》之一。1924年5月第三次印刷时起，改由北京北新书局出版，列为作者所编的《乌合丛书》之一。1930年1 月第十三次印刷时，由作者抽去其中的《不周山》一篇(后改名为《补天》，收入《故事新编》)。作者生前共印行二十二版次。'),\n(87, '无人生还', '[英]阿加莎·克里斯蒂', '人民文学出版社', '2008-3', '19.00', '9787020065394', '十个互不相识的人，被富有的欧文先生邀请到了印地安岛上的私人别墅里。晚餐后，一个神秘的声音揭开了人们心中所各自隐藏着的可怕秘密。当天晚上，年轻的马斯顿先生离奇死去，古老的童谣就像诅咒一样笼罩着所有人，似乎有一双神秘的眼镜在时刻窥视着这场死亡游戏，到访者就像消失的印地安小瓷人一样一个又一个的走向死神……'),\n(88, '红玫瑰与白玫瑰', '张爱玲', '花城出版社', '1996-06', '12.80', '9787536021440', '“也许每一个男子全都有过这样的两个女人，至少两个。娶了红玫瑰，久而久之，红的变了墙上的一抹蚊子血，白的还是\\\"床前明月光\\\"；娶了白玫瑰，白的便是衣服上沾的一粒饭黏子，红的却是心口上一颗朱砂痣”。因为《红玫瑰与白玫瑰》这句话成了脍炙人口的名言……本书收录了张爱玲1944年的中短篇小说作品。'),\n(89, '巨人的陨落', '读客', '江苏凤凰文艺出版社', '2016-5-1', '129.80', '9787539989891', '在第一次世界大战的硝烟中，每一个迈向死亡的生命都在热烈地生长——威尔士的矿工少年、刚失恋的美国法律系大学生、穷困潦倒的俄国兄弟、富有英俊的英格兰伯爵，以及痴情的德国特工… 从充满灰尘和危险的煤矿到闪闪发光的皇室宫殿，从代表着权力的走廊到爱恨纠缠的卧室，五个家族迥然不同又纠葛不断的命运逐渐揭晓，波澜壮阔地展现了一个我们自认为了解，但从未如此真切感受过的20世纪。'),\n(90, '爱你就像爱生命', '李银河', '上海锦绣文章出版社', '2008-5', '18.00', '9787806859988', '王小波书信均选自朝华出版社2004年4月第一版《爱你就像爱生命》，此书系王小波生前从未发表过的与李银河的“两地书”，也是迄今他们夫妇最完整和独立的一本书信集。'),\n(91, '华胥引（全二册）', '唐七公子', '现代出版社', '2011-1', '39.80', '9787802443914', '《华胥引(套装共2册)》主要内容包括：华胥一引，乱世成殇。琴弦震响于九州列国之上，无声惊动。这是一个发生在乱世的故事。城破之日，卫国公主叶蓁以身殉国，依靠鲛珠死而复生。当她弹起华胥调，便生死人肉白骨，探入梦境与回忆。幻术构成的曲谱里，尽是人世的辛酸与苦涩。而她与亡她国家的陈国世子一次一次于幻境中相遇，身份两重，缘也两重。清平华胥调，能不能让每个人追回旧日的思念，不再悲伤？'),\n(92, '了不起的盖茨比', '[美]弗·司各特·菲茨杰拉德', '人民文学出版社', '2004-06', '12.00', '9787020046089', '盖茨比为了久久地抱着的一个梦而付出了很高的代价。他死后，尼克发觉是汤姆暗中挑拨威尔逊去杀死盖茨比。他感到东部鬼影幢幢，世态炎凉，便决定回中西部老家去。这是一个简单的故事，却有着极悲凉的人生况味。'),\n(93, '鬼吹灯之精绝古城', '鬼吹灯', '安徽文艺出版社', '2006', '25.0', '9787539628042', '胡八一上山下乡来到中蒙边境的岗岗营子，带上了家中仅存的一本书——《十六字风水秘术》，闲来无事将书中文字背得滚瓜烂熟。之后参军到西藏，遇上雪崩掉落一条巨大的地沟当中，胡八一利用自己懂得的墓葬秘术逃得不死。复员后，胡八一和好友胖子一起加入了一支前往新疆考古的考古队。一行人历经万险来到了塔克拉玛干沙漠中的精绝古城遗址，进入了地下“鬼洞”。洞中机关重重、陷阱不断，这神秘的鬼洞似乎在住先知的掌控之中……'),\n(94, '动物农场', '[英]乔治·奥威尔', '上海译文出版社', '2007-3', '10.00', '9787532741854', '《动物农场》是奥威尔最优秀的作品之一，是一则入木三分的反乌托的政治讽喻寓言。'),\n(95, '安徒生童话故事集', '[丹麦]汉斯·克里斯蒂安·安徒生', '人民文学出版社', '1997-08', '25.00', '9787020017713', ''),\n(96, '半生缘', '张爱玲', '北京十月文艺出版社', '2006-12', '28.00', '9787530208694', '他和曼桢认识，已经是多年前的事了。算起来倒已经有十四年了——真吓人一跳！马上使他连带地觉得自己已老了许多。日子过得真快，尤其对于中年以后的人，十年八年都好像是指顾间的事。可是对于年轻人，三年五载就可以是一生一世。他和曼桢从认识到分手，不过几年的工夫，这几年里面却经过这么许多事情，仿佛把生老病死一切的哀乐都经历到了。'),\n(97, '地下铁', '幾米', '辽宁教育出版社', '2002-2', '32.00', '9787538262537', '社会高速发展，来来往往的地下铁路成为了城市文明与社会生活的缩影，从入口到出口，地下铁路将你从起点带到终点，抑或是另一个起点。'),\n(98, '骆驼祥子', '老舍', '人民文学出版社', '2000-3-1', '12.00', '9787020028115', '《骆驼祥子》是老舍用同情的笔触描绘的一幕悲剧：二十年代的北京，一个勤劳、壮实的底层社会小人物怀着发家、奋斗的美好梦想，却最终为黑暗的暴风雨所吞噬。它揭示了当时“小人物”的奴隶心理和希望的最终破灭。随着祥子心爱的女人小福子的自杀，祥子熄灭了个人奋斗的最后一朵火花。这是旧中国老北京贫苦市民的典型命运。'),\n(99, '射雕英雄传（全四册）', '金庸', '生活·读书·新知三联书店', '1999-04', '47.00', '9787108012586', '《射雕英雄传》是金庸的代表作之一，作于一九五七年到一九五九年，在《香港商报》连载。《射雕》中的人物个性单纯，郭靖诚朴厚重、黄蓉机智狡狯，读者容易印象深刻。这是中国传统小说和戏剧的特征，但不免缺乏人物内心世界的复杂性。由于人物性格单纯而情节热闹，所以《射雕》比较得到欢迎，被拍成各种语种的电影和电视剧在全球众多国家和地区热播。'),\n(100, '月亮忘記了', '幾米', '格林', '2000-2-1', 'NT$', '9789577452443', '看不見的，是不是就等於不存在？'),\n(101, '此间的少年', '江南', '华文出版社', '2004-1', '25.00', '9787507515121', '《此间的少年》讲述的是让人熟悉的大学生活的故事。小说以宋代嘉佑年为时间背景，地点在以北大为模版的“汴京大学”，登场的人物是乔峰、郭靖、令狐冲等大侠，不过在大学里，他们和当代的年轻人没有什么不同。他们早上要跑圈儿，初进校门的时候要扫舞盲，有睡不完的懒觉，站在远处默默注视自己心爱的姑娘……'),\n(102, '孤独六讲', '蒋勋', '广西师范大学出版社', '2009-10-1', '36.00', '9787563391271', '美学大师蒋勋以美学家特有的思维和情感切入孤独，从情欲、语言、革命、思维、伦理、暴力六个面向阐释孤独美学，融个人记忆、美学追问、文化反思、社会批判于一体。可以说，蒋勋在本书中，创造了孤独美学：美学的本质或许就是孤独。'),\n(103, '一個人住第5年', '[日]高木直子', '大田', '2004-12-1', 'NT$220', '9789574557806', '一個人住了五年的過來人的日常生活。一個人的生活輕鬆也寂寞，卻又難割捨。'),\n(104, '步步惊心', '桐华', '民族出版社', '2006-6', '25.00', '9787105077502', '一脚踏空的少女，穿越千年的时空，从繁华都市的深圳来到风云诡变的宫廷。正处于争位时候的阿哥们，款款深情的目光后，带着探究、带着诱惑也带着几分真真假假的心疼。她努力地想避开着历史的洪流，但那一双双幽暗深邃的眼睛却将拉住……'),\n(105, '一个人的朝圣', '[英]蕾秋·乔伊斯', '北京联合出版公司', '2013-9-1', '32.80', '9787550213524', '★2013年欧洲首席畅销小说，入围2012年布克文学奖，同名电影拍摄中'),\n(106, '常识', '梁文道', '广西师范大学出版社', '2009-1', '38.00', '9787563379637', '梁文道先生近两年来撰写的时评文字结集，谈及政治、民主、民族、教育、新闻自由、公民道德等社会诸多方面。文字风格犀利，文章主旨清晰、论述简洁有力，往往一针见血命中问题之要害，其文字在带给读者阅读快感之余，还催人省思，给人启示。本书名曰《常识》，正如梁氏自言：“本书所集，卑之无甚高论，多为常识而已。若觉可怪，是因为此乃一个常识稀缺的时代。”'),\n(107, '寻路中国', '[美]彼得·海斯勒', '上海译文出版社', '2011-1', '33.00', '9787532752805', '我叫彼得·海斯勒，是《纽约客》驻北京记者。这本书讲述了我驾车漫游中国大陆的经历。'),\n(108, '时间旅行者的妻子', '[美]奥德丽·尼芬格', '人民文学出版社', '2007-4', '29.90', '9787020060504', '相遇那年，她6岁，他36岁；'),\n(109, '荆棘鸟', '[澳]考琳·麦卡洛', '译林出版社', '1998-7', '28.00', '9787805678313', '《荆棘鸟》是一部澳大利亚的家世小说，以女主人公梅吉和神父拉尔夫的爱情纠葛为主线，描写了克利里一家三代人的故事，时间跨度长达半个多世纪。拉尔夫一心向往教会的权力，却爱上了克利里家的美丽少女梅吉。为了他追求的“上帝”，他抛弃了世俗的爱情，然而内心又极度矛盾和痛苦。以此为中心，克利里家族十余名成员的悲欢离合也得以展现。'),\n(110, '刀锋', '[英]威廉·萨默塞特·毛姆', '上海译文出版社', '2007-3', '18.00', '9787532741922', '威廉·萨默塞特·毛姆（1874-1965），英国著名小说家、戏剧家。《刀锋》是他的主要作品之一。'),\n(111, '哭泣的骆驼', '三毛', '哈尔滨出版社', '2003-6', '15.80', '9787806399071', '在《哭泣的骆驼》中，三毛依然恋恋着墨沙漠生活周遭的人与事，《收魂记》、《搭车客》、《逍遥七岛游》、《一个陌生人的死》、《大胡子与我》等篇，情趣盎然；《沙巴军曹》与《哑奴》所刻画的主角，给人留下了难以磨灭的印象；而压轴的《哭泣的骆驼》，以游击战事为背景，细细铺写一对沙漠情鸳的生死盟，竟犹如史诗般的磅礴。'),\n(112, '孩子你慢慢来', '龙应台', '生活·读书·新知三联书店', '2009-12-1', '28.00', '9787108033635', '作为华人世界最有影响的一支笔，龙应台的文章有万丈豪气，然而《孩子你慢慢来》却令人惊叹，她的文字也可以有款款深情。这本书里的龙应台是一个母亲，作为母亲的龙应台和作为一个独立的人的龙应台有着丰富、激烈的内心冲突，而正是通过对这一冲突的诉说，表现出她内心深处的母爱。但它不是传统母爱的歌颂，是对生命的实景写生，只有真正懂得爱的作家才写得出这样的生活散文。'),\n(113, '一只特立独行的猪', '王小波', '北方文艺出版社', '2006-4', '18.80', '9787531719199', '这本书里除了文化杂文，还有给其他书写的序言与跋语。这些序言与跋语也表明了我的一些态度。除此之外，还有一些轻松的随笔。不管什么书，我都不希望它太严肃，这一本也不例外。'),\n(114, '失恋33天', '鲍鲸鲸', '中信出版社', '2010-1', '25.00', '9787508618081', '黄小仙儿，27岁的大龄少女，从事高端婚庆策划；胸前无大物，姿色平平，家境也一般，唯一拿得出手的，就是一口刻薄言辞，和对这世界满腔的乐观。长途恋爱谈了七年，没有修成正果，反而在商场里看到了男友和自己闺蜜喜笑颜开的走在一起。'),\n(115, '梦里花落知多少', '三毛', '北京十月文艺出版社', '2007-6', '28.00', '9787530208922', '《梦里花落知多少》记录了荷西过世后三毛的生活，共23篇。内容均为台湾皇冠出版社81年至88年的初版。'),\n(116, '格林童话全集', '[德]格林兄弟', '人民文学出版社', '1994-11', '21.45', '9787020019526', '《格林童话全集》主要内容：本文库旨在汇总世界文学创作的精华，全面反映包括我国在内的世界文学的最高成就，为读者提供世界第一流的文学精品，它以最能代表一个时代文学成就的长篇小说为骨干，同时全面地反映其他体裁如中短篇小说、诗歌、散文、戏剧、童话、寓言等各主面最优秀的成查，选收作品的时限，外国文学部分，自古代英雄史诗至第二次世界大战结束，中国文学部分，自《诗经》至中华人民共和国成立，它是包容古今、囊括中外的珍贵的文学图书系统。'),\n(117, '尘埃落定', '阿来', '人民文学出版社', '1998-3-1', '22.0', '9787020033645', '一个声势显赫的康巴藏族土司，在酒后和汉族太太生了一个傻瓜儿子。这个人人都认定的傻子与现实生活格格不入，却有着超时代的预感和举止，成为土司制度兴衰的见证人。小说故事精彩曲折动人，以饱含激情的笔墨，超然物外的审视目光，展现了浓郁的民族风情和土司制度的浪漫神秘。'),\n(118, '麦琪的礼物', '[美]欧·亨利', '上海社会科学院出版社', '2003-7', '25.00', '9787806812297', '选收欧·亨利的小说34篇，国外当代文学类重要工具书介绍的有代表性的作品均已收入。欧·亨利是位有独特风格的杰出短篇小说家，以巧妙的构思、夸张和幽默的文笔反映了他那个时代的人和事。'),\n(119, '那些回不去的年少时光', '桐华', '江苏文艺出版社', '2010-01', '23.80', '9787539931494', '最值得珍藏的怀旧读物，写给年少自己的书，纪念我们共同的青春和成长'),\n(120, '金锁记', '张爱玲', '哈尔滨出版社', '2005-6', '13.5', '9788781074519', '《金锁记》写于1943年，小说描写了一个小商人家庭出身的女子曹七巧的心灵变迁历程。七巧做过残疾人的妻子，欲爱而不能爱，几乎像疯子一样在姜家过了30年。在财欲与情欲的压迫下，她的性格终于被扭曲，行为变得乖戾，不但破坏儿子的婚姻，致使儿媳被折磨而死，还拆散女儿的爱情。\\\"30年来她戴着黄金的枷。她用那沉重的枷角劈杀了几个人，没死的也送了半条命。\\\"'),\n(121, '海贼王', '[日]尾田荣一郎', '浙江人民美术出版社', '2007-11', '7.50', '9789882075696', '路飞所生长的小村庄里曾经是一群以「红发香克斯」为首的海盗们的暂居地，而幼年路飞一直希望可以成为他们的一员，可在一次意外的情况下，他吃了一种叫做「橡皮果实」的恶魔果实变成了橡胶人。恶魔果实给予了他这样奇特的本领，但是吃了恶魔果实的人是再也没有能力游泳的…这样还能成为海盗吗？「没有关系，我只要不掉到海里去就行了…」天性乐观的路飞并没有放弃他的海贼之路，他和香克斯约好，总有一天他会带着他的伙伴们成为海贼王。（听上去好像很有道理，可是……我真的给这个单细胞的家伙打败了）。'),\n(122, '历史深处的忧虑', '林达', '生活·读书·新知三联书店', '1997-5', '19.00', '9787108010186', '美国的面积和中国差不多。和大多数留学生及新移民一样，当我们一脚踏上这块广袤的陌生土地时，最初落脚点的选择是十分偶然的。我们落在了一个普通的地方，居住的环境平常而宁静。周围的美国人老老少少都在辛勤劳作，过着普通得不能再普通的生活。要想谋出一番好的光景，对他们也不是一件轻而易举的事情。'),\n(123, '房思琪的初恋乐园', '林奕含', '北京联合出版公司', '2018-1', '45.00', '9787559614636', '令人心碎却无能为力的真实故事。'),\n(124, '城南旧事', '关维兴图', '中国青年出版社', '2003-7', '16.00', '9787500652045', '多少年来，《城南旧事》感动了一代又一代的读者，除了再版无数次的小说版外，1985年，本书在中国大陆搬上银幕，电影“城南旧事”获得“中国电影金鸡奖”、第二届“马尼拉国际电影节最佳故事片奖金鹰奖章”、第十四届“贝尔格勒国际儿童电影节最佳影片思想奖”等多项大奖。'),\n(125, '鹿鼎记（全五册）', '金庸', '广州出版社', '2008-3', '108.00', '9787806553404', '《鹿鼎记》是金庸创作的最后一部小说，也是他最重要的代表作。'),\n(126, '大地之灯', '七堇年', '长江文艺出版社', '2007-1', '22.00', '9787535432896', '雪域高原深处长大的孤儿卡桑，父母在一次朝圣的途中双双遇难；出生在北大荒的孩子简生，父母是北大荒的插队知青，在他出生之后先后被急于返城的父母遗弃，一直到十岁，才被母亲接回大城市。十九岁时简生的母亲因为受贿案件而自杀。简生将卡桑带回城市，由于父母缺席的家庭抚养，两人在整个成长过程中充满了欠缺。在成年之后的岁月依旧伴随着内心阴影，一直都艰苦地进行自我扶正与探索。最终他们用回报或者付出的方式，获得了各自的终极救赎和解脱。'),\n(127, '悲惨世界（上中下）', '[法]雨果', '人民文学出版社', '1992-6', '66.00', '9787020017164', '这是法国十九世纪浪漫派领袖雨果继《巴黎圣母院》之后创作的又一部气势恢宏的鸿篇巨著。全书以卓越的艺术魅力，展示了一幅自1793年法国大革命至1832年巴黎人民起义期间，法国近代社会生活和政治生活的辉煌画卷，最大限度地体现了雨果在叙事方面的过人才华，是世界文学史上现实主义与浪漫主义结合的典范。小说集中反映了雨果的人道主义思想，饱含了雨果对于人类苦难命运的关心和对末来坚定不移的信念，具有震撼人心的艺术感染力。'),\n(128, '史蒂夫·乔布斯传', '[美]沃尔特·艾萨克森', '中信出版社', '2011-10-24', '68.00', '9787508630069', '这本乔布斯唯一授权的官方传记，在2011年上半年由美国出版商西蒙舒斯特对外发布出版消息以来，备受全球媒体和业界瞩目，这本书的全球出版日期最终确定为2011年11月21日，简体中文版也将同步上市。'),\n(129, '我不喜欢这世界，我只喜欢你', '乔一', '湖南少年儿童出版社', '2015-5-1', '29.80', '9787556212743', '◆暖！萌！甜！几乎每一段都令人笑出声来，但也不乏泪点。'),\n(130, '球状闪电', '刘慈欣', '四川科学技术出版社', '2005-6', '22.00', '9787536455382', '在某个离奇的雨夜，一颗球状闪电闯进了少年的视野。它的啸叫低沉中透着尖利，像是一个鬼魂在太古的荒原上吹着埙。当鬼魂奏完乐曲，球状闪电在一瞬间将少年的父母化为灰烬，而他们身下板凳却是奇迹般的冰凉。'),\n(131, '菊与刀', '[美]鲁思·本尼迪克特', '商务印书馆', '1990-6', '16.00', '9787100012935', '“菊”本是日本皇室家徽，“刀”是武士道文化的象征。美国人类学家鲁思・本尼迪克特用《菊与刀》来揭示日本人的矛盾性格亦即日本文化的双重性(如爱美而黩武、尚礼而好斗、喜新而顽固、服从而不驯等)……'),\n(132, '东霓', '笛安', '长江文艺出版社', '2010-7-1', '26.80', '9787535445582', '《东霓》和《西决》一样，还是在讲发生在那个永远的龙城的，郑家人的故事。但是不同于西决的隐忍，东霓是个活色声香的女人。这本《西决》的姐妹篇，却完全转换了主人公以及第一人称叙述的视角，呈现出来一个东霓眼中完全不同的郑家，完全不同的世界。东霓是一个经历坎坷、自私势利，却又坚韧勇敢、情深似海的女人。残酷的生活教会她精明和算计，但是在真正紧要的转折点上，她却依然把自己交付给生命深处燃烧着的冲动和本能。所以她才要不择手段地和前夫争夺，所以她机关算尽却把自己绕了进去，所以她才能勇敢地用伤痕累累的心热切地去爱，所以她才能只是因为一时冲动，给真正最关心她的人留下永远难以磨灭的伤害。'),\n(133, '长恨歌', '王安忆', '南海出版公司', '2003-8', '22.00', '9787544225502', '一个女人四十年的情与爱，被一枝细腻而绚烂的笔写得哀婉动人，其中交织着上海这所大都市从四十年代到九十年代沧海桑田的变迁。生活在上海弄堂里的女人沉垒了无数理想、幻灭、躁动和怨望，她们对情与爱的追求，她们的成败，在我们眼前依次展开。王安忆看似平淡却幽默冷峻的笔调，在对细小琐碎的生活细节的津津乐道中，展现时代变迁中的人和城市，被誉为“现代上海史诗”。'),\n(134, '你一定爱读的极简欧洲史', '约翰·赫斯特', '广西师范大学出版社', '2011-11-25', '25.00', '9787549501076', '“欧洲，为什么老是抢第一？”澳大利亚知名历史学家约翰•赫斯特在本书中的一场引人入胜的探索，为我们梳理出欧洲文明所以能改变全世界的各种特质。'),\n(135, '看不见的城市', '[意]伊塔洛·卡尔维诺', '译林出版社', '2006-8', '16.00', '9787544700603', '《看不见的城市》的第一版是在1972年11月由都灵的埃伊纳乌迪出版社出版的。在这本书出版的时候，从1972年底到1973年初，卡尔维诺曾在多家报纸的文章和访谈中谈到它。\\r'),\n(136, '香水', '[德]帕·聚斯金德', '上海译文出版社', '2005-5', '20.00', '9787532736201', '小说叙述一个奇才怪杰谋杀了26个少女的故事。其中每一次谋杀都是一个目的：只是因为迷上她们特有的味道。对格雷诺耶来说，每次都是一场恋爱，但是他爱的不是人，而是她们身上的香味；谋杀她们只是为了永远占有，并且拥有他所钟爱的那种没有感觉，没有生命的“香味”……'),\n(137, '橙', '安东尼', '长江文艺出版社', '2010-10', '28.80', '9787535446794', '想 定做一个 刻着“不过如此”的章 到处盖 盖'),\n(138, '一九八四·动物农场', '[英]乔治·奥威尔', '上海译文出版社', '2003-4', '23.00', '9787532729357', '《一九八四》和《动物农场》是奥威尔的传世之作，堪称世界文坛上最著名的政治讽喻小说。他在小说中他创造的“老大哥”、“双重思想”、“新话”等词汇都已收入权威的英语词典，甚至由他的姓衍生了一个形容词“奥威尔式”不断出现在报道国际新闻的记者笔下，足见其作品在英语国家影响之深远。“多一个人看奥威尔，就多了一份自由的保障”，有评家如是说。'),\n(139, '飞鸟集', '[印度]拉宾德拉纳特·泰戈尔', '哈尔滨出版社', '2004-6', '16.80', '9787806992197', '《飞鸟集》是泰戈尔的代表作之一，也是世界上最杰出的诗集之一。白昼和黑夜、溪流和海洋、自由和背叛，都在泰戈尔的笔下合而为一，短小的语句道出了深刻的人生哲理，引领世人探寻真理和智慧的源泉。初读这些诗篇，如同在暴风雨过后的初夏清晨，推开卧室的窗户，看到一个淡泊清透的世界，一切都是那样清新、亮丽，可是其中的韵味却很厚实，耐人寻味。'),\n(140, '查令十字街84号', '[美]海莲·汉芙', '译林出版社', '2005-05-01', '18.00', '9787806579060', '这本被全球人深深钟爱的书，记录了纽约女作家海莲和一家伦敦旧书店的书商弗兰克之间的书缘情缘。双方二十年间始终未曾谋面，相隔万里，深厚情意却能莫逆于心。无论是平淡生活中的讨书买书论书，还是书信中所蕴藏的难以言明的情感，都给人以强烈的温暖和信任。这本书既表现了海莲对书的激情之爱，也反映了她对弗兰克的精神之爱。海莲的执著、风趣、体贴、率真，跳跃于一封封书信的字里行间，使阅读成为一种愉悦而柔软的经历。来往的书信被海莲汇集成此书，被译成数十种文字流传。'),\n(141, '匆匆那年（上下）', '九夜茴', '东方出版社', '2008-1', '29.00', '9787506030328', '80年代生人的张楠因大学毕业找不到好工作而留学澳洲，在那里他认识了同样留学的方茴。就在他被方茴的神秘感吸引时，却听说她竟然是同性恋。阴错阳差，他与方茴住在了同一屋檐下，并且通过其他朋友知道方茴并不是真正的同性恋者，而是曾经深受伤害，有过一段难以忘怀的经历。一次偶然的机会，在张楠的房间里，方茴给他讲述了自己的故事……'),\n(142, '伊豆的舞女', '[日]川端康成', '广西师范大学出版社', '2002-2', '23.80', '9787563334421', '收录“十六岁的日记”、“参加葬礼的名人”、“春天的景色”、“温泉旅馆”、“花的圆舞曲”等15篇短篇小说。'),\n(143, '江城', '[美]彼得·海斯勒', '上海译文出版社', '2012-1', '36.00', '9787532756728', '1996年8月底一个温热而清朗的夜晚，我从重庆出发，乘慢船，顺江而下来到涪陵。'),\n(144, '世界尽头与冷酷仙境', '[日]村上春树', '上海译文出版社', '2002-12', '23.00', '9787532730001', '《世界尽头与冷酷仙境》是村上春树最重要的小说之一，与《挪威的森林》、《舞舞舞》合称为村上春树三大杰作。小说共40章，单数20章“冷酷仙境”，双数20章为“世界尽头”，这种交叉平行地展开故事情节的手法是村上春树小说的特征，而这部作品是这种特征最典型的体现。“冷酷仙境”写两大黑社会组织在争夺一个老科学家发明的控制人脑的装置，老人躲到了地底。主人公“我”是老人的实验对象，他受到黑社会的恐吓，在老人的孙女帮助下，经过了惊心动魄的地底之旅，好容易找到老人，却被告知由于老人的计算错误，他24小时后离开人世，转往另一世界即“世界尽头”。“我”回到地面上, 与女友过了最后一夜告别，然后驱车到海边静候死的到来。“世界尽头”是另一番景象，这里与世隔绝，居民相安无事，但人们没有心，没有感情，没有目标。“我”一直想逃离这里，但在即将成功时选择了留下，因为“我”发现“世界尽头...'),\n(145, '把时间当作朋友', '李笑来', '电子工业出版社', '2009-6', '32.00', '9787121087097', '这本书从心智成长的角度来谈时间管理，指出时间管理是成功的关键所在。作者引述自己从事的职业中所遇到的事例，告诉我们：如何打开心智，如何运用心智来和时间做朋友，如何理解时间管理的意义，在时间管理上取得突破，进而用心智开启自己的人生成功之旅。'),\n(146, '影响力', '[美]罗伯特·西奥迪尼', '中国人民大学出版社', '2006-5', '45.00', '9787300072487', '政治家运用影响力来赢得选举，商人运用影响力来兜售商品，推销员运用影响力诱惑你乖乖地把金钱捧上。即使你的朋友和家人，不知不觉之间，也会把影响力用到你的身上。但到底是为什么，当一个要求用不同的方式提出来时，你的反应就会从负面抵抗变成积极合作呢？'),\n(147, '富爸爸，穷爸爸', '莎伦·L·莱希特', '世界图书出版公司', '2000-09', '18.80', '9787506246743', '《富爸爸，穷爸爸》是一个真实的故事，作者罗伯特・清崎的亲生父亲和朋友的父亲对金钱的看法截然不同，这使他对认识金钱产生了兴趣，最终他接受了朋友的父亲的建议，也就是书中所说的。“富爸爸”的观念，即不要做金钱的奴隶，要让金钱为我们工作，并由此成为一名极富传奇色彩的成功的投资家。'),\n(148, '倚天屠龙记(共四册)', '金庸', '三联书店', '1999-04', '0', '9787108012692', '《倚天屠龙记》，金庸武侠小说，著于1961年，是“射雕三部曲”系列第三部，现收录在《金庸作品集》中。该书以元末群雄纷起、江湖动荡为广阔背景，叙述武当弟子张无忌的江湖生涯，表现众武林豪杰质朴自然，形态各异的精神风貌，展现其不可替代的人格力量。'),\n(149, '中国历代政治得失', '钱穆', '生活·读书·新知三联书店', '2001', '12.00', '9787108015280', '《中国历代政治得失》为作者的专题演讲合集，分别就中国汉、唐、宋、明、清五代的政府组织、百官职权、考试监察、财经赋税、兵役义务等种种政治制度作了提要勾玄的概观与比照，叙述因革演变，指陈利害得失。既高屋建瓴地总括了中国历史与政治的精要大义，又点明了近现代国人对传统文化和精神的种种误解。言简意赅，语重心长，实不失为一部简明的“中国政治制度史”。'),\n(150, '冰与火之歌（卷一）', '[美]乔治·R·R·马丁', '重庆出版社', '2005-5', '68.00', '9787536671256', '《冰与火之歌》由美国著名科幻奇幻小说家乔治·R·R·马丁所著，是当代奇幻文学一部影响深远的里程碑式的作品。它于1996年刚一问世，便以别具一格的结构，浩瀚辽阔的视野，错落有致的情节和生动活泼的语言，迅速征服了欧美文坛。迄今，本书已被译为数十种文字，并在各个国家迭获大奖。'),\n(151, '七夜雪', '沧月', '北京十月文艺出版社', '2006-10', '25.00', '9787530208687', '鼎剑阁霍展白为救治昔日恋人之子沫儿的病，用七年的时间拼死取得了药王谷主人薛紫夜开给他的七味绝世药引，魔教大光明宫排位第一的神秘杀手瞳为了自己能杀死魔教教主获得自由而抢夺龙血赤寒珠，霍展白和瞳在打斗中双双重伤，被薛紫夜送回药王谷治疗。沫儿的病事实上无法治疗，薛紫夜为一直隐 瞒着霍展白而不安，不顾自己寒症孱弱之身而设法寻找疗法。与此同时，薛紫夜震惊地发现这个能用眼神控制人精神的杀手瞳竟然是失散多年的儿时伙伴明介……'),\n(152, '那些年，我们一起追的女孩', '九把刀', '花山文艺出版社', '2007-1', '20.00', '9787806737842', '柯景腾读国中时是一个成绩暴烂而且又调皮捣蛋的男生，老师将他“托付”给班里最优秀的女生沈佳仪。只要他不认真学习，沈佳仪就会用钢笔戳他的衣服。'),\n(153, 'ZOO', '[日]乙一', '当代世界出版社', '2007-10', '20.00', '9787509002780', '每天早上都有一张我女朋友尸体的照片放到我的收件箱里，照片显示着女朋友的尸体正在一天天地生蛆、腐化。她是在我们去过动物园之后失踪的。所有人都认为她只是失踪了，只有我知道她被杀了。我辞了职，拿着她生前的照片四处寻找凶手的线索，一副心力憔悴的模样。然而苦心寻找的背后隐藏的却是我不愿面对的真相，是我亲手杀了她……'),\n(154, '蔷薇岛屿', '安妮宝贝（庆山）', '作家出版社', '2002-8', '18.00', '9787506324298', '《蔷薇岛屿》安妮宝贝的第四本书。内容为在上海、北京、香港、越南、柬埔寨一路旅途中拍摄的照片及写下的字，留下时光和幻觉的印记，是一本关于旅行、爱和生死的影像书。包括《再见，时光》、《赤道往北21度》、《在西贡》、《危险的美感》、《世俗生活》等17篇散文，以及小说《一场上海烟花》。'),\n(155, '红与黑', '[法]司汤达', '译林出版社', '1993-7-1', '20.00', '9787020035878', '《红与黑》这部小说的故事据悉是采自1828年2月29日《法院新闻》所登载一个死刑案件。在拿破仑帝国时代，红与黑代表着“军队”与“教会”，是有野心的法国青年发展的两个渠道（一说是轮盘上的红色与黑色）。'),\n(156, '朝花夕拾', '鲁迅', '人民文学出版社', '1972年4月', '0.25', '', '《小引》'),\n(157, '阿狸·梦之城堡', 'Hans', '上海锦绣文章出版社', '2009-1', '36.80', '9787545202267', '阿狸童话绘本为纯手绘创作，画风成熟稳定，颜色精美靓丽。阿狸绘本的文字脚本立足于挖掘人们内心深处的柔软与坚强，围绕亲情、爱情、友情主题，风格温暖，有发人深省的力量。'),\n(158, '时间简史', '[英]史蒂芬·霍金', '湖南科学技术出版社', '2010-4', '45.00', '9787535732309', '《时间简史》讲述是探索时间和空间核心秘密的故事，是关于宇宙本性的最前沿知识，包括我们的宇宙图像、空间和时间、膨胀的宇宙不确定性原理、基本粒子和自然的力、黑洞、黑洞不是这么黑、时间箭头等内容。第一版中的许多理论预言，后来在对微观或宏观宇宙世界观测中得到证实。'),\n(159, '天使与魔鬼', '[美]丹·布朗', '人民文学出版社', '2005-2', '29.80', '9787020049929', '虔诚的上帝信徒——欧洲原子核研究组织的杰出科学家列奥纳多·维特勒毕生致力于以科学的手段证明神的存在。他和其养女、神秘妩媚的科学家维特多利亚在实验室里进行高度机密的试验，成功地制造出了一种极其强大的能量——“反物质”。'),\n(160, '水浒传（全二册）', '罗贯中', '人民文学出版社', '1997-1', '50.60', '9787020008742', '《水浒传》是我国第一部以农民起义为题材的长篇章回小说，是我国文学史上一座巍然屹立的丰碑，也是世界文学宝库中一颗光彩夺目的明珠。数百年来，它一直深受我国人民的喜爱，并被译为多种文字，成为我国流传最为广泛的古代长篇小说之一。'),\n(161, '最初的爱情 最后的仪式', '[英]伊恩·麦克尤恩', '南京大学出版社', '2010-2', '22.00', '9787305063749', '全书由八个短篇组成，分别从八个位于童年、青春期和青年等不同阶段的男性视角出发，以意识和潜意识交接地带的经验为揭示对象，有时荒唐，有时伤感，有时温柔，有时骇人，有时魔幻，却都无限接近真实，接近每个人的内心。'),\n(162, '陆犯焉识', '[美]严歌苓', '作家出版社', '2011-10', '35.00', '9787506360876', '《陆犯焉识》内容简介：陆焉识本是上海大户人家才子+公子型的少爷，聪慧而倜傥，会多国语言，也会讨女人喜欢。父亲去世后，年轻无嗣的继母冯仪芳为了巩固其在家族中的地位，软硬兼施地使他娶了自己的娘家侄女冯婉喻。没有爱情的陆焉识很快出国留学，在美国华盛顿毫无愧意地过了几年花花公子的自由生活。毕业回国后的陆焉识博士开始了风流得意的大学教授生活，也开始了在风情而精明的继母和温婉而坚韧的妻子夹缝间尴尬的家庭生活。'),\n(163, '杀死一只知更鸟', '[美]哈珀·李', '译林出版社', '2012-9', '32.00', '9787544722766', '成长总是个让人烦恼的命题。成长有时会很缓慢，如小溪般唱着叮咚的歌曲趟过，有时却如此突如其来，如暴雨般劈头盖脸……三个孩子因为小镇上的几桩冤案经历了猝不及防的成长——痛苦与迷惑，悲伤与愤怒，也有温情与感动。这是爱与真知的成长经典。'),\n(164, '国境以南 太阳以西', '[日]村上春树', '上海译文出版社', '2001-8', '13.50', '9787532726745', '37岁的男主人公，在东京市区拥有两家兴旺的酒吧，还有娇美的妻子，可爱的女儿，他是一位真正的成功人士。但是，他的内心还是感到饥饿干渴，事业和家庭都填补不了，而让他那缺憾的部分充盈起来的，是他小学时的女友岛本。岛本不愿吐露自己的经历、身份、只希望他就这样接受眼前的自己，只把她当成小学时那个爱古典乐的女孩。然而，就在他接受了这不可能接受的条件时，两人却在箱根别墅度过了销魂的一夜。翌晨，她一去杳然、再无踪迹可寻了。'),\n(165, '佛祖在一号线', '李海鹏', '文化艺术出版社', '2010-6', '25.00', '9787503945434', '千呼万唤的李海鹏首部专栏集，中国当下最好的专栏作家之一。'),\n(166, '最好的我们', '八月长安', '湖南文艺出版社', '2013-8-5', '55', '9787540462642', '你总是说青春从不曾永远，而那时候的我们，就是最好的我们。'),\n(167, '西游记（全二册）', '吴承恩', '人民文学出版社', '2004-8', '47.20', '9787020008735', '《西游记》主要描写的是孙悟空保唐僧西天取经，历经九九八十一难的故事。唐僧取经是历史上一件真实的事。大约距今一千三百多年前，即唐太宗贞观元年（627），年仅25岁的青年和尚玄奘离开京城长安，只身到天竺（印度）游学。他从长安出发后，途经中亚、阿富汗、巴基斯坦，历尽艰难险阻，最后到达了印度。他在那里学习了两年多，并在一次大型佛教经学辩论会任主讲，受到了赞誉。贞观十九年（645）玄奘回到了长安，带回佛经657部。他这次西天取经，前后十九年，行程几万里，是一次传奇式的万里长征，轰动一时。后来玄奘口述西行见闻，由弟子辩机辑录成《大唐西域记》十二卷。但这部书主要讲述了路上所见各国的历史、地理及交通，没有什么故事。及到他的弟子慧立、彦琮撰写的《大唐大慈恩寺三藏法师传》，则为玄奘的经历增添了许多神话色彩，从此，唐僧取经的故事便开始在民间广为流传。南宋有《大唐三藏取经诗...'),\n(168, '雷雨', '曹禺', '人民文学出版社', '1999-05', '9.20', '9787020018567', '《雷雨》所展示的是一幕人生大悲剧，是命运对人残忍的作弄。专制、伪善的家长，热情、单纯的青年，被情爱烧疯了心的魅惑的女人，痛悔着罪孽却又不自知地犯下更大罪孽的公子哥，还有家庭的秘密，身世的秘密，所有这一切在一个雷雨夜爆发。有罪的，无辜的人一起走向毁灭。曹禺以极端的雷雨般狂飙恣肆的方式，发泄被抑压的愤懑，毁谤中国的家庭和社会。'),\n(169, '生活在别处', '[捷克]米兰·昆德拉', '上海译文出版社', '2004-5', '25.00', '9787532733323', '《生活在别处》是一个年轻艺术家的肖像画。昆德拉以其独到的笔触塑造出雅罗米尔这样一个形象，描绘了这个年轻诗人充满激情而又短暂的一生，具有“发展小说”的许多特点。就其题材而言，表现一个艺术家（或知识分子）是本世纪文学的一个重要领域，因为展示我们这个复杂的时代也只有复杂的人物才能承担。在这部作品中，作者对诗人创作过程的分析是微妙而精细的。创作过程当然不仅指下笔写作的过程，而且更广义地指一个诗人的全部成长过程。用作者自己的话说，这部小说是“对我所称之为抒情态度的一个分析。”正是在这样的创作意图下，这部书最初曾被题名为《抒情时代》。作者所要表现和所要探究的是，人的心灵所具有的激情，它的产生和它的结果。因而这本书又是一本现代心理小说，表现了一个诗人的艺术感觉的成长。书中每一章　节的名称都展示了诗人生命历程的一个阶段。他的童年、少年和青年时代，他怎样读书，怎样恋爱...'),\n(170, '瓦尔登湖', '亨利·戴维·梭罗', '上海译文出版社', '2006-8', '11.00', '9787532739578', '这本书的思想是崇尚简朴生活，热爱大自然的风光，内容丰厚，意义深远，语言生动，意境深邃，就像是个智慧的老人，闪现哲理灵光，又有高山流水那样的境界。'),\n(171, '心是孤独的猎手', '[美]卡森·麦卡勒斯', '上海三联书店', '2005-8', '25.00', '9787542621344', '《心是孤独的猎手》作者麦卡勒斯的第一部长篇小说，也是她一举成名的作品和最具震撼力的代表作，居“现代文库20世纪百佳英文小说”第17位，曾被评为百部最佳同性恋小说之一。'),\n(172, '自控力', '[美]凯利·麦格尼格尔', '文化发展出版社(原印刷工业出版社)', '2012-8', '39.80', '9787514205039', '《自控力》内容简介：作为一名健康心理学家，凯利•麦格尼格尔博士的工作就是帮助人们管理压力，并在生活中做出积极的改变。多年来，通过观察学生们是如何控制选择的，她意识到，人们关于自控的很多看法实际上妨碍了我们取得成功。例如，把自控力当作一种美德，可能会让初衷良好的目标脱离正轨。所以，麦格尼格尔要求她的学生了解影响自控的生理学基础、心理陷阱和各种社会因素。麦格尼格尔吸收了心理学、神经学和经济学等学科的最新洞见，为斯坦福大学继续教育项目开设了一门叫做“意志力科学”的课程，参与过这门课程的人称其能够“改变一生”。这门课程就是《自控力》一书的基础。本书为读者提供了清晰的框架，讲述了什么是自控力，自控力如何发生作用，以及为何自控力如此重要。'),\n(173, '京华烟云', '林语堂', '陕西师范大学出版社', '2005-7', '43.00', '9787561334386', '《京华烟云》是林语堂旅居巴黎时于1938年8月至1939年8月间用英文写就的长篇小说，并题献给“英勇的中国士兵”，英文书名为Moment in Peking，《京华烟云》是它转译为中文后的书名，也有译本将本书译为《瞬息京华》。林语堂原本打算将《红楼梦》译作英文介绍给西方读者，因故未能译成，此后决定仿照《红楼梦》的结构写一部长篇小说，于是写出了《京华烟云》。'),\n(174, '设计中的设计', '[日]原研哉', '山东人民出版社', '2006-11', '48.00', '9787209041065', '设计到底是什么？作为一名从业二十余年并且具有世界影响的设计师，原研哉对自己提出了这样一个问题。为了给出自己的答案，他走了那么长的路，做了那么多的探索。“RE-DESIGN——二十一世纪的日常用品再设计”展真是一个有趣的展览，但又不仅仅是有趣，它分明是为我们揭示了“日常生活”所具有的无限可能性。若我们能以满怀新鲜的眼神去观照日常，“设计”的意义定会超越技术的层面，为我们的生活观和人生观注入力量。'),\n(175, '我执', '梁文道', '广西师范大学出版社', '2010-10', '35.00', '9787563383870', '本书为梁文道先生所撰写的散文随笔集，是以香港《成报》文采版专栏“秘学笔记”的文字为主，谈及爱情婚姻、日常生活、疾病经历、信仰感悟、城市文化、文学艺术、历史记忆等个人生活体验和人生感受诸多方面。读来清新自然，体贴入微，在淡雅简约的叙述中往往给人意外的启迪。'),\n(176, '夏洛的网', '[美]E·B·怀特', '上海译文出版社', '2004-5', '17.00', '9787532733415', '一个蜘蛛和小猪的故事，写给孩子，也写给大人。'),\n(177, '狂人日记', '鲁迅', '京华出版社', '2006-3', '39.80', '9787807240648', '《狂人日记》是鲁迅1918年发表的第一篇白话短篇小说，当时正值“五四”运动的前夜。由于辛亥革命的关途而废，特别是帝国主义侵略的加剧，使社会各种矛盾更加复杂尖锐。鲁迅以他锐敏的思想和犀利的笔触，对封建制度及其上层建筑表现了彻底的反抗。'),\n(178, '变形记', '[奥地利]弗朗茨·卡夫卡', '浙江文艺出版社', '2003-4', '16.00', '9787533917067', '1 判决'),\n(179, '偷书贼', '[澳]马克斯·苏萨克', '南海出版公司', '2007-8', '25.00', '9787544238212', '1939年的德国，9岁的小女孩莉赛尔和弟弟被迫送往慕尼黑远郊的寄养家庭。6岁的弟弟不幸死在了路途中。在冷清的葬礼后，莉赛尔意外得到她的第一本书《掘墓人手册》。'),\n(180, '没有色彩的多崎作和他的巡礼之年', '新经典文化', '南海出版公司', '2013-10-1', '39.50', '9787544268417', '“并不是一切都消失在了时间的长河里。那时，我们坚定地相信某种东西，拥有能坚定地相信某种东西的自我。这样的信念绝不会毫无意义地烟消云散”——十六年的彷徨迷惑，换来一场决然的巡礼之年，当最后一块拼图集齐，重回完满的正五边形，剩下最稀薄的人，重建大地。'),\n(181, '海底两万里', '[法]儒尔·凡尔纳', '译林出版社', '2002-9', '19.50', '9787806574317', '本书是法国举世闻名的科幻小说作家儒尔·凡尔纳的代表作之一。'),\n(182, '激荡三十年（上）', '吴晓波', '中信出版社', '2007-1', '35.00', '9787508607719', '上卷记载1978-1992年间的企业变革。'),\n(183, '文学回忆录（全2册）', '木心', '广西师范大学出版社', '2013-1-10', '98.00', '9787549530816', '文学是可爱的。生活是好玩的。艺术是要有所牺牲的。'),\n(184, '人性的弱点全集', '[美]戴尔·卡耐基', '中国发展出版社', '2008-1', '25.00', '9787800875830', '《人性的弱点全集》汇集了卡耐基的思想精华和最激动人心的内容，是作者最成功的励志经典，出版后立即获得了广大读者的欢迎，成为西方世界最持久的人文畅销书。主要内容包括：与人相处的基本技巧、平安快乐的要诀、如何使人喜欢你、如何赢得他人的赞同、如何更好地说服他人、让你的家庭生活幸福快乐等十篇。'),\n(185, '一句顶一万句', '刘震云', '长江文艺出版社', '2009-3', '29.80', '9787535439765', '《一句顶一万句》的故事很简单，小说的前半部写的是过去：孤独无助的吴摩西失去唯一能够“说得上话”的养女，为了寻找，走出延津；小说的后半部写的是现在：吴摩西养女的儿子牛爱国，同样为了摆脱孤独寻找“说得上话”的朋友，走向延津。一走一来，延宕百年。书中的人物大部分是中国最底层的老百姓，偏偏安排了一个意大利牧师老詹。'),\n(186, '九州·缥缈录', '江南', '新世界出版社', '2005-6', '20.00', '9787801876942', '当这个世界都要崩溃；当星辰和阳光也熄灭，当马蹄踏过弱者的尸骨，当黑暗的血色吞噬人心，不死的鹰再次降落在草原，英雄还在哭泣，在铁铸的摇篮中成长……《九州·缥缈录》的故事就发生在这里，游牧部落内部的权力争夺激烈，青阳与东陆王朝间恩怨重重。这是乱世的英雄史诗，当古老的王朝日渐衰微，掌管着星辰命运的神秘宗教走入了政治斗争的漩涡，年轻的王朝继承者崭露出耀眼的锋芒。'),\n(187, '你今天真好看', '[美]莉兹·克里莫', '雅众文化/天津人民出版社', '2015-8', '39.00', '9787201094359', '《你今天真好看》是一本清新暖萌的漫画集，收录了莉兹•克里莫150多张逗趣漫画。书中集结了所有你能想到的各种萌物，恐龙、棕熊、兔子、企鹅，甚至还有伞蜥、獾、土拨鼠、狐獴……在诙谐的对话中，它们展现出一种与生俱来的幽默感和令人艳羡的生活情趣。'),\n(188, '呼兰河传', '萧红', '百花文艺出版社', '2005-01', '19.00', '9787530640470', ''),\n(189, '尼罗河上的惨案', '[英]阿加莎·克里斯蒂', '人民文学出版社', '2006-5', '22.00', '9787020056088', '林内特·里奇维被一颗子弹打穿了头颅，尼罗河之旅的宁静也因此被打破。这位年轻，美丽，时尚——拥有一切的女孩，最终失去了自己的生命。'),\n(190, '我与地坛', '史铁生', '春风文艺出版社', '2002-5', '25.00', '9787531324362', '收有“午餐半小时”、“我的遥远的清平湾”、“命若琴弦”、“第一人称”、“两个故事”等15篇史铁生的代表作。'),\n(191, '人生', '路遥', '北京十月文艺出版社', '2009-5', '20.00', '9787530209578', '《人生》是路遥的一部中篇小说，发表于1982年，它以改革时期陕北高原的城乡生活为时空背景，叙述了高中毕业生高加林回到土地又离开土地，再回到土地这样人生的变化过程。高加林同农村姑娘刘巧珍、城市姑娘黄亚萍之间的感情纠葛构成了故事发展的矛盾，也正是体现那种艰难选择的悲剧。'),\n(192, '我的精神家园', '王小波', '文化艺术出版社', '1997', '18.80', '9787503915864', '一九九七年六月，王小波逝世两个月后，他的杂文自选集《我的精神家园》出版。这是第一版的封面。相比于2002版出版的《我的精神家园》纪念版来说，这一版本没有纪念文章，只收有王自己的文字。当时这本书，和九七年五月第一次在大陆出版的《黄金时代》《白银时代》和《青铜时代》一起上架，十月又出版了《沉默的大多数》。一时间，大家都知道了，有一个王小波。可惜，那时他已辞世，只留下书店里满架的王小波，像一场喧哗无声的葬礼。'),\n(193, '占星术杀人魔法', '[日]岛田庄司', '新星出版社', '2008-9', '28.00', '9787802255036', '四十年前，一桩占星术连续杀人案件轰动全日本！先是画家梅泽平吉在密室被人重击致死，接着是他早已出嫁的长女在家中被奸杀，最后甚至连与他同住的六个女儿也全部失踪。尸体陆续被发现埋在日本各地，而每个人身上都被切掉一部分！'),\n(194, '浪潮之巅', '[美]吴军', '电子工业出版社', '2011-8', '55.00', '9787121139512', '近一百多年来，总有一些公司很幸运地、有意识或无意识地站在技术革命的浪尖之上。在这十几年间，它们代表着科技的浪潮，直到下一波浪潮的来临。'),\n(195, '浮生六记', '沈复', '人民文学出版社', '1999/1', '5.70', '9787020028313', '这是一部自传体文学的作品，原书六卷，已逸其二，现仅存四卷（有所谓“足本”者，后二记系伪作。书中记叙了作者夫妇间平凡的家居生活，坎坷际遇，和各地浪游闻见。文辞朴素，情感真挚，前人曾有“幽芳凄三角，读之心醉”的评语。本书文字不长，但向为文学爱好者和研究者所重视，影响广泛。'),\n(196, '舞！舞！舞！', '[日]村上春树', '上海译文出版社', '2002-6', '25.00', '9787532728893', '六具白骨摆列在一间亦真亦幻的死亡之屋里。“我”的老朋友“鼠”已经死于寻羊冒险。“我”好不容易找到了投缘的老同学五反田，可这位被演艺界包装得精神分裂的电影明星，却接连勒死了两名高级应召女郎，自己也驾着高级跑车“玛莎拉蒂”葬身大海。孤独的女孩“雪”和她孤傲的母亲“雨”，虽然还能在这疯狂世界上勉强生存，可“雨”的守护神笛克，却也躲不过一场莫名的车祸。度过了一段死亡陪伴的惊魂日子，“我”终于在宾馆女服务员由美吉那里找到了安全感，也有了在安静城市过安静生活的具体计划。可是，那第六具白骨到底意味着谁呢？“我”依然脱不出死亡之屋。'),\n(197, '野火集', '龙应台', '文汇出版社', '2005-8', '25.00', '9787806767245', '龙应台常常针对一种社会现象，一类具体事物，甚至于一个人、一句话、一件事，给予无情的透视和直接的批评，马上让人心有戚戚焉。这些事，就发生在周围，看得见，摸得着，那么具体、实在、确切；而内中的缘由、涵义、影响、作用，常人似乎无所感，一经点破；立时豁然开朗。'),\n(198, '妻妾成群', '苏童', '上海文艺出版社', '2004-8', '23.00', '9787532127221', '《妻妾成群》借旧中国特有的封建家庭模式作小说的框架，一个男人娶了四个女人做太太。但作者关心的不是一个男人如何在四个女人中周旋，如何控制她们，而是关心四个女人怎会把她们一齐拴在一个男人的脖子上，并且像一棵濒临枯萎的藤蔓在稀薄的空气中相互绞杀而争得那一点点空气。'),\n(199, '高效能人士的七个习惯（精华版）', '[美]史蒂芬·柯维', '中国青年出版社', '2011-6', '29.00', '9787500649038', '史蒂芬・柯维（Stephen R.Covey）哈佛大学企业管理硕士，杨百翰大学博士。他是柯维领导中心的创始人，也是富兰克林柯维公司（Franklin Covey）的联合主席，曾协助众多企业、教育单位与政府机关培训领导人才。柯维博士曾被《时代》杂志誉为“人类潜能的导师”，并入选为全美二十五位最有影响力的人物之一。在领导理论，家庭与人际关系，个人管理等领域久负盛名。本书自出书以来，高居美国畅销书排行榜长达七年，在全球七十个国家以二十八种语言发行共超过一亿册。　　富兰克林柯维公司是为组织和个人提供培训和管理咨询的世界顶尖级公司，与财富（Fortune）500强中80%以上的公司和成千上万个中小型企业以及政府职能部门都有建设性的合作关系。　　富兰克林柯维公司的服务与产品遍布全球，在全球38个国家设有44个分支机构。 关于本书　　企业领导人都知道：只有每一位员...'),\n(200, '海子的诗', '海子', '人民文学出版社', '1999-04', '15.40', '9787020026456', '本书收录了已故诗人海子的诗作精华，其诗以独特的风格深受读者的喜爱，从这些诗中反映出诗人那对于一切美好事物的眷恋之情，对于生命的世俗和崇高的激动和关怀。'),\n(201, '项链', '[法]居伊·德·莫泊桑', '河北教育出版社', '2005-2', '28.00', '9787543425651', '莫泊桑被尊称为“世界短篇小说之王”，他将短篇小说的趣味提升到前所未有的高度。在他的笔下，各种社会事件，如战争、政变、普选等，都得到了如实的表现；各个阶层的生活，如上层人士的纸醉金迷，中产阶级的锱必较，乡人村姑的朴素自然，都得到了形象的描绘；各种各样的人物，贵族、官僚、职员、店主、乞丐、妓女，都得到了逼真的刻画；各种各样的场景，如豪华的晚会、精致的沙龙、荒蛮的原野、喧哗的集镇、森严的官府、热门的街道，都得到了生动的写照。可以说，莫泊桑的短篇小说，是一幅栩栩如生的19世纪下半叶法国社会风俗长卷。'),\n(202, '教父', '[美]马里奥·普佐', '译林出版社', '1997-8', '23.30', '9787805674278', '《教父》这部小说的不同凡响的艺术魅力就在于：尽管描写的全是坏蛋，但作者曲尽妙笔，竟然能让读者不痛恨个别坏蛋，而痛恨整个龌龊的社会结构。教父及其继承人——他的小儿子迈克尔本来都是坏透了的坏蛋，但是却并不显得令人痛恨，因为他们杀人是整个不合理的社会逼出来的，因为他们杀的也都是更坏的人，他们同那些在幕后“坐地分赃”的政客比较起来，在“坏”的程度上，可真是小巫见大巫了。'),\n(203, '娱乐至死', '[美]尼尔·波兹曼', '广西师范大学出版社', '2011-6', '29.80', '9787563344970', '《娱乐至死》是对20世纪后半叶美国文化中最重大变化的探究和哀悼：印刷术时代步入没落，而电视时代蒸蒸日上；电视改变了公众话语的内容和意义；政治、宗教、教育和任何其他公共事务领域的内容，都不可避免的被电视的表达方式重新定义。电视的一般表达方式是娱乐。一切公众话语都日渐以娱乐的方式出现，并成为一种文化精神。一切文化内容都心甘情愿地成为娱乐的附庸，而且毫无怨言，甚至无声无息，“其结果是我们成了一个娱乐至死的物种”。'),\n(204, '观念的水位', '刘瑜', '浙江大学出版社', '2013-1', '36.00', '9787308108584', '作为国内公共领域最重要的声音之一，刘瑜的文字向来拥趸众多，之前的作品更多关注美国民主，与中国相关度不高。而本书更多关注东亚、中东欧、南美洲以及非洲国家的政治与民主化，比如英国、俄罗斯、委内瑞拉、赞比亚等，这些国家的民主化进程参差不齐，而很多情况与现今中国有较强的可比性，这无疑让这本书更生动，更接地气。'),\n(205, '父与子全集', '杨莹', '中国工人出版社', '2003-4', '20.00', '9787500830146', '²内容简介²'),\n(206, '罗杰疑案', '[英]阿加莎·克里斯蒂', '人民文学出版社', '2006-5', '21.00', '9787020056293', '罗杰·艾克罗伊德是个知道得太多的人。'),\n(207, '中国大历史', '[美]黄仁宇', '生活·读书·新知三联书店', '2007-2', '19.00', '9787108010360', '中国历史典籍浩如烟海，常使初学者不得其门而入。作者倡导“大历史”（macro-history），主张利用归纳法将现有史料高度压缩，先构成一个简明而前后连贯的纳领，然后在与欧美史比较的基础上加以研究。本书从技术的角度分析中国历史的进程，着眼于现代型的经济体制如何为传统社会所不容，以及是何契机使其在中国土地上落脚。'),\n(208, '寻羊冒险记', '[日]村上春树', '上海译文出版社', '2001-8', '18.80', '9787532726141', '《寻羊冒险记》是村上春树继处女作《且听风吟》、《1973年的弹珠游戏》后的第三部小说，与上述两部作品构成“我与鼠”系列三部曲。小说极富寓言性与神话色彩，作者认为该小说的创作“顺利到最后，在恰到火候处止笔”。《寻羊冒险记》是村上的第一部够规模的长篇，村上因此获得了野间文艺新人赏。'),\n(209, '带一本书去巴黎', '林达', '生活·读书·新知三联书店', '2002-5', '35.00', '9787108017079', '作者在浓厚的法国历史文化氛围中，用大量的历史细节和场景，丰富了对艺术、文化，对历史、社会，以及对“革命”的理解。'),\n(210, '动物凶猛', '王朔', '中国电影出版社', '2004-2', '15.5', '9787106020750', '他们逃课、泡妞、打群架，他们由于“不必学习那些后来注定要忘掉的无用的知识”而使自身的动物本能获得了空前的解放； 他们深知自己的未来已被框定于固定的范畴之内，所以他们一点也不担心自己的前程。“一切都无须争取，我只要等待，十八岁时自然会轮到我。”因此他们在现实生活中就只剩下随处发泄的精力、四处寻找刺激的欲望、自以为是的狂傲、随波逐流漂泊不定的心灵。在“我”的世界里，高氏兄弟是山大王、汪若海是贰臣、于北蓓是狐狸精、米兰是交际花；在“我”的心中，家长令人厌恶、学校无聊乏味，而用钥匙入室窥私或顺手拿走不超过十元钱以上的物品，是一种兴趣爱好。也有发自内心的对异性的迷恋，但这种浪漫的感情最终还是被无法控制的兽欲所吞噬。'),\n(211, '子不语1', '子不语', '新世纪出版社', '2009-12', 'RMB36.00', '9787540541903', '实力派人气漫画家夏达第五届金龙奖最佳少女漫画优胜作品！收录《子不语》第1回至第8回的完整剧情，并收录一则番外篇《虎》。0'),\n(212, '巨流河', '齐邦媛', '生活·读书·新知三联书店', '2010-10', '39.00', '9787108034731', '巨流河，在清代被称为巨流河；哑口海位于台湾南端，是鹅銮鼻灯塔下的一泓湾流。这本书写的是一个并未远去的时代，关于两代人从巨流河到哑口海的故事。那立志将中国建设成现代化国家的父亲，在牧草中哭泣的母亲，公而忘私的先生；唱着《松花江上》的东北流亡学子，初识文学滋味的南开少女，含泪朗诵雪莱和济慈的朱光潜；那盛开铁石芍药的故乡，那波涛滚滚的巨流河，那暮色山风里、隘口边回头探望的少年张大飞……六十年来，作者读书、教书，写评论文章，却一直念念不忘当年事——郭松龄在东北家乡为厚植国力反抗军阀的兵谏；抗战初起，二十九军浴血守卫华北，牺牲之壮烈；南京大屠杀，国都化为鬼蜮的悲痛；保卫大武汉，民心觉醒，誓做决不投降的中国人之慷慨激昂；夺回台儿庄的激励；一步步攀登跋涉湘桂路、川黔路奔往重庆，绝处逢生的盼望；在四川、在滇缅公路上誓死守土的英勇战士的容颜，坚毅如在眼前；那一张张呼喊...'),\n(213, '小姨多鹤', '[美]严歌苓', '作家出版社', '2008-4', '28.00', '9787506342490', '二战进入尾声，日本战败投降，大批当年被移民来中国东北企图对中国实施长期殖民统治的普通日本国民被抛弃。十六岁的少女多鹤即为其一，在死难多艰的逃亡中，她依靠机智和对生的本能的渴望逃过了死亡，被装进麻袋论斤卖给了东北某小火车站站长的二儿子张俭作为传宗接代的“工具”。张俭的哥哥据传因为抗日而被日本人杀害，张俭的老婆朱小环因日本鬼子的惊吓导致流产，从此不能生育。国仇家恨的大背景下，日本少女多鹤的介入，使得整个家庭的关系变得暧昧和怪异。'),\n(214, '第一炉香', '张爱玲', '花城出版社', '1997-3', '11.5', '9787536023925', '沉香屑---第一炉香  沉香屑---第二炉香  茉莉香片  心经  封锁  琉璃瓦  年轻的时候  花凋   中国的日夜'),\n(215, '斯通纳', '世纪文景', '世纪文景/上海人民出版社', '2016-1', '39.00', '9787208130500', '《斯通纳》讲述了生命中最重要的部分：爱，认同，怜悯，志业，傲骨，信任与死亡。'),\n(216, '芳华', '严歌苓作品在人文社', '人民文学出版社', '2017-4-1', 'CNY', '9787020123728', '从军经历伴随了严歌苓整个的青春年华。当她后来成为了一个作家，这段经历成了她取之不竭的创作源泉。《一个女兵的悄悄话》《雌性的草地》《灰舞鞋》《白麻雀》《爱犬颗勒》，都以部队生活为题材，但多是以一个作家的客观视角来为那个时代的军人塑像。而她*创作的长篇小说《芳华》则具有浓厚的个人自传色彩，是以*人称描写她当年亲历的部队文工团生活：隐藏在西南部都城的一座旧红楼里、某部队文工团的内景中发生的军版“才子佳人”的故事。'),\n(217, '爱的艺术', '[美]艾·弗洛姆', '上海译文出版社', '2008-4', '15.00', '9787532745159', '《爱的艺术》是德裔美籍心理学家和哲学家、法兰克福学派重要成员艾里希-弗洛姆最著名的作品，自1956年出版至今已被翻译成32种文字，在全世界畅销不衰，被誉为当代爱的艺术理论专著最著名的作品。'),\n(218, '退步集', '陈丹青', '广西师范大学出版社', '2005-1', '38.00', '9787563351398', '《退步集》是陈丹青归国五年来部分文字的结集，三十余篇文章，话题兼及绘画、影像、城市、教育诸方面，自云“退步”，语涉双关，也可理解为对百年中国人文艺术领域种种“进步观”的省思和追问。'),\n(219, '人间词话', '王国维', '上海古籍出版社', '1998-12-01', '9.80', '9787532524808', '《人间词话》一书乃是王氏接受了西洋美学思想之洗礼后，以崭新的眼光对中国旧文学所作的评论，具有划时代的意义，向来极受学术界重视。本书并约请当今著名专家黄霖为之导读，不仅梳理其理论框架，剔抉其精义要眇，更着重揭橥其学术源流、历史文化背景，及撰作者当时特定的情境与心态，从而在帮助读者确切理解原著的同时，凸现词学大师王国维的学术个性。'),\n(220, '未来简史', '[以色列]尤瓦尔·赫拉利', '中信出版社', '2017-1', '68', '9787508672069', '进入21世纪后，曾经长期威胁人类生存、发展的瘟疫、饥荒和战争已经被攻克，智人面临着新的待办议题：永生不老、幸福快乐和成为具有“神性”的人类。在解决这些新问题的过程中，科学技术的发展将颠覆我们很多当下认为无需佐证的“常识”，比如人文主义所推崇的自由意志将面临严峻挑战，机器将会代替人类做出更明智的选择。'),\n(221, '云中歌1', '桐华', '作家出版社', '2007-9', '24.80', '9787506341110', '西汉时期，八岁的汉昭帝刘弗陵被追逼到万里荒漠，走投无路之际，一个骑着天山雪驼的绿衫女孩云歌凭空降临，将其带出荒漠。冷漠似冰的刘弗陵最终被精灵可爱的云歌打动，互赠礼物后相约十年后的长安相会。十年后，云歌带着儿时的诺言来到长安寻找刘弗陵，无奈此时的刘哥哥不仅不记得儿时的大漠诺言，而且身边还多了个贤惠美丽的女子许平君。伤心的云歌正欲返回西漠，却遇上了难缠的绝世美男孟珏，云歌以为幸福的生活从此开始，谁知又卷入了一场宫廷王位之争……'),\n(222, '夹边沟记事', '杨显惠', '花城出版社', '2008-09', '34.00', '9787536053281', '这是一段尘封四十年的历史，当年的幸存者散落在各个角落，没有人问过他们到底发生了什么，当年的死难者早已化为白骨，连他们的后代也不知道埋在何处。幸亏杨显惠这位有良知的作家，不辞辛劳，四处寻访，历经数载，终于揭开了历史的盖子。'),\n(223, '来不及说我爱你', '匪我思存', '新世界出版社', '2006-9', '20.00', '9787802281127', '已订婚的她，在无意间救下了一个英俊又权倾一方的贵公子，原本以为这只是一场擦肩而过的邂逅，谁知道他居然甘冒奇险，在婚礼上把她抢了过来，而等待他们的却不是王子与灰姑娘走入城堡的童话……'),\n(224, '一千零一夜', '纳训', '人民文学出版社', '2003-01', '22.0', '9787020040346', '《一千零一夜》又名《天方夜谭》。\\\"天方\\\"是从前中国对阿拉伯的称呼。这本书中的故事，多是阿拉伯地区国家的传说。 公元9世纪时，是阿拉伯帝国的全盛时期，它横跨亚洲、欧洲和非洲，有着独特而辉煌的文化。《一千零一夜》是阿拉伯地区的古代民间传说。从9世纪开始，经过搜集整理，至16世纪结成集子。到了18世纪，传播至欧洲、亚洲许多国家。全书共有两百多个故事，这里所选的是其中最著名的几个。 这些故事有什么特色呢？ 它们反映了东方文化的瑰丽色彩：神秘、奇异、幻想丰富、语言优美。它们把神奇的想像和当时阿拉伯的现实结合起来，读故事便可了解那个时期阿拉伯人的生活风貌。书中同情贫苦大众的遭遇又称赞他们的智慧；书中歌颂冒险精神，特别是航海者的勇敢，因为那时候许多国家都是由于海上贸易而发达起来的。虽然书里把富有、享福作为最高理想，但是认为只有好心的人才应当享有。'),\n(225, '相约星期二', '[美]米奇·阿尔博姆', '上海译文出版社', '2007-7', '19.00', '9787532742707', '莫里·施瓦茨是作者米奇·阿尔博姆在大学时，曾给予过他许多思想的教授。米奇毕业十五年后的一天，偶然得知莫里·施瓦茨罹患肌萎性侧索硬化，来日无多，这时老教授所感受的不是对生命即将离去的恐惧，而是希望把自己许多年来思考的一些东西传播给更多的人，于是米奇·阿尔博姆作为老人唯一的学生，相约每个星期二上课。在其后的十四个星期里，米奇每星期二都飞越七百英里到老人那儿上课。在这十四堂课中，他们聊到了人生的许多组成部分，如何面对他人，如何面对爱，如何面对恐惧，如何面对家庭，以及感情及婚姻，金钱与文化，衰老与死亡。最后一堂课是莫里老人的葬礼，整个事情的过程，以及这十四堂课的笔记便构成了这本《相约星期二》。'),\n(226, '可爱的洪水猛兽', '韩寒', '万卷出版公司', '2009-08-01', '25.00', '9787547000564', '继《杂的文》后再次推出韩寒2008-2009最新博客文的精选。本书集合了以韩寒自己独特的思考方式为基础的杂文，评时事、人文、电影、艺术、赛车等，把最率性的品格，最出彩的观点，最犀利的言语，最有趣的内容，一一奉献给读者。'),\n(227, '白银时代', '王小波', '花城出版社', '1997-5', '10.00', '9787536025097', '《白银时代》是《时代三部曲》之二。这是由一组虚拟时空的作品构成的长篇。这组作品写的是本世纪长大而活到下世纪的知识分子，在跨世纪的生存过程中，回忆他们的上辈、描述他们的上辈、描述他们自己的人生。与其说这是对未来世界的预测，不如说是现代生活的寓言。'),\n(228, '台北人', '白先勇', '广西师范大学出版社', '2010-10', '38.00', '9787563397648', '作为20世纪中文小说100强的《台北人》，是一部深具复杂性的短篇小说集，由十四个一流的短篇小说构成，串联成一体，则效果遽然增加，不但小说之幅面变广，使我们看到社会之“众生相”，更重要的，由于主题命意之一再重复，与互相陪衬辅佐，使我们能更进一步深入了解作品之含义，并使我们得以一窥隐藏在作品内的作者之人生观与宇宙观。《台北人》之人物，可以说囊括了台北都市社会之各阶层：从年迈挺拔的儒将朴公（《梁父吟》）到退休了的女仆顺恩嫂（《思旧赋》），从上流社会的窦夫人（《游园惊梦》）到下流社会的“总司令”（《孤恋花》）。有知识分子，如《冬夜》之余嵚磊教授；有商人，如《花桥荣记》之老板娘；有帮佣工人，如《那血一般红的杜鹃花》之王雄；有军队里的人，如《岁除》之赖鸣升；有社交界名女，如尹雪艳；有低级舞女，如金大班。这些“大”人物、“中”人物与“小”人物，来自中国大陆不同的省...'),\n(229, '万水千山走遍', '三毛', '哈尔滨出版社', '2003-08', '13.80', '9787806399057', '大地啊，我来到你岸上时原是一个陌生人，住在你房子里时原是一个旅客，而今我离开你的门时却是一个朋友了。 当飞机降落在墨西哥首都的机场时，我的体力已经透支得几乎无法举步。长长的旅程，别人睡觉，我一直在看书。眼看全机的人都慢慢地走了，还让自己绑在安全带上。窗外的机场灯光通明，是夜间了。'),\n(230, '罗生门', '[日]芥川龙之介', '上海译文出版社', '2008-7', '12.00', '9787532744756', '芥川龙之介(1892—1927)，日本新思潮派代表作家，创作上既有浪漫主义特点，又具有现实主义倾向。以其名字命名的“芥川奖”成为日本文坛的重要奖项之一。作品以短篇小说为主，多为历史题材，情节新奇甚至诡异，以冷峻的文笔和简洁有力的语言让读者关注到社会丑恶现象，这使得他的小说既具有高度的艺术性，又成为当时社会的缩影。《罗生门》是其代表作。本书收录芥川的中短篇小说共十三篇。《罗生门》以风雨不透的布局将人推向生死抉择的极限，从而展示了“恶”的无可回避，第一次传递出作者对人的理解，对人的无奈与绝望。书山稗海，文史苑囿，于中沉潜含玩，钩没抉隐，一日发而为文，自是信手拈来，随机生发，纵横捭阖，不可抑勒。由庙堂高官到市井小民，由紫宸之深到江湖之运，其笔下无不呼之即来，腾跃纸上。芥川生性敏感，一般来说，他不重描绘而意在发掘，疏于叙述而工于点化，少的是轻灵与潇洒，多的是...'),\n(231, '面纱', '[英]威廉·萨默塞特·毛姆', '重庆出版社', '2012-5', '32.00', '9787229050238', '★同名电影《面纱》小说原著'),\n(232, '哈姆莱特', '[英]威廉·莎士比亚', '人民文学出版社', '2001-1', '7.00', '9787020035946', '本书是大学生必读丛书中的一册，书中以教育部全国高等学校中文学科教学指导委员会指定书目为依据，收录了英国著名作家莎士比亚先生的话剧《哈姆莱特》。'),\n(233, '告白', '[日]凑佳苗', '時報文化', '2009年8月31日', 'NT$250', '9789571350813', '日本銷售破67萬冊'),\n(234, '雨季不再来', '三毛', '北京十月文艺出版社', '2007-7', '28.00', '9787530208960', '《雨季不再来》以三毛的生命历程为主题，记录了三毛17岁到22岁的成长过程，真实呈现出三毛少女时代的成长感受，辍学、自闭、叛逆，游学西班牙、德国、美国后，渐渐成长为独立自信的青年，这本书中透露的纯真情怀和异质美感，可以清楚地印证她传奇性格的痕迹。'),\n(235, '琅琊榜', '海宴', '朝华出版社', '2007-12', '49.80', '9787505417670', '一卷风去琅琊榜，囊尽天下奇英才。他远在江湖，却能名动帝辇，只因神秘莫测而又言出必准的琅琊阁，突然断言他是一麒麟之才，得之可得天下一。然而，身为太子与誉王竞相拉拢招揽的对象，他竟然出人意料地舍弃了这两个皇位争夺的热门人选，转而投向默默无闻、最不受皇帝宠爱的靖王。'),\n(236, '后宫·甄嬛传Ⅰ', '流潋紫', '花山文艺出版社', '2007-2', '22.00', '9787806739747', '女人之间的斗争，永远是最残酷的斗争。而后宫，是残酷的密集地。流潋紫笔下的后宫，后宫中那群如花的女子，或许有显赫的家世，或许有绝美的容颜、机巧的智慧。她们为了争夺爱情，争夺荣华富贵，争夺一个或许并不值得的男人，钩心斗角，尔虞我诈，将青春和美好都虚耗在了这场永无止境的斗争中。虽是红颜如花，却暗藏凶险。但是无论她们的斗争怎样惨烈，对于美好，都心存希冀。 流潋紫笔下的甄嬛，举世无双，蕙质兰心，钟灵毓秀，坚信真爱。她并不是一个完美的不食人间烟火的女子，她在后宫企求奢侈的爱，又总是顾念太多，幕落时分，寂寞也就格外清冷透骨。'),\n(237, '星空', '幾米', '大塊文化', '2009-5-1', 'NT369', '9789862131176', '《星空》以一种年龄的视角，描绘了一类无法和世界沟通的孩子 ，从对社会的恐慌、逃避到逐步认识自我的过程。《星空》的画面精彩、震撼、美轮美奂，是几米目前最辉煌的绘画作品之一。'),\n(238, '朗读者', '[德]本哈德·施林克', '译林出版社', '2009-2', '22.00', '9787544707923', '战后的德国萧条破败，一个15岁的少年在电车上病倒了，他独自下车，行走在滂沱大雨中，最后在一个逼仄的过道里吐得一塌糊涂，一个36岁的陌生女人帮助了他……');\nINSERT INTO `book_info` (`id`, `name`, `author`, `press`, `press_time`, `price`, `ISBN`, `desc`) VALUES\n(239, '雾都孤儿', '世界文学名著普及本（全译本）', '上海译文出版社', '1991-7', '10.10', '9787532710942', '孤儿奥立弗・退斯特从小在贫民习艺所受尽欺凌，逃到伦敦后又陷入贼窟。身边的世界像一台疯狂运转的机器，小奥立弗却努力坚守着心底深处的纯净与高贵。这份执著终于帮他等来了柳暗花明：布朗劳先生、梅里太太等人及时伸出援助之手；与此同时，奥立弗奇特的身世，也一步步真相大白。小说深刻揭示社会弊病的同时，也在英国文学史上留下一连串栩栩如生的人物形象，一百多年来深受读者爱戴。'),\n(240, '枪炮、病菌与钢铁', '[美]贾雷德·戴蒙德', '上海世纪出版集团', '2006-4-1', '45.00', '9787532739233', '为什么是欧亚大陆人征服、赶走或大批杀死印第安人、澳大利亚人和非洲人，而不是相反？为什么么小麦和玉米、牛和猪以及现代世界的其他一些“不了起的”作物和牲畜出现在这些特定地区，而不是其他地区？在这部开创性的著作中，演化生物学家贾雷德.戴蒙德揭示了事实上有助于形成历史最广泛模式的环境因素，从而以震撼人心的力量摧毁了以种族主义为基础的人类史理论，因其突出价值和重要性，本书荣获1998年美国普利策奖和英国科普书奖，并为《纽约时报》畅销书排行榜作品。'),\n(241, '红拂夜奔', '王小波', '江苏文艺出版社', '2005-1', '28.00', '9787539921624', '《红拂夜奔》这书题就会让读者认为是写隋末杨素家妓红拂敬慕大军事家李靖，私奔相从的风流逸事。然而，这本书它以现代人的眼光去观照历史，又以历史文化原型来建构现代小说的结构。历史的重建和复归在于人类有共同的心理品质、共同的生存状态和共同的生存困境。王小波在序言中说：“我写的是内心而不是外形，是神似而不是形似。”人类自身的进化是在不断循环、重演的历史中进行的，唯有如此，那些世代相传的古典名著才能震撼现代读者的心灵，引起共鸣；那些借鉴历史原型的现代作品才能激发读者真正的兴趣。王小波写的就是这样一部把历史和现实进行双向建构的小说。'),\n(242, '深夜食堂 01', '[日]安倍夜郎', '湖南文艺出版社', '2013-1', '25.00', '9787540459246', '下班后，总有个地方在等着你……');\n\n-- --------------------------------------------------------\n\n--\n-- 表的结构 `borrow_list`\n--\n\nCREATE TABLE `borrow_list` (\n  `book_id` int(11) NOT NULL,\n  `user_id` int(11) NOT NULL,\n  `borrow_date` date NOT NULL,\n  `back_date` date NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\n--\n-- 转存表中的数据 `borrow_list`\n--\n\nINSERT INTO `borrow_list` (`book_id`, `user_id`, `borrow_date`, `back_date`) VALUES\n(1, 10000, '2018-10-18', '2018-12-18'),\n(2, 10000, '2018-10-18', '2018-12-18'),\n(5, 10010, '2018-10-13', '2019-04-13'),\n(6, 10010, '2018-10-16', '2019-03-16'),\n(8, 18888, '2018-10-17', '2019-02-17');\n\n-- --------------------------------------------------------\n\n--\n-- 表的结构 `user`\n--\n\nCREATE TABLE `user` (\n  `id` int(11) NOT NULL,\n  `pwd` char(128) NOT NULL,\n  `name` char(15) DEFAULT NULL,\n  `class` char(15) DEFAULT NULL,\n  `status` tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '0为挂失,1为正常',\n  `admin` tinyint(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0为普通用户,1为管理员',\n  `last_login_time` datetime DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\n--\n-- 转存表中的数据 `user`\n--\n\nINSERT INTO `user` (`id`, `pwd`, `name`, `class`, `status`, `admin`, `last_login_time`) VALUES\n(10000, 'e10adc3949ba59abbe56e057f20f883e', '李狗蛋', 'PHP1班', 1, 0, '2018-10-17 20:26:57'),\n(10010, 'e10adc3949ba59abbe56e057f20f883e', '王小明', 'PHP2班', 1, 0, '2018-10-16 15:36:04'),\n(10086, '21232f297a57a5a743894a0e4a801fc3', NULL, NULL, 1, 1, '2018-10-18 10:13:21'),\n(18888, 'e10adc3949ba59abbe56e057f20f883e', '王五', 'PHP3班', 1, 0, '2018-10-18 10:13:04'),\n(88888, 'e10adc3949ba59abbe56e057f20f883e', '赵六', 'PHP2班', 0, 0, '2018-10-18 10:11:31');\n\n--\n-- 转储表的索引\n--\n\n--\n-- 表的索引 `book_info`\n--\nALTER TABLE `book_info`\n  ADD PRIMARY KEY (`id`);\n\n--\n-- 表的索引 `borrow_list`\n--\nALTER TABLE `borrow_list`\n  ADD PRIMARY KEY (`book_id`,`user_id`);\n\n--\n-- 表的索引 `user`\n--\nALTER TABLE `user`\n  ADD PRIMARY KEY (`id`);\n\n--\n-- 在导出的表使用AUTO_INCREMENT\n--\n\n--\n-- 使用表AUTO_INCREMENT `book_info`\n--\nALTER TABLE `book_info`\n  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=243;\nCOMMIT;\n\n/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"
  },
  {
    "path": "index.php",
    "content": "<?php\nrequire_once(\"./Base/Base.class.php\");\n\nBase::Run();"
  }
]