本文整理汇总了PHP中View::loadHelper方法的典型用法代码示例。如果您正苦于以下问题:PHP View::loadHelper方法的具体用法?PHP View::loadHelper怎么用?PHP View::loadHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::loadHelper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
/**
* Lazy loads helpers. Provides access to deprecated request properties as well.
*
* @param string $name Name of the property being accessed.
* @return mixed Helper or property found at $name
*/
public function __get($name)
{
if (isset($this->_helperMap[$name]) && !isset($this->{$name})) {
$settings = array_merge((array) $this->_helperMap[$name]['settings'], array('enabled' => false));
$this->{$name} = $this->_View->loadHelper($this->_helperMap[$name]['class'], $settings);
}
if (isset($this->{$name})) {
return $this->{$name};
}
switch ($name) {
case 'base':
case 'here':
case 'webroot':
case 'data':
return $this->request->{$name};
case 'action':
return isset($this->request->params['action']) ? $this->request->params['action'] : '';
case 'params':
return $this->request;
}
}
示例2: getMediaURL
function getMediaURL()
{
$id = $this->request->query('user_id');
$this->loadModel('User');
$user = $this->User->findById($id);
$view = new View($this);
$avatar = $view->loadHelper('Avatar');
$img = $avatar->getMediaLink($user, array('size' => 'thumb300x150'));
echo json_encode($img);
exit;
}
示例3: View
function ajax_upcoming()
{
$this->layout = 'ajax';
$view = new View($this);
$tz = $view->loadHelper('Tmzone');
$today = $tz->GetDateTime(SES_TIMEZONE, TZ_GMT, TZ_DST, TZ_CODE, GMT_DATETIME, "date");
$this->set('today', $today);
if (!empty($this->params['data']['projid'])) {
$getUpcoming = $this->User->getUpcoming($this->params['data']['projid'], $today, $this->params['data']['type']);
$this->set('nextdue', $getUpcoming);
}
}
示例4: taskDownload
/**
* @method public taskDownload() Create downloadable folder which will contain a .csv File and a Folder containg all the Attachment
* @return string Returns the downloadable URL
* @author GDR<support@Orangescrum.com>
*/
function taskDownload()
{
if (!is_dir(DOWNLOAD_TASK_PATH)) {
mkdir(DOWNLOAD_TASK_PATH, 0777, true);
}
if (!is_dir(DOWNLOAD_TASK_PATH . "zipTask")) {
mkdir(DOWNLOAD_TASK_PATH . "zipTask", 0777, true);
}
$caseUniqId = $this->data['caseUid'];
//$caseUniqId = '8d082f712782302aafe8a62129f7cc24';
$this->layout = 'ajax';
$sorting = '';
$ProjId = NULL;
$ProjName = NULL;
$curCaseNo = NULL;
$curCaseId = NULL;
######## get case number from case uniq ID ################
$getCaseNoPjId = $this->Easycase->getEasycase($caseUniqId);
if ($getCaseNoPjId) {
$curCaseNo = $getCaseNoPjId['Easycase']['case_no'];
$curCaseId = $getCaseNoPjId['Easycase']['id'];
$prjid = $getCaseNoPjId['Easycase']['project_id'];
$is_active = intval($getCaseNoPjId['Easycase']['isactive']) ? 1 : 0;
} else {
//No task with uniq_id $caseUniqId
die;
}
######## Checking user_project ################
$this->loadModel('ProjectUser');
$cond1 = array('conditions' => array('ProjectUser.user_id' => SES_ID, 'ProjectUser.company_id' => SES_COMP, 'Project.isactive' => 1, 'Project.id' => $prjid), 'fields' => array('DISTINCT Project.id', 'Project.uniq_id', 'Project.name', 'Project.short_name'));
$this->ProjectUser->unbindModel(array('belongsTo' => array('User')));
$getProjId = $this->ProjectUser->find('first', $cond1);
if ($getProjId) {
$ProjId = $getProjId['Project']['id'];
$projUniqId = $getProjId['Project']['uniq_id'];
$ProjName = $getProjId['Project']['name'];
$projShorName = $getProjId['Project']['short_name'];
} else {
//Session user not assigned the project $prjid
die;
}
$sqlcasedata = array();
$getPostCase = array();
if ($ProjId && $curCaseNo) {
//$getPostCase = $this->Easycase->query("SELECT Easycase.*, User1.name AS created_by , User2.name as updated_by , User3.name AS Assigned_to FROM easycases as Easycase LEFT JOIN users User1 ON Easycase.user_id=User1.id LEFT JOIN users User2 ON Easycase.updated_by= User2.id LEFT JOIN users User3 ON Easycase.assign_to= User3.id WHERE Easycase.project_id='".$ProjId."' AND Easycase.case_no=".$curCaseNo." AND (Easycase.legend !=6) ORDER BY Easycase.actual_dt_created ASC");
$getPostCase = $this->Easycase->query("SELECT Easycase.*, User1.name AS created_by , User2.name as updated_by , User3.name AS Assigned_to FROM easycases as Easycase LEFT JOIN users User1 ON Easycase.user_id=User1.id LEFT JOIN users User2 ON Easycase.updated_by= User2.id LEFT JOIN users User3 ON Easycase.assign_to= User3.id WHERE Easycase.project_id='" . $ProjId . "' AND Easycase.case_no=" . $curCaseNo . " AND (Easycase.istype='1' OR Easycase.legend !=6) ORDER BY Easycase.actual_dt_created ASC");
$estimated_hours = isset($getPostCase['0']['Easycase']) && !empty($getPostCase['0']['Easycase']) ? $getPostCase['0']['Easycase']['estimated_hours'] : '0.0';
$getHours = $this->Easycase->query("SELECT SUM(hours) as hours FROM easycases as Easycase WHERE project_id='" . $ProjId . "' AND case_no=" . $curCaseNo . " AND reply_type=0");
$hours = $getHours[0][0]['hours'];
// $getcompletedtask = $this->Easycase->query("SELECT completed_task FROM easycases as Easycase WHERE project_id='".$ProjId."' AND case_no=".$curCaseNo." and completed_task != 0 ORDER BY id DESC LIMIT 1");
// $completedtask = $getcompletedtask[0]['Easycase']['completed_task'];
} else {
//$ProjId and $curCaseNo not found. This step should not, b'cos it handeled previously.
die;
}
$view = new View();
$cq = $view->loadHelper('Casequery');
$frmt = $view->loadHelper('Format');
$curdt = date('F_dS_Y', time());
$filename = strtoupper($projShorName) . '_TASK_' . $curCaseNo . "_" . $curdt . '.csv';
//$filename = $ProjName . "_#".$curCaseNo."_" . date("mdY", time()).'.csv';
$folder_name = strtoupper($projShorName) . '_TASK_' . $curCaseNo . "_" . $curdt;
if (file_exists(DOWNLOAD_TASK_PATH . $folder_name)) {
@chmod(DOWNLOAD_TASK_PATH . $folder_name . "/attachments", 0777);
@array_map('unlink', glob(DOWNLOAD_TASK_PATH . $folder_name . "/attachments/*"));
@rmdir(DOWNLOAD_TASK_PATH . $folder_name . '/attachments');
@array_map('unlink', glob(DOWNLOAD_TASK_PATH . $folder_name . "/*"));
$isdel = rmdir(DOWNLOAD_TASK_PATH . $folder_name);
}
mkdir(DOWNLOAD_TASK_PATH . $folder_name, 0777, true);
$file = fopen(DOWNLOAD_TASK_PATH . $folder_name . '/' . $filename, "w");
$csv_output = "Title, Description, Status, Priority, Task Type, Assigned To, Created By, Last Updated By, Created On, Estimated Hours, Hours Spent";
fputcsv($file, explode(',', $csv_output));
foreach ($getPostCase as $key => $case_list) {
$status = '';
$priority = '';
$tasktype = '';
$taskTitle = '';
//if(!$key) {
if (isset($case_list['Easycase']['title']) && $case_list['Easycase']['title']) {
$taskTitle = $case_list['Easycase']['title'];
}
$status = $this->Format->displayStatus($case_list['Easycase']['legend']);
if ($case_list['Easycase']['priority'] == 2) {
$priority = 'Low';
} elseif ($case_list['Easycase']['priority'] == 1) {
$priority = 'Medium';
} elseif ($case_list['Easycase']['priority'] == 0) {
$priority = 'High';
}
$types = $cq->getTypeArr($case_list['Easycase']['type_id'], $GLOBALS['TYPE']);
if (count($types)) {
$tasktype = $types['Type']['name'];
}
//}
//.........这里部分代码省略.........
示例5: UsermgmtInIt
function UsermgmtInIt(&$controller)
{
/*
setting default time zone for your site
*/
date_default_timezone_set("America/New_York");
App::import('View', 'View');
$view = new View($controller);
$html = $view->loadHelper('Html');
/*
setting site url
do not edit it
if you want to edit then for example
define("SITE_URL", "http://example.com/");
*/
define("SITE_URL", $html->url('/', true));
/*
set true if new registrations are allowed
*/
define("siteRegistration", true);
/*
set true if you want send registration mail to user
*/
define("sendRegistrationMail", true);
/*
set true if you want verify user's email id, site will send email confirmation link to user's email id
sett false you do not want verify user's email id, in this case user becomes active after registration with out email verification
*/
define("emailVerification", true);
/*
set email address for sending emails
*/
define("emailFromAddress", 'example@example.com');
/*
set site name for sending emails
*/
define("emailFromName", 'User Management Plugin');
/*
set login redirect url, it means when user gets logged in then site will redirect to this url.
*/
define("loginRedirectUrl", '/dashboard');
/*
set logout redirect url, it means when user gets logged out then site will redirect to this url.
*/
define("logoutRedirectUrl", '/login');
/*
set true if you want to enable permissions on your site
*/
define("PERMISSIONS", true);
/*
set true if you want to check permissions for admin also
*/
define("ADMIN_PERMISSIONS", false);
/*
set default group id here for registration
*/
define("defaultGroupId", 2);
/*
set Admin group id here
*/
define("ADMIN_GROUP_ID", 1);
/*
set Guest group id here
*/
define("GUEST_GROUP_ID", 3);
Cache::config('UserMgmt', array('engine' => 'File', 'duration' => '+3 months', 'path' => CACHE, 'prefix' => 'UserMgmt_'));
}
示例6: View
function ajax_milestonelist()
{
$this->loadModel('Easycase');
$view = new View($this);
$tz = $view->loadHelper('Tmzone');
$dt = $view->loadHelper('Datetime');
$cq = $view->loadHelper('Casequery');
$frmt = $view->loadHelper('Format');
$milestone_search = $this->params['data']['file_srch'];
$caseMenuFilters = $this->data['caseMenuFilters'];
if ($caseMenuFilters) {
setcookie('CURRENT_FILTER', $caseMenuFilters, COOKIE_REM, '/', DOMAIN_COOKIE, false, false);
} else {
setcookie('CURRENT_FILTER', $caseMenuFilters, COOKIE_REM, '/', DOMAIN_COOKIE, false, false);
}
$data = $this->Easycase->ajax_milestonelist($this->data, $frmt, $dt, $tz, $cq, $milestone_search);
$this->set('resCaseProj', json_encode($data));
}
示例7: startTest
function startTest()
{
$this->View = new View(null);
$this->TwitterGoodies = $this->View->loadHelper('TwitterKit.TwitterGoodies');
}
示例8: testMagicGet
/**
* Test __get allowing access to helpers.
*
* @return void
*/
public function testMagicGet()
{
$View = new View($this->PostsController);
$View->loadHelper('Html');
$this->assertInstanceOf('HtmlHelper', $View->Html);
}
示例9: preview
public function preview()
{
$this->autoRender = false;
if ($this->request->is('post') || $this->request->is('ajax')) {
$view = new View($this);
$markdown = $view->loadHelper('Markdown');
return json_encode(array('preview' => $markdown->parse($this->request->data['Preview'])));
}
return json_encode(array('preview' => 'no dice'));
}
示例10: login
function login()
{
if ($this->Session->check('mobile_user') && intval($this->Session->read('mobile_user'))) {
$this->layout = 'mobile';
$this->view = 'mobile_login';
} else {
$this->layout = 'register';
}
if (!empty($this->request->data)) {
if ($this->Auth->login()) {
if ($this->Auth->user('is_activated')) {
if ($this->Auth->user('type') == USER_TYPE_TENANT) {
if ($this->Auth->user('property_id') > 0) {
// If property no longer active, then we must redirect
$this->loadModel('Property');
$this->Property->contain();
$userProp = $this->Property->findById($this->Auth->user('property_id'));
if ($userProp['Property']['active'] == 0) {
$this->redirect(array('controller' => 'Users', 'action' => 'propertydisabled', $this->User->id));
}
} else {
/*
* If active user with no property_id they must have been removed from property
*/
$this->Session->setFlash('You are no longer assigned to a property. Please request a new property now.', 'flash_bad');
$redir_id = $this->Auth->User('id');
$this->Auth->logout();
$this->redirect(array('controller' => 'Users', 'action' => 'residentsearch', Security::cipher($redir_id, Configure::read('Security.salt2'))));
}
}
$this->redirect($this->Auth->redirect());
} elseif (!$this->Auth->user('is_activated') && $this->Auth->user('invitebyemail')) {
$this->User->id = $this->Auth->user('id');
$this->User->saveField('is_activated', true);
/*
* Update the unit to occupied after the invite is sent.
*/
if ($this->Auth->user('unit_id') > 0) {
$this->loadModel('Unit');
$this->Unit->id = $this->Auth->user('unit_id');
$this->Unit->saveField('occupied', 'Yes');
}
$this->redirect($this->Auth->redirect());
} else {
$view = new View($this);
$html = $view->loadHelper('Html');
$resendLink = $html->link('Click Here', array('controller' => 'Users', 'action' => 'resendactivation', $this->Auth->user('id')));
/*
* previoustenant field can have following values
* - 0 not a previous tenant
* - 1 a previous tenant
* - 2 a previous tenant awaiting a new activation
*/
if ($this->Auth->user('previoustenant') == 1 && $this->Auth->user('type') == USER_TYPE_TENANT) {
/*
* Previous tenant, currently inactive, who is trying to log back in - so need to send
* to page 2 of the tenant sign up process
*/
$data = array();
$data['User']['id'] = $this->Auth->User('id');
/* Set to 2 so we can differentiate - i.e. know they came through this way already */
//$data['User']['previoustenant'] = '2';
$data['User']['property_id'] = '0';
$data['User']['unit_id'] = '0';
$data['User']['requested_unit'] = '0';
$data['User']['activation_key'] = $this->User->genActivationHash();
$this->User->set($data);
if ($this->User->save($data, true, array('requested_unit', 'activation_key', 'property_id', 'unit_id'))) {
//debug($data);
$redir_id = $this->Auth->User('id');
$this->Auth->logout();
$this->redirect(array('controller' => 'Users', 'action' => 'residentsearch', Security::cipher($redir_id, Configure::read('Security.salt2'))));
} else {
$this->Session->setFlash('Error Signing Up. Please contact system admin.', 'flash_bad');
}
} else {
$this->Auth->logout();
$this->Session->setFlash('Sorry, your account is not yet activated.', 'flash_bad');
$this->redirect($this->Auth->redirect());
}
}
} else {
$this->Session->setFlash('Invalid username or password.', 'flash_bad');
}
}
}
示例11: getResponse
/**
* returns dataTables compatible array - just json_encode the resulting aray
* @param object $controller optional
* @param object $model optional
* @return array
*/
public function getResponse($controller = null, $model = null)
{
/**
* it is no longer necessary to pass in a controller or model
* this is handled in the initialize method
* $controller is disregarded.
* $model is only necessary if you are using a model from a different controller such as if you are in
* a CustomerController but your method is displaying data from an OrdersModel.
*/
if ($model != null) {
if (is_string($model)) {
$this->model = $this->controller->{$model};
} else {
$this->model = $model;
unset($model);
}
}
$conditions = isset($this->controller->paginate['conditions']) ? $this->controller->paginate['conditions'] : null;
$isFiltered = false;
if (!empty($conditions)) {
$isFiltered = true;
}
// check for ORDER BY in GET request
if (isset($this->controller->request->query) && isset($this->controller->request->query['iSortCol_0'])) {
$orderBy = $this->getOrderByStatements();
if (!empty($orderBy)) {
$this->controller->paginate = array_merge($this->controller->paginate, array('order' => $orderBy));
}
}
// check for WHERE statement in GET request
if (isset($this->controller->request->query) && !empty($this->controller->request->query['sSearch'])) {
$conditions = $this->getWhereConditions();
if (!empty($this->controller->paginate['contain'])) {
$this->controller->paginate = array_merge_recursive($this->controller->paginate, array('contain' => $conditions));
} else {
$this->controller->paginate = array_merge_recursive($this->controller->paginate, array('conditions' => $conditions));
}
$isFiltered = true;
}
// @todo avoid multiple queries for finding count, maybe look into "SQL CALC FOUND ROWS"
// get full count
$total = $this->model->find('count');
$parameters = $this->controller->paginate;
if ($isFiltered) {
$filteredTotal = $this->model->find('count', $parameters);
}
$limit = '';
// set sql limits
if (isset($this->controller->request->query['iDisplayStart']) && $this->controller->request->query['iDisplayLength'] != '-1') {
$start = $this->controller->request->query['iDisplayStart'];
$length = $this->controller->request->query['iDisplayLength'];
$parameters['limit'] = $limit = "{$start},{$length}";
}
// execute sql select
//debug($parameters);
$data = $this->model->find('all', $parameters);
//debug($data);
// dataTables compatible array
$response = array('sEcho' => isset($this->controller->request->query['sEcho']) ? intval($this->controller->request->query['sEcho']) : 1, 'iTotalRecords' => $total, 'iTotalDisplayRecords' => $isFiltered === true ? $filteredTotal : $total, 'aaData' => array());
// return data
if (!$data) {
return $response;
} else {
// failsafe for null records...
if ($data[0][$this->model->name]["id"] == null) {
return $response;
}
$count = 0;
foreach ($data as $i) {
$tmp = $this->getDataRecursively($i);
if ($this->emptyElements > 0) {
$tmp = array_pad($tmp, count($tmp) + $this->emptyElements, '');
}
$response['aaData'][$count] = array_values($tmp);
if (!empty($this->showActions)) {
$view = new View($this->controller);
$html = $view->loadHelper('Html');
$id = $response['aaData'][$count][$this->showActions["idCol"]];
$actions = "";
if (!empty($this->showActions["oppty"])) {
$actions = $actions . $html->link('<i></i>', array('controller' => 'quotes', 'action' => 'add', "0", "0", $id, "0"), array('escape' => false, 'class' => 'glyphicons coins qtips', 'data-title' => 'Generar Cotizacion'));
}
if (!empty($this->showActions["quote"])) {
$actions = $actions . $html->link('<i></i>', array('controller' => 'Orders', 'action' => 'add', "0", "0", $id, "Quote"), array('escape' => false, 'class' => 'glyphicons shopping_cart qtips', 'data-title' => 'Generar Pedido'));
$actions = $actions . $html->link('<i></i>', array('controller' => 'quotes', 'action' => 'viewPdf', $id), array('escape' => false, 'class' => 'glyphicons file qtips', 'data-title' => 'Generar PDF', 'target' => '_blank'));
}
if (!empty($this->showActions["order"])) {
$actions = $actions . $html->link('<i></i>', array('controller' => 'invoices', 'action' => 'add', "0", $id), array('escape' => false, 'class' => 'glyphicons usd qtips', 'data-title' => 'Generar Factura'));
}
//$actions = $actions . $html->link('<i></i>', array('action' => 'edit', $id ), array('escape' => false, 'class'=>'glyphicons pencil qtips','data-title'=>'Editar'));
$actions = $actions . $html->link('<i></i>', array('action' => 'delete', $id), array('escape' => false, 'class' => 'glyphicons bin qtips', 'data-title' => 'Cancelar'), __('Estas seguro de cancelar el registro # %s?', $id));
$response['aaData'][$count][] = $actions;
}
if ($this->columnsStyle) {
//.........这里部分代码省略.........
示例12: getmenus
/**
* menus
*
* @return void
* @author apple
**/
function getmenus($type = 'vmenu', $id = '', $router = 0)
{
$baseURL = Router::url("/admin/wc/{$id}/");
$menu = array('hmenu' => array("我的工作台" => array('url' => "", 'icon' => "icon-desktop", 'child' => array('网站信息' => array('url' => Router::url(array('controller' => "admin", 'action' => "wBasic")), 'icon' => "icon-double-angle-right", 'FIsAdmin' => 1), '基本信息' => array('url' => Router::url(array('controller' => "admin", 'action' => "basic")), 'icon' => "icon-double-angle-right"), '公众账号管理' => array('url' => Router::url(array('controller' => "admin", 'action' => "index")), 'icon' => "icon-double-angle-right", 'action' => array('添加公众账号' => array('url' => Router::url(array('controller' => "admin", 'action' => "webchatAdd")), 'icon' => "icon-double-angle-right"), '编辑公众账号' => array('url' => Router::url(array('controller' => "admin", 'action' => "webchatEdit")), 'icon' => "icon-double-angle-right"))), '修改密码' => array('url' => Router::url(array('controller' => "admin", 'action' => "repwd")), 'icon' => "icon-double-angle-right")), 'open' => 1, 'active' => 1)), 'vmenu' => array("工作台" => array('url' => "{$baseURL}center", 'icon' => "icon-dashboard", 'FIsActive' => 0), "系统设置" => array('url' => "", 'icon' => "icon-desktop", 'child' => array('账号设置' => array('url' => "{$baseURL}sAroz", 'icon' => "icon-double-angle-right"), '默认设置' => array('url' => "{$baseURL}bCtg", 'icon' => "icon-double-angle-right"))), "自动回复" => array('url' => "", 'icon' => "icon-edit", 'child' => array('被关注回复' => array('url' => "{$baseURL}bFllow", 'icon' => "icon-double-angle-right"), '无匹配回复' => array('url' => "{$baseURL}bMch", 'icon' => "icon-double-angle-right"), '关键字回复' => array('url' => "{$baseURL}bKds", 'icon' => "icon-double-angle-right"), 'LBS回复' => array('FIsActive' => 0, 'url' => "{$baseURL}bLbs", 'icon' => "icon-double-angle-right"))), "高级设置" => array('url' => "", 'icon' => "icon-cogs", 'child' => array('自定义菜单' => array('url' => "{$baseURL}sMenu", 'icon' => "icon-double-angle-right"), '二维码营销' => array('url' => "{$baseURL}sCode", 'icon' => "icon-double-angle-right"), '语音识别' => array('url' => "{$baseURL}sVoice", 'icon' => "icon-double-angle-right"), '粉丝管理' => array('url' => "{$baseURL}sFans", 'icon' => "icon-double-angle-right"), '微客服' => array('url' => "{$baseURL}sCuts", 'icon' => "icon-double-angle-right")), 'FIsActive' => 0), "素材库" => array('url' => "", 'icon' => "icon-picture", 'child' => array('文本' => array('url' => "{$baseURL}mTxt", 'icon' => "icon-double-angle-right", 'FIsActive' => 0), '图文' => array('url' => "{$baseURL}mPic", 'icon' => "icon-double-angle-right"), '图片' => array('url' => "{$baseURL}mPic", 'icon' => "icon-double-angle-right", 'FIsActive' => 0), '语音' => array('url' => "{$baseURL}mPic", 'icon' => "icon-double-angle-right", 'FIsActive' => 0), '图文集' => array('url' => "{$baseURL}mPicGary", 'icon' => "icon-double-angle-right", 'FIsActive' => 0), '幻灯片' => array('url' => "{$baseURL}mSlide", 'icon' => "icon-double-angle-right", 'FIsActive' => 0), '多媒体文件' => array('url' => "{$baseURL}mFile", 'icon' => "icon-double-angle-right", 'FIsActive' => 0))), "自定义菜单" => array('url' => "", 'icon' => "icon-list", 'child' => array('菜单设置' => array('url' => "{$baseURL}mFields", 'icon' => "icon-double-angle-right"))), "互动应用" => array('url' => "", 'icon' => "icon-hdd", 'FIsActive' => 0, 'child' => array('智能机器人' => array('url' => "{$baseURL}hRobot", 'icon' => "icon-double-angle-right"), '应用中心' => array('url' => "{$baseURL}hApp", 'icon' => "icon-double-angle-right"))), "统计" => array('url' => "", 'icon' => "icon-list-alt", 'child' => array('用户分析' => array('url' => "{$baseURL}sUser", 'icon' => "icon-double-angle-right"), '消息分析' => array('url' => "{$baseURL}sMsg", 'icon' => "icon-double-angle-right"), '图文分析' => array('url' => "{$baseURL}sImtxt", 'icon' => "icon-double-angle-right")), 'FIsActive' => 0), "我的APP" => array('url' => "", 'icon' => "icon-laptop", 'child' => array('APP设置' => array('url' => "{$baseURL}aSet", 'icon' => "icon-double-angle-right"), '应用模板' => array('url' => "{$baseURL}aLayout", 'icon' => "icon-double-angle-right"), '自定义模块' => array('url' => "{$baseURL}aMods", 'icon' => "icon-double-angle-right"), 'DIY界面' => array('url' => "{$baseURL}aDiyAps", 'icon' => "icon-double-angle-right"), '绑定域名' => array('url' => "{$baseURL}aDomain", 'icon' => "icon-double-angle-right"), '第三方组件' => array('url' => "{$baseURL}aCmet", 'icon' => "icon-double-angle-right")), 'FIsActive' => 0)));
$view = new View();
$main = $view->loadHelper('Main');
$vmenu = $main->menuSearch($menu[$type], $type, $router);
return $vmenu;
}
示例13: exportCSV
public function exportCSV(Model $Model, $data = array(), $return = false)
{
$debug = 0;
if (array_key_exists('fileName', $data)) {
$fileName = $data['fileName'];
}
if (array_key_exists('fieldNames', $data)) {
$fieldNames = $data['fieldNames'];
}
if (array_key_exists('data', $data)) {
$fieldData = $data['data'];
}
if (array_key_exists('title', $data)) {
$title = $data['title'];
}
if (!isset($fieldNames) || !isset($data)) {
die('error: p');
}
if (!isset($fileName)) {
$fileName = $Model->alias;
$nowTime = time();
$nowTime = date('Y-m-d H:i:s');
$fileName .= ' - ' . $nowTime;
}
if (!$debug) {
$view = new View($Model->controller);
}
if (!$debug) {
$csv = $view->loadHelper('Csv');
}
if (!$debug) {
$csv->newCsv($fileName . '.csv', $return);
}
if (isset($title)) {
foreach ($title as $key => $value) {
if (!$debug) {
$csv->setRow($value);
}
}
if (!$debug) {
$csv->setRow(array(''));
}
}
if (!$debug) {
$csv->setRow(array_values($fieldNames));
}
$keys = array_keys($fieldNames);
foreach ($keys as $i => $key) {
$keys[$i] = explode('.', $key);
}
foreach ($fieldData as $data) {
$row = array();
foreach ($keys as $key) {
$model = $key[0];
$field = $key[1];
$row[] = $data[$model][$field];
}
if (!$debug) {
$csv->setRow($row);
}
}
if ($return) {
return $csv->get_file_contents();
}
if (!$debug) {
$csv->output();
}
exit;
}
示例14: moreconversation
public function moreconversation()
{
if ($this->Session->read('user.id') == '') {
$this->redirect(array('controller' => 'user', 'action' => 'login'));
}
$this->autoRender = false;
$start = 0;
$end = $this->showMoreDisplay();
$listConversation = $this->Message->conversationListing($this->Session->read('user.id'), $start, $end, $this->sanitize($this->request->data['id']));
$html = '';
$conversation = array();
$endId = 0;
$view = new View($this);
$htmlHelper = $view->loadHelper('Html');
foreach ($listConversation as $ck => $cv) {
$endId = $cv['message']['id'];
$thisConversation = array();
$thisConversation['content'] = $this->desanitize($cv['message']['content']);
$thisConversation['created'] = $cv['message']['created'];
$thisConversation['message_id'] = $cv['message']['id'];
if ($this->Session->read('user.id') != $cv['message']['from_id']) {
$thisConversation['id'] = $cv['message']['from_id'];
$thisConversation['name'] = $cv['from_users']['from_users_name'];
$thisConversation['image'] = $cv['from_users']['from_users_image'];
if ($thisConversation['image'] == '') {
$thisConversation['image'] = 'user.png';
}
} else {
$thisConversation['id'] = $cv['message']['to_id'];
$thisConversation['name'] = $cv['to_users']['to_users_name'];
$thisConversation['image'] = $cv['to_users']['to_users_image'];
if ($thisConversation['image'] == '') {
$thisConversation['image'] = 'user.png';
}
}
$html .= '<div id="conversation-' . $thisConversation['message_id'] . '">';
$html .= '<table>';
$html .= '<tr>';
$html .= '<td class="conversation-profile-picture profile-picture-display">';
$html .= '<a href="' . $htmlHelper->url(array('controller' => 'user', 'action' => 'profile', $thisConversation['id']), true) . '">';
$html .= $htmlHelper->image($thisConversation['image'], array('width' => '128', 'height' => '128'));
$html .= '</a>';
$html .= '</td>';
$html .= '<td class="conversation-details">';
$html .= '<a href="' . $htmlHelper->url(array('controller' => 'message', 'action' => 'details', $thisConversation['message_id']), true) . '">';
$html .= '<div class="conversation-message">' . $thisConversation['content'] . '</div>';
$html .= '</a>';
$html .= '<div>';
$html .= '<div class="conversation-delete"><a class="link-conversation-delete" data-id="' . $thisConversation['message_id'] . '" href="javascript:;">Delete</a></div>';
$html .= '<div class="conversation-date">' . date('Y/m/d H:i', strtotime($thisConversation['created'])) . '</div>';
$html .= '</div>';
$html .= '</td>';
$html .= '</tr>';
$html .= '</table>';
$html .= '</div>';
}
$this->response->type('json');
echo json_encode(array('status' => $html != '' ? true : false, 'html' => $html, 'id' => $endId));
}
示例15: startTest
function startTest()
{
$View = new View(null);
$this->Twitter = $View->loadHelper('TwitterKit.Twitter');
}