本文整理汇总了PHP中UTIL_HtmlTag类的典型用法代码示例。如果您正苦于以下问题:PHP UTIL_HtmlTag类的具体用法?PHP UTIL_HtmlTag怎么用?PHP UTIL_HtmlTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UTIL_HtmlTag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(BASE_CLASS_WidgetParameter $params)
{
parent::__construct();
$this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCmpViewDir() . 'users_widget.html');
$randId = UTIL_HtmlTag::generateAutoId('base_users_widget');
$this->assign('widgetId', $randId);
$data = $this->getData($params);
$menuItems = array();
$dataToAssign = array();
if (!empty($data)) {
foreach ($data as $key => $item) {
$contId = "{$randId}_users_widget_{$key}";
$toolbarId = !empty($item['toolbar']) ? "{$randId}_toolbar_{$key}" : false;
$menuItems[$key] = array('label' => $item['menu-label'], 'id' => "{$randId}_users_widget_menu_{$key}", 'contId' => $contId, 'active' => !empty($item['menu_active']), 'toolbarId' => $toolbarId);
$usersCmp = $this->getUsersCmp($item['userIds']);
$dataToAssign[$key] = array('users' => $usersCmp->render(), 'active' => !empty($item['menu_active']), 'toolbar' => !empty($item['toolbar']) ? $item['toolbar'] : array(), 'toolbarId' => $toolbarId, 'contId' => $contId);
}
}
$this->assign('data', $dataToAssign);
$displayMenu = true;
if (count($data) == 1 && !$this->forceDisplayMenu) {
$displayMenu = false;
}
if (!$params->customizeMode && (count($data) != 1 || $this->forceDisplayMenu)) {
$menu = $this->getMenuCmp($menuItems);
if (!empty($menu)) {
$this->addComponent('menu', $menu);
}
}
}
示例2: logMsg
public function logMsg()
{
$service = AJAXIM_BOL_Service::getInstance();
if ($errorMessage = $service->checkPermissions()) {
exit(json_encode(array('error' => $errorMessage)));
}
if (empty($_POST['to'])) {
exit(json_encode(array('error' => "Receiver is not defined")));
}
if (empty($_POST['message'])) {
exit(json_encode(array('error' => "Message is empty")));
}
$message = UTIL_HtmlTag::stripTags(UTIL_HtmlTag::stripJs($_POST['message']));
$dto = new AJAXIM_BOL_Message();
$dto->setFrom(OW::getUser()->getId());
$dto->setTo($_POST['to']);
$dto->setMessage($message);
$dto->setTimestamp(time());
$dto->setRead(0);
AJAXIM_BOL_Service::getInstance()->save($dto);
//$message = AJAXIM_BOL_Service::getInstance()->splitLongMessages($message);
//$dto->setMessage(UTIL_HtmlTag::autoLink($message));
$dto->setTimestamp($dto->getTimestamp() * 1000);
exit(json_encode($dto));
}
示例3: addVideo
public function addVideo($userId, $embed, $title, $description, $thumbnailUrl, $text, $addToFeed = true)
{
if (!$this->isActive()) {
return null;
}
$title = empty($title) ? $text : $title;
$title = empty($title) ? '' : $title;
$description = empty($description) ? '' : $description;
$clipService = VIDEO_BOL_ClipService::getInstance();
$clip = new VIDEO_BOL_Clip();
$clip->title = $title;
$description = UTIL_HtmlTag::stripJs($description);
$description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
$clip->description = $description;
$clip->userId = $userId;
$clip->code = UTIL_HtmlTag::stripJs($embed);
$prov = new VideoProviders($clip->code);
$privacy = OW::getEventManager()->call('plugin.privacy.get_privacy', array('ownerId' => $clip->userId, 'action' => 'video_view_video'));
$clip->provider = $prov->detectProvider();
$clip->addDatetime = time();
$clip->status = 'approved';
$clip->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
$thumbUrl = empty($thumbnailUrl) ? $prov->getProviderThumbUrl($clip->provider) : $thumbnailUrl;
if ($thumbUrl != VideoProviders::PROVIDER_UNDEFINED) {
$clip->thumbUrl = $thumbUrl;
}
$clip->thumbCheckStamp = time();
$clipId = $clipService->addClip($clip);
if ($addToFeed) {
// Newsfeed
$event = new OW_Event('feed.action', array('pluginKey' => 'video', 'entityType' => 'video_comments', 'entityId' => $clipId, 'userId' => $clip->userId), array("content" => array("vars" => array("status" => $text))));
OW::getEventManager()->trigger($event);
}
return $clipId;
}
示例4: __construct
/**
* User list
*
* @param array $params
* integer count
* string boxType
*/
function __construct(array $params = array())
{
parent::__construct();
$this->countUsers = !empty($params['count']) ? (int) $params['count'] : self::DEFAULT_USERS_COUNT;
$boxType = !empty($params['boxType']) ? $params['boxType'] : "";
// init users short list
$randId = UTIL_HtmlTag::generateAutoId('base_users_cmp');
$data = $this->getData($this->countUsers);
$menuItems = array();
$dataToAssign = array();
foreach ($data as $key => $item) {
$contId = "{$randId}_users_cmp_{$key}";
$toolbarId = !empty($item['toolbar']) ? "{$randId}_toolbar_{$key}" : false;
$menuItems[$key] = array('label' => $item['menu-label'], 'id' => "{$randId}_users_cmp_menu_{$key}", 'contId' => $contId, 'active' => !empty($item['menu_active']), 'toolbarId' => $toolbarId, 'display' => 1);
$usersCmp = $this->getUsersCmp($item['userIds']);
$dataToAssign[$key] = array('users' => $usersCmp->render(), 'active' => !empty($item['menu_active']), 'toolbar' => !empty($item['toolbar']) ? $item['toolbar'] : array(), 'toolbarId' => $toolbarId, 'contId' => $contId);
}
$menu = $this->getMenuCmp($menuItems);
if (!empty($menu)) {
$this->addComponent('menu', $menu);
}
// assign view variables
$this->assign('widgetId', $randId);
$this->assign('data', $dataToAssign);
$this->assign('boxType', $boxType);
}
示例5: beforeContentAdd
public function beforeContentAdd(OW_Event $event)
{
$params = $event->getParams();
$data = $event->getData();
if (!empty($data)) {
return;
}
if (empty($params["status"]) && empty($params["data"])) {
$event->setData(false);
return;
}
$attachId = null;
$content = array();
if (!empty($params["data"])) {
$content = $params["data"];
if ($content['type'] == 'photo' && !empty($content['genId'])) {
$content['url'] = $content['href'] = OW::getEventManager()->call('base.attachment_save_image', array('genId' => $content['genId']));
$attachId = $content['genId'];
}
if ($content['type'] == 'video') {
$content['html'] = BOL_TextFormatService::getInstance()->validateVideoCode($content['html']);
}
}
$status = UTIL_HtmlTag::autoLink($params["status"]);
$out = NEWSFEED_BOL_Service::getInstance()->addStatus(OW::getUser()->getId(), $params['feedType'], $params['feedId'], $params['visibility'], $status, array("content" => $content, "attachmentId" => $attachId));
$event->setData($out);
}
示例6: renderInput
public function renderInput($params = null)
{
$defaultAgeFrom = isset($this->value['from']) ? (int) $this->value['from'] : $this->minAge;
$defaultAgeTo = isset($this->value['to']) ? (int) $this->value['to'] : $this->maxAge;
$fromAgeAttrs = $this->attributes;
$fromAgeAttrs['name'] = $this->getAttribute('name') . '[from]';
$fromAgeAttrs['type'] = 'text';
$fromAgeAttrs['maxlength'] = 3;
$fromAgeAttrs['style'] = 'width: 40px;';
$fromAgeAttrs['value'] = $defaultAgeFrom;
if (isset($fromAgeAttrs['id'])) {
unset($fromAgeAttrs['id']);
}
$toAgeAttrs = $this->attributes;
$toAgeAttrs['name'] = $this->getAttribute('name') . '[to]';
$toAgeAttrs['type'] = 'text';
$toAgeAttrs['maxlength'] = 3;
$toAgeAttrs['style'] = 'width: 40px;';
$toAgeAttrs['value'] = $defaultAgeTo;
if (isset($toAgeAttrs['id'])) {
unset($toAgeAttrs['id']);
}
$language = OW::getLanguage();
$result = '<span id="' . $this->getAttribute('id') . '"class="' . $this->getAttribute('name') . '">
' . UTIL_HtmlTag::generateTag('input', $fromAgeAttrs) . '
' . $language->text('base', 'form_element_to') . '
' . UTIL_HtmlTag::generateTag('input', $toAgeAttrs) . '</span>';
return $result;
}
示例7: __construct
public function __construct($conversationId, $opponentId)
{
parent::__construct('newMailMessageForm');
$this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
$field = new TextField('newMessageText');
$field->setValue(OW::getLanguage()->text('mailbox', 'text_message_invitation'));
$field->setId('newMessageText');
$this->addElement($field);
$field = new HiddenField('attachment');
$this->addElement($field);
$field = new HiddenField('conversationId');
$field->setValue($conversationId);
$this->addElement($field);
$field = new HiddenField('opponentId');
$field->setValue($opponentId);
$this->addElement($field);
$field = new HiddenField('uid');
$field->setValue(UTIL_HtmlTag::generateAutoId('mailbox_conversation_' . $conversationId . '_' . $opponentId));
$this->addElement($field);
$submit = new Submit('newMessageSendBtn');
$submit->setId('newMessageSendBtn');
$submit->setName('newMessageSendBtn');
$submit->setValue(OW::getLanguage()->text('mailbox', 'add_button'));
$this->addElement($submit);
if (!OW::getRequest()->isAjax()) {
$js = UTIL_JsGenerator::composeJsString('
owForms["newMailMessageForm"].bind( "submit", function( r )
{
$("#newmessage-mail-send-btn").addClass("owm_preloader_circle");
});');
OW::getDocument()->addOnloadScript($js);
}
$this->setAction(OW::getRouter()->urlFor('MAILBOX_MCTRL_Messages', 'newmessage'));
}
示例8: renderInput
/**
* @see FormElement::renderInput()
*
* @param array $params
* @return string
*/
public function renderInput($params = null)
{
parent::renderInput($params);
if ($this->options === null || empty($this->options)) {
return '';
}
$columnWidth = floor(100 / $this->columnsCount);
$renderedString = '<ul class="ow_checkbox_group clearfix">';
$noValue = true;
foreach ($this->options as $key => $value) {
if ($this->value !== null && is_array($this->value) && in_array($key, $this->value)) {
$this->addAttribute(FormElement::ATTR_CHECKED, 'checked');
$noValue = false;
}
$this->setId(UTIL_HtmlTag::generateAutoId('input'));
$this->addAttribute('value', $key);
$renderedString .= '<li style="width:' . $columnWidth . '%">' . UTIL_HtmlTag::generateTag('input', $this->attributes) . ' <label for="' . $this->getId() . '">' . $value . '</label></li>';
$this->removeAttribute(FormElement::ATTR_CHECKED);
}
$language = OW::getLanguage();
$attributes = $this->attributes;
$attributes['id'] = $this->getName() . '_unimportant';
$attributes['name'] = $this->getName() . '_unimportant';
if ($noValue) {
$attributes[FormElement::ATTR_CHECKED] = 'checked';
}
$renderedString .= '<li class="matchmaking_unimportant_checkbox" style="display:block;border-top: 1px solid #bbb; margin-top: 12px;padding-top:6px; width:100%">' . UTIL_HtmlTag::generateTag('input', $attributes) . ' <label for="' . $this->getId() . '">' . $language->text('matchmaking', 'this_is_unimportant') . '</label></li>';
return $renderedString . '</ul>';
}
示例9: __construct
public function __construct(BASE_CLASS_WidgetParameter $param)
{
parent::__construct();
$userId = $param->additionalParamList['entityId'];
if (isset($param->customParamList['content'])) {
$content = $param->customParamList['content'];
} else {
$settings = BOL_ComponentEntityService::getInstance()->findSettingList($param->widgetDetails->uniqName, $userId, array('content'));
$content = empty($settings['content']) ? null : $settings['content'];
}
if ($param->additionalParamList['entityId'] == OW::getUser()->getId()) {
$this->assign('ownerMode', true);
$this->assign('noContent', $content === null);
$this->addForm(new AboutMeForm($param->widgetDetails->uniqName, $content));
} else {
if (empty($content)) {
$this->setVisible(false);
return;
}
$this->assign('ownerMode', false);
$content = htmlspecialchars($content);
$content = UTIL_HtmlTag::autoLink($content);
$this->assign('contentText', $content);
}
}
示例10: process
/**
* Adds video clip
*
* @return boolean
*/
public function process()
{
$values = $this->getValues();
$clipService = VIDEO_BOL_ClipService::getInstance();
$clip = new VIDEO_BOL_Clip();
$clip->title = htmlspecialchars($values['title']);
$description = UTIL_HtmlTag::stripJs($values['description']);
$description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
$description = nl2br($description, true);
$clip->description = $description;
$clip->userId = OW::getUser()->getId();
$clip->code = '<iframe src="' . (OW::getRouter()->getBaseUrl() . 'spvideo/proxy/Allmyvideos/pending/') . $values['token'] . '" width="540" height="315" frameborder="0"></iframe>';
$privacy = OW::getEventManager()->call('plugin.privacy.get_privacy', array('ownerId' => $clip->userId, 'action' => 'video_view_video'));
$clip->provider = 'allmyvideos';
$clip->addDatetime = time();
$clip->status = 'approved';
$clip->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
$eventParams = array('pluginKey' => 'video', 'action' => 'add_video');
if (OW::getEventManager()->call('usercredits.check_balance', $eventParams) === true) {
OW::getEventManager()->call('usercredits.track_action', $eventParams);
}
if ($clipService->addClip($clip)) {
SPVIDEOLITE_PRO_ALLMYVIDEOS_CLASS_Processing::processTemporaryUpload($values['token'], $values['filename']);
BOL_TagService::getInstance()->updateEntityTags($clip->id, 'video', $values['tags']);
return array('result' => true, 'id' => $clip->id);
}
return false;
}
示例11: processSettingList
public static function processSettingList($settings, $place, $isAdmin)
{
if ($place != BOL_ComponentService::PLACE_DASHBOARD && !OW::getUser()->isAdmin()) {
$settings['content'] = UTIL_HtmlTag::stripJs($settings['content']);
//$settings['content'] = UTIL_HtmlTag::stripTags($settings['content'], array('frame'), array(), true, true);
} else {
$settings['content'] = UTIL_HtmlTag::sanitize($settings['content']);
}
return parent::processSettingList($settings, $place, $isAdmin);
}
示例12: renderInput
/**
* @see FormElement::renderInput()
*
* @param array $params
* @return string
*/
public function renderInput($params = null)
{
parent::renderInput($params);
$this->addAttribute('type', 'hidden');
$this->addAttribute('class', 'userFieldHidden');
$this->addAttribute('placeholder', OW::getLanguage()->text('mailbox', 'to'));
$input = new UserFieldRenderable();
$input->assign('input', UTIL_HtmlTag::generateTag('input', $this->attributes));
return $input->render();
}
示例13: renderInput
/**
* @see FormElement::renderInput()
*
* @param array $params
* @return string
*/
public function renderInput($params = null)
{
parent::renderInput($params);
$deleteLabel = OW::getLanguage()->text('base', 'delete');
$markup = '<div class="ow_avatar_field">';
$markup .= UTIL_HtmlTag::generateTag('input', $this->attributes);
$markup .= '<div class="ow_avatar_field_preview" style="display: none;"><img src="" alt="" /><span title="' . $deleteLabel . '"></span></div>';
$markup .= '<input type="hidden" name="" value="" class="ow_avatar_field_value" />';
$markup .= '</div>';
return $markup;
}
示例14: addAllGroupFeed
public function addAllGroupFeed()
{
if (OW::getConfig()->getValue('grouprss', 'disablePosting') == '1') {
return;
}
$commentService = BOL_CommentService::getInstance();
$newsfeedService = NEWSFEED_BOL_Service::getInstance();
$router = OW::getRouter();
$displayText = OW::getLanguage()->text('grouprss', 'feed_display_text');
$location = OW::getConfig()->getValue('grouprss', 'postLocation');
include_once 'autoloader.php';
$allFeeds = $this->feeddao->findAll();
foreach ($allFeeds as $feed) {
$simplefeed = new SimplePie();
$simplefeed->set_feed_url($feed->feedUrl);
$simplefeed->set_stupidly_fast(true);
$simplefeed->enable_cache(false);
$simplefeed->init();
$simplefeed->handle_content_type();
$items = $simplefeed->get_items(0, $feed->feedCount);
foreach ($items as $item) {
$content = UTIL_HtmlTag::autoLink($item->get_content());
if ($location == 'wall' && !$this->isDuplicateComment($feed->groupId, $content)) {
$commentService->addComment('groups_wal', $feed->groupId, 'groups', $feed->userId, $content);
}
if (trim($location) == 'newsfeed' && !$this->isDuplicateFeed($feed->groupId, $content)) {
$statusObject = $newsfeedService->saveStatus('groups', (int) $feed->groupId, $content);
$content = UTIL_HtmlTag::autoLink($content);
$action = new NEWSFEED_BOL_Action();
$action->entityId = $statusObject->id;
$action->entityType = "groups-status";
$action->pluginKey = "newsfeed";
$data = array("string" => $content, "content" => "[ph:attachment]", "view" => array("iconClass" => "ow_ic_comment"), "attachment" => array("oembed" => null, "url" => null, "attachId" => null), "data" => array("userId" => $feed->userId), "actionDto" => null, "context" => array("label" => $displayText, "url" => $router->urlForRoute('groups-view', array('groupId' => $feed->groupId))));
$action->data = json_encode($data);
$actionObject = $newsfeedService->saveAction($action);
$activity = new NEWSFEED_BOL_Activity();
$activity->activityType = NEWSFEED_BOL_Service::SYSTEM_ACTIVITY_CREATE;
$activity->activityId = $feed->userId;
$activity->actionId = $actionObject->id;
$activity->privacy = NEWSFEED_BOL_Service::PRIVACY_EVERYBODY;
$activity->userId = $feed->userId;
$activity->visibility = NEWSFEED_BOL_Service::VISIBILITY_FULL;
$activity->timeStamp = time();
$activity->data = json_encode(array());
$activityObject = $newsfeedService->saveActivity($activity);
$newsfeedService->addActivityToFeed($activity, 'groups', $feed->groupId);
}
}
$simplefeed->__destruct();
unset($feed);
}
}
示例15: renderInput
/**
* @see FormElement::renderInput()
*
* @param array $params
* @return string
*/
public function renderInput($params = null)
{
parent::renderInput($params);
if (isset($params['checked'])) {
$this->addAttribute(FormElement::ATTR_CHECKED, 'checked');
}
$label = isset($params['label']) ? $params['label'] : '';
$this->addAttribute('value', $params['value']);
$this->setId(UTIL_HtmlTag::generateAutoId('input'));
$renderedString = '<label>' . UTIL_HtmlTag::generateTag('input', $this->attributes) . $label . '</label>';
$this->removeAttribute(FormElement::ATTR_CHECKED);
return $renderedString;
}