本文整理汇总了PHP中WFToken::getToken方法的典型用法代码示例。如果您正苦于以下问题:PHP WFToken::getToken方法的具体用法?PHP WFToken::getToken怎么用?PHP WFToken::getToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WFToken
的用法示例。
在下文中一共展示了WFToken::getToken方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getQueryString
public function getQueryString($query = array())
{
// get version
//$version = $this->get('version', '000000');
// get layout
$layout = JRequest::getWord('layout');
// set layout and item, eg: &layout=plugin&plugin=link
$query['layout'] = $layout;
$query[$layout] = JRequest::getWord($layout);
// set dialog
if (JRequest::getWord('dialog')) {
$query['dialog'] = JRequest::getWord('dialog');
}
// set standalone mode (for File Browser etc)
if ($this->get('standalone') == 1) {
$query['standalone'] = 1;
}
// get component id
$component_id = JRequest::getInt('component_id');
// set component id
if ($component_id) {
$query['component_id'] = $component_id;
}
// get token
$token = WFToken::getToken();
// set token
$query[$token] = 1;
/*if (preg_match('/\d+/', $version)) {
// set version
$query['v'] = preg_replace('#[^a-z0-9]#i', '', $version);
}*/
$output = array();
foreach ($query as $key => $value) {
$output[] = $key . '=' . $value;
}
return implode('&', $output);
}
示例2: getToken
public function getToken($id)
{
return '<input type="hidden" id="wf_' . $id . '_token" name="' . WFToken::getToken() . '" value="1" />';
}
示例3:
echo WFText::_('WF_LABEL_DETAILS');
?>
</div>
<div id="browser-details">
<div id="browser-details-text"></div>
<div id="browser-details-comment"></div>
</div>
<div class="spacer"></div>
<div id="browser-buttons"></div>
<div id="browser-details-nav">
<span class="details-nav-left" role="button"></span>
<span class="details-nav-text"></span>
<span class="details-nav-right" role="button"></span>
</div>
</div>
</div>
</fieldset>
</div>
<!--input type="hidden" name="<?php
echo $this->session->getName();
?>
" value="<?php
echo $this->session->getId();
?>
" /-->
<input type="hidden" name="<?php
echo WFToken::getToken();
?>
" value="1" />
</form>
示例4: tiny_mce
/**
* Text area with WYSIWYG
*
* @param type $element
*
* @return type
*/
static function tiny_mce($element)
{
// Load js and style sheet for frontend
$base = JUri::root();
$jCfg = JFactory::getConfig();
$language = JFactory::getLanguage();
$text_direction = 'data-direction="ltr"';
if ($language->isRTL()) {
$text_direction = 'data-direction="rtl"';
}
$urlbase = 'data-url=' . $base;
if (file_exists(JPATH_ROOT . "/media/editors/tinymce/langs/" . $language->getTag() . ".js")) {
$langPrefix = $language->getTag();
} elseif (file_exists(JPATH_ROOT . "/media/editors/tinymce/langs/" . substr($language->getTag(), 0, strpos($language->getTag(), '-')) . ".js")) {
$langPrefix = substr($language->getTag(), 0, strpos($language->getTag(), '-'));
} else {
$langPrefix = "en";
}
$langPrefix = "data-lang=" . $langPrefix;
$jceData = "";
if (file_exists(JPATH_ROOT . '/media/editors/tinymce/tinymce.min.js') && $jCfg->get('editor') != 'jce') {
if ($jCfg->get('editor') != 'tinymce') {
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/tinymce.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/table/plugin.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/link/plugin.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/image/plugin.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/code/plugin.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/hr/plugin.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/charmap/plugin.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/autolink/plugin.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/lists/plugin.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/importcss/plugin.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/themes/modern/theme.min.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/content.inline.min.css', 'css');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/content.min.css', 'css');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/skin.min.css', 'css');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/skin.ie7.min.css', 'css');
}
$editor = 'tinymce';
} elseif ($jCfg->get('editor') == 'jce') {
include_once JPATH_ROOT . "/administrator/components/com_jce/includes/loader.php";
include_once JPATH_ROOT . "/administrator/components/com_jce/models/editor.php";
include_once JPATH_ROOT . "/components/com_jce/editor/libraries/classes/token.php";
// create token
$token = WFToken::getToken();
$jceData .= " data-token=" . $token;
// etag - version
$editor = new WFModelEditor();
$setting = $editor->getEditorSettings();
$etag = $setting['etag'];
$jceData .= " data-etag=" . $etag;
// get current component
$option = JFactory::getApplication()->input->get('option');
$component = WFExtensionHelper::getComponent(null, $option);
// set default component id
$component_id = 0;
$component_id = isset($component->extension_id) ? $component->extension_id : ($component->id ? $component->id : 0);
$jceData .= " data-component_id=" . $component_id;
$editor = 'jce';
} else {
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.css', 'css');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg-0.9.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg-0.9.css', 'css');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.colorpicker.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.table.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.cssWrap.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.image.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'administrator/components/com_pagebuilder/assets/js/jquery-jwysiwyg/controls/wysiwyg.link.js', 'js');
JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ASSETS_URL . 'css/jwysiwyg.css', 'css');
}
$element = self::get_extra_info($element);
$label = self::get_label($element);
$type = !empty($element["input-type"]) ? $element["input-type"] : "text";
$role = isset($element['role']) ? "role_{$element['role']}" : '';
$role2 = isset($element['role_2']) ? 'data-role="title"' : '';
$output = "<textarea type='{$type}' class='{$element['class']} jsn_tiny_mce {$role} {$editor}' id='{$element['id']}' name='{$element['id']}' {$role2} {$text_direction} {$urlbase} {$langPrefix} {$jceData} DATA_INFO>{$element['std']}</textarea>";
return self::final_element($element, $output, $label);
}
示例5: getHead
/**
* Render document head data
*/
private function getHead()
{
$output = '';
$version = $this->get('version', '000000');
$output .= '<title>' . $this->getTitle() . ' : ' . $version . '</title>' . "\n";
$layout = JRequest::getWord('layout');
$item = JRequest::getWord($layout);
$standalone = '';
$dialog = '';
if (JRequest::getWord('dialog')) {
$dialog = '&dialog=' . JRequest::getWord('dialog');
}
// set standalone mode (for File Browser etc)
if ($this->get('standalone') == 1) {
$standalone = '&standalone=1';
}
// Render scripts
$stamp = preg_match('/\\d+/', $version) ? '?version=' . $version : '';
// get token
$token = WFToken::getToken();
if ($this->get('compress_javascript', 0)) {
$script = JURI::base(true) . '/index.php?option=com_jce&view=editor&layout=' . $layout . '&' . $layout . '=' . $item . $dialog . $standalone . '&task=pack&' . $token . '=1';
$output .= "\t\t<script type=\"text/javascript\" src=\"" . $script . "\"></script>\n";
} else {
foreach ($this->_scripts as $src => $type) {
$output .= "\t\t<script type=\"" . $type . "\" src=\"" . $src . $stamp . "\"></script>\n";
}
}
if ($this->get('compress_css', 0)) {
$file = JURI::base(true) . '/index.php?option=com_jce&view=editor&layout=' . $layout . '&' . $layout . '=' . $item . $dialog . $standalone . '&task=pack&type=css&' . $token . '=1';
$output .= "\t\t<link href=\"" . $file . "\" rel=\"stylesheet\" type=\"text/css\" />\n";
} else {
foreach ($this->_styles as $k => $v) {
$output .= "\t\t<link href=\"" . $k . $stamp . "\" rel=\"stylesheet\" type=\"" . $v . "\" />\n";
}
}
// Script declarations
foreach ($this->_script as $type => $content) {
$output .= "\t\t<script type=\"" . $type . "\">" . $content . "</script>";
}
// Other head data
foreach ($this->_head as $head) {
$output .= "\t" . $head . "\n";
}
return $output;
}
示例6: getBrowserLink
public static function getBrowserLink($element = null, $filter = '')
{
// load base classes
require_once JPATH_ADMINISTRATOR . '/components/com_jce/includes/base.php';
// set $url as empty string
$url = '';
wfimport('editor.libraries.classes.editor');
wfimport('editor.libraries.classes.token');
$wf = WFEditor::getInstance();
// check the current user is in a profile
if ($wf->getProfile('browser')) {
$token = WFToken::getToken();
$url = 'index.php?option=com_jce&view=editor&layout=plugin&plugin=browser&standalone=1&' . $token . '=1';
if ($element) {
$url .= '&element=' . $element;
}
if ($filter) {
$url .= '&filter=' . $filter;
}
}
return $url;
}
示例7: getBrowserLink
public function getBrowserLink($element = null, $filter = '')
{
wfimport('editor.libraries.classes.token');
$token = WFToken::getToken();
$url = 'index.php?option=com_jce&view=editor&layout=plugin&plugin=browser&standalone=1&' . $token . '=1';
if ($element) {
$url .= '&element=' . $element;
}
if ($filter) {
$url .= '&filter=' . $filter;
}
return $url;
}
示例8: getBrowserLink
public function getBrowserLink($element = null, $filter = '')
{
require_once JPATH_SITE . DS . 'components' . DS . 'com_jce' . DS . 'editor' . DS . 'libraries' . DS . 'classes' . DS . 'token.php';
$token = WFToken::getToken();
$url = 'index.php?option=com_jce&view=editor&layout=plugin&plugin=browser&standalone=1&' . $token . '=1';
if ($element) {
$url .= '&element=' . $element;
}
if ($filter) {
$url .= '&filter=' . $filter;
}
return $url;
}