diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 20:41:31 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 20:41:31 +0000 |
commit | 70b08afa64465f4d3457ba6e1c4cc2df1dd2069b (patch) | |
tree | 251d2559ea516ae4e23395dab4b083d079b65d24 /views/default/page_elements/owner_block.php | |
parent | c66831fa5138a277a9729174caf14c7eb323fb07 (diff) | |
download | elgg-70b08afa64465f4d3457ba6e1c4cc2df1dd2069b.tar.gz elgg-70b08afa64465f4d3457ba6e1c4cc2df1dd2069b.tar.bz2 |
More views cleanup.
git-svn-id: http://code.elgg.org/elgg/trunk@3556 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/page_elements/owner_block.php')
-rw-r--r-- | views/default/page_elements/owner_block.php | 189 |
1 files changed, 92 insertions, 97 deletions
diff --git a/views/default/page_elements/owner_block.php b/views/default/page_elements/owner_block.php index 535d1b064..46397c4c2 100644 --- a/views/default/page_elements/owner_block.php +++ b/views/default/page_elements/owner_block.php @@ -1,100 +1,95 @@ <?php +/** + * Elgg owner block + * Displays page ownership information + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + */ + +$contents = ""; + +// Is there a page owner? +$owner = page_owner_entity(); +// if (!$owner && isloggedin()) $owner = $_SESSION['user']; +if ($owner instanceof ElggEntity) { + $icon = elgg_view("profile/icon",array('entity' => $owner, 'size' => 'tiny')); + if ($owner instanceof ElggUser || $owner instanceof ElggGroup) { + //$info = $owner->name; + $info = '<a href="' . $owner->getURL() . '">' . $owner->name . '</a>'; + } + $display = "<div id=\"owner_block_icon\">" . $icon . "</div>"; + $display .= "<div id=\"owner_block_content\">" . $info . "</div><div class=\"clearfloat ownerblockline\"></div>"; + + if ($owner->briefdescription) { + $desc = $owner->briefdescription; + $display .= "<div id=\"owner_block_desc\">" . $desc . "</div>"; + } + + $contents .= $display; +} + +// Are there feeds to display? +global $autofeed; + +if (isset($autofeed) && $autofeed == true) { + $url = $url2 = full_url(); + if (substr_count($url,'?')) { + $url .= "&view=rss"; + } else { + $url .= "?view=rss"; + } + //if (substr_count($url2,'?')) { + // $url2 .= "&view=odd"; + //} else { + // $url2 .= "?view=opendd"; + //} + $label = elgg_echo('feed:rss'); + //$label2 = elgg_echo('feed:odd'); + $contents .= <<<END + +<div id="owner_block_rss_feed"><a href="{$url}" rel="nofollow">{$label}</a></div> - /** - * Elgg owner block - * Displays page ownership information - * - * @package Elgg - * @subpackage Core - - * @author Curverider Ltd - - * @link http://elgg.org/ - * - */ - - $contents = ""; - - // Is there a page owner? - $owner = page_owner_entity(); - // if (!$owner && isloggedin()) $owner = $_SESSION['user']; - if ($owner instanceof ElggEntity) { - $icon = elgg_view("profile/icon",array('entity' => $owner, 'size' => 'tiny')); - if ($owner instanceof ElggUser || $owner instanceof ElggGroup) { - //$info = $owner->name; - $info = '<a href="' . $owner->getURL() . '">' . $owner->name . '</a>'; - } - $display = "<div id=\"owner_block_icon\">" . $icon . "</div>"; - $display .= "<div id=\"owner_block_content\">" . $info . "</div><div class=\"clearfloat ownerblockline\"></div>"; - - if ($owner->briefdescription) { - $desc = $owner->briefdescription; - $display .= "<div id=\"owner_block_desc\">" . $desc . "</div>"; - } - - $contents .= $display; - } - - // Are there feeds to display? - global $autofeed; - - if (isset($autofeed) && $autofeed == true) { - $url = $url2 = full_url(); - if (substr_count($url,'?')) { - $url .= "&view=rss"; - } else { - $url .= "?view=rss"; - } - //if (substr_count($url2,'?')) { - // $url2 .= "&view=odd"; - //} else { - // $url2 .= "?view=opendd"; - //} - $label = elgg_echo('feed:rss'); - //$label2 = elgg_echo('feed:odd'); - $contents .= <<<END - - <div id="owner_block_rss_feed"><a href="{$url}" rel="nofollow">{$label}</a></div> - END; - } - - //the follow are for logged in users only - if(isloggedin()){ - - //is the bookmark plugin installed? - if(is_plugin_enabled('bookmarks')){ - - $label3 = elgg_echo('bookmarks:this'); - $contents .= "<div id=\"owner_block_bookmark_this\"><a href=\"javascript:location.href='". $CONFIG->wwwroot . "mod/bookmarks/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">{$label3}</a></div>"; - - } - - //report this button - if (is_plugin_enabled('reportedcontent')) - { - $label4 = elgg_echo('reportedcontent:report'); - $contents .= "<div id=\"owner_block_report_this\"><a href=\"javascript:location.href='". $CONFIG->wwwroot . "mod/reportedcontent/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">{$label4}</a></div>"; - } - - } - - - $contents .= elgg_view('owner_block/extend'); - - // Have we been asked to inject any content? If so, display it - if (isset($vars['content'])) - $contents .= $vars['content']; - - // Initialise the submenu - $submenu = get_submenu(); // elgg_view('canvas_header/submenu'); - if (!empty($submenu)) - $contents .= "<div id=\"owner_block_submenu\">" . $submenu . "</div>"; // plugins can extend this to add menu options - - if (!empty($contents)) { - echo "<div id=\"owner_block\">"; - echo $contents; - echo "</div><div id=\"owner_block_bottom\"></div>"; - } - -?>
\ No newline at end of file +} + +//the follow are for logged in users only +if(isloggedin()){ + + //is the bookmark plugin installed? + if(is_plugin_enabled('bookmarks')){ + + $label3 = elgg_echo('bookmarks:this'); + $contents .= "<div id=\"owner_block_bookmark_this\"><a href=\"javascript:location.href='". $CONFIG->wwwroot . "mod/bookmarks/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">{$label3}</a></div>"; + + } + + //report this button + if (is_plugin_enabled('reportedcontent')) + { + $label4 = elgg_echo('reportedcontent:report'); + $contents .= "<div id=\"owner_block_report_this\"><a href=\"javascript:location.href='". $CONFIG->wwwroot . "mod/reportedcontent/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">{$label4}</a></div>"; + } + +} + + +$contents .= elgg_view('owner_block/extend'); + +// Have we been asked to inject any content? If so, display it +if (isset($vars['content'])) + $contents .= $vars['content']; + +// Initialise the submenu +$submenu = get_submenu(); // elgg_view('canvas_header/submenu'); +if (!empty($submenu)) + $contents .= "<div id=\"owner_block_submenu\">" . $submenu . "</div>"; // plugins can extend this to add menu options + +if (!empty($contents)) { + echo "<div id=\"owner_block\">"; + echo $contents; + echo "</div><div id=\"owner_block_bottom\"></div>"; +}
\ No newline at end of file |