示例#1
0
function DisplayThemeBar($theme1)
        {
        global $lang,$flag_new_themes,$contact_sheet,$theme_images,$allow_share,$n,$baseurl;

        # Work out theme name
        $themename=$theme1;
        $theme_display=getval("theme_$n","off");
       
        $themes=get_themes(array($theme1));
        if (count($themes)>0)
                {
                ?>

<div
onclick="
var theme_display=get_cookie('theme_<?php echo $n?>');
if (theme_display=='off'){var toggle_theme_display='on';} else { var toggle_theme_display='off';}
SetCookie('theme_<?php echo $n?>',toggle_theme_display,1000);
jQuery('#themebar_<?php echo htmlspecialchars(str_replace(array("\""," "),"",$themename)) ?>').slideToggle(0.2);


return false;">                
               
	<a href='#'><b><?php echo htmlspecialchars(stripslashes(i18n_get_translated(str_replace("*","",$themename)))) ?></b></a></div>
               
<div id="themebar_<?php echo htmlspecialchars(str_replace(array("\""," "),"",$themename)) ?>" style="display:<?php if ($theme_display == 'off'){echo 'none';} else {echo '';}?>" >
                <?php
                for ($m=0;$m<count($themes);$m++)
                        { ?><br>
                        &nbsp;&nbsp;&nbsp;<a href="<?php echo $baseurl?>/pages/search.php?search=!collection<?php echo $themes[$m]["ref"]?>&bc_from=themes"  title="<?php echo $lang["collectionviewhover"]?>"><?php echo htmlspecialchars(i18n_get_collection_name($themes[$m])) ?></a>
                        <?php
                        }
                ?><br><br></div><?php
                }
        }
			$relatedshares=explode(",",getvalescaped("sharerelatedresources",""));
			}
		// Create new collection
		$allow_changes=(getval("allow_changes","")!=""?1:0);
		$sharedcollection=create_collection($userref,i18n_get_translated($resource["field".$view_title_field]) . " Share " . nicedate(date("Y-m-d H:i:s")),$allow_changes);
		
		add_resource_to_collection($ref,$sharedcollection);
		if($sharing_related)
			{
			foreach($relatedshares as $relatedshare)
				{
				add_resource_to_collection($relatedshare,$sharedcollection);
				}			
			}
			
		$errors=email_collection($sharedcollection,i18n_get_collection_name($sharedcollection),$userfullname,$users,$message,false,$access,$expires,$user_email,$from_name,$cc,false,"","",$list_recipients,$add_internal_access);
		// Hide from drop down by default
		show_hide_collection($sharedcollection, false, $userref);
		
		if ($errors=="")
			{
			// Log this	
			// fix for bomb on multiple collections, daily stat object ref must be a single number.
			$crefs=explode(",",$ref);
			foreach ($crefs as $cref){		
				daily_stat("E-mailed collection",$cref);
			}
			if (!hook("replacecollectionemailredirect")){
				redirect($baseurl_short."pages/done.php?text=collection_email");
				}
			}
>
	<td><div class="ListTitle">
		<a <?php 
    if ($collections[$n]["public"] == 1 && strlen($collections[$n]["theme"]) > 0) {
        ?>
style="font-style:italic;"<?php 
    }
    ?>
 href="<?php 
    echo $baseurl_short;
    ?>
pages/search.php?search=<?php 
    echo urlencode("!collection" . $collections[$n]["ref"]);
    ?>
" onClick="return CentralSpaceLoad(this);"><?php 
    echo highlightkeywords(i18n_get_collection_name($collections[$n]), $find);
    ?>
</a></div></td>
	<td><?php 
    echo htmlspecialchars(highlightkeywords($colusername, $find));
    ?>
</td>
	<td><?php 
    echo htmlspecialchars(highlightkeywords($collection_prefix . $collections[$n]["ref"], $find));
    ?>
</td>
	<td><?php 
    echo htmlspecialchars(nicedate($collections[$n]["created"], true));
    ?>
</td>
	<td><?php 
 # Archive created, schedule the command file for deletion.
 if (!$use_zip_extension) {
     $deletion_array[] = $cmdfile;
 }
 # Remove temporary files.
 foreach ($deletion_array as $tmpfile) {
     delete_exif_tmpfile($tmpfile);
 }
 # Get the file size of the archive.
 $filesize = @filesize_unlimited($zipfile);
 if ($use_collection_name_in_zip_name) {
     # Use collection name (if configured)
     if ($archiver) {
         $filename = $lang["collectionidprefix"] . $collection . "-" . safe_file_name(i18n_get_collection_name($collectiondata)) . "-" . $size . "." . $collection_download_settings[$settings_id]["extension"];
     } else {
         $filename = $lang["collectionidprefix"] . $collection . "-" . safe_file_name(i18n_get_collection_name($collectiondata)) . "-" . $size . ".zip";
     }
 } else {
     # Do not include the collection name in the filename (default)
     if ($archiver) {
         $filename = $lang["collectionidprefix"] . $collection . "-" . $size . "." . $collection_download_settings[$settings_id]["extension"];
     } else {
         $filename = $lang["collectionidprefix"] . $collection . "-" . $size . ".zip";
     }
 }
 header("Content-Disposition: attachment; filename=" . $filename);
 if ($archiver) {
     header("Content-Type: " . $collection_download_settings[$settings_id]["mime"]);
 } else {
     header("Content-Type: application/zip");
 }
 function email_collection($colrefs, $collectionname, $fromusername, $userlist, $message, $feedback, $access = -1, $expires = "", $useremail = "", $from_name = "", $cc = "", $themeshare = false, $themename = "", $themeurlsuffix = "", $list_recipients = false, $add_internal_access = false, $group = "")
 {
     # Attempt to resolve all users in the string $userlist to user references.
     # Add $collection to these user's 'My Collections' page
     # Send them an e-mail linking to this collection
     #  handle multiple collections (comma seperated list)
     global $baseurl, $email_from, $applicationname, $lang, $userref, $email_multi_collections, $usergroup, $attach_user_smart_groups;
     if ($useremail == "") {
         $useremail = $email_from;
     }
     if ($group == "") {
         $group = $usergroup;
     }
     if (trim($userlist) == "") {
         return $lang["mustspecifyoneusername"];
     }
     $userlist = resolve_userlist_groups($userlist);
     if ($attach_user_smart_groups && strpos($userlist, $lang["groupsmart"] . ": ") !== false) {
         $groups_users = resolve_userlist_groups_smart($userlist, true);
         if ($groups_users != '') {
             if ($userlist != "") {
                 $userlist = remove_groups_smart_from_userlist($userlist);
                 if ($userlist != "") {
                     $userlist .= ",";
                 }
             }
             $userlist .= $groups_users;
         }
     }
     $ulist = trim_array(explode(",", $userlist));
     $emails = array();
     $key_required = array();
     if ($feedback) {
         $feedback = 1;
     } else {
         $feedback = 0;
     }
     $reflist = trim_array(explode(",", $colrefs));
     $emails_keys = resolve_user_emails($ulist);
     $emails = $emails_keys['emails'];
     $key_required = $emails_keys['key_required'];
     # Add the collection(s) to the user's My Collections page
     $urefs = sql_array("select ref value from user where username in ('" . join("','", $ulist) . "')");
     if (count($urefs) > 0) {
         # Delete any existing collection entries
         sql_query("delete from user_collection where collection in ('" . join("','", $reflist) . "') and user in ('" . join("','", $urefs) . "')");
         # Insert new user_collection row(s)
         #loop through the collections
         for ($nx1 = 0; $nx1 < count($reflist); $nx1++) {
             #loop through the users
             for ($nx2 = 0; $nx2 < count($urefs); $nx2++) {
                 sql_query("insert into user_collection(collection,user,request_feedback) values ({$reflist[$nx1]}, {$urefs[$nx2]}, {$feedback} )");
                 if ($add_internal_access) {
                     foreach (get_collection_resources($reflist[$nx1]) as $resource) {
                         if (get_edit_access($resource)) {
                             open_access_to_user($urefs[$nx2], $resource, $expires);
                         }
                     }
                 }
                 #log this
                 collection_log($reflist[$nx1], "S", 0, sql_value("select username as value from user where ref = {$urefs[$nx2]}", ""));
             }
         }
     }
     # Send an e-mail to each resolved user
     # htmlbreak is for composing list
     $htmlbreak = "\r\n";
     global $use_phpmailer;
     if ($use_phpmailer) {
         $htmlbreak = "<br><br>";
         $htmlbreaksingle = "<br>";
     }
     if ($fromusername == "") {
         $fromusername = $applicationname;
     }
     // fromusername is used for describing the sender's name inside the email
     if ($from_name == "") {
         $from_name = $applicationname;
     }
     // from_name is for the email headers, and needs to match the email address (app name or user name)
     $templatevars['message'] = str_replace(array("\\n", "\\r", "\\"), array("\n", "\r", ""), $message);
     if (trim($templatevars['message']) == "") {
         $templatevars['message'] = $lang['nomessage'];
     }
     $templatevars['fromusername'] = $fromusername;
     $templatevars['from_name'] = $from_name;
     if (count($reflist) > 1) {
         $subject = $applicationname . ": " . $lang['mycollections'];
     } else {
         $subject = $applicationname . ": " . $collectionname;
     }
     if ($fromusername == "") {
         $fromusername = $applicationname;
     }
     $externalmessage = $lang["emailcollectionmessageexternal"];
     $internalmessage = $lang["emailcollectionmessage"];
     $viewlinktext = $lang["clicklinkviewcollection"];
     if ($themeshare) {
         $externalmessage = $lang["emailthemecollectionmessageexternal"];
         $internalmessage = $lang["emailthememessage"];
         $viewlinktext = $lang["clicklinkviewcollections"];
     }
     ##  loop through recipients
     for ($nx1 = 0; $nx1 < count($emails); $nx1++) {
         ## loop through collections
         $list = "";
         $list2 = "";
         $origviewlinktext = $viewlinktext;
         // Save this text as we may change it for internal theme shares for this user
         if ($themeshare && !$key_required[$nx1]) {
             $url = "";
             $subject = $applicationname . ": " . $themename;
             $url = $baseurl . "/pages/themes.php" . $themeurlsuffix;
             $viewlinktext = $lang["clicklinkviewthemes"];
             $emailcollectionmessageexternal = false;
             if ($use_phpmailer) {
                 $link = "<a href=\"{$url}\">" . $themename . "</a>";
                 $list .= $htmlbreak . $link;
                 // alternate list style
                 $list2 .= $htmlbreak . $themename . ' -' . $htmlbreaksingle . $url;
                 $templatevars['list2'] = $list2;
             } else {
                 $list .= $htmlbreak . $url;
             }
             for ($nx2 = 0; $nx2 < count($reflist); $nx2++) {
                 #log this
                 collection_log($reflist[$nx2], "E", 0, $emails[$nx1]);
             }
         } else {
             for ($nx2 = 0; $nx2 < count($reflist); $nx2++) {
                 $url = "";
                 $key = "";
                 $emailcollectionmessageexternal = false;
                 # Do we need to add an external access key for this user (e-mail specified rather than username)?
                 if ($key_required[$nx1]) {
                     $k = generate_collection_access_key($reflist[$nx2], $feedback, $emails[$nx1], $access, $expires, $group);
                     $key = "&k=" . $k;
                     $emailcollectionmessageexternal = true;
                 }
                 $url = $baseurl . "/?c=" . $reflist[$nx2] . $key;
                 $collection = array();
                 $collection = sql_query("select name,savedsearch from collection where ref='{$reflist[$nx2]}'");
                 if ($collection[0]["name"] != "") {
                     $collection_name = i18n_get_collection_name($collection[0]);
                 } else {
                     $collection_name = $reflist[$nx2];
                 }
                 if ($use_phpmailer) {
                     $link = "<a href=\"{$url}\">{$collection_name}</a>";
                     $list .= $htmlbreak . $link;
                     // alternate list style
                     $list2 .= $htmlbreak . $collection_name . ' -' . $htmlbreaksingle . $url;
                     $templatevars['list2'] = $list2;
                 } else {
                     $list .= $htmlbreak . $collection_name . $htmlbreak . $url . $htmlbreak;
                 }
                 #log this
                 collection_log($reflist[$nx2], "E", 0, $emails[$nx1]);
             }
         }
         //$list.=$htmlbreak;
         $templatevars['list'] = $list;
         $templatevars['from_name'] = $from_name;
         if (isset($k)) {
             if ($expires == "") {
                 $templatevars['expires_date'] = $lang["email_link_expires_never"];
                 $templatevars['expires_days'] = $lang["email_link_expires_never"];
             } else {
                 $day_count = round((strtotime($expires) - strtotime('now')) / (60 * 60 * 24));
                 $templatevars['expires_date'] = $lang['email_link_expires_date'] . nicedate($expires);
                 $templatevars['expires_days'] = $lang['email_link_expires_days'] . $day_count;
                 if ($day_count > 1) {
                     $templatevars['expires_days'] .= " " . $lang['expire_days'] . ".";
                 } else {
                     $templatevars['expires_days'] .= " " . $lang['expire_day'] . ".";
                 }
             }
         } else {
             # Set empty expiration tempaltevars
             $templatevars['expires_date'] = '';
             $templatevars['expires_days'] = '';
         }
         if ($emailcollectionmessageexternal) {
             $template = $themeshare ? "emailthemeexternal" : "emailcollectionexternal";
         } else {
             $template = $themeshare ? "emailtheme" : "emailcollection";
         }
         if (count($emails > 1) && $list_recipients === true) {
             $body = $lang["list-recipients"] . "\n" . implode("\n", $emails) . "\n\n";
             $templatevars['list-recipients'] = $lang["list-recipients"] . "\n" . implode("\n", $emails) . "\n\n";
         } else {
             $body = "";
         }
         $body .= $templatevars['fromusername'] . " " . ($emailcollectionmessageexternal ? $externalmessage : $internalmessage) . "\n\n" . $templatevars['message'] . "\n\n" . $viewlinktext . "\n\n" . $templatevars['list'];
         #exit ($body . "<br>" . $viewlinktext);
         send_mail($emails[$nx1], $subject, $body, $fromusername, $useremail, $template, $templatevars, $from_name, $cc);
         $viewlinktext = $origviewlinktext;
     }
     hook("additional_email_collection", "", array($colrefs, $collectionname, $fromusername, $userlist, $message, $feedback, $access, $expires, $useremail, $from_name, $cc, $themeshare, $themename, $themeurlsuffix, $template, $templatevars));
     # Return an empty string (all OK).
     return "";
 }
示例#6
0
	  <?php if (!$disable_collection_toggle) { ?>
		<?php /*if ($count_result<=$max_collection_thumbs) { */?><li><a id="toggleThumbsLink" href="#" onClick="ToggleThumbs();return false;"><?php echo $lang["showthumbnails"]?></a></li><?php /*}*/ ?>
	  <?php } ?>
		<li><a href="<?php echo $baseurl_short?>pages/purchases.php" onclick="return CentralSpaceLoad(this,true);"><?php echo $lang["viewpurchases"]?></a></li>
		</ul>
		</form>

		</div>
		<?php	
		} // end of Basket Mode
	elseif ($k!="")
		{
		# Anonymous access, slightly different display
		$tempcol=$cinfo;
		?>
	<div id="CollectionMinTitle" class="ExternalShare"><h2><?php echo i18n_get_collection_name($tempcol)?></h2></div>
	<div id="CollectionMinRightNav" class="ExternalShare">
		<?php if(!hook("replaceanoncollectiontools")){ ?>
		<?php if ((isset($zipcommand) || $collection_download) && $count_result>0) { ?>
		<li><a onclick="return CentralSpaceLoad(this,true);" href="<?php echo $baseurl_short?>pages/terms.php?k=<?php echo urlencode($k) ?>&url=<?php echo urlencode("pages/collection_download.php?collection=" .  $usercollection . "&k=" . $k)?>"><?php echo $lang["action-download"]?></a></li>
		<?php } ?>
		<?php if ($feedback) {?><li><a onclick="return CentralSpaceLoad(this,true);" href="<?php echo $baseurl_short?>pages/collection_feedback.php?collection=<?php echo urlencode($usercollection) ?>&k=<?php echo urlencode($k) ?>"><?php echo $lang["sendfeedback"]?></a></li><?php } ?>
		<?php if ($count_result>0)
			{ 
			# Ability to request a whole collection (only if user has restricted access to any of these resources)
			$min_access=collection_min_access($result);
			if ($min_access!=0)
				{
				?>
				<li><a onclick="return CentralSpaceLoad(this,true);" href="<?php echo $baseurl_short?>pages/collection_request.php?ref=<?php echo urlencode($usercollection) ?>&k=<?php echo urlencode($k) ?>"><?php echo 	$lang["requestall"]?></a></li>
				<?php
function email_collection($colrefs,$collectionname,$fromusername,$userlist,$message,$feedback,$access=-1,$expires="",$useremail="",$from_name="",$cc="",$themeshare=false,$themename="",$themeurlsuffix="")
	{
	# Attempt to resolve all users in the string $userlist to user references.
	# Add $collection to these user's 'My Collections' page
	# Send them an e-mail linking to this collection
	#  handle multiple collections (comma seperated list)
	global $baseurl,$email_from,$applicationname,$lang,$userref, $email_multi_collections ;
	
	if ($useremail==""){$useremail=$email_from;}
	
	if (trim($userlist)=="") {return ($lang["mustspecifyoneusername"]);}
	$userlist=resolve_userlist_groups($userlist);
	$ulist=trim_array(explode(",",$userlist));
	$emails=array();
	$key_required=array();
	if ($feedback) {$feedback=1;} else {$feedback=0;}
	$reflist=trim_array(explode(",",$colrefs));
	
	$emails_keys=resolve_user_emails($ulist);
	$emails=$emails_keys['emails'];
	$key_required=$emails_keys['key_required'];

	# Add the collection(s) to the user's My Collections page
	$urefs=sql_array("select ref value from user where username in ('" . join("','",$ulist) . "')");
	if (count($urefs)>0)
		{
		# Delete any existing collection entries
		sql_query("delete from user_collection where collection in ('" .join("','", $reflist) . "') and user in ('" . join("','",$urefs) . "')");
		
		# Insert new user_collection row(s)
		#loop through the collections
			for ($nx1=0;$nx1<count($reflist);$nx1++)
			{	#loop through the users
				for ($nx2=0;$nx2<count($urefs);$nx2++)
				{
		sql_query("insert into user_collection(collection,user,request_feedback) values ($reflist[$nx1], $urefs[$nx2], $feedback )");
		if ($access == 0) {
			foreach (get_collection_resources($reflist[$nx1]) as $resource)	{
				open_access_to_user($urefs[$nx2],$resource,$expires);
			}
		}
				
			#log this
		collection_log($reflist[$nx1],"S",0, sql_value ("select username as value from user where ref = $urefs[$nx2]",""));

				}
			}
		}
	
	# Send an e-mail to each resolved user
	
	# htmlbreak is for composing list
	$htmlbreak="\r\n";
	global $use_phpmailer;
	if ($use_phpmailer){$htmlbreak="<br><br>";$htmlbreaksingle="<br>";} 
	
	if ($fromusername==""){$fromusername=$applicationname;} // fromusername is used for describing the sender's name inside the email
	if ($from_name==""){$from_name=$applicationname;} // from_name is for the email headers, and needs to match the email address (app name or user name)
	
	$templatevars['message']=str_replace(array("\\n","\\r","\\"),array("\n","\r",""),$message);	
	if (trim($templatevars['message'])==""){$templatevars['message']=$lang['nomessage'];} 
	
	$templatevars['fromusername']=$fromusername;
	$templatevars['from_name']=$from_name;
	
	if(count($reflist)>1){$subject=$applicationname.": ".$lang['mycollections'];}
	else { $subject=$applicationname.": ".$collectionname;}
	
	if ($fromusername==""){$fromusername=$applicationname;}
	
	$externalmessage=$lang["emailcollectionmessageexternal"];
	$internalmessage=$lang["emailcollectionmessage"];
	$viewlinktext=$lang["clicklinkviewcollection"];
	if ($themeshare) // Change the text if sharing a theme category
		{
		$externalmessage=$lang["emailthemecollectionmessageexternal"];
		$internalmessage=$lang["emailthememessage"];
		$viewlinktext=$lang["clicklinkviewcollections"];
		}
		
	##  loop through recipients
	for ($nx1=0;$nx1<count($emails);$nx1++)
		{
		## loop through collections
		$list="";
		$list2="";
		$origviewlinktext=$viewlinktext; // Save this text as we may change it for internal theme shares for this user
		if ($themeshare && !$key_required[$nx1]) # don't send a whole list of collections if internal, just send the theme category URL
			{
			$url="";
			$subject=$applicationname.": " . $themename;
			$url=$baseurl . "/pages/themes.php" . $themeurlsuffix;			
			$viewlinktext=$lang["clicklinkviewthemes"];
			$emailcollectionmessageexternal=false;
			if ($use_phpmailer){
					$link="<a href=\"$url\">" . $themename . "</a>";	
					
					$list.= $htmlbreak.$link;	
					// alternate list style				
					$list2.=$htmlbreak.$themename.' -'.$htmlbreaksingle.$url;
					$templatevars['list2']=$list2;					
					}
				else
					{
					$list.= $htmlbreak.$url;
					}
			for ($nx2=0;$nx2<count($reflist);$nx2++)
				{				
				#log this
				collection_log($reflist[$nx2],"E",0, $emails[$nx1]);
				}
			
			}
		else
			{
			for ($nx2=0;$nx2<count($reflist);$nx2++)
				{
				$url="";
				$key="";
				$emailcollectionmessageexternal=false;
				# Do we need to add an external access key for this user (e-mail specified rather than username)?
				if ($key_required[$nx1])
					{
					$k=generate_collection_access_key($reflist[$nx2],$feedback,$emails[$nx1],$access,$expires);
					$key="&k=". $k;
					$emailcollectionmessageexternal=true;
					}
				$url=$baseurl . 	"/?c=" . $reflist[$nx2] . $key;		
				$collection = array();
				$collection = sql_query("select name,savedsearch from collection where ref='$reflist[$nx2]'");
				if ($collection[0]["name"]!="") {$collection_name = i18n_get_collection_name($collection[0]);}
				else {$collection_name = $reflist[$nx2];}
				if ($use_phpmailer){
					$link="<a href=\"$url\">$collection_name</a>";	
					$list.= $htmlbreak.$link;	
					// alternate list style				
					$list2.=$htmlbreak.$collection_name.' -'.$htmlbreaksingle.$url;
					$templatevars['list2']=$list2;					
					}
				else
					{
					$list.= $htmlbreak . $collection_name . $htmlbreak . $url . $htmlbreak;
					}
				#log this
				collection_log($reflist[$nx2],"E",0, $emails[$nx1]);
				}
			}
		//$list.=$htmlbreak;	
		$templatevars['list']=$list;
		$templatevars['from_name']=$from_name;
		if ($emailcollectionmessageexternal ){
			$template=($themeshare)?"emailthemeexternal":"emailcollectionexternal";
		}
		else {
			$template=($themeshare)?"emailtheme":"emailcollection";
		}
		$body=$templatevars['fromusername']." " . (($emailcollectionmessageexternal)?$externalmessage:$internalmessage) . "\n\n" . $templatevars['message']."\n\n" . $viewlinktext ."\n\n".$templatevars['list'];
		#exit ($body . "<br>" . $viewlinktext);	
		send_mail($emails[$nx1],$subject,$body,$fromusername,$useremail,$template,$templatevars,$from_name,$cc);
		$viewlinktext=$origviewlinktext;
		}
		
	# Return an empty string (all OK).
	return "";
	}
				#show only active collections if a start date is set for $active_collections 
				if (strtotime($list[$n]['created']) > ((isset($active_collections))?strtotime($active_collections):1))
					{ if ($list[$n]["ref"]==$usercollection) {$currentfound=true;} ?>
					<option value="<?php echo $list[$n]["ref"]?>" <?php if ($list[$n]['ref']==$collection_add) {?> 	selected<?php } ?>><?php echo htmlspecialchars(i18n_get_collection_name($list[$n])) ?> <?php if ($collection_dropdown_user_access_mode){echo htmlspecialchars("(". $colusername."/".$accessmode.")"); } ?></option>
					<?php }
			
				}
			}
		if (!$currentfound && !$upload_force_mycollection)
			{
			# The user's current collection has not been found in their list of collections (perhaps they have selected a theme to edit). Display this as a separate item.
			$cc=get_collection($usercollection);
			if ($cc!==false)
				{$currentfound=true;
				?>
				<option value="<?php echo htmlspecialchars($usercollection) ?>" <?php if ($usercollection==$collection_add){?>selected <?php } ?>><?php echo htmlspecialchars(i18n_get_collection_name($cc)) ?></option>
				<?php
				}
			}
		?>
		</select>
	
		<div class="clearerleft"> </div>
		<div name="collectioninfo" id="collectioninfo" style="display:none;">
		<div name="collectionname" id="collectionname" <?php if ($upload_add_to_new_collection_opt){ ?> style="display:block;"<?php } else { ?> style="display:none;"<?php } ?>>
		<label for="collection_add"><?php echo $lang["collectionname"]?><?php if ($upload_collection_name_required){?><sup>*</sup><?php } ?></label>
		<input type=text id="entercolname" name="entercolname" class="stdwidth" value='<?php echo htmlentities(stripslashes(getval("entercolname","")), ENT_QUOTES);?>'> 
		
		</div>
		
		<?php if ($enable_public_collection_on_upload && ($enable_public_collections || checkperm('h')) && !checkperm('b')) { ?>
示例#9
0
    function DisplayTheme($themes = array(), $simpleview = false)
    {
        if ($simpleview) {
            global $baseurl_short;
            $getthemes = get_themes($themes);
            # Themes
            for ($m = 0; $m < count($getthemes); $m++) {
                ?>
				
			<a href="<?php 
                echo $baseurl_short;
                ?>
pages/search.php?search=!collection<?php 
                echo $getthemes[$m]["ref"];
                ?>
" onclick="return CentralSpaceLoad(this,true);" class="FeaturedSimplePanel HomePanel DashTile FeaturedSimpleLink" id="advertising_tile_<?php 
                echo $getthemes[$m]["ref"];
                ?>
">
			<div class="FeaturedSimpleTile">
				<div id="FeaturedSimpleTileContents_<?php 
                echo $getthemes[$m]["ref"];
                ?>
"  class="HomePanelIN FeaturedSimpleTileContents" >	
					<h2><?php 
                echo i18n_get_collection_name($getthemes[$m]);
                ?>
</h2>
				</div>			
			</div>			
			</a>			
			<?php 
            }
        } else {
            global $theme_direct_jump, $themes_column_sorting, $themes_ref_column, $themes_date_column, $baseurl_short, $baseurl, $default_perpage_list, $collection_prefix, $revsort, $sort, $find, $getthemes, $m, $lang, $flag_new_themes, $contact_sheet, $theme_images, $allow_share, $zipcommand, $collection_download, $theme_images_align_right, $themes_category_split_pages, $themes_category_split_pages_parents, $collections_compact_style, $pagename, $show_edit_all_link, $preview_all, $userref, $collection_purge, $themes_category_split_pages, $themes_category_split_pages_parents_root_node, $enable_theme_category_sharing, $enable_theme_category_edit, $show_theme_collection_stats, $lastlevelchange, $themes_single_collection_shortcut, $download_usage;
            $themes_order_by = getvalescaped("themes_order_by", getvalescaped("saved_themes_order_by", "name"));
            $sort = getvalescaped("sort", getvalescaped("saved_themes_sort", "ASC"));
            $revsort = $sort == "ASC" ? "DESC" : "ASC";
            # pager
            $per_page = getvalescaped("per_page_list", $default_perpage_list, true);
            $collection_valid_order_bys = array("name", "c");
            // sorting doesn't work for nonsplit
            if (!$themes_column_sorting || !$themes_category_split_pages || $theme_direct_jump) {
                $sort = "ASC";
                $themes_order_by = "name";
                $themes_column_sorting = false;
            }
            if ($themes_ref_column) {
                $collection_valid_order_bys[] = "ref";
            }
            if ($themes_date_column) {
                $collection_valid_order_bys[] = "created";
            }
            $modified_collection_valid_order_bys = hook("modifycollectionvalidorderbys");
            if ($modified_collection_valid_order_bys) {
                $collection_valid_order_bys = $modified_collection_valid_order_bys;
            }
            if (!in_array($themes_order_by, $collection_valid_order_bys)) {
                $sort = "ASC";
                $themes_order_by = "name";
            }
            # Check the value is one of the valid values (SQL injection filter)
            # Work out theme name
            $themecount = count($themes);
            for ($x = 0; $x < $themecount; $x++) {
                if (isset($themes[$x]) && !isset($themes[$x + 1])) {
                    $themename = i18n_get_translated($themes[$x]);
                }
            }
            $getthemes = get_themes($themes);
            $tmp = hook("getthemesdisp", "", array($themes));
            if ($tmp !== false) {
                $getthemes = $tmp;
            }
            if (!$themes_single_collection_shortcut && count($getthemes) > 0 || $themes_single_collection_shortcut && count($getthemes) > 1) {
                ?>
			<div class="RecordBox">
			<div class="RecordPanel">
	
			<div class="RecordHeader">
	
			<?php 
                if ($themes_category_split_pages && $themes_category_split_pages_parents) {
                    ?>
<h1><?php 
                    echo $lang["collections"];
                    ?>
</h1><?php 
                }
                // count total items in themes
                $totalcount = 0;
                for ($m = 0; $m < count($getthemes); $m++) {
                    $totalcount = $totalcount + $getthemes[$m]['c'];
                }
                if ($theme_images_align_right) {
                    ?>
				<div style="float:right;">
				<?php 
                }
                $images = get_theme_image($themes);
                $modified_images = hook("modify_theme_images", '', array($themes));
                if (!empty($modified_images)) {
                    $images = $modified_images;
                }
                if ($images !== false && $theme_images) {
                    for ($n = 0; $n < count($images); $n++) {
                        ?>
<div style="float:left;margin-right:12px;"><img class="CollectImageBorder" src="<?php 
                        echo get_resource_path($images[$n], false, "col", false);
                        ?>
" /></div>
					<?php 
                    }
                }
                if ($theme_images_align_right) {
                    ?>
				</div>
				<?php 
                }
                $themeslinks = "";
                for ($x = 0; $x < count($themes); $x++) {
                    $themeslinks .= "theme" . ($x + 1) . "=" . urlencode($themes[$x]) . "&";
                }
                ?>
			<table><tr><td style="margin:0px;padding:0px;">
		<h1 ><?php 
                if ($themes_category_split_pages && $themes_category_split_pages_parents && !$theme_direct_jump) {
                    if ($themes_category_split_pages_parents_root_node) {
                        ?>
<a href="<?php 
                        echo $baseurl_short;
                        ?>
pages/themes.php"  onClick="return CentralSpaceLoad(this,true);"><?php 
                        echo $lang["themes"];
                        ?>
</a> / <?php 
                    }
                    $themescrumbs = "";
                    for ($x = 0; $x < count($themes); $x++) {
                        $themescrumbs .= "theme" . ($x + 1) . "=" . urlencode($themes[$x]) . "&";
                        ?>
<a href="<?php 
                        echo $baseurl_short;
                        ?>
pages/themes.php?<?php 
                        echo $themescrumbs;
                        ?>
"  onClick="return CentralSpaceLoad(this,true);"><?php 
                        echo htmlspecialchars(i18n_get_translated($themes[$x]));
                        ?>
</a> / <?php 
                    }
                } else {
                    echo stripslashes(str_replace("*", "", $themename));
                }
                ?>
</h1></td></tr><tr><td style="margin:0px;padding:0px;">
				
				<?php 
                if ($show_theme_collection_stats || !$themes_category_split_pages && ($enable_theme_category_sharing || $enable_theme_category_edit)) {
                    $linkparams = "";
                    for ($x = 0; $x < count($themes); $x++) {
                        $linkparams .= "theme" . ($x + 1) . "=" . urlencode($themes[$x]) . "&";
                    }
                    if ($show_theme_collection_stats) {
                        ?>
						<p style="clear:none;"><?php 
                        $collcount = count($getthemes);
                        echo $collcount == 1 ? $lang["collections-1"] : sprintf(str_replace("%number", "%d", $lang["collections-2"]), $collcount, $totalcount);
                        hook("themeactioninline");
                        ?>
						</p>
						</td><td style="margin:0px;padding:0px;">
						<?php 
                    }
                    ?>
					<?php 
                    if (!$themes_category_split_pages) {
                        if (checkperm("h") && $enable_theme_category_sharing) {
                            $sharelink = "";
                            for ($x = 0; $x < count($themes); $x++) {
                                $sharelink .= "theme" . ($x + 1) . "=" . urlencode($themes[$x]) . "&";
                            }
                            ?>
							
							</td><tr><td style="margin:0px;padding:0px;">
							<a href="<?php 
                            echo $baseurl_short;
                            ?>
pages/theme_category_share.php?<?php 
                            echo $linkparams;
                            ?>
"  onClick="return CentralSpaceLoad(this,true);"><?php 
                            echo "> " . $lang["share"] . "</a>";
                        }
                        hook("themeaction");
                        if ($enable_theme_category_edit && checkperm("t")) {
                            ?>
							<a href="<?php 
                            echo $baseurl_short;
                            ?>
pages/theme_edit.php?<?php 
                            echo $linkparams . "lastlevelchange=" . $lastlevelchange;
                            ?>
" onClick="return CentralSpaceLoad(this,true);"><?php 
                            echo "> " . $lang["action-edit"] . "</a>";
                        }
                    }
                }
                ?>
				
				</td></tr></table>
				<!-- The number of collections should never be equal to zero. -->
	
			<div class="clearerright"> </div>
			</div>
			<?php 
                hook("beforethemelist");
                ?>
			<br />
			<div class="Listview" style="margin-top:10px;margin-bottom:5px;clear:left;">
			<table border="0" cellspacing="0" cellpadding="0" class="ListviewStyle">
			<tr class="ListviewBoxedTitleStyle">
			<td class="name"><?php 
                if ($themes_order_by == "name") {
                    ?>
<span class="Selected"><?php 
                }
                if ($themes_column_sorting) {
                    ?>
<a href="<?php 
                    echo $baseurl_short;
                    ?>
pages/themes.php?<?php 
                    echo $themeslinks;
                    ?>
themes_order_by=name&sort=<?php 
                    echo urlencode($revsort);
                    ?>
" onClick="return CentralSpaceLoad(this);"><?php 
                }
                echo $lang["collectionname"];
                if ($themes_category_split_pages) {
                    ?>
</a><?php 
                }
                if ($themes_order_by == "name") {
                    ?>
<div class="<?php 
                    echo htmlspecialchars($sort);
                    ?>
">&nbsp;</div><?php 
                }
                ?>
</td>
			<?php 
                if ($themes_ref_column) {
                    ?>
			<td class="ref"><?php 
                    if ($themes_order_by == "ref") {
                        ?>
<span class="Selected"><?php 
                    }
                    if ($themes_column_sorting) {
                        ?>
<a href="<?php 
                        echo $baseurl_short;
                        ?>
pages/themes.php?<?php 
                        echo $themeslinks;
                        ?>
themes_order_by=ref&sort=<?php 
                        echo urlencode($revsort);
                        ?>
" onClick="return CentralSpaceLoad(this);"><?php 
                    }
                    echo $lang["id"];
                    if ($themes_category_split_pages) {
                        ?>
</a><?php 
                    }
                    if ($themes_order_by == "ref") {
                        ?>
<div class="<?php 
                        echo htmlspecialchars($sort);
                        ?>
">&nbsp;</div><?php 
                    }
                    ?>
</td>
			<?php 
                }
                ?>
			<?php 
                if ($themes_date_column) {
                    ?>
			<td class="created"><?php 
                    if ($themes_order_by == "created") {
                        ?>
<span class="Selected"><?php 
                    }
                    if ($themes_column_sorting) {
                        ?>
<a href="<?php 
                        echo $baseurl_short;
                        ?>
pages/themes.php?<?php 
                        echo $themeslinks;
                        ?>
themes_order_by=created&sort=<?php 
                        echo urlencode($revsort);
                        ?>
" onClick="return CentralSpaceLoad(this);"><?php 
                    }
                    echo $lang["created"];
                    if ($themes_category_split_pages) {
                        ?>
</a><?php 
                    }
                    if ($themes_order_by == "created") {
                        ?>
<div class="<?php 
                        echo htmlspecialchars($sort);
                        ?>
">&nbsp;</div><?php 
                    }
                    ?>
</td>
			<?php 
                }
                ?>
			<td class="count"><?php 
                if ($themes_order_by == "c") {
                    ?>
<span class="Selected"><?php 
                }
                if ($themes_column_sorting) {
                    ?>
<a href="<?php 
                    echo $baseurl_short;
                    ?>
pages/themes.php?<?php 
                    echo $themeslinks;
                    ?>
themes_order_by=c&sort=<?php 
                    echo urlencode($revsort);
                    ?>
" onClick="return CentralSpaceLoad(this);"><?php 
                }
                echo $lang["itemstitle"];
                if ($themes_category_split_pages) {
                    ?>
</a><?php 
                }
                if ($themes_order_by == "c") {
                    ?>
<div class="<?php 
                    echo htmlspecialchars($sort);
                    ?>
">&nbsp;</div><?php 
                }
                ?>
</td>
			<?php 
                hook("beforecollectiontoolscolumnheader", "themes", array($themeslinks));
                ?>
			<td class="tools"><div class="ListTools"><?php 
                echo $lang["tools"];
                ?>
</div></td>
			</tr>
	
			<?php 
                for ($m = 0; $m < count($getthemes); $m++) {
                    ?>
				<tr <?php 
                    hook("collectionlistrowstyle");
                    ?>
>
				<td class="name" width="50%"><div class="ListTitle"><a href="<?php 
                    echo $baseurl_short;
                    ?>
pages/search.php?search=!collection<?php 
                    echo $getthemes[$m]["ref"];
                    ?>
&bc_from=themes"  title="<?php 
                    echo $lang["collectionviewhover"];
                    ?>
" onClick="return CentralSpaceLoad(this,true);"><?php 
                    echo i18n_get_collection_name($getthemes[$m]);
                    ?>
</a>
				<?php 
                    if ($flag_new_themes && time() - strtotime($getthemes[$m]["created"]) < 60 * 60 * 24 * 14) {
                        ?>
<div class="NewFlag"><?php 
                        echo $lang["newflag"];
                        ?>
</div><?php 
                    }
                    ?>
				</div></td>
				<?php 
                    if ($themes_ref_column) {
                        ?>
				<td class="ref"><?php 
                        echo $getthemes[$m]["ref"];
                        ?>
</td>
				<?php 
                    }
                    ?>
				<?php 
                    if ($themes_date_column) {
                        ?>
				<td class="created"><?php 
                        echo nicedate($getthemes[$m]["created"], true);
                        ?>
</td>
				<?php 
                    }
                    ?>
				<td class="count" width="5%"><?php 
                    echo $getthemes[$m]["c"];
                    ?>
</td>
				<?php 
                    hook('beforecollectiontoolscolumn');
                    ?>
				<td class="tools" nowrap>
					<div class="ListTools">
					<?php 
                    hook('render_themes_list_tools', '', array($getthemes[$m]));
                    render_actions($getthemes[$m], false, false);
                    ?>
					</div>
				</td>
				</tr>
				<?php 
                }
                ?>
			</table>
			</div>
	
			</div>
			<div class="PanelShadow"> </div>
			</div>
			<?php 
            }
        }
    }
示例#10
0
$result=get_themes_by_resource($ref);
if (count($result)>0) 
	{
	?><!--Panel for related themes / collections -->
	<div class="RecordBox">
	<div class="RecordPanel">  
	<div id="CollectionsThemes">
	<div class="RecordResouce BasicsBox nopadding">
	<div class="Title"><?php echo $lang["collectionsthemes"]?></div>

	<?php
		# loop and display the results
		for ($n=0;$n<count($result);$n++)			
			{
			?>
			<a href="<?php echo $baseurl_short?>pages/search.php?search=!collection<?php echo $result[$n]["ref"]?>" onClick="return CentralSpaceLoad(this,true);">&gt;&nbsp;<?php echo (strlen($result[$n]["theme"])>0)?htmlspecialchars(str_replace("*","",i18n_get_translated($result[$n]["theme"])) . " / "):$lang["public"] . " : "; ?><?php if (!$collection_public_hide_owner) {echo htmlspecialchars($result[$n]["fullname"] . " / ");} ?><?php echo i18n_get_collection_name($result[$n]); ?></a><br />
			<?php		
			}
		?>
	
	</div>
	</div>
	</div>
	<div class="PanelShadow"></div>
	</div><?php
	}} 


if($enable_find_similar && checkperm('s') && ($k == '')) { ?>
<!--Panel for search for similar resources-->
<div class="RecordBox">
示例#11
0
         $command = $imagemagick_path . "/convert.exe";
     }
     if (!file_exists($command)) {
         $command = $imagemagick_path . "/convert";
     }
     if (!file_exists($command)) {
         exit("Could not find ImageMagick 'convert' utility at location '{$command}'");
     }
     $command .= " -resize {$contact_sheet_preview_size} -quality 90 -colorspace " . $imagemagick_colorspace . " " . escapeshellarg($jpgstoragepath) . " " . escapeshellarg($jpgstoragepath);
     run_command($command);
     return true;
 }
 if (!$is_collection) {
     $filename = $lang['annotations'] . "-" . i18n_get_translated($resourcedata["field" . $view_title_field]);
 } else {
     $filename = $lang['annotations'] . "-" . i18n_get_collection_name($collectiondata);
 }
 if ($cleanup) {
     // cleanup
     if (file_exists($pdfstoragepath)) {
         unlink($pdfstoragepath);
     }
     if (file_exists($jpgstoragepath)) {
         unlink($jpgstoragepath);
     }
     $pathinfo = pathinfo($jpgstoragepath);
     if (file_exists($pathinfo['dirname'])) {
         rmdir($pathinfo['dirname']);
     }
     $pdf->Output($filename . ".pdf", 'D');
 } else {
                ?>
pages/purchases.php" onclick="return CentralSpaceLoad(this,true);"><?php 
                echo $lang["viewpurchases"];
                ?>
</a></li>
		</ul>
		</form>

		</div>
		<?php 
            } elseif ($k != "") {
                # Anonymous access, slightly different display
                $tempcol = $cinfo;
                ?>
	<div id="CollectionMinTitle" class="ExternalShare"><h2><?php 
                echo i18n_get_collection_name($tempcol);
                ?>
</h2></div>
	<div id="CollectionMinRightNav" class="ExternalShare">
		<?php 
                if (!hook("replaceanoncollectiontools")) {
                    ?>
		<?php 
                    if ((isset($zipcommand) || $collection_download) && $count_result > 0) {
                        ?>
		<li><a onclick="return CentralSpaceLoad(this,true);" href="<?php 
                        echo $baseurl_short;
                        ?>
pages/terms.php?k=<?php 
                        echo urlencode($k);
                        ?>
							$accessmode= $lang["private"];
						}
						else{
							if (strlen($list[$n]["theme"])>0){
								$accessmode= $lang["theme"];
							}
						else{
								$accessmode= $lang["public"];
							}
						}
					}
				}


					?>	
				<option value="<?php echo $list[$n]["ref"]?>" <?php if ($ref==$list[$n]["ref"]) {?> 	selected<?php $found=true;} ?>><?php echo i18n_get_collection_name($list[$n]) ?><?php if ($collection_dropdown_user_access_mode){echo "&nbsp;&nbsp;".htmlspecialchars("(". $colusername."/".$accessmode.")"); } ?></option>
				<?php 
				}
			if ($found==false)
				{
				# Add this one at the end, it can't be found
				$notfound=get_collection($ref);
				if ($notfound!==false)
					{
					?>
					<option value="<?php echo urlencode($ref) ?>" selected><?php echo $notfound["name"]?></option>
					<?php
					}
				}
			
			?>
             $theme_link .= " &gt; <a onClick='return CentralSpaceLoad(this,true);' href='" . $baseurl_short . "pages/themes.php?theme1=" . urlencode($collectiondata["theme"]) . "&theme2=" . urlencode($collectiondata["theme2"]) . "'>" . i18n_get_translated($collectiondata["theme2"]) . "</a>";
         }
         if (strlen($collectiondata["theme3"]) > 0) {
             $theme_link .= " &gt; <a onClick='return CentralSpaceLoad(this,true);' href='" . $baseurl_short . "pages/themes.php?theme1=" . urlencode($collectiondata["theme"]) . "&theme2=" . urlencode($collectiondata["theme2"]) . "&theme3=" . urlencode($collectiondata["theme3"]) . "'>" . i18n_get_translated($collectiondata["theme3"]) . "</a>";
         }
     }
     // add a tooltip to Smart Collection titles (which provides a more detailed view of the searchstring.
     $alt_text = '';
     if ($pagename == "search" && isset($collectiondata['savedsearch']) && $collectiondata['savedsearch'] != '') {
         $smartsearch = sql_query("select * from collection_savedsearch where ref=" . $collectiondata['savedsearch']);
         if (isset($smartsearch[0])) {
             $alt_text = "title='search=" . $smartsearch[0]['search'] . "&restypes=" . $smartsearch[0]['restypes'] . "&archive=" . $smartsearch[0]['archive'] . "&starsearch=" . $smartsearch[0]['starsearch'] . "'";
         }
     }
     hook("collectionsearchtitlemod");
     $search_title .= '<div align="left"><h1><div class="searchcrumbs">' . ($is_theme ? $theme_link . " > " : "") . '<span id="coltitle' . $collection . '"><a ' . $alt_text . ' href="' . $baseurl_short . 'pages/search.php?search=!collection' . $collection . $parameters_string . '" onClick="return CentralSpaceLoad(this,true);">' . i18n_get_collection_name($collectiondata) . ($display_user_and_access ? " <span class='CollectionUser'>(" . $colusername . $colaccessmode . ")" : "") . '</span></a></span>' . $searchcrumbs . '</div></h1> ';
 } elseif ($search == "" && $archive == 0) {
     # Which resource types (if any) are selected?
     $searched_types_refs_array = explode(",", $restypes);
     # Searched resource types and collection types
     $resource_types_array = get_resource_types("", false);
     # Get all resource types, untranslated
     $searched_resource_types_names_array = array();
     for ($n = 0; $n < count($resource_types_array); $n++) {
         if (in_array($resource_types_array[$n]["ref"], $searched_types_refs_array)) {
             $searched_resource_types_names_array[] = htmlspecialchars(lang_or_i18n_get_translated($resource_types_array[$n]["name"], "resourcetype-", "-2"));
         }
     }
     if (count($searched_resource_types_names_array) == count($resource_types_array)) {
         # All resource types are selected, don't list all of them
         unset($searched_resource_types_names_array);
<td class="collectionin"><?php echo $lang["showcollectionindropdown"] ?></td>

<?php hook("beforecollectiontoolscolumnheader");?>
<td class="tools"><div class="ListTools"><?php echo $lang["tools"]?></div></td>
</tr>
<form method="get" name="colactions" id="colactions" action="<?php echo $baseurl_short?>pages/collection_manage.php">
<?php

for ($n=$offset;(($n<count($collections)) && ($n<($offset+$per_page)));$n++)
	{
    $colusername=$collections[$n]['fullname'];

	?><tr <?php hook("collectionlistrowstyle");?>>
	<td class="name"><div class="ListTitle">
		<a <?php if ($collections[$n]["public"]==1 && (strlen($collections[$n]["theme"])>0)) { ?>style="font-style:italic;"<?php } ?> href="<?php echo $baseurl_short?>pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"])?>" onClick="return CentralSpaceLoad(this);"><?php echo highlightkeywords(i18n_get_collection_name($collections[$n]),$find) ?></a></div></td>
	<td class="fullname"><?php echo highlightkeywords($colusername,$find) ?></td>
	<td class="ref"><?php echo highlightkeywords($collection_prefix . $collections[$n]["ref"],$find) ?></td>
	<td class="created"><?php echo nicedate($collections[$n]["created"],true) ?></td>
	<td class="count"><?php echo $collections[$n]["count"] ?></td>
<?php if (! $hide_access_column){ ?>	<td class="access"><?php
# Work out the correct access mode to display
if (!hook('collectionaccessmode')) {
	if ($collections[$n]["public"]==0){
		echo $lang["private"];
	}
	else{
		if (strlen($collections[$n]["theme"])>0){
			echo $lang["theme"];
		}
	else{
示例#16
0
		{
		?>
		<tr <?php hook("collectionlistrowstyle");?>>
		<?php hook ("listsearchpubliccheckboxes");
		if ($use_checkboxes_for_selection){echo "<td></td>";}
		if (!isset($collections[$n]['savedsearch'])||(isset($collections[$n]['savedsearch'])&&$collections[$n]['savedsearch']==null))
			{
			$collection_prefix = $lang["collection"] . ": ";
			$collection_tag = $lang['collection'];
			}
		else
			{
			$collection_prefix = ""; # The prefix $lang['smartcollection'] . ": " is added in i18n_get_collection_name()
			$collection_tag = $lang['smartcollection'];
			}?>
		<td nowrap><div class="ListTitle"><a onClick="return CentralSpaceLoad(this,true);" href="<?php echo $pub_url?>" title="<?php echo str_replace(array("\"","'"),"", $collection_prefix . i18n_get_collection_name($collections[$n]))?>"><?php echo $collection_prefix . highlightkeywords(tidy_trim(i18n_get_collection_name($collections[$n]),45),$search)?></a></div></td>
		<?php 
		for ($x=0;$x<count($df)-1;$x++){
			?><td>-</td><?php
			}
				
		?>
		<td>-</td>
	    <?php if ($display_user_rating_stars && $k==""){ ?><td>&nbsp;&nbsp;</td><?php } ?>
		<?php if ($id_column){?><td><?php echo $collections[$n]['ref']?></td><?php } ?>
		<?php if ($resource_type_column){?><td><?php echo $collection_tag?></td><?php } ?>
		<?php if ($date_column){?><td><?php echo nicedate($collections[$n]["created"],false,true)?></td><?php } ?>
        <?php hook("addlistviewcolumnpublic");?>
		<td><div class="ListTools">
		<?php if (!hook("replacecollectiontools")){?>
		<a href="<?php echo $baseurl_short?>pages/collections.php?collection=<?php echo $collections[$n]["ref"]?>"  onClick="return CollectionDivLoad(this);">&gt;&nbsp;<?php echo $lang["action-select"]?></a>&nbsp;&nbsp;<a onClick="return CentralSpaceLoad(this,true);" href="<?php echo $pub_url?>">&gt;&nbsp;<?php echo $lang["viewall"]?></a>
>
	<td><div class="ListTitle">
    <a onClick="return CentralSpaceLoad(this,true);" <?php 
        if ($collections[$n]["public"] == 1 && strlen($collections[$n]["theme"]) > 0) {
            ?>
style="font-style:italic;"<?php 
        }
        ?>
 href="<?php 
        echo $baseurl_short;
        ?>
pages/search.php?search=<?php 
        echo urlencode("!collection" . $collections[$n]["ref"]);
        ?>
"><?php 
        echo i18n_get_collection_name($collections[$n]);
        ?>
</a></div></td>
	<td><?php 
        echo htmlspecialchars($collections[$n]["fullname"]);
        ?>
</td>
	<td><?php 
        echo $collection_prefix . $collections[$n]["ref"];
        ?>
</td>
	<td><?php 
        echo nicedate($collections[$n]["created"], true);
        ?>
</td>
	<td><?php 
                }
            }
            ?>
	
				<option value="<?php 
            echo $list[$n]["ref"];
            ?>
" <?php 
            if ($ref == $list[$n]["ref"]) {
                ?>
 	selected<?php 
                $found = true;
            }
            ?>
><?php 
            echo i18n_get_collection_name($list[$n]);
            if ($collection_dropdown_user_access_mode) {
                echo "&nbsp;&nbsp;" . htmlspecialchars("(" . $colusername . "/" . $accessmode . ")");
            }
            ?>
</option>
				<?php 
        }
        if ($found == false) {
            # Add this one at the end, it can't be found
            $notfound = get_collection($ref);
            if ($notfound !== false) {
                ?>
					<option value="<?php 
                echo urlencode($ref);
                ?>
示例#19
0
	<?php 
            # loop and display the results
            for ($n = 0; $n < count($result); $n++) {
                ?>
			<a href="<?php 
                echo $baseurl_short;
                ?>
pages/search.php?search=!collection<?php 
                echo $result[$n]["ref"];
                ?>
" onClick="return CentralSpaceLoad(this,true);">&gt;&nbsp;<?php 
                echo strlen($result[$n]["theme"]) > 0 ? htmlspecialchars(str_replace("*", "", i18n_get_translated($result[$n]["theme"])) . " / ") : $lang["public"] . " : ";
                if (!$collection_public_hide_owner) {
                    echo htmlspecialchars($result[$n]["fullname"] . " / ");
                }
                echo i18n_get_collection_name($result[$n]);
                ?>
</a><br />
			<?php 
            }
            ?>
	
	</div>
	</div>
	</div>
	<div class="PanelShadow"></div>
	</div><?php 
        }
    }
    ?>
                    # The user's current collection has not been found in their list of collections (perhaps they have selected a theme to edit). Display this as a separate item.
                    $cc = get_collection($usercollection);
                    if ($cc !== false) {
                        $currentfound = true;
                        ?>
				<option value="<?php 
                        echo htmlspecialchars($usercollection);
                        ?>
" <?php 
                        if ($usercollection == $collection_add) {
                            ?>
selected <?php 
                        }
                        ?>
><?php 
                        echo i18n_get_collection_name($cc);
                        ?>
</option>
				<?php 
                    }
                }
                ?>
		</select>
	
		<div class="clearerleft"> </div>
		<div name="collectioninfo" id="collectioninfo" style="display:none;">
		<div name="collectionname" id="collectionname" <?php 
                if ($upload_add_to_new_collection_opt) {
                    ?>
 style="display:block;"<?php 
                } else {
                $collection_tag = $lang['collection'];
            } else {
                $collection_prefix = "";
                # The prefix $lang['smartcollection'] . ": " is added in i18n_get_collection_name()
                $collection_tag = $lang['smartcollection'];
            }
            if (!hook("replacelistviewcolresults")) {
                ?>
		<td nowrap><div class="ListTitle"><a onClick="return CentralSpaceLoad(this,true);" href="<?php 
                echo $pub_url;
                ?>
" title="<?php 
                echo str_replace(array("\"", "'"), "", $collection_prefix . i18n_get_collection_name($collections[$n]));
                ?>
"><?php 
                echo $collection_prefix . highlightkeywords(tidy_trim(i18n_get_collection_name($collections[$n]), 45), $search);
                ?>
</a></div></td>
		<?php 
                for ($x = 0; $x < count($df) - 1; $x++) {
                    ?>
<td>-</td><?php 
                }
                ?>
		<td>-</td>
	    <?php 
                if ($display_user_rating_stars && $k == "") {
                    ?>
<td>&nbsp;&nbsp;</td><?php 
                }
                ?>
示例#22
0
<td><?php if ($col_order_by=="count") {?><span class="Selected"><?php } ?><a href="<?php echo $baseurl_short?>pages/collection_public.php?offset=0&col_order_by=count&sort=<?php echo urlencode($revsort)?>&find=<?php echo urlencode($find)?>" onClick="return CentralSpaceLoad(this);"><?php echo $lang["itemstitle"]?></a><?php if ($col_order_by=="count") {?><div class="<?php echo urlencode($sort)?>">&nbsp;</div><?php } ?></td>

<?php if (!$hide_access_column_public){ ?><td><?php if ($col_order_by=="public") {?><span class="Selected"><?php } ?><a href="<?php echo $baseurl_short?>pages/collection_public.php?offset=0&col_order_by=public&sort=<?php echo urlencode($revsort)?>&find=<?php echo urlencode($find)?>" onClick="return CentralSpaceLoad(this);"><?php echo $lang["access"]?></a><?php if ($col_order_by=="public") {?><div class="<?php echo urlencode($sort)?>">&nbsp;</div><?php } ?></td><?php } ?>
<?php hook("beforecollectiontoolscolumnheader");?>

<td><div class="ListTools"><?php echo $lang["tools"]?></div></td>
</tr>
<?php

for ($n=$offset;(($n<count($collections)) && ($n<($offset+$per_page)));$n++)
	{
	?>
    <tr <?php hook("collectionlistrowstyle");?>>
	<td><div class="ListTitle">
			<a href="<?php echo $baseurl_short?>pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"])?>" onClick="return CentralSpaceLoad(this,true);"><?php echo highlightkeywords(i18n_get_collection_name($collections[$n]),$find)?></a></div></td>

	<?php if (!$collection_public_hide_owner) { ?><td><?php echo highlightkeywords($collections[$n]["fullname"],$find)?></td><?php } ?>
	<td><?php echo highlightkeywords($collections[$n]["ref"],$find)?></td>
	<td><?php echo nicedate($collections[$n]["created"],true)?></td>
    <td><?php echo $collections[$n]["count"]?></td>
	<?php if (!$hide_access_column_public){ ?><td><?php echo ($collections[$n]["public"]==0)?$lang["private"]:$lang["public"]?></td><?php } ?>
	<?php hook("beforecollectiontoolscolumn");?>
	<td><div class="ListTools">
    <?php if ($collections_compact_style){
         draw_compact_style_selector($collections[$n]["ref"]);
    } else {
    ?><a href="<?php echo $baseurl_short?>pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"])?>" onClick="return CentralSpaceLoad(this,true);">&gt;&nbsp;<?php echo $lang["viewall"]?></a>
	<?php if ($contact_sheet==true) { ?>
    &nbsp;<a href="<?php echo $baseurl_short?>pages/contactsheet_settings.php?ref=<?php echo urlencode($collections[$n]["ref"]) ?>" onClick="return CentralSpaceLoad(this);">&gt;&nbsp;<?php echo $lang["contactsheet"]?></a>
	<?php } ?>
示例#23
0
			<?php if ($unapproved_collection){?><script>alert('<?php echo $lang['notapprovedsharetheme']?>');</script><?php } ?>
			</p>
			<?php
			}
		}
	//Display existing shares for collections in theme

	if ($access=="")
		{
		foreach($collectionstoshare as $collection)
			{			
			$ref=$collection["ref"];
			$keys=get_collection_external_access($ref);
			?>
			<p>&nbsp;</p>
			<h2><?php echo str_replace("%collectionname%", i18n_get_collection_name($collection), $lang["externalusersharing-name"]);?></h2>
			<div class="Question">
			<?php
			if (count($keys)==0)
				{
				?>
				<p><?php echo $lang["noexternalsharing"] ?></p>
				<?php
				}
			else
				{
				?>
				<div class="Listview">
				<table border="0" cellspacing="0" cellpadding="0" class="ListviewStyle">
				<tr class="ListviewTitleStyle">
				<td><?php echo $lang["accesskey"];?></td>
?>
pages/ajax/contactsheet.php" >
<input type=hidden name="c" value="<?php 
echo htmlspecialchars($collection);
?>
">

<!--<div name="error" id="error"></div>-->
<div style="clear:left;"> </div>
<div class="BasicsBox" style="width:450px;float:left;margin-top:0;" >
<div class="Question">
	<label><?php 
echo $lang["collectionname"];
?>
</label><div class="Fixed"><?php 
echo i18n_get_collection_name($collectiondata);
?>
</div>
<div class="clearerleft"> </div>
</div>

<div class="Question">
<label><?php 
echo $lang["display"];
?>
</label>
<select class="shrtwidth" name="sheetstyle" id="sheetstyle" onChange="
	if (jQuery('#sheetstyle').val()=='list')
		{
		document.getElementById('OrientationOptions').style.display='block';		
		document.getElementById('ThumbnailOptions').style.display='none';
 public function Header()
 {
     global $logowidth, $contactsheet_header, $contact_sheet_logo, $add_contactsheet_logo, $contact_sheet_font, $titlefontsize, $applicationname, $collectiondata, $date, $subsetting, $lang, $pagewidth, $pageheight, $logospace, $contact_sheet_logo_resize;
     if (isset($contact_sheet_logo) && $add_contactsheet_logo) {
         if (file_exists("../../" . $contact_sheet_logo)) {
             $extension = pathinfo($contact_sheet_logo);
             $extension = $extension['extension'];
             if ($extension == "pdf") {
                 //recommended as it works best with or without $contact_sheet_logo_resize
                 $this->setSourceFile("../../" . $contact_sheet_logo);
                 $this->_tplIdx = $this->importPage(1);
                 $logosize = $this->getTemplateSize($this->_tplIdx);
                 if (!$contact_sheet_logo_resize) {
                     $logowidth = $logosize['w'];
                     $logospace = $logosize['h'];
                     do_contactsheet_sizing_calculations();
                     // run this code again with new logospace
                 } else {
                     $logoratio = $logosize['w'] / $logosize['h'];
                     $logowidth = $pageheight / 8 * $logoratio;
                 }
                 $this->useTemplate($this->_tplIdx, $pagewidth / 2 - $logowidth / 2, 0.4, $logowidth);
             } else {
                 if (!$contact_sheet_logo_resize) {
                     $logospace = getimagesize("../../" . $contact_sheet_logo);
                     $logospace = $logospace[1] / 300;
                     $this->Image("../../" . $contact_sheet_logo, '', 0.5, '', $logospace, $extension, false, '', true, '300', 'C', false, false, 0, false, false, false);
                     do_contactsheet_sizing_calculations();
                     // run this code again with new logospace
                 } else {
                     $this->Image("../../" . $contact_sheet_logo, '', $pageheight / 30, '', $pageheight / 8, $extension, false, '', true, '300', 'C', false, false, 0, false, false, false);
                 }
             }
         } else {
             exit("Contact sheet logo file not found at " . $contact_sheet_logo);
         }
     }
     if ($contactsheet_header == "true") {
         $this->SetFont($contact_sheet_font, '', $titlefontsize, '', $subsetting);
         $title = $applicationname . ' - ' . i18n_get_collection_name($collectiondata) . ' - ' . nicedate($date, true, true);
         $pagenumber = $this->getAliasNumPage() . " " . $lang["of"] . " " . $this->getAliasNbPages();
         $this->Text(1, $logospace + 0.8, $title . '   ' . $pagenumber);
     }
 }
示例#26
0
         $js = sprintf("\n\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\tvar h1 = jQuery(\"h1\").text();\n\n\t\t\t\t\tif(h1 == \"%s\") {\n\t\t\t\t\t\tdocument.title = \"%s - \" + h1;\n\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t", $lang["addresourcebatchbrowser"], $applicationname);
         echo $js;
     }
     echo "</script>";
 } else {
     if (in_array($pagename, $search_title_pages)) {
         if (isset($search_title)) {
             $title = str_replace('"', "''", $lang["searchresults"] . " - " . html_entity_decode(strip_tags($search_title)));
         } else {
             if ($pagename == "collection_download" || $pagename == "edit" && getval("collection", "") != "") {
                 $collectiondata = get_collection($collection);
                 $title = strip_tags(str_replace('"', "''", i18n_get_collection_name($collectiondata)));
             } else {
                 $collection = getval("ref", "");
                 $collectiondata = get_collection($collection);
                 $title = strip_tags(str_replace('"', "''", i18n_get_collection_name($collectiondata)));
             }
         }
         // add a hyphen if title exists
         if (strlen($title) != 0) {
             $title = "- {$title}";
         }
         if ($pagename == "edit") {
             $title = " - " . $lang['action-editall'] . " " . $title;
         }
         if ($pagename == "collection_share") {
             $title = " - " . $lang['share'] . " " . $title;
         }
         if ($pagename == "collection_edit") {
             $title = " - " . $lang['action-edit'] . " " . $title;
         }
                    # The user's current collection has not been found in their list of collections (perhaps they have selected a theme to edit). Display this as a separate item.
                    $cc = get_collection($usercollection);
                    if ($cc !== false) {
                        $currentfound = true;
                        ?>
				<option value="<?php 
                        echo htmlspecialchars($usercollection);
                        ?>
" <?php 
                        if ($usercollection == $collection_add) {
                            ?>
selected <?php 
                        }
                        ?>
><?php 
                        echo htmlspecialchars(i18n_get_collection_name($cc));
                        ?>
</option>
				<?php 
                    }
                }
                ?>
		</select>
	
		<div class="clearerleft"> </div>
		<div name="collectioninfo" id="collectioninfo" style="display:none;">
		<div name="collectionname" id="collectionname" <?php 
                if ($upload_add_to_new_collection_opt) {
                    ?>
 style="display:block;"<?php 
                } else {
示例#28
0
	$show_error=true;
    $error=$lang["cannotshareemptycollection"];
	}


include "../include/header.php";
?>


<div class="BasicsBox"> 
<form method=post id="collectionform" action="<?php echo $baseurl_short?>pages/collection_share.php">
<input type="hidden" name="ref" id="ref" value="<?php echo htmlspecialchars($ref) ?>">
<input type="hidden" name="deleteaccess" id="deleteaccess" value="">
<input type="hidden" name="generateurl" id="generateurl" value="">

<h1><?php echo htmlspecialchars(str_replace("%collectionname", i18n_get_collection_name($collection), $lang["sharecollection-name"]));?></h1>

<?php if (isset($show_error)){?>
    <script type="text/javascript">
    alert('<?php echo $error;?>');
    	history.go(-1);
    </script><?php
    exit();}
?>



<div class="VerticalNav">
<ul>

<li><a onClick="return CentralSpaceLoad(this,true);" href="<?php echo $baseurl_short?>pages/collection_email.php?ref=<?php echo urlencode($ref) ?>"><?php echo $lang["emailcollection"]?></a></li>
include "../include/header.php";
$log=get_collection_log($ref, $offset+$per_page);
$results=count($log);
$totalpages=ceil($results/$per_page);
$curpage=floor($offset/$per_page)+1;

$url=$baseurl . "/pages/collection_log.php?ref=" . $ref;
$jumpcount=1;

?>

<?php
# Fetch and translate collection name
$colinfo = get_collection($ref);
$colname = i18n_get_collection_name($colinfo);
if (!checkperm("b"))
    {
    # Add selection link to collection name.
    $colname = "<a href=\"" . $baseurl_short . "pages/collections.php?collection=" . $ref . "\" onClick=\"return CollectionDivLoad(this);\">" . $colname . "</a>";
    }
?>

<div class="BasicsBox">
<?php if ($back_to_collections_link != "") { ?><div style="float:right;"><a href="<?php echo $baseurl_short?>pages/collection_manage.php" onClick="return CentralSpaceLoad(this,true);"><strong><?php echo $back_to_collections_link ?></strong> </a></div> <?php } ?>
<h1><?php echo str_replace("%collection", $colname, $lang["collectionlogheader"]);?></h1>
<div class="TopInpageNav">
<div class="InpageNavLeftBlock"><?php echo $lang["resultsdisplay"]?>:
	<?php 
	for($n=0;$n<count($list_display_array);$n++){?>
	<?php if ($per_page==$list_display_array[$n]){?><span class="Selected"><?php echo $list_display_array[$n]?></span><?php } else { ?><a onClick="return CentralSpaceLoad(this,true);" href="<?php echo $url; ?>&per_page_list_log=<?php echo $list_display_array[$n]?>"><?php echo $list_display_array[$n]?></a><?php } ?>&nbsp;|
示例#30
0
        echo "</script>";
    }

    // place collection titles
    else if (in_array($pagename,$search_title_pages)){
        if (isset($search_title)){
            $title=$lang["searchresults"]." - ".html_entity_decode(strip_tags($search_title));
        }
        else if (($pagename=="collection_download") || $pagename=="edit" && getval("collection","")!=""){
            $collectiondata=get_collection($collection);
            $title = strip_tags(i18n_get_collection_name($collectiondata));
            }  
        else {
            $collection=getval("ref","");
            $collectiondata=get_collection($collection);
            $title = strip_tags(i18n_get_collection_name($collectiondata));
            }
        // add a hyphen if title exists  
        if (strlen($title)!=0){$title="- $title";}    
        if ($pagename=="edit"){$title=" - ".$lang['action-editall']." ".$title;}
        if ($pagename=="collection_share"){$title=" - ".$lang['share']." ".$title;}
        if ($pagename=="collection_edit"){$title=" - ".$lang['action-edit']." ".$title;}
        if ($pagename=="preview_all"){$title=" - ".$lang['preview_all']." ".$title;}
        if ($pagename=="collection_download"){$title=" - ".$lang['download']." ".$title;}
        echo "<script language='javascript'>\n";
        echo "document.title = \"$applicationname $title\";\n";
        echo "</script>";
    }
    
      // place page titles
    else if (in_array($pagename,$general_title_pages)){