/** * Runs the notification widget */ public function run() { if (Yii::app()->user->isGuest) { return; } Yii::import('application.modules_core.notification.controllers.ListController'); $this->render('list', array('updateJson' => ListController::getUpdateJson())); }
function execute(&$controller, &$request, &$user) { $handler =& plzXoo::getHandler('question'); $listController = new ListController(); $listController->filter_ = new CategorySearchFilter(); $listController->filter_->fetch(); $per_page = intval(@$GLOBALS['xoopsModuleConfig']['listview_per_page']); if ($per_page <= 0) { $per_page = 20; } $listController->fetch($handler->getCount($listController->filter_->getCriteria()), $per_page); $criteria = $listController->getCriteria(); // ¼èÆÀ $objs =& $handler->getObjects($criteria); $request->setAttribute('questions', $objs); $listController->freeze(); $request->setAttribute('listController', $listController); return VIEW_SUCCESS; }
public function index() { ListController::_loadLists(['limit' => ListController::getPerPageLimit()]); $pageTitle = Config::get('siteConfig')['main']['siteTitle']; $pageDescription = Config::get('siteConfig')['main']['siteDescription']; $ogTitle = $pageTitle; $ogDescription = $pageDescription; $ogImage = ''; try { $ogTitle = Config::get('siteConfig')['main']['ogData']['siteOgTitle']; $ogDescription = Config::get('siteConfig')['main']['ogData']['siteOgDescription']; $ogImage = asset(Config::get('siteConfig')['main']['ogData']['siteOgImage']); } catch (Exception $e) { } return View::make('home')->with(array('title' => $pageTitle, 'ogTitle' => $ogTitle, 'description' => $pageDescription, 'ogDescription' => $ogDescription, 'ogImage' => $ogImage)); }
public function approveList() { $admin = App::make('loggedInAdmin'); $listId = Input::get('list-id'); $redirectUrl = Input::get('redirect-url'); if (!$listId) { return 'List ID not passed'; } try { $list = ViralList::findOrFail($listId); $pendingChanges = ViralListChanges::find($listId); if ($pendingChanges) { ListController::addListData($pendingChanges->content, $list); $pendingChanges->delete(); } $list->markAsApproved(); try { ListController::saveThumbnails($list); ListController::saveOgImage($list); } catch (Exception $e) { return Response::error("Error! List not saved! " . $e->getMessage()); } $list->save(); \Event::fire('list:approved-by-admin', $list); return Redirect::to(Helpers::getUrlWithQuery(array('status' => 'awaiting_approval'), route('adminViewLists'))); } catch (ModelNotFoundException $e) { return Response::error("Error finding list with id " . $listId); } }
/** * The default action - hand off to ListController * * @param $request * @return mixed */ public function index($request) { return ListController::create()->handleRequest($request, $this->model); }
<?php /** * @copyright (C) 2005 Carlos Rubén Jacobs * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * IDEA Content Framework is Free Software */ require_once "controllers/listController.php"; require_once "icfHorizontal.php"; $listController = new ListController(); $listController->execute();
function show() { JRequest::setVar('layout', 'show'); return parent::display(); }
Route::match(array('GET', 'POST'), 'admin/config/list', array('as' => 'adminConfigList', 'uses' => 'AdminConfigController@listConfig')); Route::match(array('GET', 'POST'), 'admin/config/email', array('as' => 'adminConfigEmail', 'uses' => 'AdminConfigController@emailConfig')); //Preview OG image Route::match(array('GET', 'POST'), 'admin/config/preview-og-image', array('as' => 'adminPreviewOgImage', 'uses' => 'AdminConfigController@previewOgImage')); //Change Password Route::match(array('GET', 'POST'), 'admin/change-password', array('as' => 'adminChangePassword', 'uses' => 'AdminController@changePassword')); //Users Route::controller('admin/users', 'AdminUsersController'); Route::match(array('GET', 'POST'), 'admin/users/', array('as' => 'adminUsersHome', 'uses' => 'AdminUsersController@index')); //Categories Route::match(array('GET', 'POST'), 'admin/categories', array('as' => 'adminCategories', 'uses' => 'AdminCategoriesController@view')); Route::match(array('GET', 'POST', 'PATCH', 'DELETE'), 'admin/categories/addEdit', array('as' => 'adminCategoriesAddEdit', 'uses' => 'AdminCategoriesController@addEdit')); //Update Route::get('admin/update', array('as' => 'update', 'uses' => 'UpdateController@index')); //Sitemap Route::controller('sitemap', 'AdminSitemapController'); }); //Media manager Route::group(array(), function () { \Route::get('media', 'W3G\\MediaManager\\MediaManagerController@showStandalone'); \Route::any('media/connector', array('as' => 'mediaConnector', 'uses' => 'W3G\\MediaManager\\MediaManagerController@connector')); }); //404 macro Response::macro('notFound', function ($value = null) { ListController::_loadLists(); return Response::view('errors.404', array('errorMsg' => strtoupper($value)), 404); }); App::missing(function ($exception) { ListController::_loadLists(); return Response::view('errors.404', array('errorMsg' => strtoupper($exception->getMessage())), 404); });
<?php function do_shortcode($content) { $shortCodeEngine = App::make('shortCodeEngine'); return $shortCodeEngine->do_shortcode($content); } return array('latest_lists' => function ($attrs = []) { $loadListOptions = ListController::getListQueryStreamOptions(['stream' => 'latest']); if (!empty($attrs['limit'])) { $loadListOptions['limit'] = $attrs['limit']; } $lists = ListController::_getLists($loadListOptions); return View::make('lists.listsList', ['lists' => $lists])->render(); }, 'popular_lists' => function ($attrs = []) { $loadListOptions = ListController::getListQueryStreamOptions(['stream' => 'popular']); if (!empty($attrs['limit'])) { $loadListOptions['limit'] = $attrs['limit']; } $lists = ListController::_getLists($loadListOptions); return View::make('lists.listsList', ['lists' => $lists])->render(); }, 'random_lists' => function ($attrs = []) { $loadListOptions = ListController::getListQueryStreamOptions(['stream' => 'random']); if (!empty($attrs['limit'])) { $loadListOptions['limit'] = $attrs['limit']; } $lists = ListController::_getLists($loadListOptions); return View::make('lists.listsList', ['lists' => $lists])->render(); });
public function profile($userId, $nameString) { $me = Auth::user(); try { $user = User::findOrFail($userId); View::share(self::getProfileOgData($user)); $listsQuery = $user->lists(); //If not logged in or if the profile is not of the logged in user, show approved lists only if (!$me || $me->id != $userId) { $listsQuery = $listsQuery->approved(); } return View::make('users.profile')->with(['user' => $user, 'lists' => $listsQuery->latest()->simplePaginate(ListController::getPerPageLimit()), 'listsCount' => $user->lists()->count(), 'showListItemStatus' => true]); } catch (Illuminate\Database\Eloquent\ModelNotFoundException $e) { return Response::notFound(); } }
public function previewOgImage() { $imageObject = Image::make(public_path('images/sample-og-image.jpg')); $userImage = public_path('images/sample-profile-pic.jpg'); ListController::processImageWithCredits($imageObject, $userImage, "John Doe"); // create response and add encoded image data $response = Response::make($imageObject->encode('jpg')); // set content-type $response->header('Content-Type', 'image/png'); // output return $response; }
function search($arr) { $kt =& $this->KT; $listing = processSearchExpression("(GeneralText contains \"" . $arr['query'] . "\")"); $result = ListController::_processListing($listing, 'search', $arr); if (!count($result)) { $result[] = array('text' => $this->xlate("No results found"), 'id' => ($listing[$i]['item_type'] == 'F' ? $listing[$i]['item_type'] . "_" : "") . $listing[$i]['id'], 'leaf' => true, 'relevance' => 0, 'qtip' => $this->xlate("Please retry your search")); } else { $result = array_slice($result, 0, 200); } $this->setResponse($result); return true; }