Loading...
 

Development


Tiki Addons

posts: 4 Italy

Hi all..

i would suggest some improvement for the addons on tiki.

0) Please, give us some documentation about addons in Tiki.

1) Protected get_raw_permissions on usersLib :
As i suggested in previus topic (ill repeat here just for make a list) the function get_raw_permissions of usersLib could be just protected instead of private.
If can override this function from another class, its easy to add an addon that redefine the userlib to the new class..

2) Ability to create new features in addons :
This seem to be already in, but, in prefsLib, function getDefaults (called for caching prefs infos) will search for a file /addons//prefs/ta_.php , but, getPreference (called everywhere) will call loadData :

Php
private function loadData( $name )  //<<< suppose $name to be "ta_addonname_feature_something"
	{
		if (in_array($name, $this->system_modified)) return null;
		if ( substr($name, 0, 3) == 'ta_' ) {
			$midpos = strpos($name, '_', 3);
			$pos = strpos($name, '_', $midpos + 1);
			$file = substr($name, 0, $pos);  /* <<< will search for a file called "ta_addonname_feature" , will never exsist!! if exist will never be loaded from getDefaults */
                       //$file = substr($name, 0, $midpos);  // <<< il suggest this fix.
		} elseif ( false !== $pos = strpos($name, '_') ) {
			$file = substr($name, 0, $pos);
		} elseif ( file_exists(__DIR__ . "/prefs/{$name}.php") ) {
			$file = $name;
		} else {
			$file = 'global';
		}

		return $this->getFileData($file);
	}


3) Writeable dirs : would be nice if we can move ALL dirs that should be writeable from apache in a subdir (webdata dir) . ATM a lot of writeable dir are hardcoded in tiki libs. (eg : templates_c , temp , temp/cache ecc..)

Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.