本文整理汇总了PHP中Dashboard类的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard类的具体用法?PHP Dashboard怎么用?PHP Dashboard使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Dashboard类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: home
private function home()
{
if (!eval(Hooks::get('HOME'))) {
return;
}
NewVersionCheck::getNews();
$dashboard = new Dashboard($this->_siteID);
$placedRS = $dashboard->getPlacements();
$calendar = new Calendar($this->_siteID);
$upcomingEventsHTML = $calendar->getUpcomingEventsHTML(7, UPCOMING_FOR_DASHBOARD);
$calendar = new Calendar($this->_siteID);
$upcomingEventsFupHTML = $calendar->getUpcomingEventsHTML(7, UPCOMING_FOR_DASHBOARD_FUP);
/* Important cand datagrid */
$dataGridProperties = array('rangeStart' => 0, 'maxResults' => 15, 'filterVisible' => false);
$dataGrid = DataGrid::get("home:ImportantPipelineDashboard", $dataGridProperties);
$this->_template->assign('dataGrid', $dataGrid);
$dataGridProperties = array('rangeStart' => 0, 'maxResults' => 15, 'filterVisible' => false);
/* Only show a month of activities. */
$dataGridProperties['startDate'] = '';
$dataGridProperties['endDate'] = '';
$dataGridProperties['period'] = 'DATE_SUB(CURDATE(), INTERVAL 1 MONTH)';
$dataGrid2 = DataGrid::get("home:CallsDataGrid", $dataGridProperties);
$this->_template->assign('dataGrid2', $dataGrid2);
$this->_template->assign('active', $this);
$this->_template->assign('placedRS', $placedRS);
$this->_template->assign('upcomingEventsHTML', $upcomingEventsHTML);
$this->_template->assign('upcomingEventsFupHTML', $upcomingEventsFupHTML);
$this->_template->assign('wildCardQuickSearch', '');
$this->_template->display('./modules/home/Home.tpl');
}
示例2: initForUser
public static function initForUser($id)
{
foreach (array('Salon', 'Cuisine', 'Chambre', 'Garage', 'Système') as $room) {
$entity = new Dashboard();
$entity->create();
$entity->user = $id;
$entity->label = $room;
$entity->default = 0;
$entity->save();
}
$entity = new Dashboard();
$entity->create();
$entity->user = $id;
$entity->label = "Général";
$entity->default = 1;
$entity->save();
$dashboard = $entity->id;
$entity = new Widget();
$entity->create();
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_profil\', \'null\', \'0\', \'0\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_ram\', \'null\', \'0\', \'1\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_system\', \'null\', \'0\', \'2\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_network\', \'null\', \'0\', \'2\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_hdd\', \'null\', \'3\', \'1\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_disk\', \'null\', \'0\', \'1\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_gpio\', \'null\', \'1\', \'0\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_services\', \'null\', \'0\', \'2\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_users\', \'null\', \'0\', \'0\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_ram\', \'null\', \'0\', \'1\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_vocal\', \'null\', \'1\', \'2\', \'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("model", "data", "cell", "column", "minified","dashboard") VALUES (\'dash_monitoring_logs\', \'null\', \'1\', \'2\', \'\',\'' . $dashboard . '\');');
return $dashboard;
}
示例3: Index
public function Index()
{
$dashboard = new Dashboard();
$quick_links = new StaticContentEGlet(new SimpleRenderer());
$quick_links->setTemplate('eglets/admin_quick_links.tpl');
$dashboard->addEGlet('Quick Links', $quick_links);
$this->view->register('dashboard', $dashboard);
}
示例4: testRenderWithOneWidget
public function testRenderWithOneWidget()
{
$kernelMock = $this->mockFactory->getKernelMock();
$kernelMock->expects($this->any())->method('getConfig')->will($this->returnValue(array('widgets' => array(array('name' => 'test')), 'template' => 'test')));
$kernelMock->expects($this->once())->method('findFileOnPath')->will($this->returnValue(__DIR__ . '/../../templates/empty.phtml'));
$widgetMock = $this->getWidgetMock($kernelMock);
$widgetProviderMock = $this->getWidgetMockProvider($kernelMock);
$widgetProviderMock->injectMock($widgetMock);
$dashboard = new Dashboard($kernelMock, $widgetProviderMock);
$dashboard->render();
}
示例5: map
/** mappatura proprietà dashboard */
public static function map(Dashboard $dashboard, array $properties)
{
if (array_key_exists('IDCLIENTE', $properties)) {
$dashboard->set_idcliente($properties['IDCLIENTE']);
}
if (array_key_exists('CODICE', $properties)) {
$dashboard->set_codice($properties['CODICE']);
}
if (array_key_exists('VALORE', $properties)) {
$dashboard->set_valore($properties['VALORE']);
}
}
示例6: filter_dashboard_dates
public function filter_dashboard_dates()
{
$data = $_POST;
$dash = new Dashboard();
$resp = new ajax_response($data['action'], true);
if ($data['dashboard_date_count'] != '') {
$resp->set_status(true);
$resp->set_data(array('dashboard_dates' => $dash->get_dashboard_data((int) $data['dashboard_date_count'])));
}
echo $resp->encode_response();
die;
}
示例7: createDashboardByNameForOwner
public static function createDashboardByNameForOwner($name, $owner)
{
$dashboard = new Dashboard();
$dashboard->name = $name;
$dashboard->layoutId = Dashboard::getNextLayoutId();
$dashboard->owner = $owner;
$dashboard->layoutType = '50,50';
// Not Coding Standard
$dashboard->isDefault = false;
$saved = $dashboard->save();
assert('$saved');
return $dashboard;
}
示例8: poll
public static function poll($polls)
{
$polls = json_decode($polls);
$_results = array();
if (is_array($polls) && count($polls) > 0) {
foreach ($polls as $i => $_poll) {
switch ($_poll->type) {
case "template":
$_results[$_poll->id] = array('type' => 'html', 'args' => Theme::make($_poll->func, array('value' => $_poll->value))->render());
break;
case "plugin":
if ($_poll->func) {
$_results[$_poll->id] = call_user_func($_poll->func, $_poll->value);
}
break;
case "check_logs":
$list = Dashboard::activity();
Session::put('usersonline_lastcheck', time());
$_results[$_poll->id] = array('type' => 'function', 'func' => 'fnUpdateGrowler', 'args' => $list);
break;
}
}
}
return $_results;
}
示例9: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
$super = User::getByUsername('super');
Yii::app()->user->userModel = $super;
//Setup test data owned by the super user.
$account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount2', $super);
ContactTestHelper::createContactWithAccountByNameForOwner('superContact', $super, $account);
ContactTestHelper::createContactWithAccountByNameForOwner('superContact2', $super, $account);
OpportunityTestHelper::createOpportunityStagesIfDoesNotExist();
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp2', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp3', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp4', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp5', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp6', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp7', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp8', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp9', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp10', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp11', $super, $account);
OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp12', $super, $account);
//Setup default dashboard.
Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
}
示例10: __construct
public function __construct()
{
// use \Podlove\Podcast_Post_Type::SETTINGS_PAGE_HANDLE to replace
// default first item name
Dashboard::$pagehook = add_submenu_page(\Podlove\Podcast_Post_Type::SETTINGS_PAGE_HANDLE, __('Dashboard', 'podlove'), __('Dashboard', 'podlove'), 'podlove_read_dashboard', \Podlove\Podcast_Post_Type::SETTINGS_PAGE_HANDLE, array(__CLASS__, 'page'));
$this->init_page_documentation(self::$pagehook);
add_action('load-' . Dashboard::$pagehook, function () {
// Adding the meta boxes here, so they can be filtered by the user settings.
add_action('add_meta_boxes_' . Dashboard::$pagehook, function () {
add_meta_box(Dashboard::$pagehook . '_about', __('About', 'podlove'), '\\Podlove\\Settings\\Dashboard\\About::content', Dashboard::$pagehook, 'side');
add_meta_box(Dashboard::$pagehook . '_statistics', __('At a glance', 'podlove'), '\\Podlove\\Settings\\Dashboard\\Statistics::content', Dashboard::$pagehook, 'normal');
add_meta_box(Dashboard::$pagehook . '_news', __('Podlove News', 'podlove'), '\\Podlove\\Settings\\Dashboard\\News::content', Dashboard::$pagehook, 'normal');
do_action('podlove_dashboard_meta_boxes');
if (current_user_can('administrator')) {
add_meta_box(Dashboard::$pagehook . '_validation', __('Validate Podcast Files', 'podlove'), '\\Podlove\\Settings\\Dashboard\\FileValidation::content', Dashboard::$pagehook, 'normal');
}
});
do_action('add_meta_boxes_' . Dashboard::$pagehook);
wp_enqueue_script('postbox');
wp_register_script('cornify-js', \Podlove\PLUGIN_URL . '/js/admin/cornify.js');
wp_enqueue_script('cornify-js');
});
add_action('publish_podcast', function () {
delete_transient('podlove_dashboard_stats');
});
}
示例11: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
//Setup test data owned by the super user.
//Setup default dashboard.
Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, Yii::app()->user->userModel);
}
示例12: before
public function before()
{
parent::before();
//Visits
$visited = \Cookie::get('visited', false);
if (!$visited) {
\Dashboard::log_visitor();
\Cookie::set("visited", true, time() + 86400);
}
// Cart
\Config::load('cart', true);
$cartManager = new \Cart\Manager(\Config::get('cart'));
\CartManager::init($cartManager);
\CartManager::context('Cart');
// Set Visitors group default
\Product\Model_Attribute::set_user_group(3);
\Theme::instance()->active('frontend');
\Theme::instance()->set_template($this->template);
// Set a global variable so views can use it
$seo = array('meta_title' => '', 'meta_description' => '', 'meta_keywords' => '', 'canonical_links' => '', 'meta_robots_index' => 1, 'meta_robots_follow' => 1);
\View::set_global('seo', $seo, false);
\View::set_global('theme', \Theme::instance(), false);
\View::set_global('logged', $this->check_logged(), false);
\View::set_global('guest', $this->check_guest(), false);
\View::set_global('logged_type', $this->check_logged_type(), false);
}
示例13: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
$super = User::getByUsername('super');
Yii::app()->user->userModel = $super;
//Setup test data owned by the super user.
AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount2', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount3', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount4', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount5', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount6', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount7', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount8', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount9', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount10', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount11', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount12', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount13', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount14', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount15', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount16', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount17', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount18', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount19', $super);
AccountTestHelper::createAccountByNameForOwner('superAccount20', $super);
//Setup default dashboard.
Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
}
示例14: resolveMaximumColumnsByDashboardId
/**
* Resolve maximum columns by dashboard id
* @return int
*/
private function resolveMaximumColumnsByDashboardId()
{
$dashBoard = Dashboard::getById(intval($_GET['dashboardId']));
$layoutTypes = Dashboard::getLayoutTypesData();
$dashBoardType = $layoutTypes[$dashBoard->layoutType];
$maximumColumns = substr($dashBoardType, 0, 1);
return $maximumColumns;
}
示例15: cmp
function cmp($a, $b)
{
$a = Dashboard::accessByClassName($a);
$b = Dashboard::accessByClassName($b);
$aTime = strtotime($a['item']['updated']);
$bTime = strtotime($b['item']['updated']);
return $bTime - $aTime;
}