本文整理汇总了PHP中JURI::buildQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP JURI::buildQuery方法的具体用法?PHP JURI::buildQuery怎么用?PHP JURI::buildQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JURI
的用法示例。
在下文中一共展示了JURI::buildQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run($form, $actiondata)
{
$mainframe =& JFactory::getApplication();
$params = new JParameter($actiondata->params);
if (function_exists('curl_init')) {
$form->debug['curl'][] = "CURL OK : the CURL function was found on this server.";
} else {
$form->debug['curl'][] = "CURL problem : the CURL function was not found on this server.";
return;
}
if (!empty($actiondata->content1)) {
$list = explode("\n", trim($actiondata->content1));
$curl_values = array();
foreach ($list as $item) {
$fields_data = explode("=", $item);
$curl_values[$fields_data[0]] = $form->data[trim($fields_data[1])];
}
}
$query = JURI::buildQuery($curl_values);
$form->debug['curl'][] = '$curl_values: ' . print_r($query, true);
$form->debug['curl'][] = 'curl_target_url: ' . $params->get('target_url');
$ch = curl_init($params->get('target_url'));
curl_setopt($ch, CURLOPT_HEADER, $params->get('header_in_response', 0));
// set to 0 to eliminate header info from response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Returns response data instead of TRUE(1)
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
// use HTTP POST to send form data
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec($ch);
//execute post and get results
curl_close($ch);
//add the response in the form data array
$form->data['curl'] = $response;
}
示例2: getReturnURL
static function getReturnURL($params, $type)
{
$app = JFactory::getApplication();
$router = $app->getRouter();
$url = null;
if ($itemid = $params->get($type))
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->nameQuote('link'));
$query->from($db->nameQuote('#__menu'));
$query->where($db->nameQuote('published') . '=1');
$query->where($db->nameQuote('id') . '=' . $db->quote($itemid));
$db->setQuery($query);
if ($link = $db->loadResult()) {
if ($router->getMode() == JROUTER_MODE_SEF) {
$url = 'index.php?Itemid='.$itemid;
}
else {
$url = $link.'&Itemid='.$itemid;
}
}
}
if (!$url)
{
// stay on the same page
$uri = clone JFactory::getURI();
$vars = $router->parse($uri);
unset($vars['lang']);
if ($router->getMode() == JROUTER_MODE_SEF)
{
if (isset($vars['Itemid']))
{
$itemid = $vars['Itemid'];
$menu = $app->getMenu();
$item = $menu->getItem($itemid);
unset($vars['Itemid']);
if (isset($item) && $vars == $item->query) {
$url = 'index.php?Itemid='.$itemid;
}
else {
$url = 'index.php?'.JURI::buildQuery($vars).'&Itemid='.$itemid;
}
}
else
{
$url = 'index.php?'.JURI::buildQuery($vars);
}
}
else
{
$url = 'index.php?'.JURI::buildQuery($vars);
}
}
return base64_encode($url);
}
示例3: array
function &_createURI($url)
{
// Create full URL if we are only appending variables to it
if (substr($url, 0, 1) == '&') {
$vars = array();
parse_str($url, $vars);
$vars = array_merge($this->getVars(), $vars);
foreach ($vars as $key => $var) {
if ($var == "") {
unset($vars[$key]);
}
}
$url = 'index.php?' . JURI::buildQuery($vars);
}
// Security - only allow one question mark in URL
$pos = strpos($url, '?');
if ($pos !== false) {
$url = substr($url, 0, $pos + 1) . str_replace('?', '%3F', substr($url, $pos + 1));
}
// Decompose link into url component parts
$uri = new JURI($url);
return $uri;
}
示例4: setType
/**
* Sets the type of the menu item currently being editted.
*
* @return void
* @since 1.6
*/
function setType()
{
// Initialise variables.
$app = JFactory::getApplication();
// Get the posted values from the request.
$data = array();
$data['type'] = json_decode(base64_decode(JRequest::getVar('params', '')));
$data['menutype'] = JRequest::getVar('menutype', '');
// Get the type.
$type = $data['type'];
$title = isset($type->title) ? $type->title : null;
$recordId = isset($type->id) ? $type->id : 0;
if ($title != 'alias' && $title != 'separator' && $title != 'url') {
$title = 'component';
}
$app->setUserState('com_menus.edit.item.type', $title);
if ($title == 'component') {
if (isset($type->request)) {
$component = JComponentHelper::getComponent($type->request->option);
$data['component_id'] = $component->id;
$app->setUserState('com_menus.edit.item.link', 'index.php?' . JURI::buildQuery((array) $type->request));
}
} else {
if ($title == 'alias') {
$app->setUserState('com_menus.edit.item.link', 'index.php?Itemid=');
}
}
unset($data['request']);
$data['type'] = $title;
if (JRequest::getCmd('fieldtype') == 'type') {
$data['link'] = $app->getUserState('com_menus.edit.item.link');
}
//Save the data in the session.
$app->setUserState('com_menus.edit.item.data', $data);
$this->type = $type;
$this->setRedirect(JRoute::_('index.php?option=com_menus&&view=item&layout=edit' . $this->getRedirectToItemAppend($recordId), false));
}
示例5: onAuthenticate
/**
* This method should handle any authentication and report back to the subject
*
* @access public
* @param array $credentials Array holding the user credentials
* @param array $options Array of extra options (return, entry_url)
* @param object $response Authentication response object
* @return boolean
* @since 1.5
*/
function onAuthenticate($credentials, $options, &$response)
{
$mainframe =& JFactory::getApplication();
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
define('Auth_OpenID_RAND_SOURCE', null);
} else {
$f = @fopen('/dev/urandom', 'r');
if ($f !== false) {
define('Auth_OpenID_RAND_SOURCE', '/dev/urandom');
fclose($f);
} else {
$f = @fopen('/dev/random', 'r');
if ($f !== false) {
define('Auth_OpenID_RAND_SOURCE', '/dev/urandom');
fclose($f);
} else {
define('Auth_OpenID_RAND_SOURCE', null);
}
}
}
jimport('openid.consumer');
jimport('joomla.filesystem.folder');
// Access the session data
$session =& JFactory::getSession();
// Create and/or start using the data store
$store_path = JPATH_ROOT . '/tmp/_joomla_openid_store';
if (!JFolder::exists($store_path) && !JFolder::create($store_path)) {
$response->type = JAUTHENTICATE_STATUS_FAILURE;
$response->error_message = "Could not create the FileStore directory '{$store_path}'. " . " Please check the effective permissions.";
return false;
}
// Create store object
$store = new Auth_OpenID_FileStore($store_path);
// Create a consumer object
$consumer = new Auth_OpenID_Consumer($store);
if (!isset($_SESSION['_openid_consumer_last_token'])) {
// Begin the OpenID authentication process.
if (!($auth_request = $consumer->begin($credentials['username']))) {
$response->type = JAUTHENTICATE_STATUS_FAILURE;
$response->error_message = 'Authentication error : could not connect to the openid server';
return false;
}
$sreg_request = Auth_OpenID_SRegRequest::build(array('email'), array('fullname', 'language', 'timezone'));
if ($sreg_request) {
$auth_request->addExtension($sreg_request);
}
$policy_uris = array();
if ($this->params->get('phishing-resistant', 0)) {
$policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/phishing-resistant';
}
if ($this->params->get('multi-factor', 0)) {
$policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/multi-factor';
}
if ($this->params->get('multi-factor-physical', 0)) {
$policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/multi-factor-physical';
}
$pape_request = new Auth_OpenID_PAPE_Request($policy_uris);
if ($pape_request) {
$auth_request->addExtension($pape_request);
}
//Create the entry url
$entry_url = isset($options['entry_url']) ? $options['entry_url'] : JURI::base();
$entry_url = JURI::getInstance($entry_url);
unset($options['entry_url']);
//We don't need this anymore
//Create the url query information
$options['return'] = isset($options['return']) ? base64_encode($options['return']) : base64_encode(JURI::base());
$options[JUtility::getToken()] = 1;
$process_url = sprintf($entry_url->toString() . "?option=com_user&task=login&username=%s", $credentials['username']);
$process_url .= '&' . JURI::buildQuery($options);
$session->set('return_url', $process_url);
$trust_url = $entry_url->toString(array('path', 'host', 'port', 'scheme'));
$session->set('trust_url', $trust_url);
// For OpenID 1, send a redirect. For OpenID 2, use a Javascript
// form to send a POST request to the server.
if ($auth_request->shouldSendRedirect()) {
$redirect_url = $auth_request->redirectURL($trust_url, $process_url);
// If the redirect URL can't be built, display an error
// message.
if (Auth_OpenID::isFailure($redirect_url)) {
displayError("Could not redirect to server: " . $redirect_url->message);
} else {
// Send redirect.
$mainframe->redirect($redirect_url);
return false;
}
} else {
// Generate form markup and render it.
$form_id = 'openid_message';
$form_html = $auth_request->htmlMarkup($trust_url, $process_url, false, array('id' => $form_id));
//.........这里部分代码省略.........
示例6: getList
//.........这里部分代码省略.........
//in sef some link have this url
//index.php/component/content/article?id=39
//id is not in vars but in $tmpuri
if (empty($vars['id'])) {
$tmpid = $tmpuri->getVar('id');
if (!empty($tmpid)) {
$vars['id'] = $tmpuri->getVar('id');
} else {
continue;
}
}
$item = $model->getItem($vars['id']);
//get alias of content item without the id , so i don't have the translation
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('alias')->from('#__content')->where('id = ' . (int) $item->id);
$db->setQuery($query);
$alias = $db->loadResult();
$vars['id'] = $item->id.':'.$alias;
$vars['catid'] =$item->catid.':'.$item->category_alias;
}
//new version 1.5
//case for k2 item alias write twice
if (isset($vars['option']) && $vars['option'] == 'com_k2'){
if ($vars['task'] == $vars['id']){
unset($vars['id']);
}
}
$url = 'index.php?'.JURI::buildQuery($vars);
$language->link = JRoute::_($url);
//TODO check performance 3 queries by languages -1
/**
* Replace the slug from the language switch with correctly translated slug.
* $language->lang_code language de la boucle (icone lien)
* $lang->getTag() => language en cours sur le site
* $default_lang langue par default du site
*/
if($lang->getTag() != $language->lang_code && !empty($vars['Itemid']))
{
$fManager = FalangManager::getInstance();
$id_lang = $fManager->getLanguageID($language->lang_code);
$db = JFactory::getDbo();
// get translated path if exist
$query = $db->getQuery(true);
$query->select('fc.value')
->from('#__falang_content fc')
->where('fc.reference_id = '.(int)$vars['Itemid'])
->where('fc.language_id = '.(int) $id_lang )
->where('fc.reference_field = \'path\'')
->where('fc.reference_table = \'menu\'');
$db->setQuery($query);
$translatedPath = $db->loadResult();
// $translatedPath not exist if not translated or site default language
// don't pass id to the query , so no translation given by falang
$query = $db->getQuery(true);
$query->select('m.path')
->from('#__menu m')
->where('m.id = '.(int)$vars['Itemid']);
$db->setQuery($query);
示例7: openid
//.........这里部分代码省略.........
$ax_request = new Auth_OpenID_AX_FetchRequest();
$ax_request->add(Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email', 1, true));
// }
$sreg_request = Auth_OpenID_SRegRequest::build(array('email'));
if ($ax_request) {
$auth_request->addExtension($ax_request);
$auth_request->addExtension($sreg_request);
}
// $policy_uris = array();
// if ($this->params->get( 'phishing-resistant', 0)) {
// $policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/phishing-resistant';
// }
//
// if ($this->params->get( 'multi-factor', 0)) {
// $policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/multi-factor';
// }
//
// if ($this->params->get( 'multi-factor-physical', 0)) {
// $policy_uris[] = 'http://schemas.openid.net/pape/policies/2007/06/multi-factor-physical';
// }
//
// $pape_request = new Auth_OpenID_PAPE_Request($policy_uris);
// if ($pape_request) {
// $auth_request->addExtension($pape_request);
// }
//Create the entry url
$entry_url = isset($options['entry_url']) ? $options['entry_url'] : JURI::base();
$entry_url = JURI::getInstance($entry_url);
unset($options['entry_url']);
//We don't need this anymore
//Create the url query information
$options['return'] = isset($options['return']) ? base64_encode($options['return']) : base64_encode(JURI::base());
$options[JUtility::getToken()] = 1;
$process_url = sprintf($entry_url->toString() . "?option=com_user&task=login&provider=%s", $provider);
$process_url = isset($username) && $username ? sprintf("%s&username=%s", $process_url, urlencode($username)) : $process_url;
$process_url .= '&' . JURI::buildQuery($options);
$session->set('return_url', $process_url);
$trust_url = $entry_url->toString(array('path', 'host', 'port', 'scheme'));
$session->set('trust_url', $trust_url);
// For OpenID 1, send a redirect. For OpenID 2, use a Javascript
// form to send a POST request to the server.
if ($auth_request->shouldSendRedirect()) {
$redirect_url = $auth_request->redirectURL($trust_url, $process_url);
// If the redirect URL can't be built, display an error
// message.
if (Auth_OpenID::isFailure($redirect_url)) {
displayError("Could not redirect to server: " . $redirect_url->message);
} else {
// Send redirect.
$mainframe->redirect($redirect_url);
return false;
}
} else {
// Generate form markup and render it.
$form_id = 'openid_message';
$form_html = $auth_request->htmlMarkup($trust_url, $process_url, false, array('id' => $form_id));
// Display an error if the form markup couldn't be generated;
// otherwise, render the HTML.
if (Auth_OpenID::isFailure($form_html)) {
//displayError("Could not redirect to server: " . $form_html->message);
} else {
JResponse::setBody($form_html);
echo JResponse::toString($mainframe->getCfg('gzip'));
$mainframe->close();
return false;
}
}
}
$result = $consumer->complete($session->get('return_url'));
// estandarizo el formato de salida de los datos necesarios
$info[EXTERNAL_ID] = $result->getDisplayIdentifier();
switch ($result->status) {
case Auth_OpenID_SUCCESS:
$info[STATUS] = Auth_SUCCESS;
$ax_resp = Auth_OpenID_AX_FetchResponse::fromSuccessResponse($result);
if ($ax_resp) {
$email = $ax_resp->getSingle('http://axschema.org/contact/email');
if ($email && !is_a($email, 'Auth_OpenID_AX_Error')) {
$info[EMAIL] = $email;
}
}
$sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($result);
if (!isset($info[EMAIL]) && $sreg_resp) {
$sreg = $sreg_resp->contents();
if (isset($sreg['email'])) {
$info[EMAIL] = $sreg['email'];
}
}
$info[EMAIL] = isset($info[EMAIL]) ? $info[EMAIL] : $info[EXTERNAL_ID];
$info[LABEL] = $dbprovider->use_email ? $info[EMAIL] : $info[EXTERNAL_ID];
break;
case Auth_OpenID_CANCEL:
$info[STATUS] = Auth_CANCEL;
break;
case Auth_OpenID_FAILURE:
$info[STATUS] = Auth_FAILURE;
break;
}
return $info;
}
示例8: onsubmit
/**
* The function that will be executed when the form is submitted
*
*/
function onsubmit($option, $params, $row)
{
global $mainframe;
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_chronocontact' . DS . 'helpers' . DS . 'plugin.php';
$helper = new ChronoContactHelperPlugin();
$doc =& JFactory::getDocument();
$doc->addStyleDeclaration("div.debug {border:1px solid red; padding:3px; margin-bottom:3px;}");
$mainframe->enqueuemessage('$_POST: ' . print_r($_POST, true));
$messages = array();
/*********do the before onsubmit code**********/
if (!empty($row->extra4)) {
eval("?>" . $row->extra4);
}
$url_values = array();
/// add main fields
if (trim($row->extra2)) {
$extras2 = explode("\n", $row->extra2);
foreach ($extras2 as $extra2) {
$values = array();
$values = explode("=", $extra2);
if ($values[1]) {
$v = urlencode(trim($values[1]));
$url_values[$v] = JRequest::getVar(trim($values[0]), '', 'post', 'string', '');
}
}
}
if (trim($row->extra1)) {
$extras = explode("\n", $row->extra1);
foreach ($extras as $extra) {
// Note: accept only the first parameter pair on each line
$values = explode("=", $extra, 2);
if (isset($values[1])) {
$url_values[$values[0]] = trim($values[1]);
}
}
}
$query = JURI::buildQuery($url_values);
$uri = $params->get('target_url') . '?' . $query;
$parts['query'] = $query;
$parts['scheme'] = 'http';
$parts['host'] = 'bobjanes.com';
//$parts['host'] = $params->get('target_url');
//$uri = JURI::toString($parts);
$MyForm =& CFChronoForm::getInstance();
$MyForm->formrow->redirecturl = $uri;
$messages[] = '<b>cf_redirect debug info</b>';
$messages[] = '$url: ' . print_r($uri, true);
$messages[] = '$_POST: ' . print_r($_POST, true);
/*
* Build query into url and set CF redirect url
*/
$helper->showCFDebugMessage('Redirect URL set');
if ($params->get('debugging')) {
$helper->showPluginDebugMessages($messages);
}
}
示例9: getReturnURL
public static function getReturnURL()
{
$app = JFactory::getApplication();
$router = $app->getRouter();
$lr_settings = self::sociallogin_getsettings();
$check_rewrite = $app->getCfg('sef_rewrite');
$url = null;
if ($itemid = $lr_settings['setredirct']) {
$db = JFactory::getDbo();
if ($router->getMode() == JROUTER_MODE_SEF) {
$query = "SELECT path FROM #__menu WHERE id = " . $itemid;
$db->setQuery($query);
$url = $db->loadResult();
if ($check_rewrite == '0' and !empty($url)) {
$url = 'index.php/' . $url;
}
} else {
$query = "SELECT link FROM #__menu WHERE id = " . $itemid;
$db->setQuery($query);
$url = $db->loadResult();
}
}
if (!$url) {
// stay on the same page
$uri = clone JFactory::getURI();
$vars = $router->parse($uri);
unset($vars['lang']);
if ($router->getMode() == JROUTER_MODE_SEF) {
if (isset($vars['Itemid'])) {
$itemid = $vars['Itemid'];
$menu = $app->getMenu();
$item = $menu->getItem($itemid);
unset($vars['Itemid']);
if (isset($item) && $vars == $item->query) {
$query = "SELECT path FROM #__menu WHERE id = '" . $itemid . "' AND home = 1";
$db->setQuery($query);
$home_url = $db->loadResult();
if ($home_url) {
$url = 'index.php';
} else {
$query = "SELECT path FROM #__menu WHERE id = " . $itemid;
$db->setQuery($query);
$url = $db->loadResult();
}
} else {
// get article url path
$articlePath =& JFactory::getURI()->getPath();
$url = $articlePath;
}
} else {
$articlePath =& JFactory::getURI()->getPath();
$url = $articlePath;
}
} else {
$url = 'index.php?' . JURI::buildQuery($vars);
}
}
return $url;
}
示例10: onsubmit
/**
* The function that will be executed when the form is submitted
*
*/
function onsubmit($option, $params, $row)
{
global $mainframe;
if (!function_exists('curl_init')) {
$mainframe->enqueuemessage("CURL problem : the CURL function was not found on this server.<br />\n Sorry, but the CURL plugin cannot be used on this site as it is currently set up.", 'error');
return;
}
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_chronocontact' . DS . 'helpers' . DS . 'plugin.php';
$helper = new ChronoContactHelperPlugin();
$doc =& JFactory::getDocument();
$doc->addStyleDeclaration("div.debug {border:1px solid red; padding:3px; margin-bottom:3px;}");
$messages = array();
/*********do the before onsubmit code**********/
if (!empty($row->extra4)) {
eval("?>" . $row->extra4);
}
$curl_values = array();
/// add main fields
if (trim($row->extra2)) {
$extras2 = explode("\n", $row->extra2);
foreach ($extras2 as $extra2) {
$values = array();
$values = explode("=", $extra2);
if ($values[1]) {
$v = urlencode(trim($values[1]));
$curl_values[$v] = JRequest::getVar(trim($values[0]), '', 'post', 'string', '');
}
}
}
if (trim($row->extra1)) {
$extras = explode("\n", $row->extra1);
foreach ($extras as $extra) {
// Note: accept only the first parameter pair on each line
$values = explode("=", $extra, 2);
$curl_values[$values[0]] = trim($values[1]);
}
}
$query = JURI::buildQuery($curl_values);
$messages[] = '<b>cf_CURL debug info</b>';
$messages[] = '$curl_values: ' . print_r($query, true);
$messages[] = '$params->target_url: ' . print_r($params->get('target_url'), true);
$ch = curl_init($params->get('target_url'));
$messages[] = '$ch: ' . print_r($ch, true);
curl_setopt($ch, CURLOPT_HEADER, $params->get('header_in_response'));
// set to 0 to eliminate header info from response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Returns response data instead of TRUE(1)
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
// use HTTP POST to send form data
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec($ch);
//execute post and get results
curl_close($ch);
$messages[] = 'CURL response: ' . print_r($response, true);
$helper->showCFDebugMessage('CURL transaction executed');
/*********do the after onsubmit code**********/
if (!empty($row->extra5)) {
eval("?>" . $row->extra5);
}
if ($params->get('debugging')) {
$helper->showPluginDebugMessages($messages);
}
}
示例11: buildInternalUrl
/**
* Build internal URL - indepedent of SEF function
*
* @param object $uri
* @return string
*/
private function buildInternalUrl($uri)
{
// Clone JURI object to avoid an error because of the method -parse- in the next step
$uri_clone = clone $uri;
// Reference to JRouter object
$route = JSite::getRouter();
// Get the internal route
$url_internal_array = $route->parse($uri_clone);
// Move Itemid at the end
if (array_key_exists('Itemid', $url_internal_array)) {
$itemid = $url_internal_array['Itemid'];
unset($url_internal_array['Itemid']);
$url_internal_array['Itemid'] = $itemid;
}
// Move lang at the end
if (array_key_exists('lang', $url_internal_array)) {
$lang = $url_internal_array['lang'];
unset($url_internal_array['lang']);
$url_internal_array['lang'] = $lang;
}
$url_internal = JURI::base() . 'index.php?' . JURI::buildQuery($url_internal_array);
return $url_internal;
}
示例12: buildUrl
/**
* build url
*
* @param array $parts parts
*
* @return string
*/
protected static function buildUrl($parts)
{
if ($item = self::_findItem($parts)) {
$parts['Itemid'] = $item->id;
}
return 'index.php?' . JURI::buildQuery($parts);
}
示例13: array
/**
* Create a uri based on a full or partial url string
*
* @access protected
* @return JURI A JURI object
*/
function &_createURI($url)
{
// Create full URL if we are only appending variables to it
if (substr($url, 0, 1) == '&') {
$vars = array();
parse_str($url, $vars);
$vars = array_merge($this->getVars(), $vars);
foreach ($vars as $key => $var) {
if ($var == "") {
unset($vars[$key]);
}
}
$url = 'index.php?' . JURI::buildQuery($vars);
}
// Decompose link into url component parts
$uri = new JURI($url);
return $uri;
}
示例14:
} else {
?>
people<?php
}
?>
did this</p>
<?php
}
if (SWG_EventsController::canRecordAttendance()) {
?>
<p>
<a class="attendance" href="<?php
echo JURI::current();
?>
?<?php
echo JURI::buildQuery(array("task" => "attendance.attend", "evttype" => $event->getType(), "evtid" => $event->id, "set" => (int) (!$attended)));
?>
"
><img src="/images/icons/<?php
if ($attended) {
?>
tick<?php
} else {
?>
tickbox<?php
}
?>
.png" width="19" height="16" /
></a>
You did this
</p>
示例15: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.2.0
*/
protected function getInput()
{
// Initialise variables
$value = '';
$html = array();
$size = !empty($this->size) ? ' size="' . $this->size . '"' : '';
$class = !empty($this->class) ? ' class="' . $this->class . '"' : 'class="inputbox"';
$recordId = (int) $this->form->getValue('id', 0);
$typeExtension = 'extension';
if ($extension = FieldsandfiltersFactory::getExtensions()->getExtensionsPivot('content_type_id', true)->get($this->value)) {
// Load Extensions Helper
KextensionsLanguage::load('plg_' . $extension->type . '_' . $extension->name, JPATH_ADMINISTRATOR);
$extensionForm = $extension->forms->get($typeExtension, new JObject());
if (isset($extensionForm->group->title)) {
$value = JText::_($extensionForm->title) . ' [' . JText::_($extensionForm->group->title) . ']';
} elseif (isset($extensionForm->title)) {
$value = JText::_($extensionForm->title);
}
}
// Load the javascript and css
JHtml::_('behavior.framework');
JHtml::_('behavior.modal');
$query = array('option' => 'com_fieldsandfilters', 'view' => 'plugins', 'tmpl' => 'component', 'layout' => 'extensions', 'recordId' => $recordId);
$link = JRoute::_('index.php?' . JURI::buildQuery($query));
if (FieldsandfiltersFactory::isVersion()) {
$html[] = '<span class="input-append">';
$html[] = ' <input type="text" readonly="readonly" disabled="disabled" value="' . $value . '"' . $size . $class . ' />';
$html[] = ' <a class="btn btn-primary" onclick="SqueezeBox.fromElement(this, {handler:\'iframe\', size: {x: 600, y: 450}, url:\'' . $link . '\'})">';
$html[] = ' <i class="icon-list icon-white"></i>';
$html[] = JText::_('JSELECT');
$html[] = ' </a>';
$html[] = '</span>';
$html[] = '<input class="input-small" type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" />';
} else {
$html[] = '<input type="text" readonly="readonly" disabled="disabled" value="' . $value . '"' . $size . $class . ' />';
$html[] = '<input type="button" value="' . JText::_('JSELECT') . '" onclick="SqueezeBox.fromElement(this, {handler:\'iframe\', size: {x: 600, y: 450}, url:\'' . $link . '\'})" />';
$html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" />';
}
return implode("\n", $html);
}