本文整理汇总了PHP中CString类的典型用法代码示例。如果您正苦于以下问题:PHP CString类的具体用法?PHP CString怎么用?PHP CString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PesquisaCentroCustoEmpresa
Public function PesquisaCentroCustoEmpresa($pesquisa, $Cod) {
$option = "";
$CentroaAlteracao = false;
$String = new CString();
$ObjModel = new ModellancaCrBd();
$resultado = parent::ListaCentroCusto(trim($pesquisa));
if ($Cod)
$CentroaAlteracao = $ObjModel->RecuperaCampo("CENTRO_CUSTO_ID", "F_LANCA_CR", "F_LANCA_CR_ID", $String->descriptografa($Cod));
if ($resultado) {
foreach ($resultado as $ListaCentro){
$select = "";
if ($CentroaAlteracao == $ListaCentro->getIdCentroCusto()) {
$select = ' selected="selected" ';
}
$option .= '<option' . $select . ' value="' . $ListaCentro->getIdCentroCusto() . '">' . $ListaCentro->getNomeCentroCusto() . '</option>';
}
$Retorno = '<label class="col-sm-2 control-label" for="combobox">Centro Custo *</label>
<div class="col-sm-3">
<select name="centro_custo" id="centro_custo" class="form-control input-sm" required="required">
<option value=""></option>' .
$option . '
</select>
</div>
</div>';
echo $Retorno;
exit();
} else {
echo 0;
exit();
}
}
示例2: PesquisaClienteGrupo
Public function PesquisaClienteGrupo($pesquisa) {
$String = new CString();
$resultado = parent::ListaEmpresaGrupos($String->convertem($pesquisa, 1));
echo json_encode($resultado);
}
示例3: injectTags
/**
* Inject data from paramter to content tags ({}) .
*
* @param $content Original content with content tags.
* @param $params Text contain all values need to be replaced.
* @param $html Auto detect url tag and insert inline.
* @return $text The content after replacing.
**/
public static function injectTags($content, $paramsTxt, $html = false)
{
$params = new CParameter($paramsTxt);
preg_match_all("/{(.*?)}/", $content, $matches, PREG_SET_ORDER);
if (!empty($matches)) {
foreach ($matches as $val) {
$replaceWith = JString::trim($params->get($val[1], null));
if (!is_null($replaceWith)) {
//if the replacement start with 'index.php', we can CRoute it
if (JString::strpos($replaceWith, 'index.php') === 0) {
$replaceWith = CRoute::getExternalURL($replaceWith);
}
if ($html) {
$replaceUrl = $params->get($val[1] . '_url', null);
if (!is_null($replaceUrl)) {
if ($val[1] == 'stream') {
$replaceUrl .= '#activity-stream-container';
}
//if the replacement start with 'index.php', we can CRoute it
if (JString::strpos($replaceUrl, 'index.php') === 0) {
$replaceUrl = CRoute::getExternalURL($replaceUrl);
}
$replaceWith = '<a href="' . $replaceUrl . '">' . $replaceWith . '</a>';
}
}
$content = CString::str_ireplace($val[0], $replaceWith, $content);
}
}
}
return $content;
}
示例4: setImage
public function setImage($path, $type = 'thumb')
{
CError::assert($path, '', '!empty', __FILE__, __LINE__);
$db = $this->getDBO();
// Fix the back quotes
$path = CString::str_ireplace('\\', '/', $path);
$type = JString::strtolower($type);
// Test if the record exists.
$oldFile = $this->{$type};
if ($db->getErrorNum()) {
JError::raiseError(500, $db->stderr());
}
if ($oldFile) {
// File exists, try to remove old files first.
$oldFile = CString::str_ireplace('/', '/', $oldFile);
// If old file is default_thumb or default, we should not remove it.
//
// Need proper way to test it
if (!JString::stristr($oldFile, 'group.jpg') && !JString::stristr($oldFile, 'group_thumb.jpg') && !JString::stristr($oldFile, 'default.jpg') && !JString::stristr($oldFile, 'default_thumb.jpg')) {
jimport('joomla.filesystem.file');
JFile::delete($oldFile);
}
}
$this->{$type} = $path;
$this->store();
}
示例5: onActivityContentDisplay
function onActivityContentDisplay($args)
{
$model =& CFactory::getModel('Wall');
$wall =& JTable::getInstance('Wall', 'CTable');
$my = CFactory::getUser();
if (empty($args->content)) {
return '';
}
$wall->load($args->cid);
CFactory::load('libraries', 'privacy');
CFactory::load('libraries', 'comment');
$comment = CComment::stripCommentData($wall->comment);
$config = CFactory::getConfig();
$commentcut = false;
if (strlen($comment) > $config->getInt('streamcontentlength')) {
$origcomment = $comment;
$comment = JString::substr($comment, 0, $config->getInt('streamcontentlength')) . ' ...';
$commentcut = true;
}
if (CPrivacy::isAccessAllowed($my->id, $args->target, 'user', 'privacyProfileView')) {
CFactory::load('helpers', 'videos');
CFactory::load('libraries', 'videos');
CFactory::load('libraries', 'wall');
$videoContent = '';
$params = new CParameter($args->params);
$videoLink = $params->get('videolink');
$image = $params->get('url');
// For older activities that does not have videoLink , we need to process it the old way.
if (!$videoLink) {
$html = CWallLibrary::_processWallContent($comment);
$tmpl = new CTemplate();
$html = CStringHelper::escape($html);
if ($commentcut) {
//add read more/less link for content
$html .= '<br /><br /><a href="javascript:void(0)" onclick="jQuery(\'#shortcomment_' . $args->cid . '\').hide(); jQuery(\'#origcomment_' . $args->cid . '\').show();" >' . JText::_('COM_COMMUNITY_READ_MORE') . '</a>';
$html = '<div id="shortcomment_' . $args->cid . '">' . $html . '</div>';
$html .= '<div id="origcomment_' . $args->cid . '" style="display:none;">' . $origcomment . '<br /><br /><a href="javascript:void(0);" onclick="jQuery(\'#shortcomment_' . $args->cid . '\').show(); jQuery(\'#origcomment_' . $args->cid . '\').hide();" >' . JText::_('COM_COMMUNITY_READ_LESS') . '</a></div>';
}
$tmpl->set('comment', $html);
$html = $tmpl->fetch('activity.wall.post');
} else {
$html = '<ul class ="cDetailList clrfix">';
$html .= '<li>';
$image = !$image ? rtrim(JURI::root(), '/') . '/components/com_community/assets/playvideo.gif' : $image;
$videoLib = new CVideoLibrary();
$provider = $videoLib->getProvider($videoLink);
$html .= '<!-- avatar --><div class="avatarWrap"><a href="javascript:void(0);" onclick="joms.activities.showVideo(\'' . $args->id . '\');"><img width="64" src="' . $image . '" class="cAvatar"/></a></div><!-- avatar -->';
$videoPlayer = $provider->getViewHTML($provider->getId(), '300', '300');
$comment = CString::str_ireplace($videoLink, '', $comment);
$html .= '<!-- details --><div class="detailWrap alpha">' . $comment . '</div><!-- details -->';
if (!empty($videoPlayer)) {
$html .= '<div style="display: none;clear: both;padding-top: 5px;" class="video-object">' . $videoPlayer . '</div>';
}
$html .= '</li>';
$html .= '</ul>';
}
return $html;
}
}
示例6: getItems
/**
* Retrieve menu items in JomSocial's toolbar
*
* @access public
* @param
*
* @return Array An array of #__menu objects.
**/
public function getItems()
{
$config = CFactory::getConfig();
$db = JFactory::getDBO();
$menus = array();
// For menu access
$my = CFactory::getUser();
//joomla 1.6
$menutitlecol = !C_JOOMLA_15 ? 'title' : 'name';
$query = 'SELECT a.' . $db->nameQuote('id') . ', a.' . $db->nameQuote('link') . ', a.' . $menutitlecol . ' as name, a.' . $db->nameQuote(TABLE_MENU_PARENTID) . ', false as script ' . ' FROM ' . $db->nameQuote('#__menu') . ' AS a ' . ' LEFT JOIN ' . $db->nameQuote('#__menu') . ' AS b ' . ' ON b.' . $db->nameQuote('id') . '=a.' . $db->nameQuote(TABLE_MENU_PARENTID) . ' AND b.' . $db->nameQuote('published') . '=' . $db->Quote(1) . ' ' . ' WHERE a.' . $db->nameQuote('published') . '=' . $db->Quote(1) . ' ' . ' AND a.' . $db->nameQuote('menutype') . '=' . $db->Quote($config->get('toolbar_menutype'));
if ($my->id == 0) {
$query .= ' AND a.' . $db->nameQuote('access') . '=' . $db->Quote(0);
}
CFactory::load('helpers', 'owner');
if ($my->id > 0 && !COwnerHelper::isCommunityAdmin()) {
// $query .= ' AND a.' . $db->nameQuote( 'access' ) . '>=' . $db->Quote( 0 ) . ' AND a.' . $db->nameQuote( 'access' ) . '<' . $db->Quote( 2 );
//we haven't supported access level setting for toolbar menu yet.
$query .= ' AND a.' . $db->nameQuote('access') . '>=' . $db->Quote(0);
}
if (COwnerHelper::isCommunityAdmin()) {
$query .= ' AND a.' . $db->nameQuote('access') . '>=' . $db->Quote(0);
}
$ordering_field = TABLE_MENU_ORDERING_FIELD;
$query .= ' ORDER BY a.' . $db->nameQuote($ordering_field);
$db->setQuery($query);
$result = $db->loadObjectList();
// remove disabled apps base on &view=value in result's link
$this->cleanMenus($result);
//avoid multiple count execution
$parentColumn = TABLE_MENU_PARENTID;
$menus = array();
foreach ($result as $i => $row) {
//get top main links on toolbar
//add Itemid if not our components and dont add item id for external link
$row->link = CString::str_ireplace('https://', 'http://', $row->link);
if (strpos($row->link, 'com_community') == false && strpos($row->link, 'http://') === false) {
$row->link .= "&Itemid=" . $row->id;
}
if ($row->{$parentColumn} == MENU_PARENT_ID) {
$obj = new stdClass();
$obj->item = $row;
$obj->item->script = false;
$obj->childs = null;
$menus[$row->id] = $obj;
}
}
// Retrieve child menus from the original result.
// Since we reduce the number of sql queries, we need to use php to split the menu's out
// accordingly.
foreach ($result as $i => $row) {
if ($row->{$parentColumn} != MENU_PARENT_ID && isset($menus[$row->{$parentColumn}])) {
if (!is_array($menus[$row->{$parentColumn}]->childs)) {
$menus[$row->{$parentColumn}]->childs = array();
}
$menus[$row->{$parentColumn}]->childs[] = $row;
}
}
return $menus;
}
示例7: profile
/**
* Displays the viewing profile page.
*
* @access public
* @param array An associative array to display the fields
*/
public function profile(&$data)
{
$mainframe = JFactory::getApplication();
$friendsModel = CFactory::getModel('friends');
$showfriends = JRequest::getVar('showfriends', false);
$userid = JRequest::getVar('userid', '');
$user = CFactory::getUser($userid);
$linkUrl = CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id);
$document = JFactory::getDocument();
$document->setTitle(JText::sprintf('COM_COMMUNITY_USERS_FEED_TITLE', $user->getDisplayName()));
$document->setDescription(JText::sprintf('COM_COMMUNITY_USERS_FEED_DESCRIPTION', $user->getDisplayName(), $user->lastvisitDate));
$document->setLink($linkUrl);
include_once JPATH_COMPONENT . '/libraries/activities.php';
$act = new CActivityStream();
$friendIds = $friendsModel->getFriendIds($user->id);
$friendIds = $showfriends ? $friendIds : null;
$rows = $act->getFEED($user->id, $friendIds, null, $mainframe->getCfg('feed_limit'));
// add the avatar image
$rssImage = new JFeedImage();
$rssImage->url = $user->getThumbAvatar();
$rssImage->link = $linkUrl;
$rssImage->width = 64;
$rssImage->height = 64;
$document->image = $rssImage;
//CFactory::load( 'helpers' , 'string' );
//CFactory::load( 'helpers' , 'time' );
foreach ($rows->data as $row) {
if ($row->type != 'title') {
// Get activities link
$pattern = '/<a href=\\"(.*?)\\"/';
preg_match_all($pattern, $row->title, $matches);
// Use activity owner link when activity link is not available
if (!empty($matches[1][1])) {
$linkUrl = $matches[1][1];
} else {
if (!empty($matches[1][0])) {
$linkUrl = $matches[1][0];
}
}
// load individual item creator class
$item = new JFeedItem();
$item->title = $row->title;
$item->link = $linkUrl;
$item->description = "<img src=\"{$row->favicon}\" alt=\"\" /> " . $row->title;
$item->date = CTimeHelper::getDate($row->createdDateRaw)->toRFC822();
$item->category = '';
//$row->category;
$item->description = CString::str_ireplace('_QQQ_', '"', $item->description);
// Make sure url is absolute
$pattern = '/href="(.*?)index.php/';
$replace = 'href="' . JURI::base() . 'index.php';
$string = $item->description;
$item->description = preg_replace($pattern, $replace, $string);
// loads item info into rss array
$document->addItem($item);
}
}
}
示例8: add
/**
* Add sharing sites into bookmarks
* @params string $providerName Pass the provider name to be displayed
* @params string $imageURL Image that needs to be displayed beside the provider
* @params string $apiURL Api URL that JomSocial should link to
**/
public function add($providerName, $className, $apiURL)
{
$apiURL = CString::str_ireplace('{uri}', $this->currentURI, $apiURL);
$obj = new stdClass();
$obj->name = $providerName;
$obj->className = $className;
$obj->link = $apiURL;
$this->_bookmarks[JString::strtolower($providerName)] = $obj;
}
示例9: display
/**
* The default method that will display the output of this view which is called by
* Joomla
*
* @param string template Template file name
**/
public function display($tpl = null)
{
$document = JFactory::getDocument();
$params = $this->get('Params');
//user's email privacy setting
//CFactory::load( 'libraries' , 'notificationtypes' );
$notificationTypes = new CNotificationTypes();
$lists = array();
for ($i = 1; $i <= 31; $i++) {
$qscale[] = JHTML::_('select.option', $i, $i);
}
$lists['qscale'] = JHTML::_('select.genericlist', $qscale, 'qscale', 'class="inputbox" size="1"', 'value', 'text', $params->get('qscale', '11'));
$videosSize = array(JHTML::_('select.option', '320x240', '320x240 (QVGA 4:3)'), JHTML::_('select.option', '400x240', '400x240 (WQVGA 5:3)'), JHTML::_('select.option', '400x300', '400x300 (Quarter SVGA 4:3)'), JHTML::_('select.option', '480x272', '480x272 (Sony PSP 30:17)'), JHTML::_('select.option', '480x320', '480x320 (iPhone 3:2)'), JHTML::_('select.option', '480x360', '480x360 (4:3)'), JHTML::_('select.option', '512x384', '512x384 (4:3)'), JHTML::_('select.option', '600x480', '600x480 (4:3)'), JHTML::_('select.option', '640x360', '640x360 (16:9)'), JHTML::_('select.option', '640x480', '640x480 (VCA 4:3)'), JHTML::_('select.option', '800x600', '800x600 (SVGA 4:3)'));
$lists['videosSize'] = JHTML::_('select.genericlist', $videosSize, 'videosSize', 'class="inputbox" size="1"', 'value', 'text', $params->get('videosSize'));
$imgQuality = array(JHTML::_('select.option', '60', 'Low'), JHTML::_('select.option', '80', 'Medium'), JHTML::_('select.option', '90', 'High'), JHTML::_('select.option', '95', 'Very High'));
$lists['imgQuality'] = JHTML::_('select.genericlist', $imgQuality, 'output_image_quality', 'class="inputbox" size="1"', 'value', 'text', $params->get('output_image_quality'));
//album mode
$albumMode = array(JHTML::_('select.option', '0', JText::_('COM_COMMUNITY_SAME_WINDOW')), JHTML::_('select.option', '1', JText::_('COM_COMMUNITY_MODAL_WINDOW')));
$lists['albumMode'] = JHTML::_('select.genericlist', $albumMode, 'album_mode', 'class="inputbox" size="1"', 'value', 'text', $params->get('album_mode'));
//video mode
$videoMode = array(JHTML::_('select.option', '0', JText::_('COM_COMMUNITY_SAME_WINDOW')), JHTML::_('select.option', '1', JText::_('COM_COMMUNITY_MODAL_WINDOW')));
$lists['videoMode'] = JHTML::_('select.genericlist', $videoMode, 'video_mode', 'class="inputbox" size="1"', 'value', 'text', $params->get('video_mode'));
//video native
$videoNative = array(JHTML::_('select.option', '0', JText::_('COM_COMMUNITY_STREAM_VIDEO_PLAYER_MEDIAELEMENT')), JHTML::_('select.option', '1', JText::_('COM_COMMUNITY_STREAM_VIDEO_PLAYER_NATIVE')));
$lists['videoNative'] = JHTML::_('select.genericlist', $videoNative, 'video_native', 'class="inputbox" size="1"', 'value', 'text', $params->get('video_native'));
// Group discussion order option
$groupDiscussionOrder = array(JHTML::_('select.option', 'ASC', 'Older first'), JHTML::_('select.option', 'DESC', 'Newer first'));
$lists['groupDicussOrder'] = JHTML::_('select.genericlist', $groupDiscussionOrder, 'group_discuss_order', 'class="inputbox" size="1"', 'value', 'text', $params->get('group_discuss_order'));
$videoThumbSize = array(JHTML::_('select.option', '320x180', '320x180'), JHTML::_('select.option', '640x360', '640x360'), JHTML::_('select.option', '1280x720', '1280x720'));
$lists['videoThumbSize'] = JHTML::_('select.genericlist', $videoThumbSize, 'videosThumbSize', 'class="inputbox" size="1"', 'value', 'text', $params->get('videosThumbSize'));
$dstOffset = array();
$counter = -4;
for ($i = 0; $i <= 8; $i++) {
$dstOffset[] = JHTML::_('select.option', $counter, $counter);
$counter++;
}
$watermarkPosition = array(JHTML::_('select.option', 'left_top', JText::_('COM_COMMUNITY_CONFIGURATION_PHOTOS_WATERMARK_POSITION_LFFT_TOP')), JHTML::_('select.option', 'left_bottom', JText::_('COM_COMMUNITY_CONFIGURATION_PHOTOS_WATERMARK_POSITION_LFFT_BOTTOM')), JHTML::_('select.option', 'right_top', JText::_('COM_COMMUNITY_CONFIGURATION_PHOTOS_WATERMARK_POSITION_RIGHT_TOP')), JHTML::_('select.option', 'right_bottom', JText::_('COM_COMMUNITY_CONFIGURATION_PHOTOS_WATERMARK_POSITION_RIGHT_BOTTOM')));
$lists['watermarkPosition'] = JHTML::_('select.genericlist', $watermarkPosition, 'watermark_position', 'class="inputbox" size="1"', 'value', 'text', $params->get('watermark_position'));
$lists['dstOffset'] = JHTML::_('select.genericlist', $dstOffset, 'daylightsavingoffset', 'class="inputbox" size="1"', 'value', 'text', $params->get('daylightsavingoffset'));
$networkModel = $this->getModel('network', false);
$JSNInfo = $networkModel->getJSNInfo();
$JSON_output = $networkModel->getJSON();
$lists['enable'] = JHTML::_('select.booleanlist', 'network_enable', 'class="inputbox"', $JSNInfo['network_enable']);
$uploadLimit = ini_get('upload_max_filesize');
$uploadLimit = CString::str_ireplace('M', ' MB', $uploadLimit);
require_once JPATH_ROOT . '/administrator/components/com_community/libraries/autoupdate.php';
$isuptodate = CAutoUpdate::checkUpdate();
$this->assign('JSNInfo', $JSNInfo);
$this->assign('JSON_output', $JSON_output);
$this->assign('lists', $lists);
$this->assign('uploadLimit', $uploadLimit);
$this->assign('config', $params);
$this->assign('isuptodate', $isuptodate);
$this->assign('notificationTypes', $notificationTypes);
parent::display($tpl);
}
示例10: PesquisaClienteGrupo
Public function PesquisaClienteGrupo($pesquisa)
{
$String = new CString();
//recebo o paametro vindo do form
$parametro = isset($_POST['pesquisaClienteCategoria']) ? $_POST['pesquisaClienteCategoria'] : null;
$msg = "";
//começo a concatenar a tabela
$msg .= "<table class='table table-hover tablePesquisaClienteGrupo' id='tabela' border='1'>";
$msg .= " <thead>";
$msg .= " <tr >";
$msg .= " <th>Cód</th>";
$msg .= " <th>Tipo</th>";
$msg .= " <th class='EmpresaGrupo' ><a href='#'>Nome</a></th>";
$msg .= " </tr>";
$msg .= " </thead>";
$msg .= " <tbody>";
$resultado = parent::ListaEmpresaGrupos($String->convertem($pesquisa, 1));
//resgata os dados na tabela
if ($resultado) {
foreach ($resultado as $res) {
$msg .= "<tr tabindex='0'>";
$msg .= "<td class='cod'>" . $res->getCodFontePagadora() . "</td>";
$msg .= "<td class='tipo'>" . $res->getTipoFontePagadora() . "</td>";
$msg .= "<td class='EmpresaGrupo'><a href='#'>" . $res->getFontePagadora() . "</a></td>";
$msg .= "</tr>";
}
} else {
$msg = "";
$msg .= "Nenhum resultado foi encontrado...";
?>
<script>
$("#pesquisaClienteCategoria").val('');
</script>
<?php
}
$msg .= " </tbody>";
$msg .= "</table>";
//retorna a msg concatenada
echo $msg;
}
示例11: friends
public function friends($data = null)
{
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$document = JFactory::getDocument();
$id = JRequest::getCmd('userid', 0);
$sorted = $jinput->get->get('sort', 'latest', 'STRING');
//JRequest::getVar( 'sort' , 'latest' , 'GET' );
$filter = JRequest::getWord('filter', 'all', 'GET');
$isMine = $id == $my->id && $my->id != 0;
$my = CFactory::getUser();
$id = $id == 0 ? $my->id : $id;
$user = CFactory::getUser($id);
$friends = CFactory::getModel('friends');
$blockModel = CFactory::getModel('block');
$document->setLink(CRoute::_('index.php?option=com_community'));
$rows = $friends->getFriends($id, $sorted, true, $filter);
// Hide submenu if we are viewing other's friends
if ($isMine) {
$document->setTitle(JText::_('COM_COMMUNITY_FRIENDS_MY_FRIENDS'));
} else {
$document->setTitle(JText::sprintf('COM_COMMUNITY_FRIENDS_ALL_FRIENDS', $user->getDisplayName()));
}
$sortItems = array('latest' => JText::_('COM_COMMUNITY_SORT_RECENT_FRIENDS'), 'online' => JText::_('COM_COMMUNITY_ONLINE'));
$resultRows = array();
// @todo: preload all friends
foreach ($rows as $row) {
$user = CFactory::getUser($row->id);
$obj = clone $row;
$obj->friendsCount = $user->getFriendCount();
$obj->profileLink = CUrlHelper::userLink($row->id);
$obj->isFriend = true;
$obj->isBlocked = $blockModel->getBlockStatus($user->id, $my->id);
$resultRows[] = $obj;
}
unset($rows);
foreach ($resultRows as $row) {
if (!$row->isBlocked) {
// load individual item creator class
$item = new JFeedItem();
$item->title = strip_tags($row->name);
$item->link = CRoute::_('index.php?option=com_community&view=profile&userid=' . $row->id);
$item->description = '<img src="' . JURI::base() . $row->_thumb . '" alt="" /> ' . $row->_status;
$item->date = $row->lastvisitDate;
$item->category = '';
//$row->category;
$item->description = CString::str_ireplace('_QQQ_', '"', $item->description);
// Make sure url is absolute
$item->description = CString::str_ireplace('href="/', 'href="' . JURI::base(), $item->description);
// loads item info into rss array
$document->addItem($item);
}
}
}
示例12: display
/**
* The default method that will display the output of this view which is called by
* Joomla
*
* @param string template Template file name
**/
public function display($tpl = null)
{
//Load pane behavior
jimport('joomla.html.pane');
$pane =& JPane::getInstance('sliders');
$document =& JFactory::getDocument();
// Load tooltips
JHTML::_('behavior.tooltip', '.hasTip');
$params = $this->get('Params');
//user's email privacy setting
CFactory::load('libraries', 'emailtypes');
$emailtypes = new CEmailTypes();
// Add submenu
$contents = '';
ob_start();
require_once JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_community' . DS . 'views' . DS . 'configuration' . DS . 'tmpl' . DS . 'navigation.php';
$contents = ob_get_contents();
ob_end_clean();
$document =& JFactory::getDocument();
$document->setBuffer($contents, 'modules', 'submenu');
$lists = array();
for ($i = 1; $i <= 31; $i++) {
$qscale[] = JHTML::_('select.option', $i, $i);
}
$lists['qscale'] = JHTML::_('select.genericlist', $qscale, 'qscale', 'class="inputbox" size="1"', 'value', 'text', $params->get('qscale', '11'));
$videosSize = array(JHTML::_('select.option', '320x240', '320x240 (QVGA 4:3)'), JHTML::_('select.option', '400x240', '400x240 (WQVGA 5:3)'), JHTML::_('select.option', '400x300', '400x300 (Quarter SVGA 4:3)'), JHTML::_('select.option', '480x272', '480x272 (Sony PSP 30:17)'), JHTML::_('select.option', '480x320', '480x320 (iPhone 3:2)'), JHTML::_('select.option', '480x360', '480x360 (4:3)'), JHTML::_('select.option', '512x384', '512x384 (4:3)'), JHTML::_('select.option', '600x480', '600x480 (4:3)'), JHTML::_('select.option', '640x360', '640x360 (16:9)'), JHTML::_('select.option', '640x480', '640x480 (VCA 4:3)'), JHTML::_('select.option', '800x600', '800x600 (SVGA 4:3)'));
$lists['videosSize'] = JHTML::_('select.genericlist', $videosSize, 'videosSize', 'class="inputbox" size="1"', 'value', 'text', $params->get('videosSize'));
$imgQuality = array(JHTML::_('select.option', '60', 'Low'), JHTML::_('select.option', '80', 'Medium'), JHTML::_('select.option', '90', 'High'), JHTML::_('select.option', '95', 'Very High'));
$lists['imgQuality'] = JHTML::_('select.genericlist', $imgQuality, 'output_image_quality', 'class="inputbox" size="1"', 'value', 'text', $params->get('output_image_quality'));
// Group discussion order option
$groupDiscussionOrder = array(JHTML::_('select.option', 'ASC', 'Older first'), JHTML::_('select.option', 'DESC', 'Newer first'));
$lists['groupDicussOrder'] = JHTML::_('select.genericlist', $groupDiscussionOrder, 'group_discuss_order', 'class="inputbox" size="1"', 'value', 'text', $params->get('group_discuss_order'));
$dstOffset = array();
$counter = -4;
for ($i = 0; $i <= 8; $i++) {
$dstOffset[] = JHTML::_('select.option', $counter, $counter);
$counter++;
}
$lists['dstOffset'] = JHTML::_('select.genericlist', $dstOffset, 'daylightsavingoffset', 'class="inputbox" size="1"', 'value', 'text', $params->get('daylightsavingoffset'));
$networkModel = $this->getModel('network', false);
$JSNInfo =& $networkModel->getJSNInfo();
$JSON_output =& $networkModel->getJSON();
$lists['enable'] = JHTML::_('select.booleanlist', 'network_enable', 'class="inputbox"', $JSNInfo['network_enable']);
$uploadLimit = ini_get('upload_max_filesize');
$uploadLimit = CString::str_ireplace('M', ' MB', $uploadLimit);
$this->assignRef('JSNInfo', $JSNInfo);
$this->assignRef('JSON_output', $JSON_output);
$this->assignRef('lists', $lists);
$this->assign('uploadLimit', $uploadLimit);
$this->assign('config', $params);
$this->assign('emailtypes', $emailtypes->getEmailTypes());
parent::display($tpl);
}
示例13: getDuration
public function getDuration()
{
$duration = '';
//Get duration
$pattern = "'<span class=gray id=video-duration>(.*?)</span>'s";
preg_match_all($pattern, $this->xmlContent, $matches);
if ($matches) {
$duration = explode(":", CString::str_ireplace(" ", "", trim(strip_tags($matches[1][0]))));
$duration = $duration[0] * 60 + $duration[1];
}
return $duration;
}
示例14: decodePlayKey
/**
* 解密播放链接的解密串
* <pre>
* return array(
* 'tuid'=>0, //教程ID
* 'tucid'=>0, //章节ID
* 'uid'=>0, //用户ID
* 'timestamp'=>0 //时间戳
* );
* </pre>
*
* @param string $_strKey
* @return array
*/
public static function decodePlayKey($_strKey = "")
{
$strDecodeKey = CString::decode($_strKey, self::PLAY_KEY);
$strDecodeKey = trim($strDecodeKey);
$aryDecode = explode('|', $strDecodeKey);
if (empty($aryDecode) || count($aryDecode) != 4) {
throw new CModelException("无法解析的KEY!");
}
//$aryTimestamp = explode('*',$aryDecode[3]);
//$aryDecode[3] = $aryTimestamp[1];
return array('tuid' => $aryDecode[0], 'tucid' => $aryDecode[1], 'uid' => $aryDecode[2], 'timestamp' => $aryDecode[3]);
}
示例15: getDescription
public function getDescription()
{
$description = '';
// Store description
$pattern = "'<blip\\:puredescription>(.*?)<\\/blip\\:puredescription>'s";
preg_match_all($pattern, $this->xmlContent, $matches);
if ($matches) {
$description = CString::str_ireplace(''', "'", $matches[1][0]);
$description = CString::str_ireplace('<![CDATA[', '', $description);
$description = CString::str_ireplace(']]>', '', $description);
}
return $description;
}