本文整理汇总了PHP中WW_addScript函数的典型用法代码示例。如果您正苦于以下问题:PHP WW_addScript函数的具体用法?PHP WW_addScript怎么用?PHP WW_addScript使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WW_addScript函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Onetouchcontact_widgetShow
/**
* show the onetouchcontact widget
*
* @param array $vars config
*
* @return string form
*/
function Onetouchcontact_widgetShow($vars)
{
$form = '<form class="onetouchcontact">Name<br/>' . '<input id="onetouchcontact-name"/><br/>Email<br/>' . '<input id="onetouchcontact-email"/><br/>';
if ($vars->phone) {
$form .= 'Phone<br/><input id="onetouchcontact-phone" /><br/>';
}
$form .= '<input type="hidden" name="cid" value="' . $vars->cid . '"/>' . '<input type="hidden" name="mid" value="' . $vars->mid . '"/>' . '<div class="onetouchcontact-msg"></div>' . '<input class="submit" type="submit" value="subscribe"/></form>';
WW_addScript('onetouchcontact/frontend/js.js');
return $form;
}
示例2: Ratings_templateFunction
/**
* Ratings_templateFunction
*
* replaces {{RATINGS}} with a rating interface
*
* @param array $vars settings
*
* @return string html
*/
function Ratings_templateFunction($vars)
{
$name = @$vars['name'];
$type = @$vars['type'];
if ($name == '') {
return '';
}
$script = '$(function(){$(".ratings").ratings();});';
WW_addScript('ratings/ratings.js');
WW_addInlineScript($script);
return '<div class="ratings" id="' . $name . '" type="' . $type . '">' . __('ratings', 'core') . '</div>';
}
示例3: IssueTracker_front
/**
* show registration or login page
*
* @param object $PAGEDATA the page object
*
* @return HTML of the page
*/
function IssueTracker_front($PAGEDATA)
{
require SCRIPTBASE . 'ww.plugins/issue-tracker/frontend/page_type.php';
global $unused_uri;
if (isset($unused_uri) && $unused_uri) {
redirect($PAGEDATA->getRelativeURL() . '#' . preg_replace('/\\/$/', '', $unused_uri));
}
if (isset($_SESSION['userdata'])) {
WW_addCSS('/j/jquery.multiselect/jquery.multiselect.css');
WW_addScript('/j/jquery.multiselect/jquery.multiselect.min.js');
}
return $PAGEDATA->render() . $html . __FromJson(@$PAGEDATA->vars['footer']);
}
示例4: SendAsEmail_showWidget
/**
* SendAsEmail_showWidget
*
* @param array $vars variables
*
* @return null
*/
function SendAsEmail_showWidget($vars)
{
$template = $vars->template;
$url = $_SERVER['REQUEST_URI'];
if (strpos($url, '&__t=') !== false || strpos($url, '?__t=') !== false) {
$url = preg_replace('/[\\?\\&]__t=[^\\&]*/', '', $url);
}
$url .= '&__t=' . $template;
if (strpos($url, '&') !== false && strpos($url, '?') === false) {
$url = preg_replace('/&/', '?', $url, 1);
}
echo '<div class="sendasemail-print"><a href="' . $url . '">Print Version</a>' . '</div>' . '<div class="sendasemail-sendasemail">' . '<a href="javascript:;" onclick="sendasemail_send(\'' . $template . '\')">' . 'Send as Email</a></div>';
WW_addScript('send-as-email/frontend/widget.js');
}
示例5: getPageHtml
/**
* This is the main function.
* It figures out if a list of quizzes, questions
* or results should be displayed and displays the correct thing
*
* @see displayQuizInfo
* @see [QuizSession::]getScore()
*
* @return string $displayString The correct page HTML
*/
function getPageHtml()
{
// { datatables
WW_addScript('http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/' . 'jquery.dataTables.min.js');
WW_addScript('/j/datatables-delay.js');
WW_addCSS('http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/' . 'jquery.dataTables.css');
WW_addCSS('http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/' . 'jquery.dataTables_themeroller.css');
// }
// { The Script
$displayString = '<script defer="defer">' . '$(function(){' . '$(\'#quizzesFrontend\').dataTable().fnSetFilteringDelay();' . '});' . '</script>';
// }
$quizzes = dbAll("SELECT DISTINCT \n\t\t\tquiz_quizzes.id, \n\t\t\tname, \n\t\t\tquiz_quizzes.description \n\t\t\tFROM quiz_quizzes, quiz_questions \n\t\t\tWHERE quiz_quizzes.id=quiz_questions.quiz_id \n\t\t\tand quiz_quizzes.enabled=1");
$displayString = $displayString . '<form method="post">';
$displayString = $displayString . '<table id="quizzesFrontend"
style="{width:100% postion:top}">';
$displayString = $displayString . '<thead><tr>';
$displayString = $displayString . '<th>Name</th>';
$displayString = $displayString . '<th>Description</th>';
$displayString = $displayString . '<th> </th>';
$displayString = $displayString . '</tr></thead>';
$displayString = $displayString . '<tbody>';
foreach ($quizzes as $quiz) {
$quizId = $quiz['id'];
$name = $quiz['name'];
$topic = $quiz['description'];
$id = $quiz['id'];
$displayString = $displayString . '<tr>';
$displayString = $displayString . displayQuizInfo($name, $topic, $id);
$displayString = $displayString . '</tr>';
}
$displayString = $displayString . '</tbody></table>';
$displayString = $displayString . '</form>';
if (isset($_POST['take'])) {
$id = $_POST['take'];
$id = addSlashes($id);
$quiz = new QuizSession($id);
$_SESSION['id'] = $id;
$quiz->chooseQuestions();
$displayString = $quiz->getQuestionPageHtml();
}
if (isset($_POST['check'])) {
$quiz = new QuizSession($_SESSION['id']);
$displayString = $quiz->checkAnswers($_SESSION['questions'], $_POST);
}
return $displayString;
}
示例6: Products_map2
/**
* get a map centered on the product
*
* @param array $params parameters
* @param object $smarty Smarty object
*
* @return html of the map
*/
function Products_map2($params, $smarty)
{
$params = array_merge(array('width' => 160, 'height' => '120'), $params);
$pid = $smarty->smarty->tpl_vars['product']->value->id;
$product = Product::getInstance($pid);
$uid = (int) $product->vals['user_id'];
if (!$uid) {
return 'unknown location';
}
$user = User::getInstance($uid, false, false);
if (!$user) {
return 'unknown user';
}
$lat = (double) $user->get('location_lat');
$lng = (double) $user->get('location_lng');
WW_addScript('products/j/maps.js');
return '<div class="products-map"' . ' data-lat="' . $lat . '"' . ' data-lng="' . $lng . '"' . ' data-pid="' . $pid . '"' . ' style="width:' . (int) $params['width'] . 'px;' . 'height:' . (int) $params['height'] . 'px"></div>';
}
示例7: poll_display
function poll_display()
{
WW_addScript('polls');
$poll = dbRow('select * from poll where enabled limit 1');
if (!count($poll)) {
return '<div class="polls-wrapper"><em>No polls available.</em></div>';
}
$id = $poll['id'];
$html = '<div class="polls-wrapper" poll-id="' . $id . '">';
$html .= '<div class="question">' . $poll['body'] . '</div><ul class="answers">';
$answers = dbAll("select * from poll_answer where poll_id={$id} order by num");
foreach ($answers as $answer) {
$html .= '<li><input type="radio" name="poll_answer" value=' . '"' . $answer['num'] . '" />' . htmlspecialchars($answer['answer']) . '</li>';
}
$html .= '</ul><input type="button" class="polls-vote" value="Vote" /><inpu' . 't type="button" class="polls-results" value="View Results" />';
$html .= '</div>';
return $html;
}
示例8: MailingLists_widget
/**
* widget for mailing lists
*
* @param array $vars parameters
*
* @return html
*/
function MailingLists_widget($vars)
{
$html = '<div id="mailinglists-subscribe">' . '<input type="email" placeholder="' . __('enter email address') . '"/>';
$sql = 'select * from mailinglists_lists';
$md5 = md5($sql);
$lists = Core_cacheLoad('mailinglists', $md5, -1);
if ($lists === -1) {
$lists = dbAll($sql);
Core_cacheSave('mailinglists', $md5, $lists);
}
if (count($lists) > 1) {
$html .= '<select><option value="">' . __('Mailing List') . '</option>';
foreach ($lists as $list) {
$html .= '<option value="' . $list['id'] . '">' . htmlspecialchars($list['name']) . '</option>';
}
$html .= '</select>';
}
$html .= '<button>' . __('Subscribe') . '</button></div>';
WW_addScript('mailinglists/js.js');
return $html;
}
示例9: MP3_frontendWidget
/**
* show frontend widget
*
* @param array $vars settings
*
* @return string html
*/
function MP3_frontendWidget($vars = null)
{
$db = dbRow('select fields,template from mp3_plugin where id=' . $vars->id);
$files = json_decode($db['fields'], true);
if (count($files) == 0) {
return 'No files yet';
}
// { if template doesnt exist, create it
$template = USERBASE . '/ww.cache/mp3/';
if (!is_dir($template)) {
mkdir($template);
}
$template .= $vars->id;
if (!file_exists($template)) {
file_put_contents($template, $db['template']);
}
// }
// { display the template
require_once SCRIPTBASE . 'ww.incs/vendor/Smarty-3.1.19/libs/Smarty.class.php';
$smarty = new Smarty();
$smarty->compile_dir = USERBASE . '/ww.cache/templates_c';
if (!file_exists(USERBASE . '/ww.cache/templates_c')) {
mkdir(USERBASE . '/ww.cache/templates_c');
}
if (!file_exists(USERBASE . '/ww.cache/templates_c/image-gallery')) {
mkdir(USERBASE . '/ww.cache/templates_c/image-gallery');
}
$smarty->registerPlugin('function', 'LIST', 'MP3_list');
$smarty->registerPlugin('function', 'PLAY', 'mp3_play');
$smarty->registerPlugin('function', 'PROGRESS', 'MP3_progress');
$smarty->left_delimiter = '{{';
$smarty->right_delimiter = '}}';
$smarty->smarty->tpl_vars['mp3_files']->value = $files;
$html = $smarty->fetch(USERBASE . '/ww.cache/mp3/' . $vars->id);
WW_addScript('mp3/frontend/jwplayer.js');
WW_addScript('mp3/frontend/widget.js');
// }
return $html;
}
示例10: json_decode
echo '</tr>' . '<tr style="display:none" id="users-email-to-send"><th colspan="3">Email to send to user</th><th><a href="#" id="new-user-email-template">template</a></th></tr>' . '<tr><td colspan="4" id="users-email-to-send-holder"></td></tr>' . '</table></div>';
// }
// { locations
echo '<div id="locations">';
// { physical location
echo '<h2>Currently located</h2>' . '<p id="user-location">The user is recorded as being located at ' . 'Lat:<input name="location_lat" value="' . (double) @$r['location_lat'] . '"/>, ' . 'Long:<input name="location_lng" value="' . (double) @$r['location_lng'] . '"/> <a href="#">edit</a></p>';
// }
// { addresses
echo '<h2>Addresses</h2> <a id="new-address" href="javascript:;" style="flo' . 'at:right">[+] Add Address</a> <div id="add-content">';
if (!is_array($r['address'])) {
if ($r['address'] == '') {
$r['address'] = '[]';
}
$r['address'] = json_decode($r['address'], true);
}
foreach ($r['address'] as $name => $address) {
$select = @$address['default'] == 'yes' ? ' checked="checked"' : '';
$address = array_merge(array('street' => '', 'street2' => '', 'town' => '', 'postcode' => '', 'county' => '', 'country' => '', 'phone' => ''), $address);
echo '<table class="address-table">' . '<tr><th colspan="2"><input type="radio"' . $select . ' name="default-address"' . ' value="' . $name . '"/>default ' . '<a href="javascript:;" class="delete-add" title="delete">[x]</a>' . '<input type="hidden" name="address[' . $name . ']"/></th></tr>' . '<tr><th>Street</th><td><input type="text" name="street-' . $name . '"' . ' value="' . $address['street'] . '"/></td></tr>' . '<tr><th>Street 2</th><td><input type="text" name="street2-' . $name . '"' . ' value="' . $address['street2'] . '"/></td></tr>' . '<tr> <th>Town</th> <td><input type="text" name="town-' . $name . '"' . ' value="' . $address['town'] . '"/></td></tr>' . '<tr> <th>Postcode</th> <td><input type="text" name="postcode-' . $name . '"' . ' value="' . $address['postcode'] . '"/></td> </tr>' . '<tr> <th>County</th> <td><input type="text" name="county-' . $name . '"' . ' value="' . $address['county'] . '"/></td> </tr>' . '<tr> <th>Country</th> <td><input type="text" name="country-' . $name . '"' . ' value="' . $address['country'] . '"/></td> </tr>' . '<tr> <th>Phone</th> <td><input type="text" name="phone-' . $name . '"' . ' value="' . $address['phone'] . '"/></td> </tr>' . '</table>';
}
echo '</div><br style="clear:both"/>';
// }
echo '</div>';
// }
// { custom data
echo '<div id="custom"><input type="hidden" value="' . htmlspecialchars($r['extras'], ENT_QUOTES) . '" /></div>';
// }
echo '<input type="submit" name="action" value="Save" />';
echo '</form></div>';
WW_addScript('/ww.admin/siteoptions/users.js');
// }
示例11: dbAll
<?php
$ads = dbAll('select id,name,customer_id,views,clicks,is_active,image_url,date_expire' . ',type_id' . ' from ads');
$ad_types = array();
$rs = dbAll('select id,name from ads_types');
foreach ($rs as $r) {
$ad_types[$r['id']] = $r['name'];
}
echo '<table id="ads-table"><thead><tr><th>ID</th><th>Name</th><th>Type</th>' . '<th>Owner</th><th>Views</th><th>Clicks</th><th>Active</th>' . '<th>Expires</th><th></th></tr></thead><tbody>';
foreach ($ads as $ad) {
$username = '';
if ($ad['customer_id']) {
$user = User::getInstance($ad['customer_id']);
$username = $user ? $user->get('name') : 'UNKNOWN';
}
echo '<tr id="ad-' . $ad['id'] . '">' . '<td>' . str_pad($ad['id'], 4, '0', STR_PAD_LEFT) . '</td>' . '<td>' . htmlspecialchars($ad['name']) . '</td>' . '<td>' . htmlspecialchars($ad_types[$ad['type_id']]) . '</td>' . '<td>' . htmlspecialchars($username) . '</td>' . '<td>' . $ad['views'] . '</td>' . '<td>' . $ad['clicks'] . '</td>' . '<td>' . ($ad['is_active'] ? 'Yes' : 'No') . '</td>' . '<td>' . $ad['date_expire'] . '</td>' . '<td><a href="#" class="edit">edit</a>' . ' | <a href="#" class="delete">[x]</a></td></tr>';
}
echo '</tbody></table><button class="new-ad">' . __('New Ad') . '</button>';
WW_addScript('/ww.plugins/ads/admin.js');
示例12: GalleryWidget_show
/**
* show the ImageGallery widget
*
* @param array $vars parameters
*
* @return html
*/
function GalleryWidget_show($vars)
{
if (!isset($vars->id) || !$vars->id) {
return '';
}
$id = $vars->id;
// { get data from widget db
$vars = dbRow('select * from image_gallery_widget where id="' . $id . '"');
// }
// { check to see if there are files in the directory
$hasImages = false;
$dirname = USERBASE . '/f/' . $vars['directory'];
if (file_exists($dirname)) {
$dir = new DirectoryIterator($dirname);
foreach ($dir as $file) {
if ($file->isDot()) {
continue;
}
$hasImages = true;
break;
}
}
// }
if ($hasImages) {
// { if template doesn't exist, create it
$template = USERBASE . '/ww.cache/image-gallery-widget/';
@mkdir($template, 0777, true);
$template .= $id;
if (!file_exists($template)) {
if (!$vars['gallery_type']) {
$vars['gallery_type'] = 'grid';
}
$thtml = file_get_contents(SCRIPTBASE . 'ww.plugins/image-gallery/admin/types/' . strtolower($vars['gallery_type']) . '.tpl');
if (!$thtml) {
$thtml = file_get_contents(dirname(__FILE__) . '/../admin/types/list.tpl');
}
file_put_contents($template, $thtml);
}
// }
// { display the template
require_once SCRIPTBASE . 'ww.incs/vendor/Smarty-3.1.19/libs/Smarty.class.php';
require_once SCRIPTBASE . 'ww.plugins/image-gallery/frontend/template-functions.php';
$smarty = new Smarty();
$smarty->compile_dir = USERBASE . '/ww.cache/templates_c';
@mkdir(USERBASE . '/ww.cache/templates_c');
@mkdir(USERBASE . '/ww.cache/templates_c/image-gallery-widget');
$smarty->registerPlugin('function', 'GALLERY_IMAGE', 'ImageGallery_templateImage');
$smarty->registerPlugin('function', 'GALLERY_IMAGES', 'ImageGallery_templateImages');
$smarty->left_delimiter = '{{';
$smarty->right_delimiter = '}}';
$c .= $smarty->fetch($template);
// { quick hack to add the options rather than
// writing a whole new function in php
$script = '
Gallery.options.directory="' . (int) $vars['directory'] . '";
Gallery.options.thumbsize=' . (int) $vars['thumbsize'] . ';
Gallery.options.imageWidth=' . (int) $vars['image_size'] . ';
Gallery.options.imageHeight=' . (int) $vars['image_size'] . ';
Gallery.gallery()
.attr("cols","' . $vars['columns'] . '")
.attr("rows","' . $vars['rows'] . '");
';
// }
WW_addScript('image-gallery/frontend/gallery.js');
WW_addInlineScript($script);
WW_addCSS('/ww.plugins/image-gallery/frontend/gallery.css');
// }
return $c;
} else {
$dir = $vars['directory'];
return '<em>' . __('gallery "%1" not found or empty.', array($dir), 'core') . '</em>';
}
}
示例13: WW_addScript
WW_addScript('/j/datatables-delay.js');
WW_addCSS('//cdn.datatables.net/1.10.2/css/jquery.dataTables.min.css');
// }
echo '<!doctype html>
<html><head><title>' . __('WebME admin area') . '</title>';
foreach ($PLUGINS as $pname => $p) {
if (file_exists(SCRIPTBASE . '/ww.plugins/' . $pname . '/admin/admin.css')) {
WW_addCSS('/ww.plugins/' . $pname . '/admin/admin.css');
}
}
echo WW_getCSS();
echo Core_getJQueryScripts() . '<script src="/js/' . filemtime(SCRIPTBASE . 'j/js.js') . '"></script>';
WW_addInlineScript('var sessid="' . session_id() . '";');
WW_addScript('/j/fg.menu/fg.menu.js');
// { languages
$sql = 'select code,name from language_names order by is_default desc,code,name';
$langs = dbAll($sql, '', 'language_names');
echo '<script>var languages=' . json_encode($langs) . ';</script>';
// }
WW_addScript('/j/jstree/jquery.jstree.js');
WW_addScript('/j/jstree/_lib/jquery.cookie.js');
WW_addInlineScript('$.jstree._themes="/j/jstree/themes/";');
echo '</head><body';
echo '><div id="header"></div>';
echo Core_languagesGetUi(array('type' => 'selectbox'));
// { if maintenance mode is enabled show warning
if (@$DBVARS['maintenance-mode'] == 'yes') {
echo '<div id="maintenance"><em>' . __('Maintenance Mode is currently enabled which means that only' . ' administrators can view the frontend of this website.' . ' Click <a href="siteoptions.php">here</a> to disable it.') . '</em></div><style type="text/css">.pages_iframe{ top:130px!important;}' . '</style>';
}
// }
echo '<div id="wrapper"><div id="main">';
示例14: Form_showForm
//.........这里部分代码省略.........
if ($_REQUEST[$name] == '') {
$_REQUEST[$name] = date('Y-m');
}
$d = '<input name="' . $name . '" value="' . $_REQUEST[$name] . '" class="ccdate"' . $help . '/>';
$has_ccdate = true;
break;
// }
// }
case 'date':
// {
if ($_REQUEST[$name] == '') {
$_REQUEST[$name] = date('Y-m-d');
}
$d = '<input name="' . $name . '" value="' . $_REQUEST[$name] . '"' . $help . ' class="date" placeholder="yyyy-mm-dd" ' . 'metadata="' . addslashes($r2['extra']) . '"/>';
$has_date = true;
break;
// }
// }
case 'email':
// {
if ($r2['extra']) {
$class .= ' verify';
$verify = '<input style="display:none" class="email-verification" ' . 'name="' . $name . '_verify" value="" placeholder="verification code"' . $help . '/>';
$_SESSION['form_input_email_verify_' . $name] = rand(10000, 99999);
} else {
$verify = '';
}
$d = '<input type="email" id="' . $name . '" name="' . $name . '" value="' . $val . '" class="email' . $class . ' text"' . $help . '/>' . $verify;
break;
// }
// }
case 'file':
// {
WW_addScript('/j/swfobject.js');
WW_addScript('/j/jquery.uploadify/jquery.uploadify.min.js');
$opts = isset($r2['extra']) ? explode(':', $r2['extra']) : array();
if (!isset($opts[0]) || !isset($opts[1])) {
$opts = array('off', '*;');
}
$multi = $opts[0] == 'on' ? 'true' : 'false';
$script = '
$(function(){
$("#' . $name . '").uploadify({
"uploader":"/j/jquery.uploadify/uploadify.swf",
"script":"/ww.plugins/forms/frontend/file-upload.php",
"cancelImg":"/ww.plugins/forms/j/cancel.png",
"multi":' . $multi . ',
"removeCompleted":false,
"fileDataName":"file-upload",
"scriptData":{
"PHPSESSID":"' . session_id() . '"
},
"onComplete":function(event,ID,fileObj,response,data){
if(response=="deleted"){
alert("You have uploaded too many large files. These files' . ' have been deleted to conserve space. Please reload the ' . 'page and try again with less or smaller files.");
}
},
"onAllComplete":function(){
$("input[type=submit]").attr("disabled",false);
},
"onSelect":function(){
$("input[type=submit]").attr("disabled","disabled");
},
"fileExt":"' . $opts[1] . '",
"fileDesc":" ",
"auto":true
示例15: isset
<?php
require_once 'header.php';
$pname = isset($_REQUEST['_plugin']) ? $_REQUEST['_plugin'] : '';
$pagename = isset($_REQUEST['_page']) ? $_REQUEST['_page'] : '';
if (preg_match('/[^\\-a-zA-Z0-9]/', $pagename) || $pagename == '') {
die('illegal character in page name');
}
if (!isset($PLUGINS[$pname])) {
die('no plugin of that name (' . htmlspecialchars($pname) . ') exists');
}
$plugin = $PLUGINS[$pname];
$_url = '/ww.admin/plugin.php?_plugin=' . urlencode($pname) . '&_page=' . $pagename;
WW_addScript('/ww.admin/j/plugins.js');
// { help pages
$help = array();
if (file_exists(SCRIPTBASE . '/ww.plugins/' . $pname . '/docs/admin.html')) {
$help[] = array('admin', 'documentation');
}
if (file_exists(SCRIPTBASE . '/ww.plugins/' . $pname . '/docs/design.html')) {
$help[] = array('design', 'design docs');
}
if (count($help)) {
echo '<div id="nav-help" style="width:150px;">';
foreach ($help as $h) {
echo '<a href="javascript:show_help(\'' . $pname . '\',\'' . $h[0] . '\')">' . $h[1] . '</a>';
}
echo '</div>';
}
// }
// { display the plugin