From 6493559ee827cfddda8e57452f96314dae2a4b6c Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Dec 2011 07:36:15 +0000 Subject: [PATCH] new file: pageheader.tgz For admins to make system announcements new file: pageheader/README For admins to make system announcements new file: pageheader/pageheader.css For admins to make system announcements new file: pageheader/pageheader.php For admins to make system announcements --- pageheader.tgz | Bin 0 -> 1181 bytes pageheader/README | 5 +++ pageheader/pageheader.css | 21 ++++++++++ pageheader/pageheader.php | 78 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 pageheader.tgz create mode 100644 pageheader/README create mode 100644 pageheader/pageheader.css create mode 100644 pageheader/pageheader.php diff --git a/pageheader.tgz b/pageheader.tgz new file mode 100644 index 0000000000000000000000000000000000000000..2dfa6785e6c2253a85e4c2bb502a8e981fa5fd4b GIT binary patch literal 1181 zcmV;O1Y-LiiwFR?#`;bG1MOH_Z`(E$&a3q+PF1gR0$Z{jIT@VTLxH5&uuFrb*h^a& zv_x5iB}x#fq~4JKzC+3v#g5}_jTa2n2gDcZGAWtRkP@F}&cVLWMx6F~`W>@m!d*;?m{Qj#4|>4nzenNeGp8s!tlM}kVp_(c43$(p^|zgxv9 zO@#bfJ%tcdX51MMM>FT^@yz*tBDyJe4>8@PWDil@64?7&8gJ^P`KB&ZkPV~8g2pRg zVkDTP$c!0p93C1qED4!s90jXHIM_wL4@sVZkh6%2kWvXU0U6Sw{X_z{6gPAxX>ZCPP+df*Mj3Z^H^%?8|SmzPrQ|zN?V6GII0CJYnfhp-1>3Bkz z5N0$Om=@St)P%~>m3z zU%&vAbT8onn>0#^u$q=KN2glHu;8oEEq9jaO=}*?x+om=*$sFR5duA(2dXuW5^rh_ zky>Vk$J#X6u*{V_6RwxVrkpu<6zyz71@i}`U9H=Uq$%!Rr!t=Aa)YegFiWvFL9jpZ z^Y?8NI1cEC*f%7~={z+>9BfNR_r5|0jT@GO;6;?6UB!c^1WV-On8~F_Fq}J4m|HwG z*IimHZ&<&0@UWJ9Zeb#>^=c7$<=otzrR}TkxqC`W>Mox5o$=C#w`aiCd_1F$9q0eH+ji&Ye|+tp>hr(4|5fMz{o{3M=tN{p zBQ?N+C?T>B5e+1clUwG?un))WcKQXs#w5e@R7)l)9`*GSPMg>3vujh#&V9uURU7Y7 zdvmH?8h*t&RrPy|L~MeW4v%s?@-3`I1?}(Fbau6%T99zrQopCTGPmNTbMTTV_5bge zZ!dnm+=Gr?{oi#vi~s+0d&fQOe|&SR{{JsfzUmwA5_NsZZm`4j*+)RaqnT}7Fp)-N zrY`-e=kP~b2(>Rz{2AW0Vj!F+c;cWj_Mxzh4|qXYu$TbdoYV)#_0>fS2jY3SMFNq_ vJ4+L;^lfdqV1LuiS)oFO3Kc3;s8FFog$flaRH#s)!dK#Nps`-l04M+eW0F!p literal 0 HcmV?d00001 diff --git a/pageheader/README b/pageheader/README new file mode 100644 index 00000000..f9b1752b --- /dev/null +++ b/pageheader/README @@ -0,0 +1,5 @@ +Page Header + +For server admins only. +Displays a text message for system announcements' +The message is entered in the admin account at settings, Plugin settings. diff --git a/pageheader/pageheader.css b/pageheader/pageheader.css new file mode 100644 index 00000000..49232cfa --- /dev/null +++ b/pageheader/pageheader.css @@ -0,0 +1,21 @@ +#pageheader-label { + float: left; + width: 300px; + margin-top: 10px; +} + +#pageheader-words { + float: left; + margin-top: 10px; +} + +#pageheader-submit { + margin-top: 15px; +} + +.pageheader { + text-align: center; + width 100%; + margin-top: 25px; + font-size: 20px; +} diff --git a/pageheader/pageheader.php b/pageheader/pageheader.php new file mode 100644 index 00000000..d9b187de --- /dev/null +++ b/pageheader/pageheader.php @@ -0,0 +1,78 @@ + + * + */ + +function pageheader_install() { + register_hook('page_header', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); + register_hook('plugin_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings'); + register_hook('plugin_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post'); + +} + + +function pageheader_uninstall() { + unregister_hook('page_header', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); + unregister_hook('plugin_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings'); + unregister_hook('plugin_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post'); + +} + + + + + +function pageheader_addon_settings(&$a,&$s) { + + + if(! is_site_admin()) + return; + + /* Add our stylesheet to the page so we can make our settings look nice */ + + $a->page['htmlhead'] .= '' . "\r\n"; + + + $words = get_config('pageheader','text'); + if(! $words) + $words = 'pageheader,'; + + $s .= '
'; + $s .= '

' . t('"pageheader" Settings') . '

'; + $s .= '
'; + + $s .= '
'; + + return; + +} + +function pageheader_addon_settings_post(&$a,&$b) { + + if(! is_site_admin()) + return; + + if($_POST['pageheader-submit']) { + set_config('pageheader','text',trim(strip_tags($_POST['pageheader-words']))); + info( t('pageheader Settings saved.') . EOL); + } +} + +function pageheader_fetch($a,&$b) { + + $a->page['htmlhead'] .= '' . "\r\n"; + $s = get_config('pageheader','text'); + if(! $s) + $s = ''; + if ($s != '') + $b .= ''; +} -- 2.39.5