compojoom/lib_compojoom
最新稳定版本:v4.1.1
Composer 安装命令:
composer require compojoom/lib_compojoom
包简介
Compojoom Libraries and Helpers for Joomla!
README 文档
README
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/.
统计信息
- 总下载量: 422
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL
- 更新时间: 2015-10-21