Last active
August 29, 2015 13:56
-
-
Save ForestMars/9270323 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function codify_block_info() { | |
$blocks = array(); | |
$blocks['submit_session'] = array( | |
'info'=> t('Submit Session Block') | |
); | |
return $blocks; | |
} | |
function codify_blocks_block_view($delta) { | |
$blocks = array(); | |
switch($delta) { | |
case 'submit_session': | |
$blocks['subject'] = t('Submit a Session'); | |
$blocks['content'] = $block; | |
break; | |
} | |
return $blocks; | |
} | |
function codify_is_anon() { | |
if (user_is_anonymous()) { | |
$block = '<div class="register-now">' . l(t('Register now to submit a session'), 'user/register') . '</div>'; | |
} | |
if (!user_is_anonymous()) { | |
$block = '<div class="register-now">' . l(t('Submit a Session'), 'node/add/session') . '</div>'; | |
} | |
return $block; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment