Show all extensions in the extension list
This commit is contained in:
		
							parent
							
								
									02b7333eb8
								
							
						
					
					
						commit
						d638dc4e53
					
				@ -1,6 +1,6 @@
 | 
			
		||||
<?php
 | 
			
		||||
/*
 | 
			
		||||
 * Name: Archive File Handler
 | 
			
		||||
 * Name: Handle Archives
 | 
			
		||||
 * Author: Shish <webmaster@shishnet.org>
 | 
			
		||||
 * Description: Allow users to upload archives (zip, etc)
 | 
			
		||||
 * Documentation:
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
<?php
 | 
			
		||||
/*
 | 
			
		||||
 * Name: Flash File Handler
 | 
			
		||||
 * Name: Handle Flash
 | 
			
		||||
 * Author: Shish <webmaster@shishnet.org>
 | 
			
		||||
 * Description: Handle Flash files
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
<?php
 | 
			
		||||
/*
 | 
			
		||||
 * Name: ICO File Handler
 | 
			
		||||
 * Name: Handle ICO
 | 
			
		||||
 * Author: Shish <webmaster@shishnet.org>
 | 
			
		||||
 * Description: Handle windows icons
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
<?php
 | 
			
		||||
/*
 | 
			
		||||
 * Name: MP3 File Handler
 | 
			
		||||
 * Name: Handle MP3
 | 
			
		||||
 * Author: Shish <webmaster@shishnet.org>
 | 
			
		||||
 * Description: Handle MP3 files
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
<?php
 | 
			
		||||
/*
 | 
			
		||||
 * Name: SVG File Handler
 | 
			
		||||
 * Name: Handle SVG
 | 
			
		||||
 * Author: Shish <webmaster@shishnet.org>
 | 
			
		||||
 * Description: Handle SVG files
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,11 @@
 | 
			
		||||
 *   extensions and read their documentation
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** @private */
 | 
			
		||||
function __extman_extcmp(ExtensionInfo $a, ExtensionInfo $b) {
 | 
			
		||||
	return strcmp($a->name, $b->name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** @private */
 | 
			
		||||
class ExtensionInfo {
 | 
			
		||||
	var $ext_name, $name, $link, $author, $email, $description, $documentation, $version;
 | 
			
		||||
@ -69,7 +74,9 @@ class ExtensionInfo {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	private function is_enabled($fname) {
 | 
			
		||||
		return file_exists("ext/$fname");
 | 
			
		||||
		if(file_exists("ext/$fname") && file_exists("contrib/$fname")) return true; // both
 | 
			
		||||
		if(file_exists("contrib/$fname")) return false; // only disabled (optional)
 | 
			
		||||
		return null; // only active (core)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -123,10 +130,21 @@ class ExtManager extends SimpleExtension {
 | 
			
		||||
 | 
			
		||||
	private function get_extensions($all) {
 | 
			
		||||
		$extensions = array();
 | 
			
		||||
		$exts = $all ? glob("contrib/*/main.php") : glob("ext/*/main.php");
 | 
			
		||||
		if($all) {
 | 
			
		||||
			$exts = glob("ext/*/main.php");
 | 
			
		||||
			foreach(glob("contrib/*/main.php") as $ae) {
 | 
			
		||||
				if(!in_array("ext".substr($ae, 7), $exts)) {
 | 
			
		||||
					$exts[] = $ae;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else {
 | 
			
		||||
			$exts = glob("ext/*/main.php");
 | 
			
		||||
		}
 | 
			
		||||
		foreach($exts as $main) {
 | 
			
		||||
			$extensions[] = new ExtensionInfo($main);
 | 
			
		||||
		}
 | 
			
		||||
		usort($extensions, "__extman_extcmp");
 | 
			
		||||
		return $extensions;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -23,7 +23,7 @@ class ExtManagerTheme extends Themelet {
 | 
			
		||||
			$h_description = html_escape($extension->description);
 | 
			
		||||
			if($extension->enabled === TRUE) $h_enabled = " checked='checked'";
 | 
			
		||||
			else if($extension->enabled === FALSE) $h_enabled = "";
 | 
			
		||||
			else $h_enabled = " disabled";
 | 
			
		||||
			else $h_enabled = " disabled checked='checked'";
 | 
			
		||||
			$h_link = make_link("ext_doc/".html_escape($extension->ext_name));
 | 
			
		||||
			$oe = ($n++ % 2 == 0) ? "even" : "odd";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,8 @@
 | 
			
		||||
<?php
 | 
			
		||||
/**
 | 
			
		||||
 * Name: Pixel File Handler
 | 
			
		||||
 * Name: Handle Pixel
 | 
			
		||||
 * Author: Shish <webmaster@shishnet.org>
 | 
			
		||||
 * Description: Handle JPG, PNG, GIF, etc files
 | 
			
		||||
 * Description: Handle JPEG, PNG, GIF, etc files
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
class PixelFileHandler extends DataHandlerExtension {
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Name: Image Viewer
 | 
			
		||||
 * Author: Shish
 | 
			
		||||
 * Description: Allows users too see uploaded images
 | 
			
		||||
 * Description: Allows users to see uploaded images
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user