function sharingSettings() { $this->validate(); $journal = Request::getJournal(); if ($journal) { $this->setupTemplate(true); $templateMgr =& TemplateManager::getManager(); $rtDao =& DAORegistry::getDAO('RTDAO'); $rt = $rtDao->getJournalRTByJournal($journal); $templateMgr->assign('sharingEnabled', $rt->getSharingEnabled()); $templateMgr->assign('sharingUserName', $rt->getSharingUserName()); $templateMgr->assign('sharingButtonStyle', $rt->getSharingButtonStyle()); $templateMgr->assign('sharingButtonStyleOptions', array_keys(SharingRT::getBtnStyles())); $templateMgr->assign('sharingDropDownMenu', $rt->getSharingDropDownMenu()); $templateMgr->assign('sharingBrand', $rt->getSharingBrand()); $templateMgr->assign('sharingDropDown', $rt->getSharingDropDown()); $templateMgr->assign('sharingLanguage', $rt->getSharingLanguage()); $templateMgr->assign('sharingLanguageOptions', SharingRT::getLanguages()); $templateMgr->assign('sharingLogo', $rt->getSharingLogo()); $templateMgr->assign('sharingLogoBackground', $rt->getSharingLogoBackground()); $templateMgr->assign('sharingLogoColor', $rt->getSharingLogoColor()); $templateMgr->assign('helpTopicId', 'journal.managementPages.readingTools.addthisSettings'); $templateMgr->display('rtadmin/addthis.tpl'); } else { Request::redirect(null, Request::getRequestedPage()); } }
function sharingSettings($args, $request) { $this->validate(); $journal = $request->getJournal(); if ($journal) { $this->setupTemplate($request, true); $templateMgr = TemplateManager::getManager($request); $rtDao = DAORegistry::getDAO('RTDAO'); $rt = $rtDao->getJournalRTByJournal($journal); $templateMgr->assign('sharingEnabled', $rt->getSharingEnabled()); $templateMgr->assign('sharingUserName', $rt->getSharingUserName()); $templateMgr->assign('sharingButtonStyle', $rt->getSharingButtonStyle()); $templateMgr->assign('sharingButtonStyleOptions', array_keys(SharingRT::getBtnStyles())); $templateMgr->assign('sharingDropDownMenu', $rt->getSharingDropDownMenu()); $templateMgr->assign('sharingBrand', $rt->getSharingBrand()); $templateMgr->assign('sharingDropDown', $rt->getSharingDropDown()); $templateMgr->assign('sharingLanguage', $rt->getSharingLanguage()); $templateMgr->assign('sharingLanguageOptions', SharingRT::getLanguages()); $templateMgr->assign('sharingLogo', $rt->getSharingLogo()); $templateMgr->assign('sharingLogoBackground', $rt->getSharingLogoBackground()); $templateMgr->assign('sharingLogoColor', $rt->getSharingLogoColor()); $templateMgr->display('rtadmin/addthis.tpl'); } else { $request->redirect(null, $request->getRequestedPage()); } }
/** * Generate the information for the HTML tag for the sharing button * @return array(url, width, height) */ function sharingButtonImage($journalRt) { $btnStyle = $journalRt->getSharingButtonStyle(); if ($journalRt->getSharingLanguage() != 'en') { if ($btnStyle == 'bookmark' || $btnStyle == 'addthis' || $btnStyle == 'bookmark-sm') { $btnStyle = 'share'; } } $btnStyles = SharingRT::getBtnStyles(); if (!isset($btnStyles[$btnStyle])) { $btnStyle = 'share'; } $btnRecord = $btnStyles[$btnStyle]; $btnUrl = (strpos(trim($btnRecord['img']), 'http://') !== 0 ? "http://s7.addthis.com/static/btn/" : "") . $btnRecord['img']; $btnUrl = str_replace('%lang%', SharingRT::sharingLocale($journalRt->getSharingLanguage()), $btnUrl); $btnWidth = $btnRecord['w']; $btnHeight = $btnRecord['h']; return array($btnUrl, $btnWidth, $btnHeight); }