public function base_render_before($sender) { if ($sender->MasterView == 'admin') { return; } //tell the browser this is a mobile style $sender->Head->addTag('meta', array('name' => 'viewport', 'content' => "width=device-width,minimum-scale=1.0,maximum-scale=1.0")); /* $sender->InformMessage( 'This message will stay here until you dismiss it!', array( 'CssClass' => 'Dismissable', 'DismissCallbackUrl' => '/plugin/dismissmessage/' ) ); */ $sender->Head->addTag('meta', array('name' => 'theme-color', 'content' => "#C08F00")); // YOU CAN REMOVE FONT-AWESOME IN ONLINE-VERSION $sender->Head->addTag('link', array('rel' => 'stylesheet', 'href' => "https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css")); //position of the panel $sender->CssClass .= c('MinusBaseline.Panel.Left', false) ? ' PanelLeft' : ' PanelRight'; //add the hamburger menu $sender->addAsset('Content', anchor('n', url('#'), 'Hamburger'), 'Hamburger'); //add the searchbox to the panel //copied from library/vendors/SmartyPlugins/function.searchbox.php $form = Gdn::factory('Form'); $form->InputPrefix = ''; $search = $form->open(array('action' => Url('/search'), 'method' => 'get')) . $form->textBox('Search', array('placeholder' => t('SearchBoxPlaceHolder', 'Search'))) . $form->button('Go', array('Name' => '')) . $form->close(); $sender->addAsset('Panel', wrap($search, 'div', array('class' => 'SiteSearch')), 'SearchBox'); //nomobile link to switch to the full site $sender->addAsset('Foot', Gdn_Theme::link('/', t(' '), '<div class="LogoFoot"><a href="%url" class="%class">%text</a></div>'), 'LogoFoot'); //Add logo to button of site $sender->addAsset('Foot', Gdn_Theme::link('profile/nomobile', t('Full Site'), '<div class="NoMobile"><a href="%url" class="%class">%text</a></div>'), 'NoMobile'); }
/** * * * @param array $Params * @param object $Smarty * @return string */ function smarty_function_dashboard_link($Params, &$Smarty) { $Path = val('path', $Params, '', true); $Text = val('text', $Params, '', true); $Wrap = val('wrap', $Params, 'li'); return Gdn_Theme::link('dashboard', val('text', $Params, ''), val('format', $Params, wrap('<a href="%url" class="%class">%text</a>', $Wrap))); }
/** * A placeholder for future menu items. * * @param array $Params The parameters passed into the function. * @param Smarty $Smarty The smarty object rendering the template. * @return string */ function smarty_function_custom_menu($Params, &$Smarty) { $Controller = $Smarty->Controller; if (is_object($Menu = val('Menu', $Controller))) { $Format = val('format', $Params, wrap('<a href="%url" class="%class">%text</a>', val('wrap', $Params, 'li'))); $Result = ''; foreach ($Menu->Items as $Group) { foreach ($Group as $Item) { // Make sure the item is a custom item. if (valr('Attributes.Standard', $Item)) { continue; } // Make sure the user has permission for the item. if ($Permission = val('Permission', $Item)) { if (!Gdn::session()->checkPermission($Permission)) { continue; } } if (($Url = val('Url', $Item)) && ($Text = val('Text', $Item))) { $Attributes = val('Attributes', $Item); $Result .= Gdn_Theme::link($Url, $Text, $Format, $Attributes) . "\r\n"; } } } return $Result; } return ''; }
/** * * * @param array $Params * @param object $Smarty * @return string */ function smarty_function_nomobile_link($Params, &$Smarty) { $Path = val('path', $Params, '', true); $Text = val('text', $Params, '', true); $Wrap = val('wrap', $Params, 'li'); return Gdn_Theme::link('profile/nomobile', val('text', $Params, t("Full Site")), val('format', $Params, wrap('<a href="%url" class="%class">%text</a>', $Wrap))); }
/** * * * @param array $Params * @param object $Smarty * @return string */ function smarty_function_signin_link($Params, &$Smarty) { if (!Gdn::session()->isValid()) { $Wrap = val('wrap', $Params, 'li'); return Gdn_Theme::link('signinout', val('text', $Params, ''), val('format', $Params, wrap('<a href="%url" rel="nofollow" class="%class">%text</a>', $Wrap)), $Params); } }
/** * Takes a route and prepends the web root (expects "/controller/action/params" as $Path). * * @param array $Params The parameters passed into the function. * The parameters that can be passed to this function are as follows. * - <b>path</b>: The relative path for the url. There are some special paths that can be used to return "intelligent" links: * - <b>signinout</b>: This will return a signin/signout url that will toggle depending on whether or not the user is already signed in. When this path is given the text is automaticall set. * - <b>withdomain</b>: Whether or not to add the domain to the url. * - <b>text</b>: Html text to be put inside an anchor. If this value is set then an html <a></a> is returned rather than just a url. * - <b>id, class, etc.</b>: When an anchor is generated then any other attributes are passed through and will be written in the resulting tag. * @param Smarty $Smarty The smarty object rendering the template. * @return The url. */ function smarty_function_link($Params, &$Smarty) { $Path = val('path', $Params, '', true); $Text = val('text', $Params, '', true); $NoTag = val('notag', $Params, false, true); $CustomFormat = val('format', $Params, false, true); if (!$Text && $Path != 'signinout' && $Path != 'signin') { $NoTag = true; } if ($CustomFormat) { $Format = $CustomFormat; } elseif ($NoTag) { $Format = '%url'; } else { $Format = '<a href="%url" class="%class">%text</a>'; } $Options = array(); if (isset($Params['withdomain'])) { $Options['WithDomain'] = $Params['withdomain']; } if (isset($Params['class'])) { $Options['class'] = $Params['class']; } if (isset($Params['tk'])) { $Options['TK'] = $Params['tk']; } if (isset($Params['target'])) { $Options['Target'] = $Params['target']; } $Result = Gdn_Theme::link($Path, $Text, $Format, $Options); return $Result; }
/** * Takes a route and prepends the web root (expects "/controller/action/params" as $Path). * * @param array The parameters passed into the function. * The parameters that can be passed to this function are as follows. * - <b>path</b>: The relative path for the url. There are some special paths that can be used to return "intelligent" links: * - <b>signinout</b>: This will return a signin/signout url that will toggle depending on whether or not the user is already signed in. When this path is given the text is automaticall set. * - <b>withdomain</b>: Whether or not to add the domain to the url. * - <b>text</b>: Html text to be put inside an anchor. If this value is set then an html <a></a> is returned rather than just a url. * - <b>id, class, etc.></b>: When an anchor is generated then any other attributes are passed through and will be written in the resulting tag. * @param Smarty The smarty object rendering the template. * @return The url. */ function smarty_function_forum_root_link($Params, &$Smarty) { $Text = val('text', $Params, '', true); $Format = val('format', $Params, '<li><a href="%url" class="%class">%text</a></li>'); $Options = array(); if (isset($Params['class'])) { $Options['class'] = $Params['class']; } $Result = Gdn_Theme::link('forumroot', $Text, $Format, $Options); return $Result; }
/** * * * @param array $Params * @param object $Smarty * @return string */ function smarty_function_categories_link($Params, &$Smarty) { $Wrap = val('wrap', $Params, 'li'); return Gdn_Theme::link('categories', val('text', $Params, t('Categories')), val('format', $Params, wrap('<a href="%url" class="%class">%text</a>', $Wrap))); }
/** * * * @param array $Params * @param object $Smarty * @return string */ function smarty_function_bookmarks_link($Params, &$Smarty) { $Wrap = val('wrap', $Params, 'li'); return Gdn_Theme::link('discussions/bookmarked', val('text', $Params, t('My Bookmarks')), val('format', $Params, wrap('<a href="%url" class="%class">%text</a>', $Wrap))); }
/** * * * @param array $Params * @param object $Smarty * @return string */ function smarty_function_profile_link($Params, &$Smarty) { $Wrap = val('wrap', $Params, 'li'); return Gdn_Theme::link('profile', val('text', $Params, ''), val('format', $Params, wrap('<a href="%url" class="%class">%text</a>', $Wrap))); }
/** * * * @param array $Params * @param object $Smarty * @return string */ function smarty_function_activity_link($Params, &$Smarty) { $Wrap = val('wrap', $Params, 'li'); return Gdn_Theme::link('activity', val('text', $Params, t('Activity')), val('format', $Params, wrap('<a href="%url" class="%class">%text</a>', $Wrap))); }
/** * This function returns the link to the "participated" page * * @param array $params The parameters passed into the function. * @param Smarty $smarty The smarty object rendering the template. * @return string */ function smarty_function_participated_link($params, &$smarty) { $wrap = val('wrap', $params, 'li'); return Gdn_Theme::link('/discussions/participated', val('text', $params, t('Participated')), val('format', $params, wrap('<a href="%url" class="%class">%text</a>', $wrap))); }
echo anchor($Row['CountUsers'], '/dashboard/user?Filter=' . urlencode($this->_BanFilter($Row))); ?> </td> <td class="CenterCell"> <?php echo $Row['CountBlockedRegistrations']; ?> </td> <td class="UsernameCell"><?php echo htmlspecialchars($Row['InsertName']); ?> </td> <td><?php echo htmlspecialchars($Row['Notes']); ?> </td> <td> <?php echo Gdn_Theme::link("/dashboard/settings/bans/edit?id={$Row['BanID']}", t('Edit'), null, array('class' => 'SmallButton Edit')); echo ' '; echo Gdn_Theme::link("/dashboard/settings/bans/delete?id={$Row['BanID']}", t('Delete'), null, array('class' => 'SmallButton Delete')); ?> </td> </tr> <?php } ?> </tbody> </table> <?php PagerModule::write();