本文整理汇总了PHP中CFormElement::renderElements方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormElement::renderElements方法的具体用法?PHP CFormElement::renderElements怎么用?PHP CFormElement::renderElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFormElement
的用法示例。
在下文中一共展示了CFormElement::renderElements方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: newalbum
/**
* Display the new album form
* */
public function newalbum()
{
$config = CFactory::getConfig();
/**
* Opengraph
*/
CHeadHelper::setType('website', JText::_('COM_COMMUNITY_PHOTOS_CREATE_NEW_ALBUM_TITLE'));
$this->addPathway(JText::_('COM_COMMUNITY_PHOTOS'), CRoute::_('index.php?option=com_community&view=photos'));
$this->addPathway(JText::_('COM_COMMUNITY_PHOTOS_CREATE_NEW_ALBUM_TITLE'));
// $js = 'assets/validate-1.5.min.js';
// CFactory::attach($js, 'js');
$handler = $this->_getHandler();
$type = $handler->getType();
$user = CFactory::getRequestUser();
$params = $user->getParams();
$album = JTable::getInstance('Album', 'CTable');
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
// Added to maintain user input value if there is save error
$album->name = $jinput->post->get('name', '', 'STRING');
//JRequest::getVar('name', '', 'POST');
$album->location = $jinput->post->get('location', '', 'STRING');
//JRequest::getVar('location', '', 'POST');
$album->description = $jinput->post->get('description', '', 'STRING');
//JRequest::getVar('description', '', 'POST');
$album->permissions = $jinput->post->get('permissions', $params->get('privacyPhotoView'), 'NONE');
//JRequest::getVar('permissions', $params->get( 'privacyPhotoView' ), 'POST');
$album->type = $jinput->post->get('type', '', 'NONE');
//JRequest::getVar('type', '', 'POST');
$album->groupid = $jinput->get('groupid', '', 'NONE');
$app = CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-photos-newalbum'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
echo $tmpl->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->set('permissions', $album->permissions)->set('type', $type)->set('album', $album)->set('referrer', '')->set('enableLocation', $config->get('enable_photos_location'))->set('submenu', $this->showSubmenu(false))->fetch('photos.editalbum');
}
示例2: search
/**
* View method to search groups
*
* @access public
*
* @returns object An object of the specific group
*/
public function search()
{
// Get the document object and set the necessary properties of the document
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_COMMUNITY_GROUPS_SEARCH_TITLE'));
$this->addPathway(JText::_('COM_COMMUNITY_GROUPS'), CRoute::_('index.php?option=com_community&view=groups'));
$this->addPathway(JText::_("COM_COMMUNITY_SEARCH"), '');
// Display the submenu
$this->showSubmenu();
$search = JRequest::getVar('search', '');
$catId = JRequest::getVar('catid', '');
$groups = '';
$pagination = null;
$posted = false;
$count = 0;
$model = CFactory::getModel('groups');
$categories = $model->getCategories();
// Test if there are any post requests made
if (!empty($search) || !empty($catId)) {
JRequest::checkToken('get') or jexit(JText::_('COM_COMMUNITY_INVALID_TOKEN'));
CFactory::load('libraries', 'apps');
$appsLib =& CAppPlugins::getInstance();
$saveSuccess = $appsLib->triggerEvent('onFormSave', array('jsform-groups-search'));
if (empty($saveSuccess) || !in_array(false, $saveSuccess)) {
$posted = true;
$groups = $model->getAllGroups($catId, null, $search);
$pagination = $model->getPagination();
$count = count($groups);
}
}
// Get the template for the group lists
$groupsHTML = $this->_getGroupsHTML($groups, $pagination);
CFactory::load('libraries', 'apps');
$app =& CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-groups-search'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$searchLinks = parent::getAppSearchLinks('groups');
$tmpl = new CTemplate();
echo $tmpl->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->set('posted', $posted)->set('groupsCount', $count)->set('groupsHTML', $groupsHTML)->set('search', $search)->set('categories', $categories)->set('catId', $catId)->set('searchLinks', $searchLinks)->fetch('groups.search');
}
示例3: uploadAvatar
function uploadAvatar()
{
$document =& JFactory::getDocument();
$document->setTitle(JText::_('CC UPLOAD EVENT AVATAR'));
$eventid = JRequest::getVar('eventid', '0');
$this->_addEventInPathway($eventid);
$this->addPathway(JText::_('CC UPLOAD EVENT AVATAR'));
$this->showSubmenu();
$event =& JTable::getInstance('Event', 'CTable');
$event->load($eventid);
CFactory::load('helpers', 'event');
$handler = CEventHelper::getHandler($event);
if (!$handler->manageable()) {
$this->noAccess();
return;
}
$config = CFactory::getConfig();
$uploadLimit = (double) $config->get('maxuploadsize');
$uploadLimit .= 'MB';
CFactory::load('models', 'events');
$event =& JTable::getInstance('Event', 'CTable');
$event->load($eventid);
CFactory::load('libraries', 'apps');
$app =& CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-events-uploadavatar'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
$tmpl->set('beforeFormDisplay', $beforeFormDisplay);
$tmpl->set('afterFormDisplay', $afterFormDisplay);
$tmpl->set('eventId', $eventid);
$tmpl->set('avatar', $event->getAvatar('avatar'));
$tmpl->set('thumbnail', $event->getAvatar());
$tmpl->set('uploadLimit', $uploadLimit);
echo $tmpl->fetch('events.uploadavatar');
}
示例4: newalbum
/**
* Display the new album form
**/
public function newalbum()
{
$config = CFactory::getConfig();
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_COMMUNITY_PHOTOS_CREATE_NEW_ALBUM_TITLE'));
$this->addPathway(JText::_('COM_COMMUNITY_PHOTOS'), CRoute::_('index.php?option=com_community&view=photos'));
$this->addPathway(JText::_('COM_COMMUNITY_PHOTOS_CREATE_NEW_ALBUM_TITLE'));
$js = 'assets/validate-1.5' . ($config->getBool('usepackedjavascript') ? '.pack.js' : '.js');
CAssets::attach($js, 'js');
$handler = $this->_getHandler();
$type = $handler->getType();
$user = CFactory::getRequestUser();
$params = $user->getParams();
$this->showSubmenu();
$album =& JTable::getInstance('Album', 'CTable');
// Added to maintain user input value if there is save error
$album->name = JRequest::getVar('name', '', 'POST');
$album->location = JRequest::getVar('location', '', 'POST');
$album->description = JRequest::getVar('description', '', 'POST');
$album->permissions = JRequest::getVar('permissions', $params->get('privacyPhotoView'), 'POST');
$album->type = JRequest::getVar('type', '', 'POST');
CFactory::load('libraries', 'apps');
$app =& CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-photos-newalbum'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
CFactory::load('libraries', 'privacy');
$tmpl = new CTemplate();
echo $tmpl->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->set('permissions', $album->permissions)->set('type', $type)->set('album', $album)->set('referrer', '')->set('enableLocation', $config->get('enable_photos_location'))->fetch('photos.editalbum');
}
示例5: uploadAvatar
public function uploadAvatar()
{
/**
* Opengraph
*/
CHeadHelper::setType('website', JText::_('COM_COMMUNITY_EVENTS_AVATAR'));
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$eventid = $jinput->get('eventid', '0', 'INT');
$this->_addEventInPathway($eventid);
$this->addPathway(JText::_('COM_COMMUNITY_EVENTS_AVATAR'));
$this->showSubmenu();
$event = JTable::getInstance('Event', 'CTable');
$event->load($eventid);
//CFactory::load( 'helpers' , 'event' );
$handler = CEventHelper::getHandler($event);
if (!$handler->manageable()) {
$this->noAccess();
return;
}
$config = CFactory::getConfig();
$uploadLimit = (double) $config->get('maxuploadsize');
$uploadLimit .= 'MB';
//CFactory::load( 'models' , 'events' );
$event = JTable::getInstance('Event', 'CTable');
$event->load($eventid);
//CFactory::load( 'libraries' , 'apps' );
$app = CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-events-uploadavatar'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
echo $tmpl->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->set('eventId', $eventid)->set('avatar', $event->getAvatar('avatar'))->set('thumbnail', $event->getThumbAvatar())->set('uploadLimit', $uploadLimit)->fetch('events.uploadavatar');
}
示例6: preferences
function preferences()
{
$mainframe =& JFactory::getApplication();
if (!$this->accessAllowed('registered')) {
return;
}
$this->showSubmenu();
$document =& JFactory::getDocument();
$document->setTitle(JText::_('CC EDIT PREFERENCES'));
$my = CFactory::getUser();
$params = $my->getParams();
$jConfig = JFactory::getConfig();
$pathway =& $mainframe->getPathway();
$pathway->addItem(JText::_($my->getDisplayName()), CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id));
$pathway->addItem(JText::_('CC EDIT PREFERENCES'), '');
$prefixURL = $my->getAlias();
if ($jConfig->getValue('sef')) {
$juriRoot = JURI::root(false);
$juriPathOnly = JURI::root(true);
$juriPathOnly = rtrim($juriPathOnly, '/');
$profileURL = rtrim(str_replace($juriPathOnly, '', $juriRoot), '/');
$profileURL .= CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id, false);
$alias = $my->getAlias();
$inputHTML = '<input id="alias" name="alias" class="inputbox" type="alias" value="' . $alias . '" />';
$prefixURL = str_replace($alias, $inputHTML, $profileURL);
// For backward compatibility issues, as we changed from ID-USER to ID:USER in 2.0,
// we also need to test older urls.
if ($prefixURL == $profileURL) {
$prefixURL = JString::str_ireplace(JString::str_ireplace(':', '-', $alias), $inputHTML, $profileURL);
}
}
CFactory::load('libraries', 'apps');
$app =& CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-profile-preferences'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
$tmpl->set('beforeFormDisplay', $beforeFormDisplay);
$tmpl->set('afterFormDisplay', $afterFormDisplay);
$tmpl->set('params', $params);
$tmpl->set('prefixURL', $prefixURL);
$tmpl->set('user', $my);
$tmpl->set('jConfig', $jConfig);
$html = $tmpl->fetch('profile.preferences');
echo $html;
}
示例7: write
public function write($data)
{
if (!$this->accessAllowed('registered')) {
return;
}
$mainframe = JFactory::getApplication();
$my = CFactory::getUser();
$config = CFactory::getConfig();
if (!$config->get('enablepm')) {
echo JText::_('COM_COMMUNITY_PRIVATE_MESSAGING_DISABLED');
return;
}
//page title
$pathway = $mainframe->getPathway();
$pathway->addItem(JText::_('COM_COMMUNITY_INBOX_TITLE'), CRoute::_('index.php?option=com_community&view=inbox'));
$pathway->addItem(JText::_('COM_COMMUNITY_INBOX_TITLE_WRITE'), '');
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_COMMUNITY_INBOX_TITLE_WRITE'));
$autoCLink = CRoute::_(JURI::base() . 'index.php?option=com_community&view=inbox&task=ajaxAutoName&no_html=1&tmpl=component');
if ($data->sent) {
return;
}
$inboxModel = CFactory::getModel('inbox');
$totalSent = $inboxModel->getTotalMessageSent($my->id);
//CFactory::load( 'libraries' , 'apps' );
$app = CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-inbox-write'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
echo $tmpl->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->set('autoCLink', $autoCLink)->set('data', $data)->set('totalSent', $totalSent)->set('maxSent', $config->get('pmperday'))->set('useRealName', $config->get('displayname') == 'name' ? '1' : '0')->set('friendsCount', $my->getFriendCount())->set('submenu', $this->showSubmenu(false))->fetch('inbox.write');
}
示例8: notifications
/**
*
*/
public function notifications()
{
$mainframe = JFactory::getApplication();
if (!$this->accessAllowed('registered')) {
return;
}
$pathway = $mainframe->getPathway();
$my = CFactory::getUser();
$pathway->addItem(JText::_($my->getDisplayName()), CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id));
$pathway->addItem(JText::_('COM_COMMUNITY_PROFILE_NOTIFICATIONS'), '');
/**
* Opengraph
*/
CHeadHelper::setType('website', JText::_('COM_COMMUNITY_PROFILE_NOTIFICATIONS'));
$user = CFactory::getUser();
$params = $user->getParams();
$config = CFactory::getConfig();
$modelNotification = CFactory::getModel('notification');
$notifications = $modelNotification->getNotification($my->id, '0', 0);
$app = CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-profile-notifications'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
echo $tmpl->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->set('params', $params)->set('config', $config)->set('submenu', $this->showSubmenu(false))->set('pagination', $modelNotification->getPagination())->set('notifications', $notifications)->fetch('profile.notification');
}
示例9: invite
/**
* Show the invite window
*/
public function invite()
{
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$jConfig = JFactory::getConfig();
/**
* Opengraph
*/
CHeadHelper::setType('website', JText::sprintf('COM_COMMUNITY_FRIENDS_INVITE_FRIENDS_TITLE', $jConfig->get('sitename')));
$my = CFactory::getUser();
//$this->showSubmenu();
$post = $jinput->post->get('action', '', 'STRING') == 'invite' ? JRequest::get('POST') : array('message' => '', 'emails' => '');
$pathway = $mainframe->getPathway();
$this->addPathway(JText::_('COM_COMMUNITY_FRIENDS'), CRoute::_('index.php?option=com_community&view=friends'));
$this->addPathway(JText::_('COM_COMMUNITY_INVITE_FRIENDS'), '');
// Process the Suggest Friends
// Load required filterbar library that will be used to display the filtering and sorting.
$id = JRequest::getCmd('userid', $my->id);
$user = CFactory::getUser($id);
$sorted = $jinput->get->get('sort', 'suggestion', 'STRING');
$filter = $jinput->get->get('filter', 'suggestion', 'STRING');
$friends = CFactory::getModel('friends');
$rows = $friends->getFriends($id, $sorted, true, $filter);
$resultRows = array();
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;
$resultRows[] = $obj;
}
unset($rows);
$app = CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-friends-invite'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
echo $tmpl->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->set('my', $my)->set('post', $post)->setRef('friends', $resultRows)->set('config', CFactory::getConfig())->set('submenu', $this->showSubmenu(false))->fetch('friends.invite');
}
示例10: write
function write($data)
{
if (!$this->accessAllowed('registered')) {
return;
}
$mainframe =& JFactory::getApplication();
$my =& JFactory::getUser();
$config = CFactory::getConfig();
if (!$config->get('enablepm')) {
echo JText::_('CC PRIVATE MESSAGING DISABLED');
return;
}
//page title
$pathway =& $mainframe->getPathway();
$pathway->addItem(JText::_('CC INBOX TITLE'), CRoute::_('index.php?option=com_community&view=inbox'));
$pathway->addItem(JText::_('CC TITLE COMPOSE'), '');
$document =& JFactory::getDocument();
$document->setTitle(JText::_('CC TITLE COMPOSE'));
$this->showSubMenu();
$autoCLink = CRoute::_(JURI::base() . 'index.php?option=com_community&view=inbox&task=ajaxAutoName&no_html=1&tmpl=component');
$js = 'assets/validate-1.5';
$js .= $config->getBool('usepackedjavascript') ? '.pack.js' : '.js';
CAssets::attach($js, 'js');
$js = 'assets/autocomplete-1.0.js';
CAssets::attach($js, 'js');
$js = <<<SHOWJS
\t\t var yPos;
\t\t\tjoms.jQuery().ready(function(){
\t\t\t\tjoms.jQuery("#to").autocomplete("{$autoCLink}", {
\t\t\t\t\tminChars:1,
\t\t\t\t\tcacheLength:10,
\t\t\t\t\tselectOnly:1,
\t\t\t\t\tmatchSubset:true,
\t\t\t\t\tmatchContains:true,
\t\t\t\t\tmultiple:false,
\t\t\t\t\tformatItem: function(data, i, n, value) {
\t \t\treturn data[0];
\t \t\t},
\t \t\tformatResult: function(data, value) {
\t \t\treturn data[0];
\t \t\t\t\t}
\t \t\t\t});
\t\t\t});
SHOWJS;
$document->addScriptDeclaration($js);
if ($data->sent) {
return;
}
$inboxModel = CFactory::getModel('inbox');
$totalSent = $inboxModel->getTotalMessageSent($my->id);
/**
* Get friend list
*/
$friends = CFactory::getModel('friends');
/**
* Get ban list
*/
$block = CFactory::getModel('block');
$sorted = JRequest::getVar('sort', 'latest', 'GET');
$rows = $friends->getFriends($my->id, $sorted, false);
$friendlist = array();
foreach ($rows as $row) {
// Exclude blocked user
if (!$block->getBlockStatus($my->id, $row->id)) {
$friendlist[] = $row;
}
}
CFactory::load('libraries', 'apps');
$app =& CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-inbox-write'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
$tmpl->set('beforeFormDisplay', $beforeFormDisplay);
$tmpl->set('afterFormDisplay', $afterFormDisplay);
$tmpl->set('autoCLink', $autoCLink);
$tmpl->set('data', $data);
$tmpl->set('rows', $friendlist);
$tmpl->set('totalSent', $totalSent);
$tmpl->set('maxSent', $config->get('pmperday'));
$tmpl->set('useRealName', $config->get('displayname') == 'name' ? '1' : '0');
$html = $tmpl->fetch('inbox.write');
echo $html;
}
示例11: search
/**
* View method to search groups
*
* @access public
*
* @returns object An object of the specific group
*/
public function search()
{
/**
* Opengraph
*/
CHeadHelper::setType('website', JText::_('COM_COMMUNITY_GROUPS_SEARCH_TITLE'));
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$this->addPathway(JText::_('COM_COMMUNITY_GROUPS'), CRoute::_('index.php?option=com_community&view=groups'));
$this->addPathway(JText::_("COM_COMMUNITY_SEARCH"), '');
$search = $jinput->get('search', '', 'STRING');
$catId = $jinput->get('catid', '', 'INT');
$groups = '';
$pagination = null;
$posted = false;
$count = 0;
$model = CFactory::getModel('groups');
$categories = $model->getCategories();
// Test if there are any post requests made
if (!empty($search) || !empty($catId)) {
JRequest::checkToken('get') or jexit(JText::_('COM_COMMUNITY_INVALID_TOKEN'));
$appsLib = CAppPlugins::getInstance();
$saveSuccess = $appsLib->triggerEvent('onFormSave', array('jsform-groups-search'));
if (empty($saveSuccess) || !in_array(false, $saveSuccess)) {
$posted = true;
$groups = $model->getAllGroups($catId, null, $search);
$pagination = $model->getPagination();
$count = count($groups);
}
}
// Get the template for the group lists
$groupsHTML = $this->_getGroupsHTML($groups, $pagination);
$app = CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-groups-search'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$searchLinks = parent::getAppSearchLinks('groups');
$tmpl = new CTemplate();
echo $tmpl->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->set('posted', $posted)->set('groupsCount', $count)->set('groupsHTML', $groupsHTML)->set('search', $search)->set('categories', $categories)->set('catId', $catId)->set('searchLinks', $searchLinks)->set('submenu', $this->showSubmenu(false))->fetch('groups.search');
}
示例12: write
public function write($data)
{
if (!$this->accessAllowed('registered')) {
return;
}
$mainframe =& JFactory::getApplication();
$my =& JFactory::getUser();
$config = CFactory::getConfig();
if (!$config->get('enablepm')) {
echo JText::_('COM_COMMUNITY_PRIVATE_MESSAGING_DISABLED');
return;
}
//page title
$pathway =& $mainframe->getPathway();
$pathway->addItem(JText::_('COM_COMMUNITY_INBOX_TITLE'), CRoute::_('index.php?option=com_community&view=inbox'));
$pathway->addItem(JText::_('COM_COMMUNITY_INBOX_TITLE_WRITE'), '');
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_COMMUNITY_INBOX_TITLE_WRITE'));
$this->showSubMenu();
$autoCLink = CRoute::_(JURI::base() . 'index.php?option=com_community&view=inbox&task=ajaxAutoName&no_html=1&tmpl=component');
$js = 'assets/validate-1.5';
$js .= $config->getBool('usepackedjavascript') ? '.pack.js' : '.js';
CAssets::attach($js, 'js');
$js = 'assets/autocomplete-1.0.js';
CAssets::attach($js, 'js');
$js = <<<SHOWJS
\t\t var yPos;
\t\t\tjoms.jQuery().ready(function(){
\t\t\t\tjoms.jQuery("#toDisplay").autocomplete("{$autoCLink}", {
\t\t\t\t\tminChars:1,
\t\t\t\t\tcacheLength:10,
\t\t\t\t\tselectOnly:1,
\t\t\t\t\tmatchSubset:true,
\t\t\t\t\tmatchContains:true,
\t\t\t\t\tmultiple:false,
\t\t\t\t\tscrollHeight: 200,
\t\t\t\t\tformatItem: function(data, i, n, value) {
\t\t\t\t\t\tvar formatHTML = '<div class="cInbox-ACResult"><img src="'+data[2]+'" />'+data[0]+'</div><div class="clr"></div>';
\t\t\t\t\t\treturn formatHTML;
\t\t\t\t\t},
\t\t\t\t\tformatResult: function(data, value) {
\t\t\t\t\t\treturn data[0];
\t \t\t\t\t}
\t \t\t\t});
\t\t\t});
SHOWJS;
$document->addScriptDeclaration($js);
if ($data->sent) {
return;
}
$inboxModel = CFactory::getModel('inbox');
$totalSent = $inboxModel->getTotalMessageSent($my->id);
CFactory::load('libraries', 'apps');
$app =& CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-inbox-write'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
echo $tmpl->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->set('autoCLink', $autoCLink)->set('data', $data)->set('totalSent', $totalSent)->set('maxSent', $config->get('pmperday'))->set('useRealName', $config->get('displayname') == 'name' ? '1' : '0')->fetch('inbox.write');
}
示例13: newalbum
/**
* Display the new album form
**/
function newalbum()
{
$config = CFactory::getConfig();
$document =& JFactory::getDocument();
$document->setTitle(JText::_('CC CREATE NEW ALBUM TITLE'));
$this->addPathway(JText::_('CC PHOTOS'), CRoute::_('index.php?option=com_community&view=photos'));
$this->addPathway(JText::_('CC CREATE NEW ALBUM TITLE'));
$js = 'assets/validate-1.5' . ($config->getBool('usepackedjavascript') ? '.pack.js' : '.js');
CAssets::attach($js, 'js');
$handler = $this->_getHandler();
$type = $handler->getType();
$this->showSubmenu();
CFactory::load('libraries', 'apps');
$app =& CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-photos-newalbum'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
$tmpl->set('beforeFormDisplay', $beforeFormDisplay);
$tmpl->set('afterFormDisplay', $afterFormDisplay);
$tmpl->set('type', $type);
echo $tmpl->fetch('photos.newalbum');
}
示例14: invite
/**
* Show the invite window
*/
function invite()
{
$mainframe =& JFactory::getApplication();
$document =& JFactory::getDocument();
$config = CFactory::getConfig();
$document->setTitle(JText::sprintf('CC INVITE FRIENDS TITLE', $config->get('sitename')));
$my = CFactory::getUser();
$this->showSubmenu();
$post = JRequest::getVar('action', '', 'POST') == 'invite' ? JRequest::get('POST') : array('message' => '', 'emails' => '');
$pathway =& $mainframe->getPathway();
$this->addPathway(JText::_('CC FRIENDS'), CRoute::_('index.php?option=com_community&view=friends'));
$this->addPathway(JText::_('CC INVITE FRIENDS'), '');
// Process the Suggest Friends
// Load required filterbar library that will be used to display the filtering and sorting.
CFactory::load('libraries', 'filterbar');
$id = JRequest::getCmd('userid', $my->id);
$user = CFactory::getUser($id);
$sorted = JRequest::getVar('sort', 'suggestion', 'GET');
$filter = JRequest::getVar('filter', 'suggestion', 'GET');
$friends = CFactory::getModel('friends');
$rows = $friends->getFriends($id, $sorted, true, $filter);
$resultRows = array();
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;
$resultRows[] = $obj;
}
unset($rows);
CFactory::load('libraries', 'apps');
$app =& CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-friends-invite'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
$tmpl->set('beforeFormDisplay', $beforeFormDisplay);
$tmpl->set('afterFormDisplay', $afterFormDisplay);
$tmpl->set('my', $my);
$tmpl->set('post', $post);
$tmpl->setRef('friends', $resultRows);
$tmpl->set('config', CFactory::getConfig());
echo $tmpl->fetch('friends.invite');
}