本文整理汇总了PHP中Module::hookBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::hookBlock方法的具体用法?PHP Module::hookBlock怎么用?PHP Module::hookBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Module
的用法示例。
在下文中一共展示了Module::hookBlock方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayMain
public function displayMain()
{
global $smarty, $link, $cookie;
if (!$cookie->logged) {
Tools::redirect($link->getPage('LoginView'));
}
$user = new User((int) $cookie->id_user);
if (Tools::isSubmit('joinCommit')) {
if (User::checkPassword($user->id, Tools::encrypt($_POST['old_passwd']))) {
if (Tools::getRequest('confirmation') == Tools::getRequest('passwd')) {
if (!empty($_POST['passwd']) && Validate::isPasswd($_POST['passwd'])) {
$user->copyFromPost();
if ($user->update()) {
$cookie->passwd = $user->passwd;
$cookie->write();
$smarty->assign('success', 'Your personal information has been successfully updated.');
}
} else {
$user->_errors[] = 'Password is invalid.';
}
} else {
$user->_errors[] = 'Password and confirmation do not match.';
}
} else {
$user->_errors[] = 'Your password is incorrect.';
}
}
$smarty->assign(array('errors' => $user->_errors, 'DISPLAY_LEFT' => Module::hookBlock(array('myaccount')), 'user' => $user));
return $smarty->fetch('my-user.tpl');
}
示例2: displayMain
public function displayMain()
{
global $smarty, $link, $cookie;
if (!$cookie->logged) {
Tools::redirect($link->getPage('LoginView'));
}
$smarty->assign(array('DISPLAY_LEFT' => Module::hookBlock(array('myaccount'))));
return $smarty->fetch('my-account.tpl');
}
示例3: displayMain
public function displayMain()
{
global $smarty, $link, $cookie;
if (!$cookie->logged) {
Tools::redirect($link->getPage('LoginView'));
}
$user = new User((int) $cookie->id_user);
$smarty->assign(array('DISPLAY_LEFT' => Module::hookBlock(array('myaccount')), 'addresses' => $user->getAddresses()));
return $smarty->fetch('my-addresses.tpl');
}
示例4: displayMain
public function displayMain()
{
global $smarty, $link, $cookie;
if (!$cookie->logged) {
Tools::redirect($link->getPage('LoginView'));
}
$user = new User((int) $cookie->id_user);
if ($reference = Tools::getRequest('reference')) {
$order = Order::getByReference($reference);
$smarty->assign(array('products' => $order->cart->getProducts(), 'h_order' => $order));
}
$smarty->assign(array('orders' => $user->getOrders(), 'DISPLAY_LEFT' => Module::hookBlock(array('myaccount'))));
return $smarty->fetch('my-orders.tpl');
}
示例5: displayMain
public function displayMain()
{
global $smarty, $link, $cookie;
if (!$cookie->logged) {
Tools::redirect($link->getPage('LoginView'));
}
$user = new User((int) $cookie->id_user);
$errors = array();
$success = false;
//添加feedback
//1.添加创建对象
if (Tools::isSubmit('submit')) {
$feedback = new Feedback();
$feedback->copyFromPost();
if ($feedback->rating <= 0 && $feedback->rating > 5) {
$feedback->rating = 4;
}
$data = explode("-", base64_decode(Tools::getRequest("data")));
$feedback->id_product = (int) $data[0];
$feedback->unit_price = (double) $data[2];
$feedback->quantity = (int) $data[3];
$feedback->md5_key = md5(Tools::getRequest("data"));
$feedback->name = substr($user->first_name, 0, 1) . "***" . substr($user->last_name, -1, 1);
$feedback->id_user = $user->id;
if ($feedback->add()) {
$success = true;
} else {
$errors = $feedback->_errors;
}
}
//2.获取用户评论过的MD5KEY
$proids = Feedback::haveFeedbackWithUser($user->id);
//3.获取用户购买过的产品
$products = array();
if ($result = $user->getPaymentedProduct()) {
foreach ($result as &$row) {
if (!in_array($row['md5_key'], $proids)) {
$products[] = $row;
}
}
}
$smarty->assign(array('success' => $success, 'errors' => $errors, 'products' => $products, 'DISPLAY_LEFT' => Module::hookBlock(array('myaccount'))));
return $smarty->fetch('my-feedback.tpl');
}
示例6: displayFooter
public function displayFooter()
{
global $smarty;
$smarty->assign(array('FOOT_BLOCK' => Module::hookBlock(array('viewed'))));
return parent::displayFooter();
}
示例7: displayLeft
public function displayLeft()
{
global $smarty;
$smarty->assign(array('LEFT_BLOCK' => Module::hookBlock(array('cmsblock'))));
return $smarty->fetch('block/left_columns.tpl');
}