本文整理汇总了PHP中CFactory::getBookmarks方法的典型用法代码示例。如果您正苦于以下问题:PHP CFactory::getBookmarks方法的具体用法?PHP CFactory::getBookmarks怎么用?PHP CFactory::getBookmarks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFactory
的用法示例。
在下文中一共展示了CFactory::getBookmarks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxEmailPage
public function ajaxEmailPage($uri, $emails, $message = '')
{
$filter = JFilterInput::getInstance();
$uri = $filter->clean($uri, 'string');
$emails = $filter->clean($emails, 'string');
$message = $filter->clean($message, 'string');
$message = stripslashes($message);
$mainframe =& JFactory::getApplication();
$bookmarks = CFactory::getBookmarks($uri);
$mailqModel = CFactory::getModel('mailq');
$config = CFactory::getConfig();
$response = new JAXResponse();
if (empty($emails)) {
$content = '<div>' . JText::_('COM_COMMUNITY_SHARE_INVALID_EMAIL') . '</div>';
$actions = '<input type="button" class="button" onclick="joms.bookmarks.show(\'' . $uri . '\');" value="' . JText::_('COM_COMMUNITY_GO_BACK_BUTTON') . '"/>';
} else {
$emails = explode(',', $emails);
$errors = array();
// Add notification
CFactory::load('libraries', 'notification');
foreach ($emails as $email) {
$email = JString::trim($email);
CFactory::load('helpers', 'validate');
if (!empty($email) && CValidateHelper::email($email)) {
$params = new CParameter('');
$params->set('uri', $uri);
$params->set('message', $message);
CNotificationLibrary::add('etype_system_bookmarks_email', '', $email, JText::sprintf('COM_COMMUNITY_SHARE_EMAIL_SUBJECT', $config->get('sitename')), '', 'bookmarks', $params);
} else {
// If there is errors with email, inform the user.
$errors[] = $email;
}
}
if ($errors) {
$content = '<div>' . JText::_('COM_COMMUNITY_EMAILS_ARE_INVALID') . '</div>';
foreach ($errors as $error) {
$content .= '<div style="font-weight:700;color: red;">' . $error . '</span>';
}
$actions = '<input type="button" class="button" onclick="joms.bookmarks.show(\'' . $uri . '\');" value="' . JText::_('COM_COMMUNITY_GO_BACK_BUTTON') . '"/>';
} else {
$content = '<div>' . JText::_('COM_COMMUNITY_EMAIL_SENT_TO_RECIPIENTS') . '</div>';
$actions = '<input type="button" class="button" onclick="cWindowHide();" value="' . JText::_('COM_COMMUNITY_DONE_BUTTON') . '"/>';
}
}
$response->addAssign('cwin_logo', 'innerHTML', JText::_('COM_COMMUNITY_SHARE_THIS'));
$response->addScriptCall('cWindowAddContent', $content, $actions);
return $response->sendResponse();
}
示例2: ajaxEmailPage
public function ajaxEmailPage($uri, $emails, $message = '')
{
$message = stripslashes($message);
$mainframe =& JFactory::getApplication();
$bookmarks = CFactory::getBookmarks($uri);
$mailqModel = CFactory::getModel('mailq');
$config = CFactory::getConfig();
$response = new JAXResponse();
if (empty($emails)) {
$content = '<div>' . JText::_('CC SHARE INVALID EMAIL') . '</div>';
$buttons = '<input type="button" class="button" onclick="joms.bookmarks.show(\'' . $uri . '\');" value="' . JText::_('CC BUTTON GO BACK') . '"/>';
} else {
$emails = explode(',', $emails);
$errors = array();
// Add notification
CFactory::load('libraries', 'notification');
foreach ($emails as $email) {
$email = JString::trim($email);
if (!empty($email) && preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})\$/i", $email)) {
$params = new JParameter('');
$params->set('uri', $uri);
$params->set('message', $message);
CNotificationLibrary::add('system.bookmarks.email', '', $email, JText::sprintf('CC SHARE EMAIL SUBJECT', $config->get('sitename')), '', 'bookmarks', $params);
} else {
// If there is errors with email, inform the user.
$errors[] = $email;
}
}
if ($errors) {
$content = '<div>' . JText::_('CC EMAILS ARE INVALID') . '</div>';
foreach ($errors as $error) {
$content .= '<div style="font-weight:700;color: red;">' . $error . '</span>';
}
$buttons = '<input type="button" class="button" onclick="joms.bookmarks.show(\'' . $uri . '\');" value="' . JText::_('CC BUTTON GO BACK') . '"/>';
} else {
$content = '<div>' . JText::_('CC EMAIL SENT TO RECIPIENTS') . '</div>';
$buttons = '<input type="button" class="button" onclick="cWindowHide();" value="' . JText::_('CC BUTTON DONE') . '"/>';
}
}
$response->addAssign('cwin_logo', 'innerHTML', JText::_('CC SHARE THIS'));
$response->addAssign('cWindowContent', 'innerHTML', $content);
$response->addScriptCall('cWindowActions', $buttons);
$response->addScriptCall('cWindowResize', 100);
return $response->sendResponse();
}
示例3: ajaxEmailPage
public function ajaxEmailPage($uri, $emails, $message = '')
{
$filter = JFilterInput::getInstance();
$uri = $filter->clean($uri, 'string');
$emails = $filter->clean($emails, 'string');
$message = $filter->clean($message, 'string');
$message = stripslashes($message);
$mainframe = JFactory::getApplication();
$bookmarks = CFactory::getBookmarks($uri);
$mailqModel = CFactory::getModel('mailq');
$config = CFactory::getConfig();
$response = new JAXResponse();
$json = array();
if (empty($emails)) {
$json['error'] = JText::_('COM_COMMUNITY_SHARE_INVALID_EMAIL');
} else {
$emails = explode(',', $emails);
$errors = array();
// Add notification
//CFactory::load( 'libraries' , 'notification' );
foreach ($emails as $email) {
$email = JString::trim($email);
if (!empty($email) && CValidateHelper::email($email)) {
$params = new CParameter('');
$params->set('uri', $uri);
$params->set('message', $message);
CNotificationLibrary::add('system_bookmarks_email', '', $email, JText::sprintf('COM_COMMUNITY_SHARE_EMAIL_SUBJECT', $config->get('sitename')), '', 'bookmarks', $params);
} else {
// If there is errors with email, inform the user.
$errors[] = $email;
}
}
if ($errors) {
$content = '<div>' . JText::_('COM_COMMUNITY_EMAILS_ARE_INVALID') . '</div>';
foreach ($errors as $error) {
$content .= '<div style="font-weight:bold; color:red;">' . $error . '</div>';
}
$json['error'] = $content;
} else {
$content = JText::_('COM_COMMUNITY_EMAIL_SENT_TO_RECIPIENTS');
$json['message'] = $content;
}
}
die(json_encode($json));
}