C:\wamp\www\phpld 4.2.1\PhpLD\templates\Professional\submit.tpl | C:\wamp\www\phpld42\PhpLD\templates\Professional\submit.tpl
1 {capture name="title"} - {l}Submit Link{/l}{/capture} 2 {capture assign="in_page_title"}{l}Submit Link{/l}{/capture} 3 {capture assign="description"}{l}Submit a new link to the directory{/l}{/capture} 4 5 {include file="header.tpl"} 6 {include file="top_bar.tpl"} 7 8 {include file="validation.tpl" form_id="submitForm" validators=$validators} 9 10 11 12 {strip} 13 {if $smarty.const.DISABLE_SUBMIT == 1 && $is_admin neq 1} 14 <table width="96%" border="0" align="center" cellpadding="4" cellspacing="4" class="sp_area"> 15 <tr> 16 <td> 17 <h2>{l}Closed{/l}</h2> 18 </td> 19 </tr> 20 <tr> 21 <td> 22 {l}We are sorry but link submissions are closed.{/l}<br /> 23 {$disablereason} 24 </td> 25 </tr> 26 </table> 27 <br /> 28 {else} 29 30 {if ($confirmed)} 31 <table border="0" class="formPage"> 32 <tr><td colspan="2" class="msg"> 33 {l}The link's email address has been confirmed.{/l}<br /> 34 {l}The link will be listed as soon as it is approved by a site administrator.{/l} 35 </td></tr> 36 </table> 37 {/if} 38 39 {if $smarty.const.REQUIRE_REGISTERED_USER == 1 and empty($regular_user_details.ID)} 40 <table border="0" class="formPage"> 41 <tr> 42 <td> 43 <h3>{l}Information{/l}</h3> 44 </td> 45 </tr> 46 <tr> 47 <td> 48 {l}You must be logged in to submit a new link.{/l} 49 <br /> 50 {l}No account yet?{/l} <a href="{$smarty.const.DOC_ROOT}/profile.php?mode=register" title="{l}Register new user{/l}">{l}Create one{/l}</a> 51 </td> 52 </tr> 53 </table> 54 {else} 55 <form method="post" action="" class="cmxform" id="submitForm" name="submitForm" enctype="multipart/form-data"> 56 <table border="0" class="formPage"> 57 {if $error} 58 <tr><td colspan="2" class="err"> 59 {l}An error has occured {foreach name=errorList from=$error_list key=errorKey item=errorItem} 60 {if $errorKey == 'DO_MATH'} 61 {if is_array($errorItem)} 62 {$errorItem.remote} 63 {else} 64 {$errorItem} 65 {/if} 66 {/if} 67 {/foreach}.{/l} 68 </td></tr> 69 {/if} 70 71 {if $double_review and !$posted} 72 <tr><td colspan="2" class="err"> 73 {$double_review} 74 </td></tr> 75 {/if} 76 77 {if $posted} 78 <tr><td colspan="2" class="msg"> 79 {l}Link submitted{/l}{if $waiting_approval eq 1}{l} and awaiting approval{/l}{/if}.<br /> 80 {l}Submit another link.{/l} 81 </td></tr> 82 {/if} 83 84 {if $needs_confirmation} 85 <tr><td colspan="2" class="msg"> 86 {l}The email address you provided needs to be confirmed before the link is listed.{/l}<br /> 87 {l}Please check your email for the confirmation link.{/l} 88 </td></tr> 89 {/if} 90 91 {if $catid eq 0} 92 <tr> 93 <td colspan="2" > 94 <div class="fields" > 95 <div class="fields_c" style="padding: 20px;"> 96 <h3>{l}Step One Choose a Category{/l}:</h3> 97 <div id="hiddenModalContent"> 98 {* Load category selection *} 99 {include file="category_select.tpl" selected=$data.CATEGORY_ID selected_parent=$data.PARENT_ID} 100 </div> 101 102 <br /> 103 104 <center> 105 <input type="button" class='btn' id="ok" value="Go To Step Two" onclick="closeCategSelectModal(self);" /> 106 </center> 107 108 {literal} 109 <script type="text/javascript"> 110 //jQuery(function($) { 111 jQuery(document).ready(function() { 112 reload_categ_tree(); 113 }); 114 //}); 115 116 function closeCategSelectModal(el) { 117 el.parent.tb_remove(); 118 destroyCatTree(); 119 jQuery("#selectCategOk").hide(); 120 jQuery("#toggleCategTree").hide(); 121 var cur_categ = jQuery("#CATEGORY_ID").val(); 122 document.location.href = "submit.php?c=" + cur_categ; 123 } 124 125 </script> 126 {/literal} 127 128 </div> 129 <div class="fields_b"></div> 130 </div> 131 </td> 132 </tr> 133 {elseif $linktypeid eq 0} 134 <tr> 135 <td colspan="2"> 136 <div class="fields"> 137 <div class="fields_c"> 138 <h3>{l}Step Two Choose a Link Type{/l}:</h3> 139 <table border="0" cellspacing="10" cellpadding="0"> 140 {if $smarty.get.LINK_TYPE == 'undefined'}<tr><td colspan="2" class="err"> 141 You must choose a link type to proceed</td></tr>{/if} 142 {foreach from=$link_types item=link_type name=link_types key=link_type_id} 143 <tr> 144 <td> 145 <input type="radio" name="LINK_TYPE" value="{$link_type_id}" {if $link_type_id == $linktypeid}checked{/if}/> 146 </td> 147 <td> 148 {l}{$link_type.NAME}{/l}&nbsp;-&nbsp; 149 {if $link_type.PRICE > 0} 150 {$smarty.const.HTML_CURRENCY_CODE}{$link_type.PRICE} / {$payment_um[$link_type.PAY_UM]} 151 {else} 152 free 153 {/if} 154 <p class="small">{l}{$link_type.DESCRIPTION}{/l}</p> 155 </td> 156 </tr> 157 {/foreach} 158 <tr><td colspan='2'> 159 <center> 160 <input type="button" class='btn' name="choicemade" value="Go To Step Three" /> 161 162 </center></tr> 163 </td> 164 </table> 165 </div> 166 <div class="fields_b"></div> 167 </div> 168 </td> 169 </tr> 170 {else} 171 <input type="hidden" name="LINK_TYPE" value="{$linktypeid}" checked="true" /> 172 {/if} 173 {if $linktypeid eq 0} 174 {else} 175 176 177 <tr> 178 <td class="label underlined" align='left' colspan="2"> 179 {l}Fields marked with a {/l}<span class='req'>*</span>{l} are required.{/l} 180 </td> 181 </tr> 182 183 {foreach from=$submit_items item=item name=submit_items} 184 {* special submit items *} 185 {if $item.FIELD_NAME == 'TITLE'} 186 <tr> 187 <td class="label">{if $valid.rules.TITLE.required==true}<span class='req'>*</span>{/if}{l}Title{/l}:</td> 188 <td class="field"> 189 <input type="text" id="TITLE" name="TITLE" value="{$data.TITLE|escape|trim}" maxlength="{$smarty.const.TITLE_MAX_LENGTH}" class="text" /> 190 {if $SEO_URL != ''} 191 <a class="admin_action" href="{if !$smarty.const.ENABLE_REWRITE} 192 {$smarty.const.DOC_ROOT}/detail.php?id={$ID} 193 {else} 194 {$smarty.const.DOC_ROOT}/{$SEO_URL}{/if}" title="{l}Preview Link on the Front End{/l}" target="_blank"> 195 <img src="{$smarty.const.TEMPLATE_ROOT}/images/outbox.png"/> 196 </a> 197 {/if} 198 </td> 199 </tr> 200 {elseif $item.FIELD_NAME == 'CATEGORY_ID'} 201 <tr> 202 <td class="label">{if $valid.rules.CATEGORY_ID.required==true}<span class='req'>*</span>{/if}{l}Category{/l}:</td> 203 <td class="field"> 204 {$CategoryTitle} 205 <div id="inlineCategSelection"> 206 {* Load category selection *} 207 <input type="hidden" id="CATEGORY_ID" name="CATEGORY_ID" value="{$CATEGORY_ID}" /> 208 <p style="text-align:center; " ><input type="button" id="selectCategBtnOk" value="Start Over" onClick="history.go(-2)" class='btn' /></p> 209 </div> 210 211 </div> 212 {if $link_type_details.MULTIPLE_CATEGORIES != ''} 213 {foreach from=$add_categs item=categ name=additional} 214 {if $smarty.foreach.additional.index < $link_type_details.MULTIPLE_CATEGORIES} 215 <div> 216 {include file="category_select.tpl" selected=$categ.CATEGORY_ID selected_parent=$categ.CATEGORY_ID additional_categs=true}&nbsp; 217 <a href="#" onclick="removeCateg(this); return false;">{l}remove{/l}</a> 218 <div style="float: none; clear: both; height: 8px;"></div> 219 </div> 220 {/if} 221 {/foreach} 222 {/if} 223 <div id="categ" style="display: none;"> 224 <br /> 225 {include file="category_select.tpl" selected=$data.CATEGORY_ID selected_parent=$data.PARENT_ID additional_categs=true}&nbsp; 226 </div> 227 <a href="" class="formDelCateg" id="fileDelCateg" onclick="removeCateg(this); return false;" style="display: none">{l}remove{/l}</a> 228 <div class="clear"></div> 229 <br /> 230 <a onclick="plusCateg();return false;" href="" id="plusCategLink" class="formSmall" style="border-width: 0;">+ {l}additional categ{/l}</a> 231 </td> 232 </tr> 233 {elseif $item.FIELD_NAME == 'OWNER_NAME'} 234 <tr> 235 <td class="label">{if $valid.rules.OWNER_NAME.required==true}<span class='req'>*</span>{/if}{l}Owner Name{/l}:</td> 236 <td class="field"> 237 <input type="text" id="OWNER_NAME" name="OWNER_NAME" value="{$data.OWNER_NAME|escape|trim}" maxlength="{$smarty.const.USER_NAME_MAX_LENGTH}" class="text" /> 238 </td> 239 </tr> 240 {elseif $item.FIELD_NAME == 'OWNER_EMAIL'} 241 <tr> 242 <td class="label">{if $valid.rules.OWNER_EMAIL.required==true}<span class='req'>*</span>{/if}{l}Owner Email{/l}:</td> 243 <td class="field"> 244 <input type="text" id="OWNER_EMAIL" name="OWNER_EMAIL" value="{$data.OWNER_EMAIL|escape|trim}" maxlength="255" class="text" /> 245 <p class="small"> 246 <span style="display: block; margin: 2px; float: left;"> 247 <input type="checkbox" name="OWNER_NEWSLETTER_ALLOW" checked="checked" /> 248 </span> 249 &nbsp; 250 <span style="display: block; float: left; margin: 2px 0 0 0;">Allow site administrator to send me newsletters. </span> 251 <div style="clear: both;"></div> 252 </p> 253 </td> 254 </tr> 255 {elseif $item.FIELD_NAME == 'META_KEYWORDS'} 256 {if $smarty.const.ENABLE_META_TAGS eq 1} 257 <tr> 258 <td class="label">{l}META Keywords{/l}:</td> 259 <td class="field"> 260 <input type="text" id="META_KEYWORDS" name="META_KEYWORDS" value="{$data.META_KEYWORDS|escape|trim}" class="text" /> 261 <p class="msg notice info">{l}Separate keywords by comma.{/l}</p> 262 </td> 263 </tr> 264 {/if} 265 {elseif $item.FIELD_NAME == 'META_DESCRIPTION'} 266 {if $smarty.const.ENABLE_META_TAGS eq 1} 267 <tr> 268 <td class="label">{l}META Description{/l}:</td> 269 <td class="smallDesc"> 270 <textarea id="META_DESCRIPTION" name="META_DESCRIPTION" rows="3" cols="30" class="text" {formtool_count_chars name="META_DESCRIPTION" limit=$smarty.const.META_DESCRIPTION_MAX_LENGTH alert=true}>{$data.META_DESCRIPTION|trim|escape}</textarea> 271 <p class="limitDesc">{l}Limit{/l}: <input type="text" name="META_DESCRIPTION_limit" class="limit_field" readonly="readonly" value="{$MetaDescriptionLimit}" /></p> 272 </td> 273 </tr> 274 {/if} 275 276 {elseif $item.FIELD_NAME eq 'RECPR_URL'} 277 <tr> 278 <td class="label">{if $valid.rules[$item.FIELD_NAME].required==true}<span class='req'>*</span>{/if}{l}{$item.NAME}{/l}:</td> 279 <td class="field"> 280 <input type="text" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" value="" size="40" maxlength="255" class="text" /> 281 <br /> 282 {if $smarty.const.SAME_DOMAIN_RECPR == 1} 283 <p class="small">{l}We require the Reciprocal to be on the same domain as the link you are submitting.{/l}</p> 284 {/if} 285 <p class="small">{l}To validate the reciprocal link please include the{/l}<br />{l}following HTML code in the page at the URL{/l}<br />{l}specified above, before submiting this form{/l}:</p> 286 <textarea name="RECPR_TEXT" rows="2" readonly="readonly" cols="50" class="text">&lt;a href="{$smarty.const.DEFAULT_RECPR_URL}"&gt;{$smarty.const.DEFAULT_RECPR_TITLE}&lt;/a&gt;</textarea> 287 </td> 288 </tr> 289 {* /special submit items *} 290 {else} 291 <tr> 292 <td class="label">{if $valid.rules[$item.FIELD_NAME].required==true}<span class='req'>*</span>{/if}{l}{$item.NAME}{/l}:</td> 293 <td class="field"> 294 {if $item.TYPE eq 'STR'} 295 <input type="text" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" value="{$data[$item.FIELD_NAME]|escape|trim}" size="40" class="text" /> 296 {elseif $item.TYPE eq 'TXT'} 297 {include file="rte.tpl" NAME=$item.FIELD_NAME VALUE=$data[$item.FIELD_NAME]} 298 {elseif $item.TYPE eq 'BOOL'} 299 {html_options options=$yes_no selected=$data[$item.FIELD_NAME] name=$item.FIELD_NAME id=$item.FIELD_NAME} 300 {elseif $item.TYPE eq 'DROPDOWN'} 301 {html_options2 options=$item.OPTIONS selected=$data[$item.FIELD_NAME] name=$item.FIELD_NAME id=$item.FIELD_NAME} 302 {elseif $item.TYPE eq 'CAT'} 303 {html_options options=$categsNormal selected=$data[$item.FIELD_NAME] name=$item.FIELD_NAME id=$item.FIELD_NAME} 304 {elseif $item.TYPE eq 'FILE'} 305 <input type="file" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" class="text"/><br /> 306 {l}Allowed files{/l}: .pdf, .xls, .xlsx, .doc, .docx, .zip, .rar, .txt, .rtf, .csv. {l}Files of other types will not be uploaded at all{/l}. 307 <br/> 308 {if $data[$item.FIELD_NAME] neq ''} 309 {l}Current{/l}: <br/><a href="{$smarty.const.SITE_URL}uploads/{$data[$item.FIELD_NAME]}" target="_blank">{$data[$item.FIELD_NAME]}</a> 310 &nbsp;<input type="checkbox" name="MARK_REMOVE_{$item.FIELD_NAME}" value="1"/>&nbsp;{l}Mark for removal{/l} 311 {/if} 312 {elseif $item.TYPE eq 'VIDEO'} 313 <input type="file" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" class="text"/><br/> 314 {l}Allowed files{/l}: .avi, .mpg, .wmv, .mov {l}Files of other types will not be uploaded at all{/l}. 315 <br /> 316 {if $data[$item.FIELD_NAME] neq ''} 317 {l}Current{/l}: <br/><img src="{$smarty.const.SITE_URL}uploads/thumb/{$data[$item.FIELD_NAME]}.jpg"/> <a href="{$smarty.const.DOC_ROOT}/rm_si.php?id={$item.ID}&lid={$data.ID}">{l}Remove{/l}</a> 318 {/if} 319 {elseif $item.TYPE eq 'IMAGE'} 320 <input type="file" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" class="text"/><br/> 321 {l}Allowed files{/l}: .gif, .png, .jpg, .jpeg. {l}Files of other types will not be uploaded at all{/l}. 322 <br /> 323 {if $data[$item.FIELD_NAME] neq ''} 324 {l}Current{/l}: <br/> 325 <a href="{$smarty.const.SITE_URL}uploads/{$data[$item.FIELD_NAME]}?detail=1&TB_iframe=true&height=400&width=400" onclick="return showThickbox(this);" class="thickbox"> 326 <img src="{$smarty.const.SITE_URL}uploads/thumb/{$data[$item.FIELD_NAME]}"/></a> 327 &nbsp;<input type="checkbox" name="MARK_REMOVE_{$item.FIELD_NAME}" value="1"/>&nbsp;{l}Mark for removal{/l} 328 {/if} 329 {elseif $item.TYPE eq 'IMAGEGROUP'} 330 {php} 331 // assign a uniqid to this field so we can find the files on submit 332 $this->assign('imagegroupid',uniqid()); 333 {/php} 334 <input type="hidden" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" value="{$imagegroupid}"/> 335 {literal} 336 <div id="file-uploader"> 337 <noscript> 338 <p>Please enable JavaScript to use file uploader.</p> 339 <!-- or put a simple form for upload here --> 340 </noscript> 341 </div> 342 <script src="javascripts/fileuploader.js" type="text/javascript"></script> 343 <script> 344 curr_count = 0; 345 function createUploader(){ 346 var uploader = new qq.FileUploader({ 347 element: document.getElementById('file-uploader'), 348 action: 'uploadimg.php', 349 onSubmit: function(id, fileName, responseJSON){ 350 curr_count = curr_count+1; 351 if(curr_count>=parseInt("{/literal}{$link_types[$linktypeid].COUNT_IMAGES}{literal}")) 352 jQuery(".qq-upload-button").hide(); 353 }, 354 params: { 355 {/literal} 356 imagegroupid: "{$imagegroupid}" 357 {literal} 358 } 359 }); 360 } 361 window.onload = createUploader; 362 </script> 363 364 {/literal} 365 {/if} 366 367 {if $item.DESCRIPTION} 368 <br /><p class="small">{$item.DESCRIPTION}</p> 369 {/if} 370 </td> 371 </tr> 372 {/if} 373 {/foreach} 374 375 {if $link_type_details.DEEP_LINKS > 0} 376 <tr> 377 <td class="label required"><label>{l}Deep Links{/l}:</label></td> 378 <td class="smallDesc"> 379 <table id="additional_links" border="0" cellpadding="0" cellspacing="0"> 380 <tr> 381 <td align="center">{l}Titles{/l}</td> 382 <td align="center">{l}URLs{/l}</td> 383 </tr> 384 385 {section name=i start=0 loop=$link_type_details.DEEP_LINKS} 386 <tr> 387 <td><input type="text" name="ADD_LINK_TITLE[]" class="text" style="width: 130px;" value="{$add_links[i].TITLE}" /></td> 388 <td><input type="text" name="ADD_LINK_URL[]" class="text" style="width: 130px;" value="{$add_links[i].URL}" /></td> 389 </tr> 390 {/section} 391 </table> 392 393 <div class="clear"></div> 394 </td> 395 </tr> 396 {/if} 397 398 {if $remove_link} 399 <tr> 400 <td class="label">{l}Mark for removal{/l}:</td> 401 <td class="field"> 402 <input type="checkbox" id="MARK_REMOVE" name="MARK_REMOVE" /><span class="small">{l}Use with caution{/l}</span> 403 </td> 404 </tr> 405 {/if} 406 {if $smarty.const.VISUAL_CONFIRM eq 2} 407 <tr> 408 <td class="label"<span class='req'>*</span>{l}DO THE MATH{/l}:</td> 409 <td class="field"> 410 <span style="color: red;"> 411 {foreach name=errorList from=$error_list key=errorKey item=errorItem} 412 {if $errorKey == 'DO_MATH'} 413 {if is_array($errorItem)} 414 {$errorItem.remote}<br/> 415 {else} 416 {$errorItem}<br/> 417 {/if} 418 {/if} 419 {/foreach} 420 </span> 421 <font style="font-weight: bold; font-size: 14pt; color: red; margin-right: 10px;">{$DO_MATH_N1} + {$DO_MATH_N2} = </font><input type="text" id="DO_MATH" name="DO_MATH" value='{$DO_MATH}' class="text" style="width: 60px;"/> 422 <br/> 423 <br/> 424 </td> 425 </tr> 426 {/if} 427 {if $smarty.const.VISUAL_CONFIRM eq 1} 428 {if $dont_show_captch neq 1} 429 <tr id="{$item.NAME}"> 430 <td class="label"><span class='req'>*</span>{l}Enter the code shown{/l}:</td> 431 <td class="field"> 432 <input id="IMAGEHASH" name="IMAGEHASH" type="hidden" value="{$imagehash}" /> 433 <input class="required text" id="CAPTCHA" name="CAPTCHA" type="text" value="" size="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" maxlength="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" class="text" /> 434 <label for="CAPTCHA" id="captcha_validation" style="float: none; color: red; padding-left: .5em; "></label> 435 <div style="clear: both;"></div> 436 <p class="small">{l}This helps prevent automated registrations.{/l}</p> 437 <img src="{$smarty.const.DOC_ROOT}/captcha.php?imagehash={$imagehash}" class="captcha" alt="{l}Visual Confirmation Security Code{/l}" title="{l}Visual Confirmation Security Code{/l}" /> 438 </td> 439 </tr> 440 {/if} 441 {/if} 442 443 <tr id="AGREERULES"> 444 <td class="label"><span class='req'>*</span><a href="{$smarty.const.DOC_ROOT}/rules.php" title="Submission Rules" target='_blank'>{l}Submission Rules Agreement{/l}</a>:</td> 445 <td class="field"> 446 <input type="checkbox" id="AGREERULES" name="AGREERULES"{if $AGREERULES eq 'on'} checked="checked"{/if} /> {l}I AGREE with the {/l}<a href="{$smarty.const.DOC_ROOT}/rules.php" title="Submission Rules" target='_blank'>{l}submission rules{/l}</a> 447 </td> 448 </tr> 449 <tr> 450 <td colspan="2" class="buttons"> 451 {if !$review_link and !$remove_link} 452 <input type="submit" name="continue" value="{l}Continue{/l}" onclick="this.value='Please Wait'" class="btn" /> 453 {else} 454 <input type="hidden" name="id" value="{$data.ID}"/> 455 <input type="submit" name="edit" value="{l}Continue{/l}" class="btn" /> 456 {/if} 457 </td> 458 </tr> 459 {/if}</table> 460 <input type="hidden" name="formSubmitted" value="1" /> 461 </form> 462 {/if} 463 {/if} 464 465 {literal} 466 467 <script type="text/javascript"> 468 469 //jQuery(function($) { 470 jQuery(document).ready(function(){ 471 jQuery("input[name=choicemade]").click(function(){ 472 //update_form(); // albert: seems useless, we are making a refresh when the user changes the link type 473 var ts = jQuery('input[name=LINK_TYPE]:checked').val() 474 var lt = getUrlVars()["LINK_TYPE"]; 475 if (lt) { 476 var url = location.href.replace("LINK_TYPE="+lt, "LINK_TYPE=" + ts); 477 } else { 478 if (location.href.search(/\?/) == -1) { 479 var url = location.href + "?LINK_TYPE="+ts; 480 } else { 481 var url = location.href + "&LINK_TYPE="+ts; 482 } 483 } 484 location.href= url; 485 }); 486 487 function getUrlVars() 488 { 489 var vars = [], hash; 490 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 491 for(var i = 0; i < hashes.length; i++) 492 { 493 hash = hashes[i].split('='); 494 vars.push(hash[0]); 495 vars[hash[0]] = hash[1]; 496 } 497 return vars; 498 } 499 500 501 jQuery("#addCateg").click(function(){ 502 var categs_count = jQuery("#multiple_categs").children().size(); 503 var link_type = jQuery('input[name=LINK_TYPE]:checked').val(); 504 if (categs_count < multiple_categs[link_type]) { 505 jQuery("#add_categ").clone(true).insertAfter("#add_categ"); 506 categs_count++; 507 } 508 if (categs_count == multiple_categs[link_type]) 509 jQuery(this).hide(); 510 511 }); 512 513 jQuery("#removeCateg").click(function(){ 514 if (jQuery("#addCateg").is(":hidden")) 515 jQuery("#addCateg").show(); 516 if (jQuery("#multiple_categs").children().size() > 1) 517 jQuery(this).parent().remove(); 518 }); 519 520 521 jQuery("#submitForm").submit(function() { 522 jQuery('#categ').remove(); 523 return true; 524 }); 525 526 }); 527 //}); 528 529 var maxCats = {/literal}{if $link_type_details.MULTIPLE_CATEGORIES == ''}1{else}{$link_type_details.MULTIPLE_CATEGORIES}{/if}{literal}; 530 var numCats = {/literal}1 + {$add_categs|@count}{literal}; 531 if (numCats >= maxCats) { 532 jQuery('#plusCategLink').css('display','none'); 533 } 534 535 function plusCateg() 536 { 537 var div = $('categ'); 538 var newDiv = div.cloneNode(true); 539 newDiv.id = '' 540 newDiv.style.display = 'block'; 541 542 //newDiv.find('*.smallText').val(""); 543 544 var delLink = jQuery('#fileDelCateg'); 545 var a = delLink.cloneNode(true); 546 a.id = ''; 547 a.style.display = "inline"; 548 newDiv.appendChild(a); 549 delLink.parentNode.insertBefore(newDiv, delLink); 550 551 numCats++; 552 if (numCats >= maxCats) { 553 jQuery('#plusCategLink').css('display','none'); 554 } 555 } 556 557 function removeCateg(elem) 558 { 559 elem.parentNode.remove(elem.previousSibling); 560 561 numCats--; 562 if (numCats < maxCats) { 563 jQuery('#plusCategLink').css('display','block'); 564 } 565 } 566 567 Array.prototype.in_array = function(p_val) { 568 for(var i = 0, l = this.length; i < l; i++) { 569 if(this[i] == p_val) { 570 return true; 571 } 572 } 573 return false; 574 } 575 576 577 </script> 578 579 {/literal} 580 581 582 583 584 {include file="footer.tpl"} 585 {/strip} | 1 {capture name="title"} - {l}Submit Link{/l}{/capture} 2 {capture assign="in_page_title"}{l}Submit Link{/l}{/capture} 3 {capture assign="description"}{l}Submit a new link to the directory{/l}{/capture} 4 5 {include file="header.tpl"} 6 {include file="top_bar.tpl"} 7 8 {include file="validation.tpl" form_id="submitForm" validators=$validators} 9 10 11 12 {strip} 13 {if $smarty.const.DISABLE_SUBMIT == 1 && $is_admin neq 1} 14 <table width="96%" border="0" align="center" cellpadding="4" cellspacing="4" class="sp_area"> 15 <tr> 16 <td> 17 <h2>{l}Closed{/l}</h2> 18 </td> 19 </tr> 20 <tr> 21 <td> 22 {l}We are sorry but link submissions are closed.{/l}<br /> 23 {$disablereason} 24 </td> 25 </tr> 26 </table> 27 <br /> 28 {else} 29 30 {if ($confirmed)} 31 <table border="0" class="formPage"> 32 <tr><td colspan="2" class="msg"> 33 {l}The link's email address has been confirmed.{/l}<br /> 34 {l}The link will be listed as soon as it is approved by a site administrator.{/l} 35 </td></tr> 36 </table> 37 {/if} 38 39 {if $smarty.const.REQUIRE_REGISTERED_USER == 1 and empty($regular_user_details.ID)} 40 <table border="0" class="formPage"> 41 <tr> 42 <td> 43 <h3>{l}Information{/l}</h3> 44 </td> 45 </tr> 46 <tr> 47 <td> 48 {l}You must be logged in to submit a new link.{/l} 49 <br /> 50 {l}No account yet?{/l} <a href="{$smarty.const.DOC_ROOT}/profile.php?mode=register" title="{l}Register new user{/l}">{l}Create one{/l}</a> 51 </td> 52 </tr> 53 </table> 54 {else} 55 <form method="post" action="" class="cmxform" id="submitForm" name="submitForm" enctype="multipart/form-data"> 56 <table border="0" class="formPage"> 57 {if $error} 58 <tr><td colspan="2" class="err"> 59 {l}An error has occured {foreach name=errorList from=$error_list key=errorKey item=errorItem} 60 {if $errorKey == 'DO_MATH'} 61 {if is_array($errorItem)} 62 {$errorItem.remote} 63 {else} 64 {$errorItem} 65 {/if} 66 {/if} 67 {/foreach}.{/l} 68 </td></tr> 69 {/if} 70 71 {if $double_review and !$posted} 72 <tr><td colspan="2" class="err"> 73 {$double_review} 74 </td></tr> 75 {/if} 76 77 {if $posted} 78 <tr><td colspan="2" class="msg"> 79 {l}Link submitted{/l}{if $waiting_approval eq 1}{l} and awaiting approval{/l}{/if}.<br /> 80 {l}Submit another link.{/l} 81 </td></tr> 82 {/if} 83 84 {if $needs_confirmation} 85 <tr><td colspan="2" class="msg"> 86 {l}The email address you provided needs to be confirmed before the link is listed.{/l}<br /> 87 {l}Please check your email for the confirmation link.{/l} 88 </td></tr> 89 {/if} 90 91 {if $catid eq 0} 92 <tr> 93 <td colspan="2" > 94 <div class="fields" > 95 <div class="fields_c" style="padding: 20px;"> 96 <h3>{l}Step One Choose a Category{/l}:</h3> 97 <div id="hiddenModalContent"> 98 {* Load category selection *} 99 {include file="category_select.tpl" selected=$data.CATEGORY_ID selected_parent=$data.PARENT_ID} 100 </div> 101 102 <br /> 103 104 <center> 105 <input type="button" class='btn' id="ok" value="Go To Step Two" onclick="closeCategSelectModal(self);" /> 106 </center> 107 108 {literal} 109 <script type="text/javascript"> 110 jQuery(function($) { 111 $(document).ready(function() { 112 reload_categ_tree(); 113 }); 114 }); 115 116 function closeCategSelectModal(el) { 117 el.parent.tb_remove(); 118 destroyCatTree(); 119 jQuery("#selectCategOk").hide(); 120 jQuery("#toggleCategTree").hide(); 121 var cur_categ = jQuery("#CATEGORY_ID").val(); 122 document.location.href = "submit.php?c=" + cur_categ; 123 } 124 125 </script> 126 {/literal} 127 128 </div> 129 <div class="fields_b"></div> 130 </div> 131 </td> 132 </tr> 133 {elseif $linktypeid eq 0} 134 <tr> 135 <td colspan="2"> 136 <div class="fields"> 137 <div class="fields_c"> 138 <h3>{l}Step Two Choose a Link Type{/l}:</h3> 139 <table border="0" cellspacing="10" cellpadding="0"> 140 {if $smarty.get.LINK_TYPE == 'undefined'}<tr><td colspan="2" class="err"> 141 You must choose a link type to proceed</td></tr>{/if} 142 {foreach from=$link_types item=link_type name=link_types key=link_type_id} 143 <tr> 144 <td> 145 <input type="radio" name="LINK_TYPE" value="{$link_type_id}" {if $link_type_id == $linktypeid}checked{/if}/> 146 </td> 147 <td> 148 {l}{$link_type.NAME}{/l}&nbsp;-&nbsp; 149 {if $link_type.PRICE > 0} 150 {$smarty.const.HTML_CURRENCY_CODE}{$link_type.PRICE} / {$payment_um[$link_type.PAY_UM]} 151 {else} 152 free 153 {/if} 154 <p class="small">{l}{$link_type.DESCRIPTION}{/l}</p> 155 </td> 156 </tr> 157 {/foreach} 158 <tr><td colspan='2'> 159 <center> 160 <input type="button" class='btn' name="choicemade" value="Go To Step Three" /> 161 162 </center></tr> 163 </td> 164 </table> 165 </div> 166 <div class="fields_b"></div> 167 </div> 168 </td> 169 </tr> 170 {else} 171 <input type="hidden" name="LINK_TYPE" value="{$linktypeid}" checked="true" /> 172 {/if} 173 {if $linktypeid eq 0} 174 {else} 175 176 177 <tr> 178 <td class="label underlined" align='left' colspan="2"> 179 {l}Fields marked with a {/l}<span class='req'>*</span>{l} are required.{/l} 180 </td> 181 </tr> 182 183 {foreach from=$submit_items item=item name=submit_items} 184 {* special submit items *} 185 {if $item.FIELD_NAME == 'TITLE'} 186 <tr> 187 <td class="label">{if $valid.rules.TITLE.required==true}<span class='req'>*</span>{/if}{l}Title{/l}:</td> 188 <td class="field"> 189 <input type="text" id="TITLE" name="TITLE" value="{$data.TITLE|escape|trim}" maxlength="{$smarty.const.TITLE_MAX_LENGTH}" class="text" /> 190 {if $SEO_URL != ''} 191 <a class="admin_action" href="{if !$smarty.const.ENABLE_REWRITE} 192 {$smarty.const.DOC_ROOT}/detail.php?id={$ID} 193 {else} 194 {$smarty.const.DOC_ROOT}/{$SEO_URL}{/if}" title="{l}Preview Link on the Front End{/l}" target="_blank"> 195 <img src="{$smarty.const.TEMPLATE_ROOT}/images/outbox.png"/> 196 </a> 197 {/if} 198 </td> 199 </tr> 200 {elseif $item.FIELD_NAME == 'CATEGORY_ID'} 201 <tr> 202 <td class="label">{if $valid.rules.CATEGORY_ID.required==true}<span class='req'>*</span>{/if}{l}Category{/l}:</td> 203 <td class="field"> 204 {$CategoryTitle} 205 <div id="inlineCategSelection"> 206 {* Load category selection *} 207 <input type="hidden" id="CATEGORY_ID" name="CATEGORY_ID" value="{$CATEGORY_ID}" /> 208 <p style="text-align:center; " ><input type="button" id="selectCategBtnOk" value="Start Over" onClick="history.go(-2)" class='btn' /></p> 209 </div> 210 211 </div> 212 {if $link_type_details.MULTIPLE_CATEGORIES != ''} 213 {foreach from=$add_categs item=categ name=additional} 214 {if $smarty.foreach.additional.index < $link_type_details.MULTIPLE_CATEGORIES} 215 <div> 216 {include file="category_select.tpl" selected=$categ.CATEGORY_ID selected_parent=$categ.CATEGORY_ID additional_categs=true}&nbsp; 217 <a href="#" onclick="removeCateg(this); return false;">{l}remove{/l}</a> 218 <div style="float: none; clear: both; height: 8px;"></div> 219 </div> 220 {/if} 221 {/foreach} 222 {/if} 223 <div id="categ" style="display: none;"> 224 <br /> 225 {include file="category_select.tpl" selected=$data.CATEGORY_ID selected_parent=$data.PARENT_ID additional_categs=true}&nbsp; 226 </div> 227 <a href="" class="formDelCateg" id="fileDelCateg" onclick="removeCateg(this); return false;" style="display: none">{l}remove{/l}</a> 228 <div class="clear"></div> 229 <br /> 230 <a onclick="plusCateg();return false;" href="" id="plusCategLink" class="formSmall" style="border-width: 0;">+ {l}additional categ{/l}</a> 231 </td> 232 </tr> 233 {elseif $item.FIELD_NAME == 'OWNER_NAME'} 234 <tr> 235 <td class="label">{if $valid.rules.OWNER_NAME.required==true}<span class='req'>*</span>{/if}{l}Owner Name{/l}:</td> 236 <td class="field"> 237 <input type="text" id="OWNER_NAME" name="OWNER_NAME" value="{$data.OWNER_NAME|escape|trim}" maxlength="{$smarty.const.USER_NAME_MAX_LENGTH}" class="text" /> 238 </td> 239 </tr> 240 {elseif $item.FIELD_NAME == 'OWNER_EMAIL'} 241 <tr> 242 <td class="label">{if $valid.rules.OWNER_EMAIL.required==true}<span class='req'>*</span>{/if}{l}Owner Email{/l}:</td> 243 <td class="field"> 244 <input type="text" id="OWNER_EMAIL" name="OWNER_EMAIL" value="{$data.OWNER_EMAIL|escape|trim}" maxlength="255" class="text" /> 245 <p class="small"> 246 <span style="display: block; margin: 2px; float: left;"> 247 <input type="checkbox" name="OWNER_NEWSLETTER_ALLOW" checked="checked" /> 248 </span> 249 &nbsp; 250 <span style="display: block; float: left; margin: 2px 0 0 0;">Allow site administrator to send me newsletters. </span> 251 <div style="clear: both;"></div> 252 </p> 253 </td> 254 </tr> 255 {elseif $item.FIELD_NAME == 'META_KEYWORDS'} 256 {if $smarty.const.ENABLE_META_TAGS eq 1} 257 <tr> 258 <td class="label">{l}META Keywords{/l}:</td> 259 <td class="field"> 260 <input type="text" id="META_KEYWORDS" name="META_KEYWORDS" value="{$data.META_KEYWORDS|escape|trim}" class="text" /> 261 <p class="msg notice info">{l}Separate keywords by comma.{/l}</p> 262 </td> 263 </tr> 264 {/if} 265 {elseif $item.FIELD_NAME == 'META_DESCRIPTION'} 266 {if $smarty.const.ENABLE_META_TAGS eq 1} 267 <tr> 268 <td class="label">{l}META Description{/l}:</td> 269 <td class="smallDesc"> 270 <textarea id="META_DESCRIPTION" name="META_DESCRIPTION" rows="3" cols="30" class="text" {formtool_count_chars name="META_DESCRIPTION" limit=$smarty.const.META_DESCRIPTION_MAX_LENGTH alert=true}>{$data.META_DESCRIPTION|trim|escape}</textarea> 271 <p class="limitDesc">{l}Limit{/l}: <input type="text" name="META_DESCRIPTION_limit" class="limit_field" readonly="readonly" value="{$MetaDescriptionLimit}" /></p> 272 </td> 273 </tr> 274 {/if} 275 276 {elseif $item.FIELD_NAME eq 'RECPR_URL'} 277 <tr> 278 <td class="label">{if $valid.rules[$item.FIELD_NAME].required==true}<span class='req'>*</span>{/if}{l}{$item.NAME}{/l}:</td> 279 <td class="field"> 280 <input type="text" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" value="" size="40" maxlength="255" class="text" /> 281 <br /> 282 {if $smarty.const.SAME_DOMAIN_RECPR == 1} 283 <p class="small">{l}We require the Reciprocal to be on the same domain as the link you are submitting.{/l}</p> 284 {/if} 285 <p class="small">{l}To validate the reciprocal link please include the{/l}<br />{l}following HTML code in the page at the URL{/l}<br />{l}specified above, before submiting this form{/l}:</p> 286 <textarea name="RECPR_TEXT" rows="2" readonly="readonly" cols="50" class="text">&lt;a href="{$smarty.const.DEFAULT_RECPR_URL}"&gt;{$smarty.const.DEFAULT_RECPR_TITLE}&lt;/a&gt;</textarea> 287 </td> 288 </tr> 289 {* /special submit items *} 290 {else} 291 <tr> 292 <td class="label">{if $valid.rules[$item.FIELD_NAME].required==true}<span class='req'>*</span>{/if}{l}{$item.NAME}{/l}:</td> 293 <td class="field"> 294 {if $item.TYPE eq 'STR'} 295 <input type="text" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" value="{$data[$item.FIELD_NAME]|escape|trim}" size="40" class="text" /> 296 {elseif $item.TYPE eq 'TXT'} 297 {include file="rte.tpl" NAME=$item.FIELD_NAME VALUE=$data[$item.FIELD_NAME]} 298 {elseif $item.TYPE eq 'BOOL'} 299 {html_options options=$yes_no selected=$data[$item.FIELD_NAME] name=$item.FIELD_NAME id=$item.FIELD_NAME} 300 {elseif $item.TYPE eq 'DROPDOWN'} 301 {html_options2 options=$item.OPTIONS selected=$data[$item.FIELD_NAME] name=$item.FIELD_NAME id=$item.FIELD_NAME} 302 {elseif $item.TYPE eq 'CAT'} 303 {html_options options=$categsNormal selected=$data[$item.FIELD_NAME] name=$item.FIELD_NAME id=$item.FIELD_NAME} 304 {elseif $item.TYPE eq 'FILE'} 305 <input type="file" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" class="text"/><br /> 306 {l}Allowed files{/l}: .pdf, .xls, .xlsx, .doc, .docx, .zip, .rar, .txt, .rtf, .csv. {l}Files of other types will not be uploaded at all{/l}. 307 <br/> 308 {if $data[$item.FIELD_NAME] neq ''} 309 {l}Current{/l}: <br/><a href="{$smarty.const.SITE_URL}uploads/{$data[$item.FIELD_NAME]}" target="_blank">{$data[$item.FIELD_NAME]}</a> 310 &nbsp;<input type="checkbox" name="MARK_REMOVE_{$item.FIELD_NAME}" value="1"/>&nbsp;{l}Mark for removal{/l} 311 {/if} 312 {elseif $item.TYPE eq 'VIDEO'} 313 <input type="file" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" class="text"/><br/> 314 {l}Allowed files{/l}: .avi, .mpg, .wmv, .mov {l}Files of other types will not be uploaded at all{/l}. 315 <br /> 316 {if $data[$item.FIELD_NAME] neq ''} 317 {l}Current{/l}: <br/><img src="{$smarty.const.SITE_URL}uploads/thumb/{$data[$item.FIELD_NAME]}.jpg"/> <a href="{$smarty.const.DOC_ROOT}/rm_si.php?id={$item.ID}&lid={$data.ID}">{l}Remove{/l}</a> 318 {/if} 319 {elseif $item.TYPE eq 'IMAGE'} 320 <input type="file" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" class="text"/><br/> 321 {l}Allowed files{/l}: .gif, .png, .jpg, .jpeg. {l}Files of other types will not be uploaded at all{/l}. 322 <br /> 323 {if $data[$item.FIELD_NAME] neq ''} 324 {l}Current{/l}: <br/> 325 <a href="{$smarty.const.SITE_URL}uploads/{$data[$item.FIELD_NAME]}?detail=1&TB_iframe=true&height=400&width=400" onclick="return showThickbox(this);" class="thickbox"> 326 <img src="{$smarty.const.SITE_URL}uploads/thumb/{$data[$item.FIELD_NAME]}"/></a> 327 &nbsp;<input type="checkbox" name="MARK_REMOVE_{$item.FIELD_NAME}" value="1"/>&nbsp;{l}Mark for removal{/l} 328 {/if} 329 {elseif $item.TYPE eq 'IMAGEGROUP'} 330 {php} 331 // assign a uniqid to this field so we can find the files on submit 332 $this->assign('imagegroupid',uniqid()); 333 {/php} 334 <input type="hidden" name="{$item.FIELD_NAME}" id="{$item.FIELD_NAME}" value="{$imagegroupid}"/> 335 {literal} 336 <div id="file-uploader"> 337 <noscript> 338 <p>Please enable JavaScript to use file uploader.</p> 339 <!-- or put a simple form for upload here --> 340 </noscript> 341 </div> 342 <script src="javascripts/fileuploader.js" type="text/javascript"></script> 343 <script> 344 curr_count = 0; 345 function createUploader(){ 346 var uploader = new qq.FileUploader({ 347 element: document.getElementById('file-uploader'), 348 action: 'uploadimg.php', 349 onSubmit: function(id, fileName, responseJSON){ 350 curr_count = curr_count+1; 351 if(curr_count>=parseInt("{/literal}{$link_types[$linktypeid].COUNT_IMAGES}{literal}")) 352 jQuery(".qq-upload-button").hide(); 353 }, 354 params: { 355 {/literal} 356 imagegroupid: "{$imagegroupid}" 357 {literal} 358 } 359 }); 360 } 361 window.onload = createUploader; 362 </script> 363 364 {/literal} 365 {/if} 366 367 {if $item.DESCRIPTION} 368 <br /><p class="small">{$item.DESCRIPTION}</p> 369 {/if} 370 </td> 371 </tr> 372 {/if} 373 {/foreach} 374 375 {if $link_type_details.DEEP_LINKS > 0} 376 <tr> 377 <td class="label required"><label>{l}Deep Links{/l}:</label></td> 378 <td class="smallDesc"> 379 <table id="additional_links" border="0" cellpadding="0" cellspacing="0"> 380 <tr> 381 <td align="center">{l}Titles{/l}</td> 382 <td align="center">{l}URLs{/l}</td> 383 </tr> 384 385 {section name=i start=0 loop=$link_type_details.DEEP_LINKS} 386 <tr> 387 <td><input type="text" name="ADD_LINK_TITLE[]" class="text" style="width: 130px;" value="{$add_links[i].TITLE}" /></td> 388 <td><input type="text" name="ADD_LINK_URL[]" class="text" style="width: 130px;" value="{$add_links[i].URL}" /></td> 389 </tr> 390 {/section} 391 </table> 392 393 <div class="clear"></div> 394 </td> 395 </tr> 396 {/if} 397 398 {if $remove_link} 399 <tr> 400 <td class="label">{l}Mark for removal{/l}:</td> 401 <td class="field"> 402 <input type="checkbox" id="MARK_REMOVE" name="MARK_REMOVE" /><span class="small">{l}Use with caution{/l}</span> 403 </td> 404 </tr> 405 {/if} 406 {if $smarty.const.VISUAL_CONFIRM eq 2} 407 <tr> 408 <td class="label"<span class='req'>*</span>{l}DO THE MATH{/l}:</td> 409 <td class="field"> 410 <span style="color: red;"> 411 {foreach name=errorList from=$error_list key=errorKey item=errorItem} 412 {if $errorKey == 'DO_MATH'} 413 {if is_array($errorItem)} 414 {$errorItem.remote}<br/> 415 {else} 416 {$errorItem}<br/> 417 {/if} 418 {/if} 419 {/foreach} 420 </span> 421 <font style="font-weight: bold; font-size: 14pt; color: red; margin-right: 10px;">{$DO_MATH_N1} + {$DO_MATH_N2} = </font><input type="text" id="DO_MATH" name="DO_MATH" value='{$DO_MATH}' class="text" style="width: 60px;"/> 422 <br/> 423 <br/> 424 </td> 425 </tr> 426 {/if} 427 {if $smarty.const.VISUAL_CONFIRM eq 1} 428 {if $dont_show_captch neq 1} 429 <tr id="{$item.NAME}"> 430 <td class="label"><span class='req'>*</span>{l}Enter the code shown{/l}:</td> 431 <td class="field"> 432 <input id="IMAGEHASH" name="IMAGEHASH" type="hidden" value="{$imagehash}" /> 433 <input class="required text" id="CAPTCHA" name="CAPTCHA" type="text" value="" size="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" maxlength="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" class="text" /> 434 <label for="CAPTCHA" id="captcha_validation" style="float: none; color: red; padding-left: .5em; "></label> 435 <div style="clear: both;"></div> 436 <p class="small">{l}This helps prevent automated registrations.{/l}</p> 437 <img src="{$smarty.const.DOC_ROOT}/captcha.php?imagehash={$imagehash}" class="captcha" alt="{l}Visual Confirmation Security Code{/l}" title="{l}Visual Confirmation Security Code{/l}" /> 438 </td> 439 </tr> 440 {/if} 441 {/if} 442 443 <tr id="AGREERULES"> 444 <td class="label"><span class='req'>*</span><a href="{$smarty.const.DOC_ROOT}/rules.php" title="Submission Rules" target='_blank'>{l}Submission Rules Agreement{/l}</a>:</td> 445 <td class="field"> 446 <input type="checkbox" id="AGREERULES" name="AGREERULES"{if $AGREERULES eq 'on'} checked="checked"{/if} /> {l}I AGREE with the {/l}<a href="{$smarty.const.DOC_ROOT}/rules.php" title="Submission Rules" target='_blank'>{l}submission rules{/l}</a> 447 </td> 448 </tr> 449 <tr> 450 <td colspan="2" class="buttons"> 451 {if !$review_link and !$remove_link} 452 <input type="submit" name="continue" value="{l}Continue{/l}" onclick="this.value='Please Wait'" class="btn" /> 453 {else} 454 <input type="hidden" name="id" value="{$data.ID}"/> 455 <input type="submit" name="edit" value="{l}Continue{/l}" class="btn" /> 456 {/if} 457 </td> 458 </tr> 459 {/if}</table> 460 <input type="hidden" name="formSubmitted" value="1" /> 461 </form> 462 {/if} 463 {/if} 464 465 {literal} 466 467 <script type="text/javascript"> 468 469 jQuery(function($) { 470 $(document).ready(function(){ 471 $("input[name=choicemade]").click(function(){ 472 //update_form(); // albert: seems useless, we are making a refresh when the user changes the link type 473 var ts = $('input[name=LINK_TYPE]:checked').val() 474 var lt = getUrlVars()["LINK_TYPE"]; 475 if (lt) { 476 var url = location.href.replace("LINK_TYPE="+lt, "LINK_TYPE=" + ts); 477 } else { 478 if (location.href.search(/\?/) == -1) { 479 var url = location.href + "?LINK_TYPE="+ts; 480 } else { 481 var url = location.href + "&LINK_TYPE="+ts; 482 } 483 } 484 location.href= url; 485 }); 486 487 function getUrlVars() 488 { 489 var vars = [], hash; 490 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 491 for(var i = 0; i < hashes.length; i++) 492 { 493 hash = hashes[i].split('='); 494 vars.push(hash[0]); 495 vars[hash[0]] = hash[1]; 496 } 497 return vars; 498 } 499 500 501 $("#addCateg").click(function(){ 502 var categs_count = $("#multiple_categs").children().size(); 503 var link_type = $('input[name=LINK_TYPE]:checked').val(); 504 if (categs_count < multiple_categs[link_type]) { 505 $("#add_categ").clone(true).insertAfter("#add_categ"); 506 categs_count++; 507 } 508 if (categs_count == multiple_categs[link_type]) 509 $(this).hide(); 510 511 }); 512 513 $("#removeCateg").click(function(){ 514 if ($("#addCateg").is(":hidden")) 515 $("#addCateg").show(); 516 if ($("#multiple_categs").children().size() > 1) 517 $(this).parent().remove(); 518 }); 519 520 521 $("#submitForm").submit(function() { 522 $('#categ').remove(); 523 return true; 524 }); 525 526 }); 527 }); 528 529 var maxCats = {/literal}{if $link_type_details.MULTIPLE_CATEGORIES == ''}1{else}{$link_type_details.MULTIPLE_CATEGORIES}{/if}{literal}; 530 var numCats = {/literal}1 + {$add_categs|@count}{literal}; 531 if (numCats >= maxCats) { 532 $('plusCategLink').style.display = 'none'; 533 } 534 535 function plusCateg() 536 { 537 var div = $('categ'); 538 var newDiv = div.cloneNode(true); 539 newDiv.id = '' 540 newDiv.style.display = 'block'; 541 542 //newDiv.find('*.smallText').val(""); 543 544 var delLink = $('fileDelCateg'); 545 var a = delLink.cloneNode(true); 546 a.id = ''; 547 a.style.display = "inline"; 548 newDiv.appendChild(a); 549 delLink.parentNode.insertBefore(newDiv, delLink); 550 551 numCats++; 552 if (numCats >= maxCats) { 553 $('plusCategLink').style.display = 'none'; 554 } 555 } 556 557 function removeCateg(elem) 558 { 559 elem.parentNode.remove(elem.previousSibling); 560 561 numCats--; 562 if (numCats < maxCats) { 563 $('plusCategLink').style.display = 'block'; 564 } 565 } 566 567 Array.prototype.in_array = function(p_val) { 568 for(var i = 0, l = this.length; i < l; i++) { 569 if(this[i] == p_val) { 570 return true; 571 } 572 } 573 return false; 574 } 575 576 577 </script> 578 579 {/literal} 580 581 582 583 584 {include file="footer.tpl"} 585 {/strip}
Legend: | Added(0,4) | Deleted(0,14) | Changed(24) | Changed in changed(26)