本文整理匯總了PHP中zotop::t方法的典型用法代碼示例。如果您正苦於以下問題:PHP zotop::t方法的具體用法?PHP zotop::t怎麽用?PHP zotop::t使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類zotop
的用法示例。
在下文中一共展示了zotop::t方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct($config = array())
{
if (!$this->test()) {
zotop::error(zotop::t('The memcache extension is not available'));
}
$host = $config['host'];
$host = empty($host) ? zotop::config('system.cache.memcache.host') : $host;
$host = empty($host) ? '127.0.0.1' : $host;
$post = $config['post'];
$port = empty($port) ? zotop::config('system.cache.memcache.port') : $port;
$port = empty($port) ? '11211' : $port;
$timeout = isset($config['timeout']) ? (bool) $config['timeout'] : false;
$persistent = isset($config['persistent']) ? (bool) $config['persistent'] : false;
unset($config);
//是否持久鏈接
$connect = $persistent ? 'pconnect' : 'connect';
$this->memcache =& new Memcache();
if ($timeout === false) {
$this->connected = @$this->memcache->{$connect}($host, $port);
} else {
$this->connected = @$this->memcache->{$connect}($host, $port, $timeout);
}
if (!$this->connected) {
zotop::error(zotop::t('無法連接memcache服務器 “{$host}:{$port}”,請檢查參數配置是否正確', array('host' => $host, 'port' => $port)));
}
}
示例2: onDefault
public function onDefault()
{
if (form::isPostBack()) {
msg::error('開發中', '數據保存開發中,請稍後……');
}
$header['title'] = '係統設置';
page::header($header);
page::top();
page::navbar($this->navbar(), 'main');
form::header();
block::header('網站基本信息');
form::field(array('type' => 'text', 'label' => zotop::t('網站名稱'), 'name' => 'zotop.site.title', 'value' => zotop::config('zotop.site.title'), 'description' => zotop::t('網站名稱,將顯示在標題和導航中')));
form::field(array('type' => 'text', 'label' => zotop::t('網站域名'), 'name' => 'zotop.site.domain', 'value' => zotop::config('zotop.site.domain'), 'description' => zotop::t('網站域名地址,不包含http://,如:www.zotop.com')));
form::field(array('type' => 'text', 'label' => zotop::t('備案信息'), 'name' => 'zotop.site.icp', 'value' => zotop::config('zotop.site.icp'), 'description' => zotop::t('頁麵底部可以顯示 ICP 備案信息,如果網站已備案,在此輸入您的授權碼,它將顯示在頁麵底部,如果沒有請留空')));
form::field(array('type' => 'select', 'options' => array('0' => '不顯示', '1' => '顯示'), 'label' => zotop::t('授權信息'), 'name' => 'zotop.site.license', 'value' => zotop::config('zotop.site.license'), 'description' => zotop::t('頁腳部位顯示程序官方網站鏈接')));
form::field(array('type' => 'textarea', 'label' => zotop::t('網站簡介'), 'name' => 'zotop.site.about', 'value' => zotop::config('zotop.site.about')));
block::footer();
block::header('聯係信息設置');
form::field(array('type' => 'text', 'label' => zotop::t('公司名稱'), 'name' => 'zotop.site.title', 'value' => '', 'description' => zotop::t('網站隸屬的公司或者組織名稱')));
form::field(array('type' => 'textarea', 'label' => zotop::t('網站簡介'), 'name' => 'zotop.site.about', 'value' => ''));
block::footer();
form::buttons(array('type' => 'submit'), array('type' => 'back'));
form::footer();
page::bottom();
page::footer();
}
示例3: actionIndex
public function actionIndex($parentid = 0)
{
$folder = zotop::model('system.folder');
if (form::isPostBack()) {
$post = form::post();
foreach ((array) $post['id'] as $i => $id) {
$folder->update(array('order' => $i + 1), $id);
}
if (!$folder->error()) {
msg::success('保存成功', zotop::url('system/folder/index'));
}
msg::error($folder->msg());
}
$folders = $folder->getAll();
$tree = new tree($folders, 0);
$rows = $tree->getChild($parentid);
$position = $tree->getPosition($parentid);
foreach ($position as $p) {
$pos[zotop::url('system/folder/index/' . $p['id'])] = $p['title'];
}
$page = new page();
$page->set('title', zotop::t('文件管理'));
$page->set('navbar', $this->navbar($parentid));
$page->set('position', array(zotop::url('system/file') => zotop::t('文件管理'), zotop::url('system/folder') => zotop::t('分類管理')) + (array) $pos + array('列表'));
$page->set('folders', $folders);
$page->set('rows', $rows);
$page->set('hash', $hash);
$page->display();
}
示例4: onDefault
public function onDefault()
{
if (form::isPostBack()) {
$post = array();
$post['username'] = request::post('username');
$post['password'] = request::post('password');
$post['logintime'] = time();
$user = zotop::model('zotop.user');
$data = $user->read($post['username'], 'username');
//zotop::dump($data);
if ($data == false) {
msg::error('登陸失敗', zotop::t('賬戶名稱`{$username}`不存在,請檢查!', array('username' => $post['username'])));
}
zotop::user($data);
msg::success('登陸成功', '登陸成功,係統正在加載中', 'reload', 2);
}
if (zotop::user() != null) {
zotop::redirect('zotop/index');
}
$header['title'] = '用戶登錄';
$header['js'] = url::module() . '/admin/js/login.js';
$header['body']['class'] = "login";
page::header($header);
block::header(array('id' => 'LoginWindow', 'title' => '用戶登錄'));
form::header(array('title' => '', 'description' => '請輸入用戶名和密碼', 'class' => 'small'));
form::field(array('type' => 'text', 'label' => zotop::t('帳 戶(U)'), 'name' => 'username', 'value' => zotop::user('username'), 'valid' => 'required:true'));
form::field(array('type' => 'password', 'label' => zotop::t('密 碼(P)'), 'name' => 'password', 'value' => ''));
form::buttons(array('type' => 'submit', 'value' => '登 陸'), array('type' => 'button', 'name' => 'options', 'value' => '選 項'));
form::footer();
block::footer();
page::footer();
}
示例5: actionIndex
public function actionIndex()
{
$page = new page();
$page->title = zotop::t('係統管理');
$page->navbar = $this->navbar();
$page->display();
}
示例6: editAction
public function editAction($tablename)
{
if (form::isPostBack()) {
$tablename = request::post('tablename');
$name = request::post('name');
$comment = request::post('comment');
$primary = request::post('primary');
if (strtolower($tablename) !== strtolower($name)) {
$rename = zotop::db()->table($tablename)->rename($name);
}
if ($comment !== NULL) {
$comment = zotop::db()->table($name)->comment($comment);
}
if ($primary) {
$primary = zotop::db()->table($name)->primary($primary);
}
$this->success('數據表設置成功,正在刷新頁麵,請稍後……', zotop::url('database/table'));
}
$db = zotop::db();
$database = $db->config();
$tables = $db->tables(true);
$table = $tables[$tablename];
if (!isset($table)) {
$this->error(zotop::t('數據表{$tablename}不存在', array('tablename' => $tablename)));
}
$page = new dialog();
$page->title = '數據庫管理:' . $database['database'] . ' @ ' . $database['hostname'] . '<i>></i> 編輯:' . $tablename;
$page->set('database', $database);
$page->set('table', $table);
$page->display();
}
示例7: changePasswordAction
public function changePasswordAction()
{
$user = zotop::model('zotop.user');
$user->id = (int) zotop::user('id');
$user->username = (string) zotop::user('username');
if (form::isPostBack()) {
$user->read();
$password = request::post('password');
$newpassword = request::post('newpassword');
if ($user->password($password) != $user->password) {
msg::error(zotop::t('您輸入的原密碼:<b>{$password}</b>錯誤,請確認', array('password' => $password)));
}
if ($newpassword != request::post('newpassword2')) {
msg::error(zotop::t('兩次輸入的新密碼不一致,請確認'));
}
if ($newpassword != $password) {
$update = $user->update(array('id' => $user->id, 'password' => $user->password($newpassword)));
}
msg::success(zotop::t('密碼修改成功,請記住您的新密碼'), url::current());
}
$page = new page();
$page->title = '修改我的密碼';
$page->set('user', $user);
$page->set('navbar', $this->navbar());
$page->display();
}
示例8: actionIndex
public function actionIndex($type = '')
{
$file = zotop::model('zotop.file');
if (!empty($type)) {
$where = array('type', '=', $type);
}
$files = $file->db()->where($where)->orderby('createtime', 'desc')->getPage();
$pagination = new pagination();
$pagination->page = $files['page'];
$pagination->pagesize = $files['pagesize'];
$pagination->total = $files['total'];
$p = $pagination->render();
$totalsize = $file->totalsize();
$totalcount = $file->count();
$page = new page();
$page->set('title', zotop::t('文件管理'));
$page->set('navbar', $this->navbar());
$page->set('page', $files['page']);
$page->set('pagesize', $files['pagesize']);
$page->set('total', $files['total']);
$page->set('files', $files['data']);
$page->set('totalsize', $totalsize);
$page->set('totalcount', $totalcount);
$page->set('pagination', $p);
$page->display();
}
示例9: actionDelete
public function actionDelete($tablename)
{
$delete = zotop::db()->table($tablename)->drop();
if (!$delete) {
msg::error(zotop::t('刪除數據表{$tablename}失敗', array('tablename' => $tablename)));
}
msg::success('刪除成功', zotop::url('database/table'));
}
示例10: types
public function types($type = '')
{
$types = array('core' => zotop::t('核心模塊'), 'com' => zotop::t('功能模塊'), 'plugin' => zotop::t('插件模塊'));
if (empty($type)) {
return $types;
}
return $types[$type];
}
示例11: actionSide
public function actionSide()
{
$category = zotop::model('content.category');
$tree = $category->getTree(0, '<span class="zotop-icon zotop-icon-$icon"></span><a href="' . zotop::url('content/content/index/$id') . '" target="mainIframe">$title</a>');
$page = new side();
$page->set('title', zotop::t('文件管理'));
$page->set('tree', $tree);
$page->display();
}
示例12: add
public function add($data = array())
{
$this->bind($data);
if ((int) $this->id <= 0) {
$this->error(zotop::t('編號不能為空'));
return false;
}
$this->insert();
return $this->error() ? false : true;
}
示例13: success
/**
* 顯示成功消息
*
*/
public static function success($content = '', $url = '', $life = 2)
{
$msg = array('type' => 'success', 'title' => zotop::t('success'), 'content' => '', 'detail' => '', 'url' => $url, 'life' => $life, 'action' => '');
if (is_array($content)) {
$msg = array_merge($msg, $content, array('type' => 'success'));
} else {
$msg['content'] = $content;
}
msg::show($msg);
}
示例14: onSend
public function onSend()
{
$header['title'] = '發送短消息';
dialog::header($header);
form::header(array('title' => '', 'description' => '請輸入收信人的賬戶並輸入短消息內容', 'class' => 'small'));
form::field(array('type' => 'text', 'label' => zotop::t('收信人'), 'name' => 'sendto', 'value' => '', 'description' => '請輸入收信人的賬戶名稱,多個賬戶之間請用’逗號‘隔開'));
form::field(array('type' => 'textarea', 'label' => zotop::t('內 容'), 'name' => 'content', 'value' => ''));
form::buttons(array('type' => 'submit', 'value' => '發 送'), array('type' => 'button', 'name' => 'close', 'value' => '取消', 'class' => 'zotop-dialog-close'));
form::footer();
dialog::footer();
}
示例15: onBing
public function onBing()
{
$header['title'] = 'Bing搜索';
dialog::header($header);
dialog::navbar($this->navbar(), 'bing');
form::header(array('title' => '', 'description' => '<span class="zotop-tip">請先搜索圖片,然後插入</span>'));
dialog::add(html::iframe('images', 'about:blank', array('width' => '100%', 'style' => 'width:100%;height:200px;')));
form::buttons(array('id' => 'UploadImages', 'type' => 'submit', 'value' => '插入圖片'), array('type' => 'button', 'value' => zotop::t('取消'), 'class' => 'zotop-dialog-close'));
form::footer();
dialog::footer();
}