本文整理汇总了PHP中WFView类的典型用法代码示例。如果您正苦于以下问题:PHP WFView类的具体用法?PHP WFView怎么用?PHP WFView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WFView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: WFView
/**
* Get or create the theme view
* @access provate
* @return object WFView
*/
private function &getView()
{
static $view;
if (!is_object($view)) {
// create plugin view
$view = new WFView(array('base_path' => WF_EDITOR_THEMES . DS . $this->get('theme'), 'template_path' => WF_EDITOR_THEMES . DS . $this->get('theme') . DS . 'tmpl', 'name' => $this->get('dialog'), 'layout' => $this->get('dialog')));
$view->assign('theme', $this);
}
return $view;
}
示例2: WFView
/**
* Get plugin View
* @access public
* @return WFView
*/
public function &getView()
{
static $view;
if (!is_object($view)) {
// create plugin view
$view = new WFView(array('base_path' => $this->get('_base_path'), 'template_path' => $this->get('_template_path'), 'name' => $this->get('_name'), 'layout' => $this->get('_layout')));
$view->assign('plugin', $this);
}
return $view;
}
示例3: loadPanel
/**
* Load a panel view
* @access private
* @param object $layout Layout (panel) name
* @return panel JView object
*/
private function loadPanel($panel, $state)
{
$view = new WFView(array('name' => $panel, 'layout' => $panel));
// add tab paths
foreach ($this->_paths as $path) {
$view->addTemplatePath($path);
}
// assign panel state to view
$view->assign('state', (int) $state);
return $view;
}
示例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: addChild
function addChild(WFView $view)
{
if (!$view instanceof WFPassword) {
throw new WFException("Only WFPassword child views are accepted.");
}
if ($this->confirmPasswordId !== NULL) {
throw new WFException("WFPassword accepts only one child.");
}
$this->confirmPasswordId = $view->id();
$this->setValueForKey(false, 'autocomplete');
$view->setValueForKey(false, 'autocomplete');
return parent::addChild($view);
}
示例6: 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;
}
示例7: execute
function execute()
{
if (JRequest::getVar('json', '', 'POST', 'STRING', 2) || JRequest::getCmd('action') == 'upload') {
$this->processXHR();
} else {
$this->display();
$document =& WFDocument::getInstance();
$document->pack();
// create plugin view
$view = new WFView(array('base_path' => $this->get('base_path'), 'template_path' => $this->get('template_path'), 'name' => 'link', 'layout' => $this->get('layout')));
$view->assign('plugin', $this);
// set body output
$document->setBody($view->loadTemplate());
$document->render();
}
}
示例8: addChild
/**
* Add a child view to this view.
*
* @param object A WFView object to add.
*/
function addChild(WFView $view)
{
$this->children[$view->id()] = $view;
$view->setParent($this);
}
示例9: addChild
/**
* To implement our prototype functionality, we need to detect when a child object named "<id>Prototype" has been added.
*
* If a prototype object is detected, we set up the prototype for the WFDynamic.
*
* @param object WFView The object being added.
*/
function addChild(WFView $view)
{
if ($view->id() == "{$this->id}Prototype") {
$this->setPrototype($view);
} else {
// add new view to the "parentView" object
$parentView = $this->calculateParent();
if ($parentView) {
$parentView->addChild($view);
} else {
parent::addChild($view);
}
}
}
示例10: 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);
}
示例11: 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);
}
示例12: 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);
}
示例13: 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);
}
示例14: 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);
}
示例15: 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);
}