本文整理汇总了PHP中CMS::stdfile_url方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS::stdfile_url方法的具体用法?PHP CMS::stdfile_url怎么用?PHP CMS::stdfile_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMS
的用法示例。
在下文中一共展示了CMS::stdfile_url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: map
/**
* @param string $service
* @param string $id
* @param array $options
* @return string
*/
public function map($t, $service, $map_id, $name, $options = array(), $path_to_template = '../tao/views/helpers/maps')
{
if (!is_array($options)) {
$options = (array) $options;
}
$json_string = json_encode($options);
$lang = 'ru';
if ($options['properties']['lang'] != null) {
$lang = $options['properties']['lang'];
}
if ($service == null) {
$service = 'google';
}
switch ($service) {
case 'google':
$t->use_script('https://maps.google.com/maps/api/js?sensor=false&language=' . $lang, array('type' => 'lib', 'weight' => -21));
$t->use_script('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/src/infobubble-compiled.js', array('type' => 'lib', 'weight' => -20));
break;
case 'yandex':
$t->use_script('http://api-maps.yandex.ru/2.0/?load=package.full&lang=' . $lang, array('type' => 'lib', 'weight' => -21));
break;
default:
return;
}
$t->use_script(CMS::stdfile_url('scripts/maps.js'), array('type' => 'lib', 'weight' => -19));
return $t->partial($path_to_template, array('json_string' => $json_string, 'map' => $service . '_maps', 'name' => $name, 'map_id' => $map_id));
}
示例2: layout_preprocess
protected function layout_preprocess($l, $name, $data)
{
$js_file = $this->get_js_file($data);
$l->use_scripts(CMS::stdfile_url('scripts/jquery/ui.js'));
$l->use_scripts($js_file);
$l->use_style(CMS::stdfile_url('styles/jquery/ui.css'));
return parent::layout_preprocess($l, $name, $data);
}
示例3: render_tree
protected function render_tree()
{
$fform = $this->create_filters_form();
$filters_form_fields = $this->prepare_filter_forms();
$t = $this->render('tree', array('c' => $this, 'title' => $this->title_list(), 'count' => $this->get_tree_count(), 'message_norows' => $this->message_norows(), 'can_add' => $this->access_add(), 'add_url' => $this->action_url('add', $this->page), 'add_button_caption' => $this->button_add(), 'filters_form' => $fform, 'filters_form_fields' => $filters_form_fields));
if ($this->enable_checkcolumn) {
$t->use_scripts(CMS::stdfile_url('scripts/extjs/CheckColumn.js'))->use_styles(CMS::stdfile_url('styles/extjs/CheckHeader.css'));
}
return $t;
}
示例4: layout_preprocess
protected function layout_preprocess($l, $name, $data)
{
$id = $this->url_class();
$code = "; \$(function() { \$('.{$id} div.tree_select').filter('.name_{$name}').each(\n\t\t\t\t\tfunction() {\n\t \t\t\t\t\tTAO.fields.tree_select(\$(this));\n\t\t\t\t\t\t}\n\t\t)});";
$l->append_to('js', $code);
$l->with('url_class', $id);
$l->use_scripts(CMS::stdfile_url('scripts/fields/tree-select.js'));
$l->use_styles(CMS::stdfile_url('styles/fields/tree-select.css'));
$l->use_scripts(CMS::stdfile_url('scripts/jquery/scroll-to.js'));
return parent::layout_preprocess($l, $name, $data);
}
示例5: preprocess
protected function preprocess($template, $name, $data)
{
$item = $this->get_item($name, $data);
if ($item) {
$prefix = $item->code ? str_replace($item->code, '', $item->full_code) : CMS::vars()->db()->find($this->request('parent_id'))->code . '.';
// var_dump();
$template->with('prefix', $prefix);
}
$template->use_script(CMS::stdfile_url('scripts/fields/varcode.js'));
$template->use_style(CMS::stdfile_url('styles/fields/varcode.css'));
return parent::preprocess($template, $name, $data);
}
示例6: preprocess
public function preprocess($template, $name, $data)
{
$template->use_scripts(CMS::stdfile_url('scripts/jquery/tabby.js'));
parent::preprocess($template, $name, $data);
$parms = $template->parms;
$class = isset($parms['tagparms']['class']) ? $parms['tagparms']['class'] : '';
$class .= ' use-tab-key';
$class = trim($class);
$template->update_parm('tagparms', array('class' => $class));
if (empty($parms['tagparms']['style'])) {
$template->update_parm('tagparms', array('style' => 'width: 300px;height:100px;'));
}
return $template;
}
示例7: get_lang_file
protected function get_lang_file($data)
{
$lang_file = false;
$lang_file = $data['lang_file'];
$lang = $this->get_lang($data);
$path = "jquery/lang/{$lang}.js";
if ($data['lang_file']) {
$lang_file = $data['lang_file'];
} elseif (IO_FS::exists('scripts/' . $path)) {
$lang_file = $path;
} elseif (IO_FS::exists(CMS::stdfile('scripts/' . $path))) {
$lang_file = CMS::stdfile_url('scripts/' . $path);
}
return $lang_file;
}
示例8: layout_preprocess
protected function layout_preprocess($l, $name, $data)
{
$item = $this->get_item($name, $data);
$l->use_styles(CMS::stdfile_url('styles/SlickGrid/slick.grid.css'), CMS::stdfile_url('styles/SlickGrid/slick-default-theme.css'), CMS::stdfile_url('styles/SlickGrid/slick.css'), CMS::stdfile_url('styles/jquery/ui.css'), CMS::stdfile_url('styles/fields/documents-grid.css'));
$l->use_scripts(CMS::stdfile_url('scripts/tao/data.js'), CMS::stdfile_url('scripts/tao/oop.js'), CMS::stdfile_url('scripts/fields/documents-grid.js'), CMS::stdfile_url('scripts/jquery/ui.js'), CMS::stdfile_url('scripts/jquery/event.drag.js'), CMS::stdfile_url('scripts/jquery/event.drop.js'), CMS::stdfile_url('scripts/SlickGrid/slick.core.js'), CMS::stdfile_url('scripts/SlickGrid/slick.formatters.js'), CMS::stdfile_url('scripts/SlickGrid/slick.editors.js'), CMS::stdfile_url('scripts/SlickGrid/slick.grid.js'), CMS::stdfile_url('scripts/SlickGrid/slick.table.js'), CMS::stdfile_url('scripts/SlickGrid/plugins/slick.rowmovemanager.js'), CMS::stdfile_url('scripts/SlickGrid/plugins/slick.rowselectionmodel.js'), CMS::stdfile_url('scripts/tao/data.js'));
$id = $this->url_class();
$l->with('url_class', $id);
if ($item && !$item->is_phantom()) {
$code = <<<JS
\t\t\$(window).load(function () { \$('.{$id}.field-{$name}').each(function() {TAO.fields.documents_grid.process(\$(this))}) })
JS;
$l->append_to('js', $code);
}
Templates_HTML::add_scripts_settings(array('fields' => array($name => array('fields' => $this->get_fields($name, $data), 'api' => array('read' => CMS::$current_controller->field_action_url($name, 'load', $data['__item']), 'update' => CMS::$current_controller->field_action_url($name, 'update', $data['__item']), 'destroy' => CMS::$current_controller->field_action_url($name, 'delete', $data['__item']), 'save' => CMS::$current_controller->field_action_url($name, 'save', $data['__item']))))));
return parent::layout_preprocess($l, $name, $data);
}
示例9: default_settings
/**
* Настройки по умолчанию
*
* @return array
*/
public function default_settings()
{
return array('fullPanel' => true, 'iconsPath' => CMS::stdfile_url('images/nicEditor/nicEditorIcons.gif'));
}
示例10: scripts
public function scripts()
{
return array('jquery.js', CMS::stdfile_url('scripts/admin/tree.js'));
}
示例11: component_icon
/**
* @param string $name
*
* @return string
*/
static function component_icon($name)
{
return CMS::stdfile_url('images/components/default.gif');
}
示例12: lazy
public function lazy($parms = array())
{
$this->lazy = true;
$this->lazy_parms = array_merge($this->lazy_parms, $parms);
$this->template()->root->use_script(CMS::stdfile_url('scripts/jquery/lazyload.js'));
$this->template()->add_scripts_settings(array('lazyload' => $this->lazy_parms['settings']), true);
return $this;
}
示例13: layout_preprocess
protected function layout_preprocess($l, $name, $data)
{
$formats = $this->get_formats($name, $data);
foreach ($formats as $code => $format) {
if (!empty($format['__langs_name'])) {
foreach ($format['__langs_name'] as $lang => $lname) {
$format['__type']->layout_preprocess($l, $lname, $format['__data']);
}
} else {
$format['__type']->layout_preprocess($l, $format['__name'], $format['__data']);
}
}
$l->update_parm('formats', $formats);
$l->use_scripts(CMS::stdfile_url('scripts/fields/content.js'));
$l->use_styles(CMS::stdfile_url('styles/fields/content.css'));
$id = $this->url_class();
$code = <<<JS
\$(function() {
\$(".{$id}.field-{$name}").each(function() {TAO.fields.content(\$(this));});
});
JS;
$l->append_to('js', $code);
$l->with('url_class', $id);
return parent::layout_preprocess($l, $name, $data);
}
示例14: render
public function render($type = 'render/default', $exclude_fields = array('path'))
{
$template = $this->template()->spawn($this->type->template($this->data, $type));
$template->use_styles(CMS::stdfile_url('styles/fields/documents.css'));
return $template->with(array('files' => $this->filelist(), 'dir' => $this->dir(), 'files_data' => $this->type->files_data($this->name, $this->data, $this->item), 'container' => $this, 'exclude_fields' => $exclude_fields))->render();
}
示例15: layout_preprocess
protected function layout_preprocess($l, $name, $data)
{
$this->use_styles(CMS::stdfile_url('styles/fields/gallery.css'));
$this->use_scripts(CMS::stdfile_url('scripts/jquery/dragsort.js'));
//$this->use_scripts(CMS::stdfile_url('scripts/jquery/json.js'));
$this->use_scripts(CMS::stdfile_url('scripts/fields/gallery.js'));
$l->use_scripts(CMS::stdfile_url('scripts/jquery/block.js'));
$id = $this->url_class();
$code = <<<JS
\t\t\$(function () { \$('.{$id}.field-{$name}').each(function() {TAO.fields.gallery.process(\$(this))}) });;
JS;
$item = $this->get_item($name, $data);
if ($item && method_exists($item, 'is_phantom') && !$item->is_phantom()) {
$l->append_to('js', $code);
}
$l->with('url_class', $id);
return parent::layout_preprocess($l, $name, $data);
}