本文整理汇总了PHP中Concrete\Core\Http\ResponseAssetGroup类的典型用法代码示例。如果您正苦于以下问题:PHP ResponseAssetGroup类的具体用法?PHP ResponseAssetGroup怎么用?PHP ResponseAssetGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ResponseAssetGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selectPage
/**
* Creates form fields and JavaScript page chooser for choosing a page. For use with inclusion in blocks.
* <code>
* $dh->selectPage('pageID', '1'); // prints out the home page and makes it selectable.
* </code>
*
* @param int $cID
*/
public function selectPage($fieldName, $cID = false)
{
$r = ResponseAssetGroup::get();
$r->requireAsset('core/sitemap');
$selectedCID = 0;
if (isset($_REQUEST[$fieldName])) {
$selectedCID = Loader::helper('security')->sanitizeInt($_REQUEST[$fieldName]);
} else {
if ($cID > 0) {
$selectedCID = $cID;
}
}
$html = '';
$clearStyle = 'display: none';
$html .= '<div class="ccm-summary-selected-item" data-page-selector="' . $fieldName . '"><div class="ccm-summary-selected-item-inner"><strong class="ccm-summary-selected-item-label">';
if ($selectedCID > 0) {
$oc = Page::getByID($selectedCID);
$html .= $oc->getCollectionName();
$clearStyle = '';
}
$html .= '</strong></div>';
$html .= '<a class="ccm-sitemap-select-page" data-page-selector-launch="' . $fieldName . '" dialog-width="90%" dialog-height="70%" dialog-append-buttons="true" dialog-modal="false" dialog-title="' . t('Choose Page') . '" href="' . REL_DIR_FILES_TOOLS_REQUIRED . '/sitemap_search_selector?cID=' . $selectedCID . '" dialog-on-close="Concrete.event.fire(\'fileselectorclose\', \'{$fieldName}\');">' . t('Select Page') . '</a>';
$html .= ' <a href="javascript:void(0)" dialog-sender="' . $fieldName . '" data-page-selector-clear="' . $fieldName . '" class="ccm-sitemap-clear-selected-page" style="float: right; margin-top: -8px;' . $clearStyle . '"><img src="' . ASSETS_URL_IMAGES . '/icons/remove.png" style="vertical-align: middle; margin-left: 3px" /></a>';
$html .= '<input type="hidden" data-page-selector="cID" name="' . $fieldName . '" value="' . $selectedCID . '"/>';
$html .= '</div>';
$html .= "<script type=\"text/javascript\">\n \$(function() {\n var ccmActivePageField;\n var launcher = \$('a[data-page-selector-launch=\"{$fieldName}\"]'), name = '{$fieldName}', openEvent, openEvent2;\n var container = \$('div[data-page-selector=\"' + name + '\"]');\n launcher.dialog();\n ConcreteEvent.bind('fileselectorclose', function(field_name) {\n ConcreteEvent.unbind('ConcreteSitemap.' + name);\n ConcreteEvent.unbind('SitemapSelectPage.' + name);\n ConcreteEvent.unbind('ConcreteSitemapPageSearch.' + name);\n });\n launcher.on('click', function () {\n var selector = \$(this),\n handle_select = function(e, data) {\n ConcreteEvent.unbind(e);\n var handle = selector.attr('data-page-selector-launch');\n container.find('.ccm-summary-selected-item-label').html(data.title);\n container.find('.ccm-sitemap-clear-selected-page').show();\n container.find('input[data-page-selector=cID]').val(data.cID);\n \$.fn.dialog.closeTop();\n };\n\n ConcreteEvent.bind('ConcreteSitemap.' + name, function (event, sitemap) {\n ConcreteEvent.subscribe('SitemapSelectPage.' + name, function (e, data) {\n if (data.instance === sitemap) {\n handle_select(e, data);\n }\n });\n });\n\n ConcreteEvent.bind('ConcreteSitemapPageSearch.' + name, function (event, search) {\n\n ConcreteEvent.subscribe('SitemapSelectPage.' + name, function (e, data) {\n if (data.instance === search) {\n handle_select(e, data);\n }\n });\n });\n });\n\n \$('a[data-page-selector-clear={$fieldName}]').click(function () {\n var container = \$('div[data-page-selector={$fieldName}]');\n container.find('.ccm-summary-selected-item-label').html('');\n container.find('.ccm-sitemap-clear-selected-page').hide();\n container.find('input[data-page-selector=cID]').val('');\n });\n });\n </script>";
return $html;
}
示例2: __construct
public function __construct($config, $pluginManager, $styles)
{
$this->assets = ResponseAssetGroup::get();
$this->pluginManager = $pluginManager;
$this->config = $config;
$this->styles = $styles;
}
示例3: view
public function view()
{
$r = ResponseAssetGroup::get();
$r->requireAsset('core/conversation');
$r->requireAsset('core/lightbox');
$fileSettings = $this->getFileSettings();
$conversation = $this->getConversationObject();
if (is_object($conversation)) {
$this->set('conversation', $conversation);
if ($this->enablePosting) {
$token = Loader::helper('validation/token')->generate('add_conversation_message');
} else {
$token = '';
}
$this->set('posttoken', $token);
$this->set('cID', Page::getCurrentPage()->getCollectionID());
$this->set('users', $this->getActiveUsers(true));
$this->set('maxFilesGuest', $fileSettings['maxFilesGuest']);
$this->set('maxFilesRegistered', $fileSettings['maxFilesRegistered']);
$this->set('maxFileSizeGuest', $fileSettings['maxFileSizeGuest']);
$this->set('maxFileSizeRegistered', $fileSettings['maxFileSizeRegistered']);
$this->set('fileExtensions', $fileSettings['fileExtensions']);
$this->set('attachmentsEnabled', $fileSettings['attachmentsEnabled']);
$this->set('attachmentOverridesEnabled', $fileSettings['attachmentOverridesEnabled']);
}
}
示例4: view
public function view()
{
$r = ResponseAssetGroup::get();
$r->requireAsset('core/app/editable-fields');
$form = Loader::helper('form');
$attribs = FileAttributeKey::getList();
$this->set('files', $this->files);
$this->set('attributes', $attribs);
}
示例5: view
public function view()
{
$r = ResponseAssetGroup::get();
$r->requireAsset('core/sitemap');
$cnt = new SearchPagesController();
$cnt->search();
$this->set('searchController', $cnt);
$result = Loader::helper('json')->encode($cnt->getSearchResultObject()->getJSONObject());
$this->set('result', $result);
}
示例6: view
public function view()
{
$r = ResponseAssetGroup::get();
$r->requireAsset('core/app/editable-fields');
$this->populatePages();
$form = Loader::helper('form');
$attribs = CollectionAttributeKey::getList();
$this->set('pages', $this->pages);
$this->set('attributes', $attribs);
}
示例7: __construct
public function __construct()
{
$fp = new Permissions(\FileSet::getGlobal());
$tp = new Permissions();
$this->assets = ResponseAssetGroup::get();
$this->token = Core::make("token")->generate('editor');
$this->setAllowFileManager($fp->canAccessFileManager());
$this->setAllowSitemap($tp->canAccessSitemap());
$this->pluginManager = new PluginManager();
$this->pluginManager->selectMultiple(\Package::getByHandle('community_ckeditor')->getConfig()->get('plugins', array()));
}
示例8: on_start
/**
* On CMS boot.
*
* @return void
*/
public function on_start()
{
$this->registerAssets();
Events::addListener('on_before_render', function ($e) {
$c = Page::getCurrentPage();
if ($c instanceof Page) {
$r = ResponseAssetGroup::get();
if (!$c->isEditMode()) {
$r->requireAsset('smooth-scrolling');
}
}
});
}
示例9: view
public function view()
{
$r = ResponseAssetGroup::get();
$r->requireAsset('core/app/editable-fields');
if (isset($_REQUEST['fvID'])) {
$fv = $this->file->getVersion(Loader::helper('security')->sanitizeInt($_REQUEST['fvID']));
$this->set('previewMode', true);
} else {
$fv = $this->file->getApprovedVersion();
$this->set('previewMode', false);
}
$this->set('fv', $fv);
$this->set('form', Loader::helper('form'));
$this->set('dateHelper', Loader::helper('date'));
}
示例10: render
public function render($value = false)
{
$r = \Concrete\Core\Http\ResponseAssetGroup::get();
$r->requireAsset('core/style-customizer');
$strOptions = '';
$i = 0;
$options['inputName'] = $this->getVariable();
if (is_object($value)) {
$options['value'] = $value->getUrl();
}
$strOptions = json_encode($options);
print '<span class="ccm-style-customizer-display-swatch-wrapper" data-image-selector="' . $this->getVariable() . '"></span>';
print "<script type=\"text/javascript\">";
print "\$(function() { \$('span[data-image-selector=" . $this->getVariable() . "]').concreteStyleCustomizerImageSelector({$strOptions}); });";
print "</script>";
}
示例11: jsonSerialize
public function jsonSerialize()
{
ob_start();
print $this->renderSearchField();
$field = ob_get_contents();
ob_end_clean();
$ag = ResponseAssetGroup::get();
$assetsResponse = array();
foreach ($ag->getAssetsToOutput() as $position => $assets) {
foreach ($assets as $asset) {
if (is_object($asset)) {
$assetsResponse[$asset->getAssetType()][] = $asset->getAssetURL();
}
}
}
return ['key' => $this->getKey(), 'label' => $this->getDisplayName(), 'element' => $field, 'data' => $this->data, 'assets' => $assetsResponse];
}
示例12: __construct
public function __construct()
{
$fp = FilePermissions::getGlobal();
$tp = new TaskPermission();
$this->assets = ResponseAssetGroup::get();
$this->token = Core::make("token")->generate('editor');
$this->allowFileManager = \Config::get('concrete.editor.concrete.enable_filemanager') && $fp->canAccessFileManager();
$this->allowSitemap = \Config::get('concrete.editor.concrete.enable_sitemap') && $tp->canAccessSitemap();
$this->pluginManager = new PluginManager();
$this->pluginManager->register('undoredo', t('Undo/Redo'));
$this->pluginManager->register('underline', t('Underline'));
$this->pluginManager->register('concrete5lightbox', t('Lightbox'));
$this->pluginManager->register('specialcharacters', t('Special Characters Palette'));
$this->pluginManager->register('table', t('Table'));
$this->pluginManager->register('fontfamily', t('Font Family'));
$this->pluginManager->register('fontsize', t('Font Size'));
$this->pluginManager->register('fontcolor', t('Font Color'));
$this->pluginManager->selectMultiple(\Config::get('concrete.editor.plugins.selected'));
}
示例13: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$ag = \Concrete\Core\Http\ResponseAssetGroup::get();
$ag->requireAsset('core/lightbox');
?>
<div id="ccm-dialog-help" class="ccm-ui">
<div class="container-fluid">
<div class="row">
<div class="col-xs-8">
<h2><?php
echo t('Learn the basics.');
?>
</h2>
<div class="spacer-row-2"></div>
<div class="row">
<div class="col-xs-12">
<div class="ccm-dialog-help-item">
<h4><?php
echo t('Use the toolbar');
?>
</h4>
<ol class="breadcrumb">
<li><a data-lightbox="iframe" href="https://www.youtube.com/watch?v=VB-R71zk06U"><?php
echo t('Watch Video');
?>
</a></li>
<li class="hidden-xs"><a href="#" data-launch-guide="toolbar"><?php
echo t('Run Guide');
?>
</a></li>
示例14: getField
protected function getField($field)
{
$r = new stdClass();
$r->field = $field;
$searchRequest = $this->searchRequest->getSearchRequest();
$form = Loader::helper('form');
$wdt = Loader::helper('form/date_time');
/* @var $wdt \Concrete\Core\Form\Service\Widget\DateTime */
$html = '';
switch ($field) {
case 'date_added':
$html .= $wdt->datetime('date_added_from', $wdt->translate('date_added_from', $searchRequest)) . t('to') . $wdt->datetime('date_added_to', $wdt->translate('date_added_to', $searchRequest));
break;
case 'is_active':
$html .= $form->select('active', array('0' => t('Inactive Users'), '1' => t('Active Users')), array('style' => 'vertical-align: middle'));
break;
case 'group_set':
$gsl = new GroupSetList();
$groupsets = array();
foreach ($gsl->get() as $gs) {
$groupsets[$gs->getGroupSetID()] = $gs->getGroupSetDisplayName();
}
$html .= $form->select('gsID', $groupsets);
break;
default:
if (Loader::helper('validation/numbers')->integer($field)) {
$ak = UserAttributeKey::getByID($field);
$html .= $ak->render('search', null, true);
}
break;
}
$r->html = $html;
$ag = ResponseAssetGroup::get();
$r->assets = array();
foreach ($ag->getAssetsToOutput() as $position => $assets) {
foreach ($assets as $asset) {
if (is_object($asset)) {
// have to do a check here because we might be included a dumb javascript call like i18n_js
$r->assets[$asset->getAssetType()][] = $asset->getAssetURL();
}
}
}
return $r;
}
示例15: add_attribute
/**
* Retrieve attribute HTML to inject into the other view.
*/
public function add_attribute()
{
$allowed = $this->assignment->getAttributesAllowedArray();
$ak = CollectionAttributeKey::getByID($_REQUEST['akID']);
if (is_object($ak) && in_array($ak->getAttributeKeyID(), $allowed)) {
$obj = $this->getAttributeJSONRepresentation($ak, 'add');
$obj->pending = true;
$obj->assets = array();
$ag = ResponseAssetGroup::get();
foreach ($ag->getAssetsToOutput() as $position => $assets) {
foreach ($assets as $asset) {
if (is_object($asset)) {
// have to do a check here because we might be included a dumb javascript call like i18n_js
$obj->assets[$asset->getAssetType()][] = $asset->getAssetURL();
}
}
}
Loader::helper('ajax')->sendResult($obj);
}
}