当前位置: 首页>>代码示例>>PHP>>正文


PHP Widgets::getWidgets方法代码示例

本文整理汇总了PHP中Widgets::getWidgets方法的典型用法代码示例。如果您正苦于以下问题:PHP Widgets::getWidgets方法的具体用法?PHP Widgets::getWidgets怎么用?PHP Widgets::getWidgets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Widgets的用法示例。


在下文中一共展示了Widgets::getWidgets方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addAction

 public function addAction()
 {
     // Get, check and setup the parameters
     $prefix = $this->getRequest()->getParam("widget");
     // Is the widget available
     $widgets = new Widgets();
     $available = $widgets->getAvailableWidgets();
     if (!isset($available[$prefix])) {
         return;
     }
     // Add the widget
     $widget_id = $widgets->addWidget($prefix);
     $widget = $widgets->getWidget($widget_id);
     // Find the widget position
     $total = count($widgets->getWidgets());
     // Set the position
     $widgets->setPosition($widget_id, $total);
     // Return the new widget
     $this->view->widget = $widget;
 }
开发者ID:kreativmind,项目名称:storytlr,代码行数:20,代码来源:WidgetsController.php

示例2: foreach

$files = $fdb->getFiles();
if ($files && count($files) > 0) {
    foreach ($files as $file) {
        $fdb->deleteFile($file->key);
    }
}
// Delete all stories
$stdb = new Stories();
$stories = $stdb->getStories();
if ($stories && count($stories) > 0) {
    foreach ($stories as $story) {
        $stdb->deleteStory($story['id']);
    }
}
// Delete all widgets
$wdb = new Widgets();
$widgets = $wdb->getWidgets();
if ($widgets && count($widgets) > 0) {
    foreach ($widgets as $widget) {
        $wdb->deleteWidget($widget['id']);
    }
}
// Delete all properties
$up = new Properties(array(Properties::KEY => $user->id));
$up->deleteAllProperties();
$wp = new WidgetsProperties(array(Properties::KEY => $user->id));
$wp->deleteAllProperties();
// Delete the user
$udb->deleteUser($user->id);
// Exit with proper message
die("User {$user->username} has been deleted.\r\n");
开发者ID:kreativmind,项目名称:storytlr,代码行数:31,代码来源:delete.php

示例3: common

 protected function common()
 {
     // Set the timezone to the user timezone
     $timezone = $this->_properties->getProperty('timezone');
     date_default_timezone_set($timezone);
     // Assgin a different layout if embedded
     if ($this->_embed) {
         if ($this->_embed == 'page') {
             $this->_helper->layout->setlayout('embed_page');
         } else {
             $this->_helper->layout->disableLayout();
         }
     }
     // Fetch the user configured widgets
     if (!$this->_embed) {
         $w = new Widgets();
         $this->view->widgets = $w->getWidgets($this->_user->id);
     }
     // User provided footer (e.g. tracker)
     $user_footer = $this->_properties->getProperty('footer');
     $this->view->user_footer = $user_footer;
     // Javascript
     $this->view->headScript()->appendFile('js/prototype/prototype.js');
     $this->view->headScript()->appendFile('js/scriptaculous/builder.js');
     $this->view->headScript()->appendFile('js/scriptaculous/builder.js');
     $this->view->headScript()->appendFile('js/scriptaculous/effects.js');
     $this->view->headScript()->appendFile('js/scriptaculous/dragdrop.js');
     $this->view->headScript()->appendFile('js/scriptaculous/controls.js');
     $this->view->headScript()->appendFile('js/scriptaculous/slider.js');
     $this->view->headScript()->appendFile('js/scriptaculous/sound.js');
     $this->view->headScript()->appendFile('js/storytlr/validateForm.js');
     $this->view->headScript()->appendFile('js/storytlr/common.js');
     $this->view->headScript()->appendFile('js/controllers/adminbar.js');
     $this->view->headScript()->appendFile('js/accordion/accordion.js');
     // Meta
     $this->view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8');
     // CSS
     $this->view->headLink()->appendStylesheet('style/toolbar.css');
     $this->view->headLink()->appendStylesheet('themes/' . $this->_properties->getProperty('theme') . '/style.css');
     // Colors
     $colors = $this->_properties->getProperties(array("color_title", "color_subtitle", "color_sidebar_border", "color_background", "color_link", "color_sidebar_text", "color_sidebar_header"));
     $this->view->colors = $colors;
     // Error and status messages
     $this->view->status_messages = $this->getStatusMessages();
     $this->view->error_messages = $this->getErrorMessages();
     // User details
     $this->view->username = $this->_user->username;
     $this->view->user_id = $this->_user->id;
     $this->view->admin = $this->_admin;
     // Theme
     $themes = Themes::getAvailableThemes();
     $theme = $this->_properties->getProperty('theme');
     $this->view->theme = $theme;
     $this->view->theme_data = $themes[$theme];
     // Pages
     $pages = new Pages();
     $this->view->pages = $pages->getPages();
     // Page layout
     $this->view->background_image = $this->_properties->getProperty('background_image');
     $this->view->header_image = $this->_properties->getProperty('header_image');
     $this->view->has_colors = $this->_properties->getProperty('has_colors');
     $this->view->css_enabled = $this->_properties->getProperty('css_enabled');
     $this->view->css_content = $this->_properties->getProperty('css_content');
     $this->view->title = $this->_properties->getProperty('title');
     $this->view->subtitle = $this->_properties->getProperty('subtitle');
     $this->view->disqus = $this->_properties->getProperty('disqus');
     $this->view->googlefc = $this->_properties->getProperty('googlefc');
     $this->view->footer = $this->_properties->getProperty('footer');
 }
开发者ID:segphault,项目名称:storytlr,代码行数:69,代码来源:BaseController.php


注:本文中的Widgets::getWidgets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。