本文整理汇总了PHP中Loader::block方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::block方法的具体用法?PHP Loader::block怎么用?PHP Loader::block使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loader
的用法示例。
在下文中一共展示了Loader::block方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
// Since we added the origfilename column in 5.0.0b1 we need to populate it
Loader::block('library_file');
$bl = new LibraryFileBlockController();
$bl->populateOriginalFilenames();
// install the new block types made available
BlockType::installBlockType('flash_content');
BlockType::installBlockType('guestbook');
BlockType::installBlockType('slideshow');
BlockType::installBlockType('search');
BlockType::installBlockType('google_map');
BlockType::installBlockType('video');
BlockType::installBlockType('rss_displayer');
BlockType::installBlockType('youtube');
BlockType::installBlockType('survey');
// rename external form
$bt = BlockType::getByHandle('custom_form');
$db = Loader::db();
$tables = $db->MetaTables('TABLES');
if (isset($tables['btCustomForm']) && !isset($tables['btExternalForm'])) {
$db->Execute("alter table btCustomForm rename btExternalForm");
}
if (is_object($bt)) {
BlockType::installBlockType('external_form', $bt->getBlockTypeID());
}
// add new theme
$th = PageTheme::getByHandle('greensalad');
if (!is_object($th)) {
PageTheme::add('greensalad');
}
}
示例2: CoreAutoload
function CoreAutoload($class)
{
$txt = Loader::helper('text');
if ($class == 'DashboardBaseController') {
Loader::controller('/dashboard/base');
}
if (strpos($class, 'BlockController') > 0) {
$class = substr($class, 0, strpos($class, 'BlockController'));
$handle = $txt->uncamelcase($class);
Loader::block($handle);
} else {
if (strpos($class, 'Helper') > 0) {
$class = substr($class, 0, strpos($class, 'Helper'));
$handle = $txt->uncamelcase($class);
$handle = preg_replace('/^site_/', '', $handle);
Loader::helper($handle);
} else {
if (strpos($class, 'AttributeType') > 0) {
$class = substr($class, 0, strpos($class, 'AttributeType'));
$handle = $txt->uncamelcase($class);
$at = AttributeType::getByHandle($handle);
}
}
}
}
示例3: __construct
public function __construct()
{
Loader::model('user_statistics');
Loader::model('page_statistics');
$u = new User();
$ui = UserInfo::getByID($u->getUserID());
$us = new UserStatistics($ui);
$this->set('uLastActivity', $us->getPreviousSessionPageViews());
$timeStr = '';
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$timeStr = '%x ' . t('at') . ' %I:%M %p';
} else {
$timeStr = '%x ' . t('at') . ' %l:%M %p';
}
$this->set('uLastLogin', strftime($timeStr, $ui->getLastLogin('user')));
$this->set('uName', $ui->getUserName());
$this->set('totalViews', PageStatistics::getTotalPageViewsForOthers($u));
$this->set('totalVersions', PageStatistics::getTotalPageVersions());
$this->set('lastEditSite', strftime($timeStr, strtotime(PageStatistics::getSiteLastEdit('user'))));
$llu = UserStatistics::getLastLoggedInUser();
if ($llu->getUserID() == $u->getUserID()) {
$this->set('lastLoginSite', t('Your login is the most recent.'));
} else {
$this->set('lastLoginSite', strftime($timeStr, $llu->getLastLogin()));
}
$this->set('totalEditMode', PageStatistics::getTotalPagesCheckedOut());
Loader::block('form');
$this->set('totalFormSubmissions', FormBlockStatistics::getTotalSubmissions());
$this->set('totalFormSubmissionsToday', FormBlockStatistics::getTotalSubmissions(date('Y-m-d')));
}
示例4: view
public function view()
{
$u = new User();
$ui = UserInfo::getByID($u->getUserID());
Loader::model("page_statistics");
Loader::model("user_statistics");
$timeStr = '';
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$timeStr = '%x ' . t('at') . ' %I:%M %p';
} else {
$timeStr = '%x ' . t('at') . ' %l:%M %p';
}
if (is_object($ui)) {
$this->set('uLastLogin', strftime($timeStr, $ui->getLastLogin('user')));
$this->set('uName', $ui->getUserName());
$this->set('lastEditSite', strftime($timeStr, strtotime(PageStatistics::getSiteLastEdit('user'))));
$llu = UserStatistics::getLastLoggedInUser();
if ($llu->getUserID() == $u->getUserID()) {
$this->set('lastLoginSite', t('Your login is the most recent.'));
} else {
$this->set('lastLoginSite', strftime($timeStr, $llu->getLastLogin()));
}
Loader::block('form');
}
$this->set('totalFormSubmissions', FormBlockStatistics::getTotalSubmissions());
$this->set('totalFormSubmissionsToday', FormBlockStatistics::getTotalSubmissions(date('Y-m-d')));
}
示例5: __autoload
function __autoload($class) {
$txt = Loader::helper('text');
if (strpos($class, 'BlockController') > 0) {
$class = substr($class, 0, strpos($class, 'BlockController'));
$handle = $txt->uncamelcase($class);
Loader::block($handle);
} else if (strpos($class, 'Helper') > 0) {
$class = substr($class, 0, strpos($class, 'Helper'));
$handle = $txt->uncamelcase($class);
$handle = preg_replace('/^site_/', '', $handle);
Loader::helper($handle);
} else if (strpos($class, 'AttributeType') > 0) {
$class = substr($class, 0, strpos($class, 'AttributeType'));
$handle = $txt->uncamelcase($class);
$at = AttributeType::getByHandle($handle);
}
}
示例6: view
public function view() {
$u = new User();
$ui = UserInfo::getByID($u->getUserID());
Loader::model("page_statistics");
Loader::model("user_statistics");
Loader::block('form');
$dh = Loader::helper('date');
if (is_object($ui)) {
$this->set('uLastLogin', $dh->date(DATE_APP_GENERIC_MDYT, $ui->getLastLogin('user')));
$this->set('uName', $ui->getUserName());
$this->set('lastEditSite', $dh->date(DATE_APP_GENERIC_MDYT, strtotime(PageStatistics::getSiteLastEdit('user'))));
$llu = UserStatistics::getLastLoggedInUser();
if ($llu->getUserID() == $u->getUserID()) {
$this->set('lastLoginSite', t('Your login is the most recent.'));
} else {
$this->set('lastLoginSite', $dh->date(DATE_APP_GENERIC_MDYT, $llu->getLastLogin()));
}
}
$this->set('totalFormSubmissions', FormBlockStatistics::getTotalSubmissions());
$this->set('totalFormSubmissionsToday', FormBlockStatistics::getTotalSubmissions(date('Y-m-d')));
}
示例7: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
if ($_GET['_ccm_dashboard_external']) {
return;
}
if (!defined('WHITE_LABEL_DASHBOARD_BACKGROUND_SRC')) {
Config::getOrDefine('WHITE_LABEL_DASHBOARD_BACKGROUND_SRC', false);
}
if (!defined('WHITE_LABEL_DASHBOARD_BACKGROUND_CAPTION')) {
Config::getOrDefine('WHITE_LABEL_DASHBOARD_BACKGROUND_CAPTION', false);
}
if (!defined('WHITE_LABEL_DASHBOARD_BACKGROUND_FEED')) {
Config::getOrDefine('WHITE_LABEL_DASHBOARD_BACKGROUND_FEED', false);
}
Loader::block('autonav');
$nh = Loader::helper('navigation');
$dashboard = Page::getByPath("/dashboard");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
Loader::library('3rdparty/mobile_detect');
$md = new Mobile_Detect();
$html = Loader::helper('html');
$v = View::getInstance();
if (!isset($enableEditing) || $enableEditing == false) {
$v->disableEditing();
}
示例8: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
Loader::block('form');
class DashboardReportsFormsController extends Controller {
private $pageSize=3;
public function view(){
if($_REQUEST['all']){
$this->pageSize=100000;
$_REQUEST['page']=1;
}
$this->loadSurveyResponses();
}
public function excel(){
$dateHelper = Loader::helper('date');
$this->pageSize=0;
$this->loadSurveyResponses();
$textHelper = Loader::helper('text');
$questionSet=$this->get('questionSet');
$answerSets=$this->get('answerSets');
$questions=$this->get('questions');
$surveys=$this->get('surveys');
$fileName=$textHelper->filterNonAlphaNum($surveys[$questionSet]['surveyName']);
示例9: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
Loader::block('library_file');
class HtmlBlockController extends BlockController
{
var $pobj;
protected $btTable = 'btContentLocal';
protected $btInterfaceWidth = "600";
protected $btInterfaceHeight = "465";
protected $btCacheBlockOutput = true;
protected $btCacheBlockOutputOnPost = true;
protected $btCacheBlockOutputForRegisteredUsers = true;
public $content = "";
public function getBlockTypeDescription()
{
return t("For adding HTML by hand.");
}
public function getBlockTypeName()
{
return t("HTML");
}
public function __construct($obj = null)
{
parent::__construct($obj);
}
public function view()
{
$this->set('content', $this->content);
}
public function getSearchableContent()
示例10: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
Loader::block('survey');
/* Formats dates to a human-readable form.
Example Input: 2009-03-11 15:00:00
Example Output: 3/11/2009 at 3:20 pm */
function formatDate($InputTime)
{
$dh = Loader::helper('date');
if (defined('DATE_APP_SURVEY_RESULTS')) {
return date(DATE_APP_SURVEY_RESULTS, strtotime($InputTime));
}
$InputTime = $dh->getLocalDateTime($InputTime);
$timestamp = strtotime($InputTime);
if ($timestamp) {
// If today
if ($timestamp >= strtotime(date('n/d/y'))) {
return 'Today at ' . date('g:i a', $timestamp);
} else {
// If day in past
return date('n/j/y \\a\\t g:i a', $timestamp);
}
}
return;
}
class DashboardReportsSurveysController extends Controller
{
public function viewDetail($bID = 0, $cID = 0)
{
// If a valid bID and cID are set, get the corresponding data
示例11: on_start
/**
* Automatically loads the file block class
*/
public function on_start()
{
Loader::block('file');
}
示例12: getDashboardPaneHeader
public function getDashboardPaneHeader($title = false, $help = false, $navigatePages = array(), $upToPage = false)
{
$c = Page::getCurrentPage();
$vt = Loader::helper('validation/token');
$token = $vt->generate('access_quick_nav');
$currentMenu = array();
$nh = Loader::helper('navigation');
$trail = $nh->getTrailToCollection($c);
if (count($trail) > 1 || count($navigatePages) > 1 || is_object($upToPage)) {
$parent = Page::getByID($c->getCollectionParentID());
if (count($trail) > 1 && !is_object($upToPage)) {
$upToPage = Page::getByID($parent->getCollectionParentID());
}
Loader::block('autonav');
$subpages = array();
if ($navigatePages !== -1) {
if (count($navigatePages) > 0) {
$subpages = $navigatePages;
} else {
$subpages = AutonavBlockController::getChildPages($parent);
}
}
$subpagesP = array();
foreach ($subpages as $sc) {
$cp = new Permissions($sc);
if ($cp->canRead()) {
$subpagesP[] = $sc;
}
}
if (count($subpagesP) > 0 || is_object($upToPage)) {
$relatedPages = '<div id="ccm-page-navigate-pages-content" style="display: none">';
$relatedPages .= '<ul class="ccm-navigate-page-menu">';
foreach ($subpagesP as $sc) {
if ($c->getCollectionPath() == $sc->getCollectionPath() || strpos($c->getCollectionPath(), $sc->getCollectionPath()) == 0 && strpos($c->getCollectionPath(), $sc->getCollectionPath()) !== false) {
$class = 'nav-selected';
} else {
$class = '';
}
$relatedPages .= '<li class="' . $class . '"><a href="' . $nh->getLinkToCollection($sc, false, true) . '">' . $sc->getCollectionName() . '</a></li>';
}
if ($upToPage) {
$relatedPages .= '<li class="ccm-menu-separator"></li>';
$relatedPages .= '<li><a href="' . $nh->getLinkToCollection($upToPage, false, true) . '">' . t('< Back to %s', $upToPage->getCollectionName()) . '</a></li>';
}
$relatedPages .= '</ul>';
$relatedPages .= '</div>';
$navigateTitle = $parent->getCollectionName();
}
}
$html = '<div class="ccm-pane-header">';
$html .= $relatedPages;
$class = 'ccm-icon-favorite';
$u = new User();
$quicknav = unserialize($u->config('QUICK_NAV_BOOKMARKS'));
if (is_array($quicknav)) {
if (in_array($c->getCollectionID(), $quicknav)) {
$class = 'ccm-icon-favorite-selected';
}
}
$html .= '<ul class="ccm-pane-header-icons">';
if (!$help) {
$ih = Loader::helper('concrete/interface/help');
$pageHelp = $ih->getPages();
if (isset($pageHelp[$c->getCollectionPath()])) {
$help = $pageHelp[$c->getCollectionPath()];
}
}
if (is_array($help)) {
$help = $help[0] . '<br/><br/><a href="' . $help[1] . '" class="btn small" target="_blank">' . t('Learn More') . '</a>';
}
if (isset($relatedPages)) {
$html .= '<li><a href="javascript:void(0)" onmouseover="ccm_togglePopover(event, this)" class="ccm-icon-navigate-pages" title="' . $navigateTitle . '" id="ccm-page-navigate-pages">' . t('Help') . '</a></li>';
}
if ($help) {
$html .= '<li><span style="display: none" id="ccm-page-help-content">' . $help . '</span><a href="javascript:void(0)" onclick="ccm_togglePopover(event, this)" class="ccm-icon-help" title="' . t('Help') . '" id="ccm-page-help">' . t('Help') . '</a></li>';
}
if (Config::get('TOOLBAR_QUICK_NAV_BEHAVIOR') != 'disabled') {
$html .= '<li><a href="javascript:void(0)" id="ccm-add-to-quick-nav" onclick="ccm_toggleQuickNav(' . $c->getCollectionID() . ',\'' . $token . '\')" class="' . $class . '">' . t('Add to Favorites') . '</a></li>';
}
$html .= '<li><a href="javascript:void(0)" onclick="ccm_closeDashboardPane(this)" class="ccm-icon-close">' . t('Close') . '</a></li>';
$html .= '</ul>';
if (!$title) {
$title = $c->getCollectionName();
}
$html .= '<h3>' . $title . '</h3>';
$html .= '</div>';
return $html;
}
示例13: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
Loader::block('page_list');
$previewMode = true;
$nh = Loader::helper('navigation');
$controller = new PageListBlockController($b);
$_REQUEST['num'] = ($_REQUEST['num'] > 0) ? $_REQUEST['num'] : 0;
$_REQUEST['cThis'] = ($_REQUEST['cParentID'] == $controller->cID) ? '1' : '0';
$_REQUEST['cParentID'] = ($_REQUEST['cParentID'] == 'OTHER') ? $_REQUEST['cParentIDValue'] : $_REQUEST['cParentID'];
$controller->num = $_REQUEST['num'];
$controller->cParentID = $_REQUEST['cParentID'];
$controller->cThis = $_REQUEST['cThis'];
$controller->orderBy = $_REQUEST['orderBy'];
$controller->ctID = $_REQUEST['ctID'];
$controller->rss = $_REQUEST['rss'];
$controller->displayFeaturedOnly = $_REQUEST['displayFeaturedOnly'];
$cArray = $controller->getPages();
//echo var_dump($cArray);
require(dirname(__FILE__) . '/../view.php');
exit;
示例14: defined
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
Loader::block('premium_google_map');
//Permissions Check
if ($_GET['bID']) {
$b = Block::getByID(intval($_GET['bID']));
$c = $b->getBlockCollectionObject();
if (!$b) {
throw new Exception(t('File not found.'));
}
$mapController = new PremiumGoogleMapBlockController($b);
$fileId = intval($mapController->getFileID());
$fileController = LibraryFileBlockController::getFile($fileId);
if (!$fileController) {
throw new Exception(t('File not found.'));
}
header("Pragma: public");
// required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Type: application/vnd.google-earth.kml+xml kml; charset=utf8");
header("Content-Disposition: inline; filename=" . $fileController->getFilename());
header("Content-Title: Google Earth KML");
$cp = new Permissions($c);
if ($cp->canRead()) {
$filePath = $fileController->getFilePath();
if (!file_exists($filePath)) {
throw new Exception(t('File not found.'));
}
示例15: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
Loader::library('search');
Loader::model('search/file');
Loader::model('collection_types');
Loader::block('image');
$cID = $c->getCollectionID();
$ImageExts = array("jpg", "jpeg", "png", "gif");
if ($_GET['task'] == 'delete') {
$b = Block::getByID($_GET['bID']);
if (is_object($b)) {
$orgCID = $b->getOriginalCollection();
$b->deleteBlock(true);
if ($orgCID == $cID) {
$c->approvePendingAction();
}
$message = t("File Deleted.");
}
}
if ($_REQUEST[uploadNewFile]) {
// lets try to determine if this is an image file!
$names = explode(".", $_FILES['filename']['name']);
$name_count = count($names) - 1;
$fext = strtolower($names[$name_count]);
foreach ($ImageExts as $imgExt) {
if ($fext == $imgExt) {
$fileType = "image";
}
}
##### end figuring out what kind of file this is