Author $h_author "; } public function display_artists(){ global $page; $page->set_title("Artists"); $page->set_heading("Artists"); $page->add_block(new Block("Artists", $html, "main", 10)); //$this->display_paginator($page, "artist/list", null, $pageNumber, $totalPages); } public function sidebar_options(/*string*/ $mode, $artistID=NULL, $is_admin=FALSE){ global $page; if($mode == "neutral"){ $html = "
".$user->get_auth_html()."
"; } if($mode == "editor"){ $html = "
".$user->get_auth_html()."
".$user->get_auth_html()."
"; if($is_admin){ $html .= "
".$user->get_auth_html()."
"; } $html .= "
".$user->get_auth_html()."
".$user->get_auth_html()."
".$user->get_auth_html()."
"; } $page->add_block(new Block("Manage Artists", $html, "left", 10)); } public function show_artist_editor($artist, $aliases, $members, $urls) { $artistName = $artist['name']; $artistNotes = $artist['notes']; $artistID = $artist['id']; // aliases $aliasesString = ""; $aliasesIDsString = ""; foreach ($aliases as $alias) { $aliasesString .= $alias["alias_name"]." "; $aliasesIDsString .= $alias["alias_id"]." "; } $aliasesString = rtrim($aliasesString); $aliasesIDsString = rtrim($aliasesIDsString); // members $membersString = ""; $membersIDsString = ""; foreach ($members as $member) { $membersString .= $member["name"]." "; $membersIDsString .= $member["id"]." "; } $membersString = rtrim($membersString); $membersIDsString = rtrim($membersIDsString); // urls $urlsString = ""; $urlsIDsString = ""; foreach ($urls as $url) { $urlsString .= $url["url"]."\n"; $urlsIDsString .= $url["id"]." "; } $urlsString = substr($urlsString, 0, strlen($urlsString) -1); $urlsIDsString = rtrim($urlsIDsString); $html = '
'.$user->get_auth_html().'
Name:
Alias:
Members:
URLs:
Notes:
'; global $page; $page->add_block(new Block("Edit artist", $html, "main", 10)); } public function new_artist_composer() { global $page; $html = "
".$user->get_auth_html()."
Name:
Aliases:
Members:
URLs:
Notes:
"; $page->set_title("Artists"); $page->set_heading("Artists"); $page->add_block(new Block("Artists", $html, "main", 10)); } public function list_artists($artists, $pageNumber, $totalPages) { global $user, $page; $html = "". "". "". "". "". ""; if(!$user->is_anonymous()) $html .= ""; // space for edit link $html .= ""; $n = 0; $deletionLinkActionArray = array('artist' => 'artist/nuke/' , 'alias' => 'artist/alias/delete/' , 'member' => 'artist/member/delete/' ); $editionLinkActionArray = array('artist' => 'artist/edit/' , 'alias' => 'artist/alias/edit/' , 'member' => 'artist/member/edit/' ); $typeTextArray = array('artist' => 'Artist' , 'alias' => 'Alias' , 'member' => 'Member' ); foreach ($artists as $artist) { if ($artist['type'] != 'artist') $artist['name'] = str_replace("_", " ", $artist['name']); $elementLink = "".str_replace("_", " ", $artist['name']).""; $artist_link = "".str_replace("_", " ", $artist['artist_name']).""; $user_link = "".$artist['user_name'].""; $edit_link = "Edit"; $del_link = "Delete"; $html .= "". "". "". "". ""; if(!$user->is_anonymous()) $html .= ""; if($user->is_admin()) $html .= ""; $html .= ""; } $html .= "
NameTypeLast updaterPostsAction
".$elementLink; //if ($artist['type'] == 'member') // $html .= " (member of ".$artist_link.")"; //if ($artist['type'] == 'alias') // $html .= " (alias for ".$artist_link.")"; $html .= "".$typeTextArray[$artist['type']]."".$user_link."".$artist['posts']."".$edit_link."".$del_link."
"; $page->set_title("Artists"); $page->set_heading("Artists"); $page->add_block(new Block("Artists", $html, "main", 10)); $this->display_paginator($page, "artist/list", null, $pageNumber, $totalPages); } public function show_new_alias_composer($artistID) { $html = ' '.$user->get_auth_html().'
Alias:
'; global $page; $page->add_block(new Block("Artist Aliases", $html, "main", 20)); } public function show_new_member_composer($artistID) { $html = '
'.$user->get_auth_html().'
Members:
'; global $page; $page->add_block(new Block("Artist members", $html, "main", 30)); } public function show_new_url_composer($artistID) { $html = '
'.$user->get_auth_html().'
URL:
'; global $page; $page->add_block(new Block("Artist URLs", $html, "main", 40)); } public function show_alias_editor($alias) { $html = '
'.$user->get_auth_html().'
'; global $page; $page->add_block(new Block("Edit Alias", $html, "main", 10)); } public function show_url_editor($url) { $html = '
'.$user->get_auth_html().'
'; global $page; $page->add_block(new Block("Edit URL", $html, "main", 10)); } public function show_member_editor($member) { $html = '
'.$user->get_auth_html().'
'; global $page; $page->add_block(new Block("Edit Member", $html, "main", 10)); } public function show_artist($artist, $aliases, $members, $urls, $images, $userIsLogged, $userIsAdmin) { global $user, $event, $page; $artist_link = "".str_replace("_", " ", $artist['name']).""; $n = 0; $html = ""; if ($userIsLogged) $html .= ""; if ($userIsAdmin) $html .= ""; $html .= " "; if ($userIsLogged) $html .= ""; if ($userIsAdmin) $html .= ""; $html .= ""; if (count($aliases) > 0) { $aliasViewLink = str_replace("_", " ", $aliases[0]['alias_name']); // no link anymore $aliasEditLink = "Edit"; $aliasDeleteLink = "Delete"; $html .= ""; if ($userIsLogged) $html .= ""; if ($userIsAdmin) $html .= ""; $html .= ""; if (count($aliases) > 1) { for ($i = 1; $i < count($aliases); $i++) { $aliasViewLink = str_replace("_", " ", $aliases[$i]['alias_name']); // no link anymore $aliasEditLink = "Edit"; $aliasDeleteLink = "Delete"; $html .= ""; if ($userIsLogged) $html .= ""; if ($userIsAdmin) $html .= ""; $html .= ""; } } } if (count($members) > 0) { $memberViewLink = str_replace("_", " ", $members[0]['name']); // no link anymore $memberEditLink = "Edit"; $memberDeleteLink = "Delete"; $html .= ""; if ($userIsLogged) $html .= ""; if ($userIsAdmin) $html .= ""; $html .= ""; if (count($members) > 1) { for ($i = 1; $i < count($members); $i++) { $memberViewLink = str_replace("_", " ", $members[$i]['name']); // no link anymore $memberEditLink = "Edit"; $memberDeleteLink = "Delete"; $html .= ""; if ($userIsLogged) $html .= ""; if ($userIsAdmin) $html .= ""; $html .= ""; } } } if (count($urls) > 0) { $urlViewLink = "".str_replace("_", " ", $urls[0]['url']).""; $urlEditLink = "Edit"; $urlDeleteLink = "Delete"; $html .= ""; if ($userIsLogged) $html .= ""; if ($userIsAdmin) $html .= ""; $html .= ""; if (count($urls) > 1) { for ($i = 1; $i < count($urls); $i++) { $urlViewLink = "".str_replace("_", " ", $urls[$i]['url']).""; $urlEditLink = "Edit"; $urlDeleteLink = "Delete"; $html .= ""; if ($userIsLogged) $html .= ""; if ($userIsAdmin) $html .= ""; $html .= ""; } } } $html .= ""; if ($userIsLogged) $html .= ""; if ($userIsAdmin) $html .= ""; //TODO how will notes be edited? On edit artist? (should there be an editartist?) or on a editnotes? //same question for deletion $html .= "
Name: ".$artist_link."
Aliases: ".$aliasViewLink."".$aliasEditLink."".$aliasDeleteLink."
  ".$aliasViewLink."".$aliasEditLink."".$aliasDeleteLink."
Members: ".$memberViewLink."".$memberEditLink."".$memberDeleteLink."
  ".$memberViewLink."".$memberEditLink."".$memberDeleteLink."
URLs: ".$urlViewLink."".$urlEditLink."".$urlDeleteLink."
  ".$urlViewLink."".$urlEditLink."".$urlDeleteLink."
Notes: ".$artist["notes"]."
"; $page->set_title("Artist"); $page->set_heading("Artist"); $page->add_block(new Block("Artist", $html, "main", 10)); //we show the images for the artist $artist_images = ""; foreach($images as $image) { $thumb_html = $this->build_thumb_html($image); $artist_images .= ''. ''.$thumb_html.''. ''; } $page->add_block(new Block("Artist Images", $artist_images, "main", 20)); } } ?>