本文整理汇总了PHP中Header::import方法的典型用法代码示例。如果您正苦于以下问题:PHP Header::import方法的具体用法?PHP Header::import怎么用?PHP Header::import使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Header
的用法示例。
在下文中一共展示了Header::import方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invokeHandler
public function invokeHandler(Smarty $viewModel, Header $header, User $user, $page)
{
$header->title('PayPic');
$viewModel->assign("pname", "@RTPic");
if ($user->isValid()) {
$header->import('jqgeeks/bootstrap_css', 'upload');
global $RDb;
$images = $RDb->fetchAll("select * from files where uid=%d AND albumid=0", $user->getToken());
$viewModel->assign("images", $images);
return "upload";
} else {
$header->import('jqgeeks/bootstrap_css', 'google_login');
return "login";
}
}
示例2: invokeHandler
public function invokeHandler(Smarty $viewModel, Header $header, $f, $page)
{
$header->title('PayPic');
$header->import('jqgeeks/bootstrap_css', 'mypage');
$viewModel->assign("pname", "@RTPic");
return self::showLatest($viewModel);
}
示例3: invokeHandler
public function invokeHandler(Smarty $viewModel, Header $header, $f, $page, $aid)
{
$header->title('PayPic');
$header->import('picbootstrap', 'mypage');
$viewModel->assign("pname", "@RTPic");
$album = new Album($aid);
$viewModel->assign("images", $album->getImges());
return "images";
}
示例4: invokeHandler
public function invokeHandler(Smarty $viewModel, Header $header, $f, $page, $pid)
{
$header->title('PayPic');
$header->import('jqgeeks/bootstrap_css', 'mypage');
$viewModel->assign("pname", "@RTPic");
global $RDb;
$image = $RDb->fetch("select * from files where id=%d", $pid);
$viewModel->assign("image", $image);
return "image";
}
示例5: invokeHandler
public function invokeHandler(Smarty $viewModel, Header $header, $f, $page)
{
$header->title('PayPic');
$header->import('jqgeeks/bootstrap_css', 'mypage');
$viewModel->assign("pname", "@RTPic");
global $RDb;
$imageAccess = $RDb->fetchAll("select * from file_access fa,files f,user u" . " where fa.pid=f.id and u.uid=fa.uid");
$viewModel->assign("images", $imageAccess);
return "imageAccess";
}
示例6: invokeHandler
public function invokeHandler(Smarty $viewModel, Header $header, User $user, $uname, $upass)
{
$header->title('PayPic');
$header->import('jqgeeks/bootstrap_css', 'google_login');
$viewModel->assign("pname", "@RTPic");
if ($user->auth($uname, $upass)) {
include_once HANDLER_PATH . "/Images.php";
return Images::showlatest($viewModel);
} else {
return "login";
}
}
示例7: invokeHandler
/**
* @param Smarty $viewModel
* @param Header $header
* @param DataModel $dataModel
* @param User $user
* @param string $view
* @param string $module
* @return string
*/
public function invokeHandler(Smarty $viewModel, Header $header, DataModel $dataModel, User $user, $view = "empty", $module = "index_page")
{
$header->title("ThEroticStories");
$header->import($module);
return $view;
}
示例8: invokeHandler
public function invokeHandler(Smarty $viewModel, Header $header, DataModel $dataModel, AbstractUser $user, $view = "empty")
{
$header->title(DEFAULT_TITLE);
$header->import(DEFAULT_BUNDLE);
return $view;
}
示例9: invokeHandler
public function invokeHandler(Smarty $viewModel, Header $header, $pid, $imageAction = "view", User $user)
{
$header->title('PayPic');
$header->import('picbootstrap', 'mypage');
$viewModel->assign("pname", "@RTPic");
global $RDb;
$picture = new Picture($pid, $user->getToken());
//$image = Picture::getPicInfoById($pid);
Browser::log($picture, $user->getToken(), $picture->image->uid, $user->getToken() == $picture->image->uid);
$hasBaught = false;
$hasSaved = false;
$canBuy = false;
if ($user->isValid()) {
if ($picture->isMyPic()) {
Browser::log('isMyPic');
$user->set('canAccess_' . $pid, $picture->image->file_path);
} else {
$imageAccess = Picture::getPicAccess($pid, $user->getToken());
$hasFileAccessIndexed = !empty($imageAccess);
if ($hasFileAccessIndexed) {
$hasBaught = $imageAccess->baught == 1;
$hasSaved = $imageAccess->saved == 1;
}
$canBuy = $user->getCoins() >= $picture->image->price;
if (strcmp("buyImage", $imageAction) == 0) {
if ($picture->isPaid() && !$hasBaught && $canBuy) {
if ($hasFileAccessIndexed) {
$RDb->update("update file_access set baught=1 where uid=%d AND pid=%d", $user->uid, $pid);
} else {
$RDb->update("INSERT INTO file_access (uid,pid,baught,saved) values(%d,%d,1,1)", $user->uid, $pid);
$hasFileAccessIndexed = true;
}
$user->setCoins($user->get('coins') - $picture->image->price);
$hasBaught = true;
}
} else {
if (strcmp("saveImage", $imageAction) == 0) {
if ($hasFileAccessIndexed) {
$RDb->update("update file_access set saved=1 where uid=%d AND pid=%d", $user->uid, $pid);
} else {
$RDb->update("INSERT INTO file_access (uid,pid,baught,saved) values(%d,%d,0,1)", $user->uid, $pid);
$hasFileAccessIndexed = true;
}
$hasSaved = true;
} else {
if (strcmp("unsaveImage", $imageAction) == 0) {
if ($hasFileAccessIndexed) {
$RDb->update("update file_access set saved=0 where uid=%d AND pid=%d", $user->uid, $pid);
}
$hasFileAccessIndexed = true;
$hasSaved = false;
} else {
if (strcmp("likeImage", $imageAction) == 0) {
if ($hasFileAccessIndexed) {
$like = $imageAccess->liked == 0 ? 1 : 0;
$RDb->update("update file_access set liked=%d where uid=%d AND pid=%d", $like, $user->uid, $pid);
} else {
$RDb->update("INSERT INTO file_access (uid,pid,liked,baught,saved) values(%d,%d,1,0,0)", $user->uid, $pid);
}
$picture->image->likes = $picture->image->likes + $like * 2 - 1;
$RDb->update("update files set likes=%d where id=%d", ${$picture}->image->likes, $pid);
$hasFileAccessIndexed = true;
}
}
}
}
if (!$picture->isPaid() || $hasBaught) {
$user->set('canAccess_' . $pid, $picture->image->file_path);
}
}
}
$viewModel->assign("isMyPic", $picture->isMyPic());
$viewModel->assign("canBuy", $canBuy);
$viewModel->assign("hasBaught", $hasBaught);
$viewModel->assign("isPaid", $picture->isPaid());
$viewModel->assign("hasSaved", $hasSaved);
$viewModel->assign("image", $picture->image);
return "image";
}