⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit.php

📁 php网页设计
💻 PHP
📖 第 1 页 / 共 2 页
字号:
	{ 	?>	<div class="Question">	<label for="copyfrom"><?=$lang["batchcopyfrom"]?></label>	<input class="stdwidth" type="text" name="copyfrom" id="copyfrom" value="" style="width:80px;">	<input type="submit" name="copyfromsubmit" value="<?=$lang["copy"]?>">	</div>	<?	}$use=$ref;# 'Copy from' been supplied? Load data from this resource instead.if (getval("copyfrom","")!="") {$use=getvalescaped("copyfrom","");}	$fields=get_resource_field_data($use,$multiple);for ($n=0;$n<count($fields);$n++)	{	if (!(($resource["archive"]==0) && ($fields[$n]["resource_type"]==999))) {	$name="field_" . $fields[$n]["ref"];	$value=$fields[$n]["value"];		if ($multiple) {$value="";} # Blank the value for multi-edits.		if (($fields[$n]["resource_type"]!=$lastrt)&& ($lastrt!=-1))		{		?><br><h1><?=get_resource_type_name($fields[$n]["resource_type"])?> <?=$lang["properties"]?></h1><?		}	$lastrt=$fields[$n]["resource_type"];	if (getval("resetform","")!="") {$value="";}	?>	<? if ($multiple) { # Multiple items, a toggle checkbox appears which activates the question	?><div><input name="editthis_<?=$name?>" id="editthis_<?=$n?>" type="checkbox" value="yes" onClick="var q=document.getElementById('question_<?=$n?>');var m=document.getElementById('modeselect_<?=$n?>');var f=document.getElementById('findreplace_<?=$n?>');if (this.checked) {q.style.display='block';m.style.display='block';} else {q.style.display='none';m.style.display='none';f.style.display='none';document.getElementById('modeselectinput_<?=$n?>').selectedIndex=0;}">&nbsp;<label for="editthis<?=$n?>"><?=htmlspecialchars(i18n_get_translated($fields[$n]["title"]))?></label></div><? } ?>	<?	if ($multiple)		{		# When editing multiple, give option to select Replace All Text or Find and Replace		?>		<div class="Question" id="modeselect_<?=$n?>" style="display:none;padding-bottom:0;margin-bottom:0;">		<label><?=$lang["editmode"]?></label>		<select id="modeselectinput_<?=$n?>" name="modeselect_<?=$fields[$n]["ref"]?>" class="stdwidth" onChange="var fr=document.getElementById('findreplace_<?=$n?>');var q=document.getElementById('question_<?=$n?>');if (this.value=='FR') {fr.style.display='block';q.style.display='none';} else {fr.style.display='none';q.style.display='block';}">		<option value="RT"><?=$lang["replacealltext"]?></option>		<option value="FR"><?=$lang["findandreplace"]?></option>		<option value="AP"><?=$lang["appendtext"]?></option>		</select>		</div>				<div class="Question" id="findreplace_<?=$n?>" style="display:none;border-top:none;">		<label>&nbsp;</label>		<?=$lang["find"]?> <input type="text" name="find_<?=$fields[$n]["ref"]?>" class="shrtwidth">		<?=$lang["andreplacewith"]?> <input type="text" name="replace_<?=$fields[$n]["ref"]?>" class="shrtwidth">		</div>		<?		}	?>	<div class="Question" id="question_<?=$n?>" <?if ($multiple) {?>style="display:none;border-top:none;"<? } ?>>	<label for="<?=$name?>"><?if (!$multiple) {?><?=htmlspecialchars(i18n_get_translated($fields[$n]["title"]))?> <? if ($fields[$n]["required"]==1) { ?><sup>*</sup><? } ?><? } ?></label>	<?	switch ($fields[$n]["type"]) {		case 0: # -------- Plain text entry		?><input class="stdwidth" type=text name="<?=$name?>" id="<?=$name?>" value="<?=htmlspecialchars($value)?>"><?		break;			case 1: # -------- Text area entry		?><textarea class="stdwidth" rows=6 cols=50 name="<?=$name?>" id="<?=$name?>"><?=htmlspecialchars($value)?></textarea><?		break;				case 5: # -------- Larger text area entry		?><textarea class="stdwidth" style="width:450px;" rows=20 cols=80 name="<?=$name?>" id="<?=$name?>"><?=htmlspecialchars($value)?></textarea><?		break;				case 2: # -------- Check box list		$options=trim_array(explode(",",$fields[$n]["options"]));sort($options);		$set=trim_array(explode(",",$value));		$wrap=0;		$l=average_length($options);		$cols=5;		if ($l>10) {$cols=4;}		if ($l>15) {$cols=3;}		if ($l>25) {$cols=2;}		?>		<table cellpadding=2 cellspacing=0><tr>		<?		for ($m=0;$m<count($options);$m++)			{			$name=$fields[$n]["ref"] . "_" . $m;			$wrap++;if ($wrap>$cols) {$wrap=1;?></tr><tr><?}			?>			<td width="1"><input type="checkbox" name="<?=$name?>" value="yes" <?if (in_array($options[$m],$set)) {?>checked<?}?> /></td><td><?=htmlspecialchars(i18n_get_translated($options[$m]))?>&nbsp;&nbsp;</td>			<?			}		?></tr></table><?		break;		case 3: # -------- Drop down list		$options=explode(",",$fields[$n]["options"]);		?><select class="stdwidth" name="<?=$name?>" id="<?=$name?>"><?		for ($m=0;$m<count($options);$m++)			{			?>			<option value="<?=htmlspecialchars(trim($options[$m]))?>" <?if (trim($options[$m])==trim($value)) {?>selected<?}?>><?=htmlspecialchars(trim(i18n_get_translated($options[$m])))?></option>			<?			}		?></select><?		break;						case 4: # -------- Date selector		case 6: # Also includes expiry date        $dy=date("Y");$dm=date("m");$dd=date("d");		if ($fields[$n]["type"]==6) {$dy="";$dm="";$dd="";}		if ($value!="")        	{            #fetch the date parts from the value            $sd=split(" ",$value);            $value=$sd[0];            $sd=split("-",$value);            if (count($sd)>=3)            	{	            $dy=intval($sd[0]);$dm=intval($sd[1]);$dd=intval($sd[2]);	            }            }        ?>        <select name="<?=$name?>-d"><option value=""><?=$lang["day"]?></option>        <?for ($m=1;$m<=31;$m++) {?><option <?if($m==$dd){echo " selected";}?>><?=sprintf("%02d",$m)?></option><?}?>        </select>                    <select name="<?=$name?>-m"><option value=""><?=$lang["month"]?></option>        <?for ($m=1;$m<=12;$m++) {?><option <?if($m==$dm){echo " selected";}?> value="<?=sprintf("%02d",$m)?>"><?=$lang["months"][$m-1]?></option><?}?>        </select>                   <input type=text size=5 name="<?=$name?>-y" value="<?=$dy?>">        <?		break;		}		?>				<?		# Display any error messages from previous save		if (array_key_exists($fields[$n]["ref"],$errors))			{			?>			<div class="FormError">!! <?=$errors[$fields[$n]["ref"]]?> !!</div>			<?			}		?>				<div class="clearerleft"> </div>		</div>		<?	}	}?><br><h1><?=$lang["statusandrelationships"]?></h1>	<!-- Archive Status -->	<? if ($multiple) { ?><div><input name="editthis_status" id="editthis_status" value="yes" type="checkbox" onClick="var q=document.getElementById('question_status');if (q.style.display!='block') {q.style.display='block';} else {q.style.display='none';}">&nbsp;<label for="editthis<?=$n?>"><?=$lang["status"]?></label></div><? } ?>	<div class="Question" id="question_status" <? if ($multiple) {?>style="display:none;"<?}?>>	<label for="archive"><?=$lang["status"]?></label>	<select class="stdwidth" name="archive" id="archive">		<? for ($n=-2;$n<=2;$n++) { ?>	<? if (checkperm("e" . $n)) { ?><option value="<?=$n?>" <? if ($resource["archive"]==$n) { ?>selected<? } ?>><?=$lang["status" . $n]?></option><? } ?>	<? } ?>	</select>	<div class="clearerleft"> </div>	</div>		<!-- Access -->	<? if ($multiple) { ?><div><input name="editthis_access" id="editthis_access" value="yes" type="checkbox" onClick="var q=document.getElementById('question_access');if (q.style.display!='block') {q.style.display='block';} else {q.style.display='none';}">&nbsp;<label for="editthis<?=$n?>"><?=$lang["access"]?></label></div><? } ?>	<div class="Question" id="question_access" <? if ($multiple) {?>style="display:none;"<?}?>>	<label for="archive"><?=$lang["access"]?></label>	<select class="stdwidth" name="access" id="access" onChange="var c=document.getElementById('custom_access');if (this.value==3) {c.style.display='block';} else {c.style.display='none';}">		<? for ($n=0;$n<=3;$n++) { ?>	<option value="<?=$n?>" <? if ($resource["access"]==$n) { ?>selected<? } ?>><?=$lang["access" . $n]?></option>	<? } ?>	</select>	<div class="clearerleft"> </div>	<table id="custom_access" cellpadding=3 cellspacing=3 style="padding-left:150px;<? if ($resource["access"]!=3) { ?>display:none;<? } ?>">	<?	$groups=get_resource_custom_access($ref);	for ($n=0;$n<count($groups);$n++)		{		$access=2;$editable=true;		if ($groups[$n]["access"]!="") {$access=$groups[$n]["access"];}		$perms=explode(",",$groups[$n]["permissions"]);		if (in_array("v",$perms)) {$access=0;$editable=false;}		?>		<tr>		<td valign=middle nowrap><?=htmlspecialchars($groups[$n]["name"])?>&nbsp;&nbsp;</td>		<td width=10 valign=middle><input type=radio name="custom_<?=$groups[$n]["ref"]?>" value="0" <? if (!$editable) { ?>disabled<? } ?> <? if ($access==0) { ?>checked<? } ?>></td>		<td align=left valign=middle><?=$lang["access0"]?></td>		<td width=10 valign=middle><input type=radio name="custom_<?=$groups[$n]["ref"]?>" value="1" <? if (!$editable) { ?>disabled<? } ?> <? if ($access==1) { ?>checked<? } ?>></td>		<td align=left valign=middle><?=$lang["access1"]?></td>		<td width=10 valign=middle><input type=radio name="custom_<?=$groups[$n]["ref"]?>" value="2" <? if (!$editable) { ?>disabled<? } ?> <? if ($access==2) { ?>checked<? } ?>></td>		<td align=left valign=middle><?=$lang["access2"]?></td>		</tr>		<?		}	?></table>	<div class="clearerleft"> </div>	</div>		<!-- Related Resources -->	<? if ($multiple) { ?><div><input name="editthis_related" id="editthis_related" value="yes" type="checkbox" onClick="var q=document.getElementById('question_related');if (q.style.display!='block') {q.style.display='block';} else {q.style.display='none';}">&nbsp;<label for="editthis<?=$n?>"><?=$lang["relatedresources"]?></label></div><? } ?>	<div class="Question" id="question_related" <? if ($multiple) {?>style="display:none;"<?}?>>	<label for="related"><?=$lang["relatedresources"]?></label>	<textarea class="stdwidth" rows=3 cols=50 name="related" id="related"><?=((getval("resetform","")!="")?"":join(", ",get_related_resources($ref)))?></textarea>	<div class="clearerleft"> </div>	</div>	<div class="QuestionSubmit">	<label for="buttons"> </label>	<input name="resetform" type="submit" value="<?=$lang["clearform"]?>" />&nbsp;	<input <? if ($multiple) { ?>onclick="return confirm('<?=$lang["confirmeditall"]?>');"<? } ?> name="save" type="submit" value="&nbsp;&nbsp;<?=($ref>0)?$lang["save"]:$lang["next"]?>&nbsp;&nbsp;" />	</div></form><p><sup>*</sup> <?=$lang["requiredfield"]?></p></div><!--<p><a href="view.php?ref=<?=$ref?>">Back to view</a></p>--><?include "include/footer.php";?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -