compojoom/lib_compojoom

Compojoom Libraries and Helpers for Joomla!

Installs: 420

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 4

Forks: 0

Open Issues: 1

Language:JavaScript

v4.1.1 2016-04-05 15:57 UTC

This package is not auto-updated.

Last update: 2024-11-23 19:42:52 UTC


README

Build Status

The goal of this library is to ease the Joomla extension development process by abstracting commonly used functions in one place.

USAGE

Add the following line to your code:

require_once JPATH_LIBRARIES . '/compojoom/include.php';

Requirements for building the package from github

In order to build the installation packages of this library you need to have the following tools:

  • A command line environment. Bash under Linux / Mac OS X . On Windows you will need to run most tools using an elevated privileges (administrator) command prompt.

  • The PHP CLI binary in your path

  • Git binaries(*)

  • Installed composer

Build instructions

composer install

cp jorobo.dist.ini jorobo.ini

robo build

This is going to create an installable package in the /dist folder, which you can deploy with your extension.

Using the Avatar & Profile support

In your component config you can create the following fields:

<fieldset name="integrations" label="Integrations"
	          addfieldpath="/libraries/compojoom/form/fields">
  <field name="support_avatars" type="avatars"
         default="0"
         isPro="@@PRO@@"
         label="LIB_COMPOJOOM_SUPPORT_AVATARS_LABEL" description="LIB_COMPOJOOM_SUPPORT_AVATARS_DESC" />
  <field name="profile_link" label="LIB_COMPOJOOM_SUPPORT_PROFILES_LABEL"
         description="LIB_COMPOJOOM_SUPPORT_PROFILES_DESC"
         isPro="@@PRO@@"
         type="profiles" default="" />
</fieldset>

Note: the fieldset has an addfieldpath -> this would fetch the fields from that location. The isPRO attribute determines if all available options should be made available for selection. Generally in Core extensions we don't want to make those fields available.

Now to actually use the system in your php files you need to do the following:

$avatarSystem = CompojoomAvatars::getInstance($system);
$avatars = $avatarSystem->getAvatars($users);

$system is the avatar system name. Generally the value from: support_avatars in your config.
$users is an array with user ids

To use the profile system in php files you need to do the following

$profileSystem = CompojoomProfiles::getInstance($profile);
$link = $profileSystem->getLink($id);

$profile is the profile system name. Generally the value from profile_link in your config
$id is the user id that we are generating the link for

COPYRIGHT AND DISCLAIMER

Compojoom library - Copyright (c) 2008 - 2016 Compojoom.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.