本文整理汇总了PHP中WFView::display方法的典型用法代码示例。如果您正苦于以下问题:PHP WFView::display方法的具体用法?PHP WFView::display怎么用?PHP WFView::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WFView
的用法示例。
在下文中一共展示了WFView::display方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
wfimport('admin.models.updates');
$mainframe = JFactory::getApplication();
$model = $this->getModel();
$version = $model->getVersion();
$component = WFExtensionHelper::getComponent();
// get params definitions
$params = new WFParameter($component->params, '', 'preferences');
$canUpdate = WFModelUpdates::canUpdate() && WFModel::authorize('installer');
$options = array('feed' => (int) $params->get('feed', 0), 'updates' => (int) $params->get('updates', $canUpdate ? 1 : 0), 'labels' => array('feed' => WFText::_('WF_CPANEL_FEED_LOAD'), 'updates' => WFText::_('WF_UPDATES'), 'updates_available' => WFText::_('WF_UPDATES_AVAILABLE')));
JHtml::_('behavior.modal');
$this->addScript('components/com_jce/media/js/cpanel.js');
$this->addScriptDeclaration('jQuery.jce.Cpanel.options = ' . json_encode($options) . ';');
// load styles
$this->addStyleSheet(JURI::root(true) . '/administrator/components/com_jce/media/css/cpanel.css');
if (WFModel::authorize('preferences')) {
WFToolbarHelper::preferences();
}
if (WFModel::authorize('installer')) {
WFToolbarHelper::updates($canUpdate);
}
WFToolbarHelper::help('cpanel.about');
$views = array('config', 'profiles', 'installer', 'browser', 'mediabox');
$icons = array();
foreach ($views as $view) {
// check if its allowed...
if (WFModel::authorize($view) === false) {
continue;
}
$attribs = array('target="_self"');
$title = 'WF_' . strtoupper($view);
$description = 'WF_' . strtoupper($view) . '_DESC';
$link = 'index.php?option=com_jce&view=' . $view;
if ($view == 'browser') {
$link = WFModel::getBrowserLink();
$component = WFExtensionHelper::getComponent();
// get params definitions
$params = new WFParameter($component->params, '', 'preferences');
$width = (int) $params->get('browser_width', 790);
$height = (int) $params->get('browser_height', 560);
if (empty($link)) {
continue;
}
$attribs = array('target="_blank"', 'class="browser"', 'onclick="Joomla.modal(this, \'' . $link . '\', ' . $width . ', ' . $height . ');return false;"');
$title = 'WF_' . strtoupper($view) . '_TITLE';
$description = 'WF_CPANEL_' . strtoupper($view);
}
// if its mediabox, check the plugin is installed and enabled
if ($view == 'mediabox' && !JPluginHelper::isEnabled('system', 'jcemediabox')) {
continue;
}
$icons[] = '<li class="cpanel-icon wf-tooltip" title="' . WFText::_($title) . '::' . WFText::_($description) . '"><a id="wf-browser-link" href="' . $link . '"' . implode(' ', $attribs) . '><span class="' . $view . '"></span>' . WFText::_($title) . '</a></li>';
}
$this->assign('icons', $icons);
$this->assign('model', $model);
$this->assign('params', $params);
$this->assign('version', $version);
parent::display($tpl);
}
示例2: display
function display($tpl = null)
{
$db = JFactory::getDBO();
$client = JRequest::getWord('client', 'admin');
$model = $this->getModel();
$this->document->setTitle(WFText::_('WF_PREFERENCES_TITLE'));
$this->document->addStyleSheet('templates/system/css/system.css');
$component = WFExtensionHelper::getComponent();
$xml = JPATH_COMPONENT . '/models/preferences.xml';
// get params definitions
$params = new WFParameter($component->params, $xml, 'preferences');
$params->addElementPath(JPATH_COMPONENT . '/elements');
if (WFModel::authorize('admin')) {
$form = $model->getForm('permissions');
} else {
$form = null;
}
$this->assign('params', $params);
$this->assign('permissons', $form);
$this->addStyleSheet('components/com_jce/media/css/preferences.css');
$this->addScript('components/com_jce/media/js/preferences.js');
if (JRequest::getInt('close') == 1) {
$this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Preferences.close();});');
} else {
$this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Preferences.init();});');
}
parent::display($tpl);
}
示例3: display
function display($tpl = null)
{
$language = JFactory::getLanguage();
$language->load('plg_editors_jce', JPATH_ADMINISTRATOR);
$client = JRequest::getWord('client', 'site');
$model = $this->getModel();
$plugin = WFExtensionHelper::getPlugin();
$xml = WF_EDITOR_LIBRARIES . '/xml/config/editor.xml';
$data = null;
// get params from editor plugin
if ($plugin->params && $plugin->params !== "{}") {
$data = json_decode($plugin->params);
} else {
$component = WFExtensionHelper::getComponent();
// get params from component "params" field (legacy)
if ($component->params) {
$data = json_decode($component->params);
}
}
// get params definitions
$params = new WFParameter($data, $xml, 'editor');
$params->addElementPath(JPATH_COMPONENT . '/elements');
$this->assign('model', $model);
$this->assign('params', $params);
$this->assign('client', $client);
WFToolbarHelper::apply();
WFToolbarHelper::save();
WFToolbarHelper::help('config.about');
parent::display($tpl);
}
示例4: render
/**
* Render the browser view
* @access public
*/
public function render()
{
$session = JFactory::getSession();
$view = new WFView(array('name' => 'browser', 'layout' => 'file'));
// assign session data
$view->assign('session', $session);
// assign form action
$view->assign('action', $this->getFormAction());
// return view output
$view->display();
}
示例5: display
function display($tpl = null)
{
$model = $this->getModel();
$this->addScript('components/com_jce/media/js/update.js');
$options = array('language' => array('check' => WFText::_('WF_UPDATES_CHECK'), 'install' => WFText::_('WF_UPDATES_INSTALL'), 'installed' => WFText::_('WF_UPDATES_INSTALLED'), 'no_updates' => WFText::_('WF_UPDATES_NONE'), 'high' => WFText::_('WF_UPDATES_HIGH'), 'medium' => WFText::_('WF_UPDATES_MEDIUM'), 'low' => WFText::_('WF_UPDATES_LOW'), 'full' => WFText::_('WF_UPDATES_FULL'), 'patch' => WFText::_('WF_UPDATES_PATCH'), 'auth_failed' => WFText::_('WF_UPDATES_AUTH_FAIL'), 'update_info' => WFText::_('WF_UPDATES_INFO'), 'install_info' => WFText::_('WF_UPDATES_INSTALL_INFO'), 'check_updates' => WFText::_('WF_UPDATES_CHECKING'), 'read_more' => WFText::_('WF_UPDATES_READMORE'), 'read_less' => WFText::_('WF_UPDATES_READLESS')));
$options = json_encode($options);
$this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Update.init(' . $options . ');});');
// load styles
$this->addStyleSheet(JURI::root(true) . '/administrator/components/com_jce/media/css/updates.css');
parent::display($tpl);
}
示例6: display
function display($tpl = null)
{
$db = JFactory::getDBO();
$lang = JFactory::getLanguage();
$lang->load('plg_system_jcemediabox');
$client = JRequest::getWord('client', 'site');
$model = $this->getModel();
$plugin = JPluginHelper::getPlugin('system', 'jcemediabox');
$params = $this->getParams($plugin->params);
$this->assignRef('params', $params);
$this->assignRef('client', $client);
$this->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/colorpicker.js?version=' . $model->getVersion());
$this->addStyleSheet('components/com_jce/media/css/colorpicker.css?version=' . $model->getVersion());
$options = array('template_colors' => WFToolsHelper::getTemplateColors(), 'custom_colors' => '', 'labels' => array('picker' => WFText::_('WF_COLORPICKER_PICKER'), 'palette' => WFText::_('WF_COLORPICKER_PALETTE'), 'named' => WFText::_('WF_COLORPICKER_NAMED'), 'template' => WFText::_('WF_COLORPICKER_TEMPLATE'), 'custom' => WFText::_('WF_COLORPICKER_CUSTOM'), 'color' => WFText::_('WF_COLORPICKER_COLOR'), 'apply' => WFText::_('WF_COLORPICKER_APPLY'), 'name' => WFText::_('WF_COLORPICKER_NAME')));
$this->addScriptDeclaration('jQuery(document).ready(function($){$("input.color").colorpicker(' . json_encode($options) . ');});');
WFToolbarHelper::apply();
WFToolbarHelper::save();
WFToolbarHelper::help('mediabox.config');
parent::display($tpl);
}
示例7: display
function display($tpl = null)
{
wfimport('admin.models.updates');
$app = JFactory::getApplication();
$model = $this->getModel();
$state = $model->getState();
$layout = JRequest::getWord('layout', 'install');
$plugins = '';
$extensions = '';
$languages = '';
JHtml::_('behavior.modal');
if (WFModel::authorize('uninstall')) {
WFToolbarHelper::deleteList('', 'remove', 'WF_INSTALLER_UNINSTALL');
}
WFToolbarHelper::updates(WFModelUpdates::canUpdate());
WFToolbarHelper::help('installer.about');
$options = array('extensions' => array('zip', 'tar', 'gz', 'gzip', 'tgz', 'tbz2', 'bz2', 'bzip2'), 'width' => 300, 'button' => 'install_button', 'task' => 'install', 'iframe' => false, 'labels' => array('browse' => WFText::_('WF_LABEL_BROWSE'), 'alert' => WFText::_('WF_INSTALLER_FILETYPE_ERROR')));
$this->addScript('components/com_jce/media/js/installer.js');
$this->addScript('components/com_jce/media/js/uploads.js');
$this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Installer.init(' . json_encode($options) . ');});');
// load styles
$this->addStyleSheet(JURI::root(true) . '/administrator/components/com_jce/media/css/installer.css');
$state->set('install.directory', $app->getCfg('tmp_path'));
$plugins = $model->getPlugins();
$extensions = $model->getExtensions();
$languages = $model->getLanguages();
$related = $model->getRelated();
$this->assign('plugins', $plugins);
$this->assign('extensions', $extensions);
$this->assign('languages', $languages);
$this->assign('related', $related);
$result = $state->get('install.result');
$this->assign('showMessage', count($result));
$this->assign('model', $model);
$this->assign('state', $state);
$ftp = JClientHelper::setCredentialsFromRequest('ftp');
$this->assign('ftp', $ftp);
$this->setLayout($layout);
parent::display($tpl);
}
示例8: getPopupTemplates
public function getPopupTemplates()
{
$output = '';
$path = WF_EDITOR_EXTENSIONS . '/popups';
$file = 'default.php';
foreach ($this->getTemplates() as $template) {
$wf = WFEditorPlugin::getInstance();
$view = $wf->getView();
$output .= $view->loadTemplate($template);
}
foreach ($this->getPopups() as $popup) {
$view = new WFView(array('name' => $popup, 'base_path' => WF_EDITOR_EXTENSIONS . '/popups/' . $popup, 'template_path' => WF_EDITOR_EXTENSIONS . '/popups/' . $popup . '/tmpl'));
$instance = $this->getPopupExtension($popup);
$view->assign('popup', $instance);
if (file_exists($path . '/' . $popup . '/tmpl/' . $file)) {
ob_start();
$output .= '<div id="popup_extension_' . $popup . '" style="display:none;">';
$view->display();
$output .= ob_get_contents();
$output .= '</div>';
ob_end_clean();
}
}
return $output;
}
示例9: display
public function display($tpl = null)
{
$app = JFactory::getApplication();
$option = JRequest::getCmd('option');
$client = 'admin';
$view = JRequest::getWord('view');
$db = JFactory::getDBO();
$currentUser = JFactory::getUser();
$acl = JFactory::getACL();
$model = $this->getModel();
$this->addScript('components/com_jce/media/js/users.js');
$filter_order = $app->getUserStateFromRequest("{$option}.{$view}.filter_order", 'filter_order', 'a.name', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest("{$option}.{$view}.filter_order_Dir", 'filter_order_Dir', '', 'word');
$filter_type = $app->getUserStateFromRequest("{$option}.{$view}.filter_type", 'filter_type', '', 'int');
$search = $app->getUserStateFromRequest("{$option}.{$view}.search", 'search', '', 'cmd');
$search = JString::strtolower($search);
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int');
$limitstart = $app->getUserStateFromRequest("{$option}.{$view}.limitstart", 'limitstart', 0, 'int');
$where = array();
if (!empty($search)) {
if (defined('JPATH_PLATFORM')) {
$quoted = $db->quote('%' . $search . '%', false);
} else {
$quoted = $db->Quote('%' . $search . '%', false);
}
$where[] = 'a.username LIKE ' . $quoted . ' OR a.email LIKE ' . $quoted . ' OR a.name LIKE ' . $quoted;
}
if (defined('JPATH_PLATFORM')) {
if ($filter_type) {
$where[] = 'map.group_id = LOWER(' . $db->Quote($filter_type) . ') ';
}
} else {
if ($filter_type) {
$where[] = 'a.gid =' . (int) $filter_type;
}
// exclude any child group id's for this user
$pgids = $acl->get_group_children($currentUser->get('gid'), 'ARO', 'RECURSE');
if (is_array($pgids) && count($pgids) > 0) {
JArrayHelper::toInteger($pgids);
$where[] = 'a.gid NOT IN (' . implode(',', $pgids) . ')';
}
// Exclude ROOT, USERS, Super Administrator, Public Frontend, Public Backend
$where[] = 'a.gid NOT IN (17,28,29,30)';
}
// Only unblocked users
$where[] = 'a.block = 0';
$orderby = array($filter_order, $filter_order_Dir);
jimport('joomla.html.pagination');
if (defined('JPATH_PLATFORM')) {
$query = $db->getQuery(true);
$query->select('COUNT(a.id)')->from('#__users AS a')->join('LEFT', '#__user_usergroup_map AS map ON map.user_id = a.id');
if (count($where)) {
$query->where($where);
}
$db->setQuery($query);
$total = $db->loadResult();
$pagination = new JPagination($total, $limitstart, $limit);
$query = $db->getQuery(true);
$query->select('a.id, a.name, a.username, g.title AS groupname');
$query->from('#__users AS a');
$query->join('LEFT', '#__user_usergroup_map AS map ON map.user_id = a.id');
$query->join('LEFT', '#__usergroups AS g ON g.id = map.group_id');
if (count($where)) {
$query->where($where);
}
$query->group('a.id, a.name, a.username, g.title');
$query->order(trim(implode(' ', $orderby)));
} else {
$query = 'SELECT COUNT(a.id)' . ' FROM #__users AS a' . $where;
$db->setQuery($query);
$total = $db->loadResult();
$pagination = new JPagination($total, $limitstart, $limit);
$query = 'SELECT a.id, a.name, a.username, g.name AS groupname' . ' FROM #__users AS a' . ' INNER JOIN #__core_acl_aro AS aro ON aro.value = a.id' . ' INNER JOIN #__core_acl_groups_aro_map AS gm ON gm.aro_id = aro.id' . ' INNER JOIN #__core_acl_aro_groups AS g ON g.id = gm.group_id' . (count($where) ? ' WHERE (' . implode(') AND (', $where) . ')' : '') . ' GROUP BY a.id, a.name, a.username, g.name' . ' ORDER BY ' . trim(implode(' ', $orderby));
}
$db->setQuery($query, $pagination->limitstart, $pagination->limit);
$rows = $db->loadObjectList();
$options = array(JHTML::_('select.option', '', '- ' . WFText::_('WF_USERS_GROUP_SELECT') . ' -'));
if (defined('JPATH_PLATFORM')) {
$query = $db->getQuery(true);
$query->select('a.id AS value, a.title AS text')->from('#__usergroups AS a');
// Add the level in the tree.
$query->select('COUNT(DISTINCT b.id) AS level');
$query->join('LEFT OUTER', '#__usergroups AS b ON a.lft > b.lft AND a.rgt < b.rgt');
$query->group('a.id, a.lft, a.rgt, a.parent_id, a.title');
$query->order('a.lft ASC');
// Get the options.
$db->setQuery($query);
$items = $db->loadObjectList() or die($db->stdErr());
// Pad the option text with spaces using depth level as a multiplier.
for ($i = 0, $n = count($items); $i < $n; $i++) {
$options[] = JHTML::_('select.option', $items[$i]->value, str_repeat('- ', $items[$i]->level) . $items[$i]->text);
}
} else {
// get list of Groups for dropdown filter
$query = 'SELECT id AS value, name AS text' . ' FROM #__core_acl_aro_groups' . ' WHERE id NOT IN (17,28,29,30)';
$db->setQuery($query);
$items = $db->loadObjectList();
$i = '-';
//$options[] = JHTML::_('select.option', '0', WFText::_('Guest'));
foreach ($items as $item) {
//.........这里部分代码省略.........