function checkFiles($rel_dir, $all_files, &$unclaimed)
{
    $rel_dir = $rel_dir . ($rel_dir != "" ? "/" : "");
    $dh = opendir(BASE . $rel_dir);
    $exclude_dirs = array("files", "external", "cache", "sdk", "testing", "conf/profiles");
    $exclude_all = array("CVS", "tmp/views_c");
    while (($file = readdir($dh)) !== false) {
        if (is_dir(BASE . $rel_dir . $file) && substr($file, 0, 1) != "." && !in_array($rel_dir . $file, $exclude_dirs) && !in_array($file, $exclude_all)) {
            checkFiles("{$rel_dir}{$file}", $all_files, $unclaimed);
        } else {
            if (is_file(BASE . $rel_dir . $file) && substr($file, 0, 1) != ".") {
                if (!isset($all_files["{$rel_dir}{$file}"])) {
                    $unclaimed[] = "{$rel_dir}{$file}";
                }
            }
        }
    }
}
Ejemplo n.º 2
0
 * *******************************************************************************/
if (ob_get_level() < 1) {
    ob_start();
}
ob_implicit_flush(1);
// load the generated persistence file if found
$persistence = array();
if (file_exists($persist = sugar_cached('/modules/UpgradeWizard/_persistence.php'))) {
    require_once $persist;
}
require_once 'modules/UpgradeWizard/uw_utils.php';
switch ($_REQUEST['systemCheckStep']) {
    case 'find_all_files':
        ob_end_flush();
        $persistence['files_to_check'] = getFilesForPermsCheck();
        break;
    case 'check_found_files':
        if (empty($persistence['files_to_check'])) {
            logThis('*** ERROR: could not find persistent array of files to check');
            echo $mod_strings['ERR_UW_NO_FILES'];
        } else {
            ob_end_flush();
            $persistence = checkFiles($persistence['files_to_check'], true);
        }
        break;
    case 'check_files_status':
        $ret = $persistence['filesNotWritable'] ? 'true' : 'false';
        echo $ret;
        break;
}
write_array_to_file('persistence', $persistence, $persist);
Ejemplo n.º 3
0
    protected function _build($moduleID, $name, $value)
    {
        /* @var JDocument $document */
        require_once dirname(__FILE__) . "/../helpers/cleaner.php";
        $items = json_decode(base64_decode($value));
        checkFiles($items, $moduleID);
        $document = JFactory::getDocument();
        $document->addStyleSheet(JURI::root() . "modules/mod_os_touchslider/assets/css/jquery-ui-1.10.3.custom.min.css");
        $document->addStyleSheet(JURI::root() . "modules/mod_os_touchslider/assets/css/fileuploader.css");
        $document->addStyleSheet(JURI::root() . "modules/mod_os_touchslider/assets/css/admin_style.css");
        $document->addStyleSheet(JURI::root() . "modules/mod_os_touchslider/assets/css/basic.css");
        if (version_compare(JVERSION, "3.2.0", 'lt')) {
            $document->addScript(JURI::root() . "modules/mod_os_touchslider/assets/js/jquery-1.7.1.min.js");
        }
        $document->addScript(JURI::root() . "modules/mod_os_touchslider/assets/js/base64.js");
        $document->addScript(JURI::root() . "modules/mod_os_touchslider/assets/js/fileuploader.js");
        $document->addScript(JURI::root() . "modules/mod_os_touchslider/assets/js/jquery-ui-1.10.3.custom.min.js");
        ?>
        <div id="file-area">
            <noscript>
                <p>JavaScript disabled :(</p>
            </noscript>
        </div>

        <section id="wrapper">
            <ul id="images"></ul>
            <input id="json_query" type="hidden" name="jform[params][imagezer]" value="<?php 
        echo $value;
        ?>
" type="text" >
        </section>
        <input type="hidden" value="Clear all" class="clear_all_btn">

        <?php 
        $document->addScript(JURI::root() . "modules/mod_os_touchslider/assets/fileuploader/fileuploader.min.js");
        $document->addStyleSheet(JURI::root() . "modules/mod_os_touchslider/assets/fileuploader/fileuploader.css");
        // Remove temp files
        $items = json_decode(base64_decode($value));
        $html = '
          <div id="btss-message" class="clearfix"></div>
          <div id="btss-file-uploader">
          <noscript>
         Javascript is required to use OS Touch Slider - Joomla Responsive Slideshow <a href="http://ordasoft.com/os-touch-slider-joomla-responsive-slideshow"> OS Touch Slider is free simple and easy Responsive Slideshow Joomla module with drag and drop feature</a>,
          </noscript>
          </div>
          <ul id="btss-gallery-container" class="clearfix"></ul>
          ';
        ?>
        <div id="dialog-form" title="Image options" style="display:none;">
            <label for="name">Slide link</label>
            <input placeholder="<?php 
        echo JURI::root();
        ?>
" type="text" name="name"
               id="name" class="text ui-widget-content ui-corner-all" />
            <label for="description">Slide alt tag,name</label>
            <input type="text" name="description" id="description" value="" class="text ui-widget-content ui-corner-all" />
            <label for="caption">Caption</label>
            <textarea id="caption" name="caption" placeholder="Put any html code" cols="46" rows="5"></textarea>
            <input type="hidden" class="where" value="">
        </div>
        <script language="JavaScript">
	 
            function setImagesData(value){
                var data = Base64.encode(JSON.stringify(value));
                if (data.length < 62000){
                  return true;
                }   else {
                  alert("You can not enter more than 62,000 characters");
                }
             }

           (function($) {
                var uploader = new qq.FileUploader({
                    element: document.getElementById('file-area'),
                    action: '<?php 
        echo JURI::root() . "modules/mod_os_touchslider/file_uploader/uploader.php";
        ?>
',
                    params: {
                        id: '<?php 
        echo $moduleID;
        ?>
'
                    },
                    sizeLimit: 10 * 1024 * 1024,
                    allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
                    debug: false,
                    template:
                        '<div class="qq-uploader">' +
                            '<div class="qq-upload-drop-area"><p>drag and drop images here</p><span class="btnButton">Select images</span></div>' +
                            '<div class="qq-upload-button"><p>drag and drop images here</p><span class="pseudo_button">Select images</span></div>' +
                            '<ul class="qq-upload-list"></ul>' +
                            '</div><div style="display:none;" id="my_popup"><p>Popup content</p></div>',
    /////////////////////////////////Create imgage//////////////////////////////////////////////////////               
                    onComplete: function (id, filename, responseJSON) {  
                        if (!responseJSON.success) {
                        }
                        else {
                            if($("input#json_query").val() != "")
                              var $images = JSON.parse(Base64.decode($("input#json_query").val()));
                            if ($("input#json_query").val() != "") {
                                $images.push({'file':responseJSON.file,'alt':'', 'name':'',caption:Base64.encode('')});                    
                             if (setImagesData($images)) {
                                    $("#json_query").val(Base64.encode(JSON.stringify($images)));
                                    refresh_data(append_button);
                                }
                            } else {
                                $images = new Array();
                                $images.push({'file':responseJSON.file,'alt':'', 'name':'',caption:Base64.encode('')});
                                if (setImagesData($images)) {
                                    $("#json_query").val(Base64.encode(JSON.stringify($images)));
                                    refresh_data(append_button);
                                }
                            }
                        }
                    }
               });
               
                $(".qq-upload-button span, .qq-upload-button input").wrapAll("<div class='btnButton'></div>");
    ///////////////////////////////////////Show images///////////////////////////////////////////////////////////////////             
                function refresh_data(func){
                    setTimeout(function() {
                        if($("input#json_query").val() == "") return ;
                        var image_set = JSON.parse(Base64.decode($("input#json_query").val()));
                        var image_mass = new Array();
                        $.each(image_set, function(key,img){
                            image_mass.push("<li><img src=\"<?php 
        echo JURI::root() . 'images/os_touchslider_' . $moduleID . '/manager/';
        ?>
"+img.file+"\" alt=\""+img.alt+"\" name=\""+img.name+"\"  caption=\""+((typeof img.caption == "undefined")? "":img.caption  )+"\"><a item=\""+img.file+"\" class=\"rem_item\"></a><a name=\""+((typeof img.name == "undefined")? "":img.name )+"\" description=\""+((typeof img.alt == "undefined")? "":img.alt  )+"\" caption=\""+((typeof img.caption == "undefined")? "":img.caption  )+"\" item=\""+img.file+"\" class=\"edit_item popup\"></a></li>");
                        });
                        $("ul#images").html(image_mass.join(""));
                        func();
                        },1000);
                }
                refresh_data(append_button);
                $("#images").sortable({
                    start : function(event, ui) {
                        ui.item.addClass('active');
                    },
                    stop : function(event, ui) {
                        ui.item.removeClass('active').effect("highlight", { color: '#000' }, 0, function() {
                            var mass = new Array();
                            $.each($('#images li img'), function(index, event) {
                                $(this).attr('ordering',parseInt(index, 10));
                                var filename = $(this).attr("src").split('/').pop();
                                mass.push({file:filename, alt:$(this).attr('alt'),
                                   name:$(this).attr("name"), caption:$(this).attr("caption") });
                            });
                            $("#json_query").val(Base64.encode(JSON.stringify(mass)));
                        });
                    }
                });
                $("#images").disableSelection();

                function append_button() {
                    $(".clear_all_btn").click(function(){
                        var $images = new Array();
                        $("#json_query").val(Base64.encode(JSON.stringify($images)));
                        $("ul#images li").fadeOut(1000, function() { $(this).remove();});
                    });
    ///////////////////////////////////////Delete images///////////////////////////////////////////////////////////////////
                    $(".rem_item").click(function(){
                        var file = $(this).attr("item");
                        var images = JSON.parse(Base64.decode(jQuery("input#json_query").val()));
                        var $rem = $(this).parent();
                        if(images.length > 0){
                            $.each(images, function(k,img){
                                if(img.file == file) {
                                    $($rem).fadeOut(400, function() { $(this).remove();});
                                    images.splice(k,1);
                                    return false; //stop each
                                }
                            });
                            $("#json_query").val(Base64.encode(JSON.stringify(images)));
                        }
                    });
                    $( "#dialog-form" ).dialog({
                        autoOpen: false,
                        height: 245,
                        width: 560,
                        modal: true,
                        buttons: {
                            "Save": function() {
                                var where = $(this).find(".where").val();
                                var $image_set = JSON.parse(Base64.decode($("input#json_query").val()));
                                var tmp_this = this;
                                $.each($image_set, function(k,item) {
                                    if(item.file == where ) {
                                        $image_set[k].name= $(tmp_this).find("#name").val();
                                        $image_set[k].alt= $(tmp_this).find("#description").val();
                                        $image_set[k].caption = Base64.encode($(tmp_this).find("#caption").val());
                                        return false;
                                    }
                                });
                                $("a.edit_item[item='"+ $(this).find(".where").val() + "']").attr('name', $(this).find("#name").val());
                                $("a.edit_item[item='"+ $(this).find(".where").val() + "']").attr('description', $(this).find("#description").val());
                                $("a.edit_item[item='"+ $(this).find(".where").val() + "']").attr('caption', Base64.encode($(this).find("#caption").val()));
                                if (setImagesData($image_set)) {
                                    $("input#json_query").val(Base64.encode(JSON.stringify($image_set)));
                                }
                                $(this).find(".where").val();
                                $(this).dialog( "close" );
                                $(this).css("height","1px");
                            }
                        },
                        close: function() {
                        }
                    });
                    $("a.popup").click(function(){
                        $("div#dialog-form input#name").val($(this).attr('name'));
                        $("div#dialog-form input#description").val($(this).attr('description'));
                        $("div#dialog-form textarea#caption").val(Base64.decode($(this).attr('caption')));
                        $("div#dialog-form input.where").val($(this).attr('item'));
                        $("#dialog-form").css("height","100%");
                        $("#dialog-form").dialog("open");
                    });
                }

                $(function(){
                    var obj = $('.slideoptions');
                    obj.bind('keyup', function() {
                        this.value = this.value.replace(/[^0-9]+/g, '');
                    });
                    obj.bind('keydown', function() {
                        this.value = this.value.replace(/[^0-9]+/g, '');
                    });
                });

                $.widget("ui.tooltip", $.ui.tooltip, {
                    options: {
                        content: function() {
                            return $(this).prop('title');
                        }
                    }
                  });
                $(document).tooltip();
            })(jQuery);
        </script>
        <?php 
        return $html;
    }
Ejemplo n.º 4
0
<?php 
$document->setTitle(JText::_('COM_JDOWNLOADS_RUN_MONITORING_TITLE'));
// check whether we may do the job
$config = JFactory::getConfig();
$secret = $config->get('secret');
$jinput = JFactory::getApplication()->input;
$param = $jinput->get('key', '', 'string');
if ($param != $secret) {
    echo '<b>' . JText::_('COM_JDOWNLOADS_NOT_ALLOWED_ACTION_MSG') . '</b>';
    exit;
}
echo '<br />';
echo '<div  style="font-family:Verdana; font-size:10"><b>' . JText::_('COM_JDOWNLOADS_RUN_MONITORING_INFO2') . '</b><br />' . JText::_('COM_JDOWNLOADS_RUN_MONITORING_INFO') . '<br /><br /></div>';
flush();
$time_start = microtime_float();
checkFiles($task);
$time_end = microtime_float();
$time = $time_end - $time_start;
echo '<br /><small>The scan duration: ' . number_format($time, 2) . ' seconds.</small>';
echo '<br /><br /><small>' . JText::_('COM_JDOWNLOADS_RUN_MONITORING_INFO8') . '</small>';
echo '</body></html>';
/* checkFiles
/
/ check uploaddir and subdirs for variations
/ 
/
*/
function checkFiles($task)
{
    global $jlistConfig, $lang;
    $limits = remove_server_limits();
Ejemplo n.º 5
0
 function upgrade()
 {
     $model = new UpdaterModel();
     $this->manifest = $model->getManifest();
     $this->forceinstall = $model->getFlagForceInstall();
     $this->forceinstall = true;
     // We're not checking today/.
     if (!$this->forceinstall) {
         $file_errors = checkFiles();
         $errors = count($file_errors);
         if ($errors > 0) {
             $this->setRedirect('index.php?option=com_updater&task=display', "We have detected {$errors} files that are not writeable in your Jooml! install - check 'Diagnostics' for details. Joomla! Upgrade may fail and will not continue.  \n        To get rid of this message and continue, fix your website permissions or\n        enable 'Force Install' in the parameters menu.", 'error');
             return;
         }
     }
     $url = $model->retrievedownloadlink('joomla.jupgrade');
     $p_file = isJInstallerHelper::downloadPackage($url);
     $config =& JFactory::getConfig();
     $tmp_dest = $config->getValue('config.tmp_path');
     // Alternate: extract then copy
     $success = isJInstallerHelper::extract("{$tmp_dest}/{$p_file}", "/", true);
     // Direct extract *should* work better
     //$success = isJInstallerHelper::archive_extract("$tmp_dest/$p_file", JPATH_ROOT); // Direct extraction
     if ($success) {
         $this->setRedirect('index.php?option=com_updater&task=display', 'Joomla! Upgrade Success');
     } else {
         $this->setRedirect('index.php?option=com_updater&task=display', 'Joomla! Upgrade Failed <i>Please Check Your Sites Permissions!</i>', 'error');
     }
 }
Ejemplo n.º 6
0
    protected function _build($moduleID, $name, $value)
    {
        /* @var JDocument $document */
        require_once dirname(__FILE__) . "/../helpers/cleaner.php";
        $items = json_decode(base64_decode($value));
        checkFiles($items, $moduleID);
        $document = JFactory::getDocument();
        $document->addStyleSheet(JURI::root() . "modules/mod_OS_ImageGallery_Free/assets/css/jquery-ui-1.10.3.custom.min.css");
        $document->addStyleSheet(JURI::root() . "modules/mod_OS_ImageGallery_Free/assets/css/fileuploader.css");
        $document->addStyleSheet(JURI::root() . "modules/mod_OS_ImageGallery_Free/assets/css/admin_style.css");
        $document->addStyleSheet(JURI::root() . "modules/mod_OS_ImageGallery_Free/assets/css/basic.css");
        if (version_compare(JVERSION, "3.2.0", 'lt')) {
            $document->addScript(JURI::root() . "modules/mod_OS_ImageGallery_Free/assets/js/jquery-1.7.1.min.js");
        }
        $document->addScript(JURI::root() . "modules/mod_OS_ImageGallery_Free/assets/js/base64.js");
        $document->addScript(JURI::root() . "modules/mod_OS_ImageGallery_Free/assets/js/fileuploader.js");
        $document->addScript(JURI::root() . "modules/mod_OS_ImageGallery_Free/assets/js/jquery-ui-1.10.3.custom.min.js");
        ?>

        <script type="text/javascript">
           if($('.controls').length){
            $(document).on('keydown','.controls input.number', function(e){
             var data=$(this).val();
             var KeyID = (window.event) ? event.keyCode : e.keyCode;
             //console.log(KeyID);
             if((KeyID<48||KeyID>57) && KeyID!=8 && KeyID!=46 && KeyID!=116 && KeyID!=37 && KeyID!=39 ){
              $(this).val(data);
              return false;
             }
            });
           }
        </script>
        <div id="file-area">
            <noscript>
                <p>JavaScript disabled :(</p>
            </noscript>
        </div>

        <section id="wrapper">
            <ul id="images"></ul>
            <input id="json_query" type="hidden" name="jform[params][imagezer]" value="<?php 
        echo $value;
        ?>
" type="text" >
        </section>
        <input type="hidden" value="Clear all" class="clear_all_btn">
        <?php 
        $document->addScript(JURI::root() . "modules/mod_OS_ImageGallery_Free/assets/fileuploader/fileuploader.min.js");
        $document->addStyleSheet(JURI::root() . "modules/mod_OS_ImageGallery_Free/assets/fileuploader/fileuploader.css");
        // Remove temp files
        $items = json_decode(base64_decode($value));
        $html = '
			<div id="btss-message" class="clearfix"></div>
			<div id="btss-file-uploader">		
                <noscript>
					<p>' . JText::_('mod_OS_ImageGallery_Free_NOTICE_JAVASCRIPT') . '</p>
				</noscript>         
			</div>
			<ul id="btss-gallery-container" class="clearfix"></ul>
			';
        ?>
        <div id="dialog-form" title="Image options" style="display:none;">
           <fieldset>
                    <label for="name">Image name</label>
                    <input type="text" name="name" id="name" value="" class="text ui-widget-content ui-corner-all" />

                    <label for="description">Image alt</label>
                    <input type="text" name="description" id="description" value="" class="text ui-widget-content ui-corner-all" />
                    <input type="hidden" class="where" value="">
           </fieldset>
        </div>
        <script language="JavaScript">
            (function($) {

                var uploader = new qq.FileUploader({
                    element: document.getElementById('file-area'),
                    action: '<?php 
        echo JURI::root() . "modules/mod_OS_ImageGallery_Free/file_uploader/uploader.php";
        ?>
',
                    params: {
                        id: '<?php 
        echo $moduleID;
        ?>
'
                    },
                    sizeLimit: 10 * 1024 * 1024,
                    allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
                    debug: false,
                    template:
                        '<div class="qq-uploader">' +
                            '<div class="qq-upload-drop-area"><p>drag and drop images here</p><span class="btnButton">Select images</span></div>' +
                            '<div class="qq-upload-button"><p>drag and drop images here</p><span class="pseudo_button">Select images</span></div>' +
                            '<ul class="qq-upload-list"></ul>' +
                            '</div><div style="display:none;" id="my_popup"><p>Popup content</p></div>',
                    onComplete: function (id, filename, responseJSON) {
                        //console.log(filename);
                        if (!responseJSON.success) {
                            //console.log(filename + ' - ' + responseJSON.message);
                        }
                        else {
                            if($("input#json_query").val() != "")
                            var $images = JSON.parse(Base64.decode($("input#json_query").val()));
                            if ($("input#json_query").val() != "") {
                                $images.push({'file':responseJSON.file,'alt':'', 'name':''});
                                $("#json_query").val(Base64.encode(JSON.stringify($images)));
                                refresh_data(append_button);
                            } else {
                                $images = new Array();
                                $images.push({'file':responseJSON.file,'alt':'', 'name':''});
                                $("#json_query").val(Base64.encode(JSON.stringify($images)));
                                refresh_data(append_button);
                            }
                        }
                    }
                });

                $(".qq-upload-button span, .qq-upload-button input").wrapAll("<div class='btnButton'></div>");

                function refresh_data(func){
                    setTimeout(function() {
                        var image_set = JSON.parse(Base64.decode($("input#json_query").val()));
                        var image_mass = new Array();
                        $.each(image_set, function(key,img){
                            image_mass.push("<li><img src=\"<?php 
        echo JURI::root() . 'images/os_imagegallery_' . $moduleID . '/manager/';
        ?>
"+img.file+"\" alt=\""+img.alt+"\" name=\""+img.name+"\"><a item=\""+img.file+"\" class=\"rem_item\"></a><a name=\""+((typeof img.name == "undefined")? "":img.name )+"\" description=\""+((typeof img.alt == "undefined")? "":img.alt  )+"\" item=\""+img.file+"\" class=\"edit_item popup\"></a></li>");
                        });
                        $("ul#images").html(image_mass.join(""));
                        func();
                        },1000);
                }
                refresh_data(append_button);
                $("#images").sortable({
                    start : function(event, ui) {
                        ui.item.addClass('active');
                    },
                    stop : function(event, ui) {
                        ui.item.removeClass('active').effect("highlight", { color: '#000' }, 0, function() {
                            var mass = new Array();
                            $.each($('#images li img'), function(index, event) {
                                $(this).attr('ordering',parseInt(index, 10));
                                var filename = $(this).attr("src").split('/').pop();
                                mass.push({file:filename, alt:$(this).attr('alt'), name:$(this).attr("name")});
                            });
                            $("#json_query").val(Base64.encode(JSON.stringify(mass)));
                      //  window.location.hash = Base64.encode(JSON.stringify(mass));
                        });
                    }
                });
                $("#images").disableSelection();

                function append_button() {
                    $(".clear_all_btn").click(function(){
                        var $images = new Array();
                        $("#json_query").val(Base64.encode(JSON.stringify($images)));
                        $("ul#images li").fadeOut(1000, function() { $(this).remove();});
                    });

                    $(".rem_item").click(function(){
                        var file = $(this).attr("item");
                        var images = JSON.parse(Base64.decode(jQuery("input#json_query").val()));

                     //   console.log(images);
                        var $rem = $(this).parent();
                        if(images.length > 0){
                            $.each(images, function(k,img){
                                if(img.file == file) {
                                    $($rem).fadeOut(400, function() { $(this).remove();});

                                    images.splice(k,1);
                                    return false; //stop each
                                }
                            });

                            //console.log(images);
                        $("#json_query").val(Base64.encode(JSON.stringify(images)));
                        }
                    });
                    $( "#dialog-form" ).dialog({
                        autoOpen: false,
                        height: 245,
                        width: 560,
                        modal: true,
                        buttons: {
                            "Save": function() {
                                var where = $(this).find(".where").val();
                                var $image_set = JSON.parse(Base64.decode($("input#json_query").val()));
                                var tmp_this = this;
                                $.each($image_set, function(k,item) {
                                    if(item.file == where ) {
                                        $image_set[k].name= $(tmp_this).find("#name").val();
                                        $image_set[k].alt= $(tmp_this).find("#description").val();
                                        return false;
                                    }
                                });
                                $("a.edit_item[item='"+ $(this).find(".where").val() + "']").attr('name', $(this).find("#name").val());
                                $("a.edit_item[item='"+ $(this).find(".where").val() + "']").attr('description', $(this).find("#description").val());
                                $("input#json_query").val(Base64.encode(JSON.stringify($image_set)));
                                $(this).find(".where").val();
                                $(this).dialog("close");
                                $(this).css("height","1px");
                            }
                        },
                        close: function() {
                        }
                    });
                    $("a.popup").click(function(){
                        $("div#dialog-form input#name").val($(this).attr('name'));
                        $("div#dialog-form input#description").val($(this).attr('description'));
                        $("div#dialog-form input.where").val($(this).attr('item'));
                        $("#dialog-form").css("height","100%");
                        $("#dialog-form").dialog( "open");
                    });
                }

                $(function(){
                    var maxLen = 20;
                    var obj = $('.slideoptions');
                    obj.bind('keyup', function() {
                        this.value = this.value.replace(/[A-Za-z\W]/, '');
                    });
                    obj.bind('keydown', function() {
                        this.value = this.value.replace(/[A-Za-z\W]/, '');
                    });
                });

                $.widget("ui.tooltip", $.ui.tooltip, {
                    options: {
                          content: function () {
                            return $(this).prop('title');
                        }
                    }
                  });
                $(document).tooltip();

            })(jQuery);
        </script>
        <?php 
        return $html;
    }
        $FIX = true;
        break;
    default:
        $FIX = false;
}
$validateFix = $FIX ? "Validating and Repairing" : "Validating";
$errorLines = array();
$warningLines = array();
echo "CRMod Sound File Checker {$VERSION} - Brayden Traas" . PHP_EOL . PHP_EOL;
echo "{$validateFix} {$FILE_COMMANDS} and {$FILE_STATUS}..." . PHP_EOL;
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" . PHP_EOL . PHP_EOL;
importLuaScript($FILE_COMMANDS);
importLuaScript($FILE_STATUS);
//print_r($ships);
//print_r($speechLines);
$stats = checkFiles();
$errorCount = count($stats['problemShips']);
foreach ($errorLines as $scriptErrors) {
    $errorCount += count($scriptErrors);
}
$warningCount = count($stats['warningShips']);
foreach ($warningLines as $scriptWarnings) {
    $warningCount += count($scriptWarnings);
}
if ($errorCount < 1) {
    $FIX = false;
}
if ($FIX == false) {
    displayStats($stats);
} else {
    echo "Errors found:    " . $errorCount . "\nAttempting to repair...\n";
Ejemplo n.º 8
0
                }
            }
            if (!importFile($path, $meta)) {
                pieError("ImportError", array('file' => htmlspecialchars($file)));
            }
            $count++;
            $size += filesize($path);
        }
    }
} else {
    // Retrieve the list of files of the FILE path.
    if (!($list = getFileList($_REQUEST['filepath']))) {
        pieError("ImportError");
    }
    // Validate if the files already exist.
    $num = checkFiles($list);
    $count = 0;
    $size = 0;
    // Import the files of the list.
    foreach ($list as $file) {
        $path = $_REQUEST['filepath'] . "/{$file}";
        if (!importFile($path, array())) {
            pieError("ImportError", array('file' => htmlspecialchars($file)));
        }
        $count++;
        $size += filesize($path);
    }
}
pieLog("alter");
pieNotice("ImportSuccess", array('num' => $num, 'count' => $count, 'size' => pieMakeSize($size)));
pieTail();