HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/yoda-ict/uttoeternietoe.com/wwwroot/wp-content/plugins/totalsmug/totalsmug.js.php
<?php
include('../../../wp-config.php');
$site_url = get_option('siteurl');
?>
/**
 * Handle:	totalSmugAdmin
 * Version: 0.0.1
 * Deps:	jQuery
 * Enqueue:	true
 */

var totalSmugAdmin = function() {}

String.prototype.beginsWith = function(t, i) { if (i==false) { return 
(t == this.substring(0, t.length)); } else { return (t.toLowerCase() 
== this.substring(0, t.length).toLowerCase()); } } 


totalSmugAdmin.prototype = {
    options           : {},
    generateShortCode : function() {
        var attrs = '';
        
        jQuery.each(this['options'], function(name, value){
            if (value != '') {
                attrs += ' ' + name + '="' + value + '"';
            }
        });
		
		return '[totalsmug' + attrs + ']';
    },
    sendToEditor      : function(f) {
        var collection = jQuery(f).find("input[id^=TotalSmug]:not(input:checkbox),input[id^=TotalSmug]:checkbox:checked,select[id^=TotalSmug]");
        
        var $this = this;
        
        collection.each(function () {
            var name = this.name.substring(10, this.name.length-1);
            $this['options'][name] = this.value;
        });
        
        if ( $this['options']['albumid'] == '' ) {
			alert("Please select a Smugmug Album or add a new one.");
			return false;
      } 
        jQuery.post("<?php echo $site_url; ?>/wp-admin/admin-ajax.php", {action:"reset_album_rss", "cookie": encodeURIComponent(document.cookie), name:$this['options']['albumid']});
        send_to_editor(this.generateShortCode());
        return false;
    },
    addNewAlbum         : function(f,b) {
          var $name = jQuery(b).val();
          if ( $name != '' ) {
            jQuery.post("<?php echo $site_url; ?>/wp-admin/admin-ajax.php", {action:"add_album_dd", "cookie": encodeURIComponent(document.cookie), name:$name}, function(str)	{
            if (str.beginsWith('<option',true)== true) {
              jQuery(f).html(str);
              jQuery('#album_add_link').toggle(1);
              jQuery('#TotalSmug_Add_Album').toggle(400);
              jQuery(b).val('');
            }
            else
            {
              jQuery('#add_album_error').html(str);
            }
            });
          }
          else {
            alert("You have to fill in the name of the new album.");
            return false;
          }
    }
}

var totalSmugAdmin = new totalSmugAdmin();

jQuery(document).ready(function() {
 // hides the slickbox as soon as the DOM is ready
 // (a little sooner than page load)
  jQuery('#TotalSmug_Add_Album').hide();
 // toggles the slickbox on clicking the noted link  
  jQuery('a#album_add_link').click(function() {
    jQuery('#album_add_link').toggle(1);
    jQuery('#TotalSmug_Add_Album').toggle(400);
    return false;
  });
});