当前位置: 首页>>代码示例>>PHP>>正文


PHP get_collection_resources函数代码示例

本文整理汇总了PHP中get_collection_resources函数的典型用法代码示例。如果您正苦于以下问题:PHP get_collection_resources函数的具体用法?PHP get_collection_resources怎么用?PHP get_collection_resources使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_collection_resources函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: HookFlickr_theme_publishThemesRender_actions_add_collection_option

function HookFlickr_theme_publishThemesRender_actions_add_collection_option($top_actions, $options)
{
    global $getthemes, $m, $lang, $baseurl_short;
    $theme = $getthemes[$m];
    // these aren't really set on themes.php
    $result = get_collection_resources($theme['ref']);
    $count_result = count($result);
    $c = count($options);
    if ($count_result > 0) {
        $lang_string = $lang["publish_to_flickr"];
        $unpublished = sql_value("select count(*) value from resource join collection_resource on resource.ref=collection_resource.resource where collection_resource.collection='" . $theme["ref"] . "' and flickr_photo_id is null", 0);
        if ($unpublished > 0) {
            $lang_string .= " <strong>(" . ($unpublished == 1 ? $lang["unpublished-1"] : str_replace("%number", $unpublished, $lang["unpublished-2"])) . ")</strong>";
        }
        $data_attribute['url'] = sprintf('%splugins/flickr_theme_publish/pages/sync.php?theme=%s', $baseurl_short, urlencode($theme["ref"]));
        $options[$c]['value'] = 'flickr_publish';
        $options[$c]['label'] = $lang_string;
        $options[$c]['data_attr'] = $data_attribute;
        return $options;
    }
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:21,代码来源:themes.php

示例2: check_access_key_collection

function check_access_key_collection($collection, $key)
{
    if ($collection == "" || !is_numeric($collection)) {
        return false;
    }
    $r = get_collection_resources($collection);
    if (count($r) == 0) {
        return false;
    }
    for ($n = 0; $n < count($r); $n++) {
        # Verify a supplied external access key for all resources in a collection
        if (!check_access_key($r[$n], $key)) {
            return false;
        }
    }
    # Set the 'last used' date for this key
    sql_query("update external_access_keys set lastused=now() where collection='{$collection}' and access_key='{$key}'");
    return true;
}
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:19,代码来源:general.php

示例3: relate_to_collection

function relate_to_collection($ref, $collection)
{
    # Relates every resource in $collection to $ref
    $colresources = get_collection_resources($collection);
    sql_query("delete from resource_related where resource='{$ref}' and related in ('" . join("','", $colresources) . "')");
    sql_query("insert into resource_related(resource,related) values ({$ref}," . join("),(" . $ref . ",", $colresources) . ")");
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:7,代码来源:collections_functions.php

示例4: str_replace

else
	{
	foreach($collectionstoshare as $collection)
		{			
		$ref=$collection["ref"];		
	
		# Get min access to this collection
		$minaccess=collection_min_access($ref);
		
		if ($minaccess>=1 && !$restricted_share) # Minimum access is restricted or lower and sharing of restricted resources is not allowed. The user cannot share this collection.
			{
			$show_error=true;
			$error = str_replace("%collectionname%", i18n_get_collection_name($collection), $lang["collection-name"]) . "\n" . $lang["restrictedsharecollection"];
			}
			
		if (count(get_collection_resources($ref))==0) # Sharing an empty collection?
			{
			$show_error=true;
			$error = str_replace("%collectionname%", i18n_get_collection_name($collection), $lang["collection-name"]) . "\n" . $lang["cannotshareemptycollection"];
			}
		
		}
	
	$access=getvalescaped("access","");
	$expires=getvalescaped("expires","");
		
	if (getvalescaped("generateurl","")=="")
		{ ?>
									
			<div class="VerticalNav">
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:30,代码来源:theme_category_share.php

示例5: save_request

function save_request($request)
	{
	# Use the posted form to update the request
	global $applicationname,$baseurl,$lang,$request_senduserupdates;
		
	$status=getvalescaped("status","",true);
	$expires=getvalescaped("expires","");
	$currentrequest=get_request($request);
	$oldstatus=$currentrequest["status"];
	$assigned_to=getvalescaped("assigned_to","");
	$reason=getvalescaped("reason","");
	$reasonapproved=getvalescaped("reasonapproved","");
	
	
	# --------------------- User Assignment ------------------------
	# Has the assigned_to value changed?
	if ($currentrequest["assigned_to"]!=$assigned_to && checkperm("Ra"))
		{
		if ($assigned_to==0)
			{
			# Cancel assignment
			sql_query("update request set assigned_to=null where ref='$request'");
			}
		else
			{
			# Update and notify user
			sql_query("update request set assigned_to='$assigned_to' where ref='$request'");

			$message=$lang["requestassignedtoyoumail"] . "\n\n$baseurl/?q=" . $request . "\n";
			$assigned_to_user=get_user($assigned_to);
			send_mail($assigned_to_user["email"],$applicationname . ": " . $lang["requestassignedtoyou"],$message);
			$userconfirmmessage=str_replace("%",$assigned_to_user["fullname"] . " (" . $assigned_to_user["email"] . ")" ,$lang["requestassignedtouser"]);
			if ($request_senduserupdates){send_mail($currentrequest["email"],$applicationname . ": " . $lang["requestupdated"] . " - $request",$userconfirmmessage);}
			}
		}
	
	
	# Has either the status or the expiry date changed?
	if (($oldstatus!=$status || $expires!=$currentrequest["expires"]) && $status==1)
		{
		# --------------- APPROVED -------------
		# Send approval e-mail
		$message=$lang["requestapprovedmail"] . "\n\n" . $lang["approvalreason"]. ": " . $reasonapproved . "\n\n" ;
		$message.="$baseurl/?c=" . $currentrequest["collection"] . "\n";
		if ($expires!="")
			{
			# Add expiry time to message.
			$message.=$lang["requestapprovedexpires"] . " " . nicedate($expires) . "\n\n";
			}
		$reasonapproved=str_replace(array("\\r","\\n"),"\n",$reasonapproved);$reasonapproved=str_replace("\n\n","\n",$reasonapproved); # Fix line breaks.
		send_mail($currentrequest["email"],$applicationname . ": " . $lang["requestcollection"] . " - " . $lang["resourcerequeststatus1"],$message);
		
		# Mark resources as full access for this user
		foreach (get_collection_resources($currentrequest["collection"]) as $resource)
			{
			open_access_to_user($currentrequest["user"],$resource,$expires);
			}
		}

	if ($oldstatus!=$status && $status==2)	
		{
		# --------------- DECLINED -------------
		# Send declined e-mail

		$reason=str_replace(array("\\r","\\n"),"\n",$reason);$reason=str_replace("\n\n","\n",$reason); # Fix line breaks.
		$message=$lang["requestdeclinedmail"] . "\n\n" . $lang["declinereason"] . ": ". $reason . "\n\n$baseurl/?c=" . $currentrequest["collection"] . "\n";
		send_mail($currentrequest["email"],$applicationname . ": " . $lang["requestcollection"] . " - " . $lang["resourcerequeststatus2"],$message);

		# Remove access that my have been granted by an inadvertant 'approved' command.
		foreach (get_collection_resources($currentrequest["collection"]) as $resource)
			{
			remove_access_to_user($currentrequest["user"],$resource);
			}

		}

	if ($oldstatus!=$status && $status==0)
		{
		# --------------- PENDING -------------
		# Moved back to pending. Delete any permissions set by a previous 'approve'.
		foreach (get_collection_resources($currentrequest["collection"]) as $resource)
			{
			remove_access_to_user($currentrequest["user"],$resource);
			}
		}

	# Save status
	sql_query("update request set status='$status',expires=" . ($expires==""?"null":"'$expires'") . ",reason='$reason',reasonapproved='$reasonapproved' where ref='$request'");

	if (getval("delete","")!="")
		{
		# Delete the request - this is done AFTER any e-mails have been sent out so this can be used on approval.
		sql_query("delete from request where ref='$request'");
		return true;		
		}

	}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:97,代码来源:request_functions.php

示例6: save_resource_data_multi

function save_resource_data_multi($collection)
	{
	# Save all submitted data for collection $collection, this is for the 'edit multiple resources' feature
	# Loop through the field data and save (if necessary)
	$list=get_collection_resources($collection);

	$tmp = hook("altercollist", "", array("save_resource_data_multi", $list)); if(is_array($tmp)) { if(count($tmp)>0) $list = $tmp; else return true; } // alter the collection list to spare some when saving multiple, if you need

	$ref=$list[0];
	$fields=get_resource_field_data($ref,true);
	global $auto_order_checkbox;
	$expiry_field_edited=false;

	for ($n=0;$n<count($fields);$n++)
		{
		if (getval("editthis_field_" . $fields[$n]["ref"],"")!="" || hook("save_resource_data_multi_field_decision","",array($fields[$n]["ref"])))
			{
			if ($fields[$n]["type"]==2)
				{
				# construct the value from the ticked boxes
				$val=","; # Note: it seems wrong to start with a comma, but this ensures it is treated as a comma separated list by split_keywords(), so if just one item is selected it still does individual word adding, so 'South Asia' is split to 'South Asia','South','Asia'.
				$options=trim_array(explode(",",$fields[$n]["options"]));
				if ($auto_order_checkbox) {sort($options);}
				
				for ($m=0;$m<count($options);$m++)
					{
					$name=$fields[$n]["ref"] . "_" . md5($options[$m]);
					if (getval($name,"")=="yes")
						{
						if ($val!=",") {$val.=",";}
						$val.=$options[$m];
						}
					}
				}
			elseif ($fields[$n]["type"]==4 || $fields[$n]["type"]==6 || $fields[$n]["type"]==10)
				{
				# date/expiry date type, construct the value from the date dropdowns
				$val=sprintf("%04d", getvalescaped("field_" . $fields[$n]["ref"] . "-y",""));
				if ((int)$val<=0) 
					{
					$val="";
					}
				elseif (($field=getvalescaped("field_" . $fields[$n]["ref"] . "-m",""))!="") 
					{
					$val.="-" . $field;
					if (($field=getvalescaped("field_" . $fields[$n]["ref"] . "-d",""))!="") 
						{
						$val.="-" . $field;
						if (($field=getval("field_" . $fields[$n]["ref"] . "-h",""))!="")
							{
							$val.=" " . $field . ":";
							if (($field=getvalescaped("field_" . $fields[$n]["ref"] . "-i",""))!="") 
								{
									$val.=$field;
								} 
							else 
								{
									$val.="00";
								}
							}
						}
					}
				}
			elseif ($fields[$n]["type"] == 3)
				{
				$val=getvalescaped("field_" . $fields[$n]["ref"],"");				
				// if it doesn't already start with a comma, add one
				if (substr($val,0,1) != ',')
					{
					$val = ','.$val;
					}
				}
			else
				{
				$val=getvalescaped("field_" . $fields[$n]["ref"],"");
				}
			$origval=$val;
			# Loop through all the resources and save.
			for ($m=0;$m<count($list);$m++)
				{
				$ref=$list[$m];
				$resource_sql="";

				# Work out existing field value.
				$existing=escape_check(sql_value("select value from resource_data where resource='$ref' and resource_type_field='" . $fields[$n]["ref"] . "'",""));
				
				# Find and replace mode? Perform the find and replace.
				if (getval("modeselect_" . $fields[$n]["ref"],"")=="FR")
					{
					$val=str_replace
						(
						getvalescaped("find_" . $fields[$n]["ref"],""),
						getvalescaped("replace_" . $fields[$n]["ref"],""),
						$existing
						);
					}
				
				# Append text/option(s) mode?
				if (getval("modeselect_" . $fields[$n]["ref"],"")=="AP")
					{
//.........这里部分代码省略.........
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:101,代码来源:resource_functions.php

示例7: getvalescaped

			alert("<?php 
            echo $lang["resourcenotinresults"];
            ?>
");
			</script>
			<?php 
        }
    }
}
$collection = getvalescaped("collection", "", true);
if ($collection != "") {
    # If editing multiple items, use the first resource as the template
    $multiple = true;
    $edit_autosave = false;
    # Do not allow auto saving for batch editing.
    $items = get_collection_resources($collection);
    if (count($items) == 0) {
        $error = $lang['error-cannoteditemptycollection'];
        error_alert($error);
        exit;
    }
    # check editability
    if (!allow_multi_edit($collection)) {
        $error = $lang['error-permissiondenied'];
        error_alert($error);
        exit;
    }
    $ref = $items[0];
} else {
    $multiple = false;
}
开发者ID:claytondaley,项目名称:resourcespace,代码行数:31,代码来源:edit.php

示例8: header

# if bypass sharing page option is on, redirect to e-mail
if ($bypass_share_screen) {
    header('Location:collection_email.php?ref=' . $ref);
}
$collection = get_collection($ref);
# Process deletion of access keys
if (getval("deleteaccess", "") != "") {
    delete_collection_access_key($ref, getvalescaped("deleteaccess", ""));
}
# Get min access to this collection
$minaccess = collection_min_access($ref);
if ($minaccess >= 1 && !$restricted_share) {
    $show_error = true;
    $error = $lang["restrictedsharecollection"];
}
if (!$collection_allow_empty_share && count(get_collection_resources($ref)) == 0) {
    $show_error = true;
    $error = $lang["cannotshareemptycollection"];
}
include "../include/header.php";
?>


<div class="BasicsBox"> 
<form method=post id="collectionform" action="collection_share.php">
<input type="hidden" name="ref" id="ref" value="<?php 
echo $ref;
?>
">
<input type="hidden" name="deleteaccess" id="deleteaccess" value="">
<input type="hidden" name="generateurl" id="generateurl" value="">
开发者ID:vongalpha,项目名称:resourcespace,代码行数:31,代码来源:collection_share.php

示例9: getvalescaped

// clear cookie for new search
# Most sorts such as popularity, date, and ID should be descending by default,
# but it seems custom display fields like title or country should be the opposite.
$default_sort = "DESC";
if (substr($order_by, 0, 5) == "field") {
    $default_sort = "ASC";
}
$sort = getvalescaped("sort", $default_sort);
setcookie("saved_sort", $sort);
$revsort = $sort == "ASC" ? "DESC" : "ASC";
## If displaying a collection
# Enable/disable the reordering feature. Just for collections for now.
$allow_reorder = false;
# get current collection resources to pre-fill checkboxes
if ($use_checkboxes_for_selection) {
    $collectionresources = get_collection_resources($usercollection);
}
$hiddenfields = getvalescaped("hiddenfields", "");
# fetch resource types from query string and generate a resource types cookie
if (getvalescaped("resetrestypes", "") == "") {
    $restypes = getvalescaped("restypes", "");
} else {
    $restypes = "";
    reset($_POST);
    reset($_GET);
    foreach (array_merge($_GET, $_POST) as $key => $value) {
        $hiddenfields = array();
        //$hiddenfields=explode(",",$hiddenfields);
        if ($key == "rttickall" && $value == "on") {
            $restypes = "";
            break;
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:31,代码来源:search.php

示例10: urlencode

    $topurl = "pages/" . $default_home_page;
    if ($use_theme_as_home) {
        $topurl = "pages/themes.php";
    }
    if ($use_recent_as_home) {
        $topurl = "pages/search.php?search=" . urlencode("!last" . $recent_search_quantity);
    }
}
/* end hook replacetopurl */
if (getval("c", "") != "") {
    # quick redirect to a collection (from e-mails, keep the URL nice and short)
    $c = getvalescaped("c", "");
    $topurl = "pages/search.php?search=" . urlencode("!collection" . $c) . "&k=" . $k;
    if ($k != "") {
        # External access user... set top URL to first resource
        $r = get_collection_resources($c);
        if (count($r) > 0) {
            # Fetch collection data
            $cinfo = get_collection($c);
            if ($cinfo === false) {
                exit("Collection not found.");
            }
            if ($feedback_resource_select && $cinfo["request_feedback"]) {
                $topurl = "pages/collection_feedback.php?collection=" . $c . "&k=" . $k;
            } else {
                $topurl = "pages/search.php?search=" . urlencode("!collection" . $c) . "&k=" . $k;
            }
        }
    }
}
if (getval("r", "") != "") {
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:31,代码来源:index.php

示例11: get_collection_resources

        ?>
/pages/tools/update_previews.php?ref=<?php 
        echo $ref + 1;
        ?>
&previewbased=<?php 
        echo $previewbased;
        ?>
"/>
    	<?php 
    } else {
        ?>
    	Done.	
    	<?php 
    }
} else {
    $collection = get_collection_resources($collectionid);
    if (!is_array($collection)) {
        echo "Collection id returned no resources.";
        die;
    }
    if (!(is_numeric($ref) && $ref > 0)) {
        $ref = $collection[0];
        $key = 0;
    } else {
        $key = array_search($ref, $collection);
    }
    if (update_preview($ref)) {
        ?>
        <img src="<?php 
        echo get_resource_path($ref, false, "pre", false);
        ?>
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:31,代码来源:update_previews.php

示例12: managed_collection_request

function managed_collection_request($ref, $details, $ref_is_resource = false)
{
    # Request mode 1
    # Managed via the administrative interface
    # An e-mail is still sent.
    global $applicationname, $email_from, $baseurl, $email_notify, $username, $useremail, $userref, $lang, $request_senduserupdates, $watermark, $filename_field, $view_title_field, $access, $resource_type_request_emails, $manage_request_admin;
    # Has a resource reference (instead of a collection reference) been passed?
    # Manage requests only work with collections. Create a collection containing only this resource.
    if ($ref_is_resource) {
        $admin_mail_template = "emailresourcerequest";
        $user_mail_template = "emailuserresourcerequest";
        $resourcedata = get_resource_data($ref);
        $templatevars['thumbnail'] = get_resource_path($ref, true, "thm", false, "jpg", $scramble = -1, $page = 1, $watermark ? $access == 1 ? true : false : false);
        # Allow alternative configuration settings for this resource type
        resource_type_config_override($resourcedata['resource_type']);
        if (!file_exists($templatevars['thumbnail'])) {
            $templatevars['thumbnail'] = "../gfx/" . get_nopreview_icon($resourcedata["resource_type"], $resourcedata["file_extension"], false);
        }
        $templatevars['url'] = $baseurl . "/?r=" . $ref;
        if (isset($filename_field)) {
            $templatevars["filename"] = $lang["fieldtitle-original_filename"] . ": " . get_data_by_field($ref, $filename_field);
        }
        if (isset($resourcedata["field" . $view_title_field])) {
            $templatevars["title"] = $resourcedata["field" . $view_title_field];
        }
        $c = create_collection($userref, $lang["request"] . " " . date("ymdHis"));
        add_resource_to_collection($ref, $c);
        $ref = $c;
        # Proceed as normal
    } else {
        $admin_mail_template = "emailcollectionrequest";
        $user_mail_template = "emailusercollectionrequest";
        $collectiondata = get_collection($ref);
        $templatevars['url'] = $baseurl . "/?c=" . $ref;
        if (isset($collectiondata["name"])) {
            $templatevars["title"] = $collectiondata["name"];
        }
    }
    # Fomulate e-mail text
    $templatevars['username'] = $username;
    $templatevars["useremail"] = $useremail;
    $userdata = get_user($userref);
    $templatevars["fullname"] = $userdata["fullname"];
    $message = "";
    reset($_POST);
    foreach ($_POST as $key => $value) {
        if (strpos($key, "_label") !== false) {
            # Add custom field
            $setting = trim($_POST[str_replace("_label", "", $key)]);
            if ($setting != "") {
                $message .= $value . ": " . $setting . "\n\n";
            }
        }
    }
    if (trim($details) != "") {
        $message .= $lang["requestreason"] . ": " . newlines($details) . "\n\n";
    } else {
        return false;
    }
    # Add custom fields
    $c = "";
    global $custom_request_fields, $custom_request_required;
    if (isset($custom_request_fields)) {
        $custom = explode(",", $custom_request_fields);
        # Required fields?
        if (isset($custom_request_required)) {
            $required = explode(",", $custom_request_required);
        }
        for ($n = 0; $n < count($custom); $n++) {
            if (isset($required) && in_array($custom[$n], $required) && getval("custom" . $n, "") == "") {
                return false;
                # Required field was not set.
            }
            $message .= i18n_get_translated($custom[$n]) . ": " . getval("custom" . $n, "") . "\n\n";
        }
    }
    # Create the request
    global $request_query;
    $request_query = "insert into request(user,collection,created,request_mode,status,comments) values ('{$userref}','{$ref}',now(),1,0,'" . escape_check($message) . "')";
    global $notify_manage_request_admin, $assigned_to_user;
    $notify_manage_request_admin = false;
    // Manage individual requests of resources:
    hook('autoassign_individual_requests', '', array($userref, $ref, $message, isset($collectiondata)));
    if (isset($manage_request_admin) && !isset($collectiondata)) {
        $query = sprintf("\n                    SELECT DISTINCT r.resource_type AS value\n                      FROM collection_resource AS cr\n                INNER JOIN resource r ON cr.resource = r.ref\n                     WHERE cr.collection = '%s';\n            ", $ref);
        $request_resource_type = sql_value($query, 0);
        if ($request_resource_type != 0 && array_key_exists($request_resource_type, $manage_request_admin)) {
            $request_query = sprintf("\n                    INSERT INTO request(\n                                            user,\n                                            collection,\n                                            created,\n                                            request_mode,\n                                            `status`,\n                                            comments,\n                                            assigned_to\n                                       )\n                         VALUES (\n                                     '%s',\n                                     '%s',\n                                     NOW(),\n                                     1,\n                                     0,\n                                     '%s',\n                                     '%s'\n                                );\n                ", $userref, $ref, escape_check($message), $manage_request_admin[$request_resource_type]);
            $assigned_to_user = get_user($manage_request_admin[$request_resource_type]);
            $notify_manage_request_admin = true;
        }
    }
    // Manage collection requests:
    hook('autoassign_collection_requests', '', array($userref, isset($collectiondata) ? $collectiondata : array(), $message, isset($collectiondata)));
    if (isset($manage_request_admin) && isset($collectiondata)) {
        $all_r_types = get_resource_types();
        foreach ($all_r_types as $r_type) {
            $all_resource_types[] = $r_type['ref'];
        }
        $resources = get_collection_resources($collectiondata['ref']);
//.........这里部分代码省略.........
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:101,代码来源:request_functions.php

示例13: HookAutoassign_mrequestsAllAutoassign_collection_requests

function HookAutoassign_mrequestsAllAutoassign_collection_requests($user_ref, $collection_data, $message, $manage_collection_request)
{
    global $manage_request_admin, $assigned_to_user, $email_notify, $lang, $baseurl, $applicationname, $request_query, $notify_manage_request_admin;
    // Do not process this any further as this should only handle collection requests
    if (!$manage_collection_request) {
        return false;
    }
    $resources = get_collection_resources($collection_data['ref']);
    $mapped_fields = get_mapped_fields();
    $collection_resources_by_assigned_user = array();
    $collections = array();
    // Build the collections map between asigned user and resources the collection should contain
    foreach ($resources as $resource) {
        $resource_data = get_resource_field_data($resource);
        $assigned_administrator = 0;
        $resource_not_assigned = true;
        foreach ($resource_data as $r_data) {
            if (in_array($r_data['ref'], $mapped_fields)) {
                $assigned_administrator = get_mapped_user_by_field($r_data['ref'], $r_data['value']);
                if ($assigned_administrator === 0) {
                    $collection_resources_by_assigned_user['not_managed'][] = $resource;
                } else {
                    $collection_resources_by_assigned_user[$assigned_administrator][] = $resource;
                }
                $resource_not_assigned = false;
                break;
            }
        }
        if ($resource_not_assigned && !isset($manage_request_admin)) {
            $collection_resources_by_assigned_user['not_managed'][] = $resource;
        }
    }
    // Create collections based on who is supposed to handle the request
    foreach ($collection_resources_by_assigned_user as $assigned_user_id => $collection_resources) {
        if ($assigned_user_id === 'not_managed') {
            $collections['not_managed'] = create_collection($user_ref, $collection_data['name'] . ' request for unmanaged resources');
            foreach ($collection_resources as $collection_resource_id) {
                add_resource_to_collection($collection_resource_id, $collections['not_managed']);
            }
            continue;
        }
        $user = get_user($assigned_user_id);
        $collections[$assigned_user_id] = create_collection($user_ref, $collection_data['name'] . ' request - managed by ' . $user['email']);
        foreach ($collection_resources as $collection_resource_id) {
            add_resource_to_collection($collection_resource_id, $collections[$assigned_user_id]);
        }
        // Attach assigned admin to this collection
        add_collection($user['ref'], $collections[$assigned_user_id]);
    }
    if (!empty($collections)) {
        foreach ($collections as $assigned_to => $collection_id) {
            $assigned_to_user = get_user($assigned_to);
            $request_query = sprintf("\n                    INSERT INTO request(\n                                            user,\n                                            collection,\n                                            created,\n                                            request_mode,\n                                            `status`,\n                                            comments,\n                                            assigned_to\n                                       )\n                         VALUES (\n                                     '%s',  # user\n                                     '%s',  # collection\n                                     NOW(), # created\n                                     1,     # request_mode\n                                     0,     # status\n                                     '%s',  # comments\n                                     '%s'   # assigned_to\n                                );\n                ", $user_ref, $collection_id, escape_check($message), $assigned_to);
            if ($assigned_to === 'not_managed' || !$assigned_to_user) {
                $assigned_to_user['email'] = $email_notify;
                $request_query = sprintf("\n                        INSERT INTO request(\n                                                user,\n                                                collection,\n                                                created,\n                                                request_mode,\n                                                `status`,\n                                                comments\n                                           )\n                             VALUES (\n                                         '%s',  # user\n                                         '%s',  # collection\n                                         NOW(), # created\n                                         1,     # request_mode\n                                         0,     # status\n                                         '%s'   # comments\n                                    );\n                    ", $user_ref, $collection_id, escape_check($message), $assigned_to);
            }
            sql_query($request_query);
            $request = sql_insert_id();
            // Send the mail:
            $email_message = $lang['requestassignedtoyoumail'] . "\n\n" . $baseurl . "/?q=" . $request . "\n";
            send_mail($assigned_to_user['email'], $applicationname . ': ' . $lang['requestassignedtoyou'], $email_message);
            unset($email_message);
        }
        $notify_manage_request_admin = false;
    }
    // If we've got this far, make sure auto assigning managed requests based on resource types won't overwrite this
    unset($manage_request_admin);
    return true;
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:70,代码来源:all.php

示例14: get_themes

<?php 
// Get collections under the theme
$collectionstoshare = get_themes($themes, $subthemes);
if (count($collectionstoshare) < 1) {
    $show_error = true;
    $error = $lang["cannotshareemptythemecategory"];
} else {
    foreach ($collectionstoshare as $collection) {
        $ref = $collection["ref"];
        # Get min access to this collection
        $minaccess = collection_min_access($ref);
        if ($minaccess >= 1 && !$restricted_share) {
            $show_error = true;
            $error = str_replace("%collectionname%", i18n_get_collection_name($collection), $lang["collection-name"]) . "\n" . $lang["restrictedsharecollection"];
        }
        if (count(get_collection_resources($ref)) == 0) {
            $show_error = true;
            $error = str_replace("%collectionname%", i18n_get_collection_name($collection), $lang["collection-name"]) . "\n" . $lang["cannotshareemptycollection"];
        }
    }
    $access = getvalescaped("access", "");
    $expires = getvalescaped("expires", "");
    if (getvalescaped("generateurl", "") == "") {
        ?>
									
			<div class="VerticalNav">

			<li><a id="emaillink" onClick="var _href=jQuery('#emaillink').attr('href');var subthemes=document.getElementById('subthemes').checked;jQuery('#emaillink').attr('href',_href + '&subthemes=' + subthemes);return CentralSpaceLoad(this,true);" href="<?php 
        echo $baseurl_short . "pages/collection_email.php" . $linksuffix . "&catshare=true\">" . $lang["email_theme_category"];
        ?>
</a></li>
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:31,代码来源:theme_category_share.php

示例15: create_collection

    }
    // Create a copy of the collection for admin:
    $admin_copy = create_collection(-1, $lang['send_collection_to_admin_emailedcollectionname']);
    copy_collection($collection_id, $admin_copy);
    $collection_id = $admin_copy;
    // Get the user (or username) of the contributor:
    $user = get_user($userref);
    if (isset($user) && trim($user['fullname']) != '') {
        $user = $user['fullname'];
    } else {
        $user = $user['username'];
    }
    // Get details about the collection:
    $collection = get_collection($collection_id);
    $collection_name = $collection['name'];
    $resources_in_collection = count(get_collection_resources($collection_id));
    // Build mail and send it:
    $subject = $applicationname . ': ' . $lang['send_collection_to_admin_emailsubject'] . $user;
    $message = $user . $lang['send_collection_to_admin_usercontributedcollection'] . "\n\n";
    $message .= $baseurl . '/pages/search.php?search=!collection' . $collection_id . "\n\n";
    $message .= $lang['send_collection_to_admin_additionalinformation'] . "\n\n";
    $message .= $lang['send_collection_to_admin_collectionname'] . $collection_name . "\n\n";
    $message .= $lang['send_collection_to_admin_numberofresources'] . $resources_in_collection . "\n\n";
    send_mail($email_notify, $subject, $message, '', '');
    exit;
}
global $php_path, $relate_on_upload, $enable_related_resources;
if ($relate_on_upload && $enable_related_resources && getval("uploaded_refs", "") != "") {
    $resource_refs = getval("uploaded_refs", "");
    $stringlist = "";
    foreach ($resource_refs as $k => $v) {
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:31,代码来源:upload_plupload.php


注:本文中的get_collection_resources函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。