Thứ Năm, 23 tháng 5, 2013

Custom user groups

I use custom user groups (user roles) within Joomla 1.5. For example under the registered users group I've added several subgroups:
myproject
customers
customer A admin
product manager
product manager admin
etc....
I use these groups within my extension to set the permissions.
When I add the groups into the jos_core_acl_aro_groups table and set the relations correctly the groups in the user management are not displayed correctly (e.q. the administrator groups disappear). For displaying the groups correctly you will have to change the code of : administrator/components/com_users/admin.users.php line 285:
(Not sure in what version this changed - but in J! 1.5.14 this change is no longer in the administrator/components/com_users/admin.users.php file. This change must now be made to administrator/components/com_users/views/user/view.html.php on line 113.)
if ( $userGroupName == $myGroupName && $myGroupName == 'administrator' )
{
// administrators can't change each other
$lists['gid'] = '<input type="hidden" name="gid" value="'. $user->get('gid') .'" /><strong>'. JText::_( 'Administrator' ) .'</strong>';
}
else
{
$gtree = $acl->get_group_children_tree( null, 'USERS', false );
into
if ( $userGroupName == $myGroupName && $myGroupName == 'administrator' )
{
// administrators can't change each other
$lists['gid'] = '<input type="hidden" name="gid" value="'. $user->get('gid') .'" /><strong>'. JText::_( 'Administrator' ) .'</strong>';
}
else
{
$gtree = $acl->get_group_children_tree( null, 'USERS', true);
If you like to add your self custom groups do the following:
Edit the jos_core_acl_aro_groups table and add your custom groups (for example with phpmyadmin). When you add a new group make sure that you assign the correct parent to the added group. For example: the joomla registered group has the ID 18, when you assign a subgroup to it make sure that the parent_id is 18. Dont assign the lft and rght fields yet but use the code below to rebuild the groups tree correctly:
<?php
 
// Put this code in a file in your Joomla root then run it. Don't forget to delete the file when you're done.
 
require 'configuration.php';
$config = new JConfig;
 
$user = $config->user;
$password = $config->password;
$db = $config->db;
$host = $config->host;
 
mysql_connect($config->host, $config->user, $config->password) or
die("Could not connect: " . mysql_error());
mysql_select_db($config->db);
 
// 0-> parent_id in Joomla this is the value of the parent_id field of the Root record
// 1-> start the left tree at 1
rebuild_tree (0, 1);
 
function rebuild_tree($parent_id, $left) {
 
global $config;
 
// the right value of this node is the left value + 1
$right = $left + 1;
 
// get all children of this node
$result = mysql_query('SELECT id FROM ' . $config->dbprefix . 'core_acl_aro_groups WHERE parent_id = ' . $parent_id . ';')
or die(mysql_error());
 
while ($row = mysql_fetch_array($result)) {
// recursive execution of this function for each
// child of this node
// $right is the current right value, which is
// incremented by the rebuild_tree function
$right = rebuild_tree($row['id'], $right);
}
 
// we've got the left value, and now that we've processed
// the children of this node we also know the right value
mysql_query('UPDATE ' . $config->dbprefix . 'core_acl_aro_groups SET lft = ' . $left . ', rgt = ' . $right . ' WHERE id = ' . $parent_id . ';')
or die(mysql_error());
 
// return the right value of this node + 1
return $right + 1;
}
 
echo 'Complete! Go check your Joomla User Admin!';
 
?>
When you want to use the custom groups to assign to your articles so that for example only the customers can view specific articles you need to add these groups into the jos_groups, just assign the ID + name of the group whereby the name must be equal to the groups names you added into the jos_core_acl_aro_groups table.

Creating a CSS Drop down Menu

To emphasize W3C valid code and lean pages, neither Flash nor JavaScript are generally considered to be favourable. Many (drop down) menu solutions make use of one of these two. There are a number of techniques one can use to get more visually attractive (drop down) menus, almost solely using cascading style sheet (CSS) and limiting the use of Javascript.
All use unordered lists (ul) to create the menu. An often-used solution is the drop down menus called “Suckerfish” or "Son of Suckerfish." It's pure CSS, very lean, hack free and employs just 12 lines of JavaScript to fix some problems with Microsoft Internet Explorer 6 and earlier. You can see a demo of what can be created with Suckerfish. More detailed guides about the Suckerfish technique can be found at htmldog.com and alistapart.com.

Contents

 [hide

Suckerfish Combined with the Extended Menu Module

In order to let Suckerfish function well, you need your menu in the form of a good clean list. It just so happens that there is a module out there to do this. It's called Extended Menu (Module Type: mod_exmenu-j15). You can find it Extended menu and in the JED.
Download and install the module. Now let’s set it up:
In the main Joomla interface, open the Extensions menu and choose the Module Manager.
Select your newly added Extended Menu Module by clicking on its name - it'll probably be fairly close to the bottom of the list.
• Assign a Menu suffix and a Module class suffix of "mainnav" (unless you change the CSS, below)
• Set Menu style: Tree List
• Set Expand Menu: Yes (don't worry about the tooltip description here - the CSS code takes care of hiding and showing the sub-menus, so they need to always be visible.)
• You can leave the other settings here at their defaults.
In order to see it in action, you will likely want to select a set of menus for it to display.

The Cascading Style Sheet

You can either add these CSS selectors to your existing template.css or create a new CSS file. If you create a new file be sure to include a reference to it inside the <head>..</head> section of your template's index.php file.
#twocols{ /* The columns that gets dropped down over yours might be different. */
z-index:20;
}
 
#leftcol{ /* The columns that gets dropped down over yours might be different. */
z-index:10;
}
 
.moduletablemainnav { /* I have absolutely positioned the module, you might have a different scheme. */
position:absolute;
top:187px;
left:20px;
z-index:100;
font:0.9em Verdana, Arial, Helvetica, sans-serif;
margin:0;
padding:0;
}
 
#mainlevelmainnav,#mainlevelmainnav ul {
float:left;
list-style:none;
line-height:1em;
background:transparent;
font-weight:700;
margin:0;
padding:0;
}
 
#mainlevelmainnav a {
display:block;
color:#f90;
text-decoration:none;
margin-right:15px;
padding:0.3em;
}
 
#mainlevelmainnav li {
float:left;
padding:0;
}
 
#mainlevelmainnav li ul {
position:absolute;
left:-999em;
height:auto;
width:11em;
font-weight:400;
background:#36f;
border:#00C 1px solid;
margin:0;
}
 
#mainlevelmainnav li li {
width:11em;
}
 
#mainlevelmainnav li ul a {
width:11em;
color:#fff;
font-size:0.9em;
line-height:1em;
font-weight:400;
}
 
#mainlevelmainnav li:hover ul ul,#mainlevelmainnav li:hover ul ul ul,#mainlevelmainnav li.sfhover ul ul,#mainlevelmainnav li.sfhover ul ul ul{
left:-999em;
}
 
#mainlevelmainnav li:hover ul,#mainlevelmainnav li li:hover ul,#mainlevelmainnav li li li:hover ul,#mainlevelmainnav li.sfhover
ul,#mainlevelmainnav li li.sfhover ul,#mainlevelmainnav li li li.sfhover ul {
left:auto;
z-index:6000;
}
 
#mainlevelmainnav li li:hover,#mainlevelmainnav li li.sfhover {
background:#039 url(../images/soccerball.gif) 98% 50% no-repeat;
}
Make sure you have the z-indexes set up properly. Also remember, in order to have a z-index, the element needs some sort of positioning. If not absolute, then relative.

The JavaScript File

You need to insert a reference to the JavaScript file for early versions of Microsoft Internet Explorer into the head of your template's index.php file.
<script type="text/javascript"><!--//--><![CDATA[//><!--
sfHover = function() {
var sfEls = document.getElementById("mainlevelmainnav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]></script>

Suckerfish Combined with the Default Joomla! Menu Module

The second approach is to implement a Drop Down menu using the mod_mainmenu module that comes with Joomal 1.5. I've played around with the “suckerfish” and CSS to make this work. This work perfectly in IE 7 as well as Netscape.
1. Create your Menu with the following Hierarchy:
Menu 1.
– Menu 1 Sub Menu 1.
– Menu 1 Sub Menu 2.
– Menu 1 Sub Menu 3.
2. Make sure the mod_mainmenu parameters are set to:
• Menu Style is set to List.
• Always show sub-menu Items is set to Yes.
• Menu Class Suffix is set to san - you can pick you own, but then make sure you change it in CSS & JS files.
3. Insert this piece of JS in your template index.php <head> tag, or in Javascript file that’s called from index.php
/* ********* drop down menu Java script code - start **********/
<script type=”text/javascript”><!//–><![CDATA[//><!– // don’t need this line if using .JS file
sfHover = function()
{
var sfEls = document.menusan.getElementsByTagName(”LI”);
 
for (var j=0; j<sfEls.length; j++)
{
sfEls[j].onmouseover=function()
{
this.className+=” sfhover”;
}
sfEls[j].onmouseout=function()
{
this.className=this.className.replace(new RegExp(” sfhover\\b”), “”);
}
}
}
if (window.attachEvent) window.attachEvent(onload, sfHover);
//–><!]]></script> // don’t need this line if using .JS file
 
/* ********* drop down menu Java script code – end **********/
4. Here's the corresponding CSS
Either add these CSS selectors to your template's existing template.css file or create a new CSS file, name it and include it between the <head>...</head> section of the index.php.
/****************** Dropdown Menu styling starts here **************/
.menusan
{
/* Use these parameters to positions your menu. */
position: relative;
left: 10px;
}
 
.menusan, .menusan li, .menusan li ul { /* all lists */
padding: 0;
margin: 0;
list-style: none;
}
 
.menusan li a {
display: block;
width: 10em;
color:#FFFFFF ;
background-color:#BC031F;
border:2px solid #BC031F;
text-decoration:none;
}
 
.menusan li { /* all list items */
float: left;
width: 10em; /* The width is needed by the Opera browser. */
border-bottom:1px solid #ccc;
}
 
.menusan li ul { /* second-level lists */
position: absolute;
width: 10em;
left: -98%; /* Use left instead of display to hide menus; display: none isn’t read by screen readers. */
}
 
.menusan li a:hover {
border:2px solid #8C7AD6;
background-color:#8C7AD6;
color:#fff;
}
 
.menusan li:hover ul, .menusan li.sfhover ul { /* lists nested under hovered list items */
left: auto; /* change this to 10px, 20px, etc for indenting the sub menu */
}
/* **************** Dropdown Menu styling end here ***************/
5. Save all.

Creating Several Menus Using Just One Menu

You can use a single menu to create multiple drop downs menus. Just create the menu in the following hierarchy and you’ll have 2 drop down menus, Menu 1 & Menu 2.
Menu 1.
– Menu 1 Sub Menu 1.
– Menu 1 Sub Menu 2.
– Menu 1 Sub Menu 3.
Menu 2.
– Menu 2 Sub Menu 1.
– Menu 2 Sub Menu 2.
– Menu 2 Sub Menu 3.
You might have to play with CSS a bit to work out the positions of the second menu etc. (Note: This did not work on the Chrome Browser 5.0.)

Thứ Ba, 21 tháng 5, 2013

FEATURES OVERVIEW


Joomla is so much more than just a powerful content management system. Here is a list of features "out of the box," but the true power of Joomla is in its extensibility.

User Management

Joomla has a registration system that allows users to configure personal options. There are nine user groups with various types of permissions on what users are allowed to access, edit, publish and administrate.

Authentication is an important part of user management and Joomla support multiple protocols, including LDAP, OpenID, and even Gmail. This allows users to use their existing account information to streamline the registration process.

Media Manager

The Media Manager is the tool for easily managing media files or folders and you can configure the MIME type settings to handle any type of file. The Media Manager is integrated into the Article Editor tool so you can grab images and other files at any time.

Language Manager

There is international support for many world languages and UTF-8 encoding. If you need your Web site in one language and the administrator panel in another, multiple languages are possible.

Banner Management

It's easy to set up banners on your Web site using the Banner Manager, starting with creating a client profile. Once you add campaigns and as many banners as you need, you can set impression numbers, special URLs, and more.

Contact Management

The Contact Manager helps your users to find the right person and their contact information. It also supports multiple contact forms going to specific individuals as well as groups.

Polls

If you want to find out more about your users, it's easy to create polls with multiple options.

Search

Help navigate users to most popular search items and provide the admin with search statistics.

Web Link Management

Providing link resources for site users is simple and you can sort them into categories, even count every click.

Content Management

Joomla's simplified three-tiered system of articles makes organizing your content a snap. You can organize your content any way you want and not necessarily how it will be on your Web site. Your users can rate articles, e-mail them to a friend, or automatically save a PDF (with UTF-8 support for all languages). Administrators can archive content for safekeeping, hiding it from site visitors.
On public Web sites, built-in e-mail cloaking protects email addresses from spambots.
Creating content is simple with the WYSIWYG editor, giving even novice users the ability to combine text, images in an attractive way. Once you've created your articles, there are a number of pre-installed modules to show the most popular articles, latest new items, newsflashes, related articles, and more.

Syndication and Newsfeed Management

With Joomla, it's easy to syndicate your site content, allowing your users to subscribe to new content in their favorite RSS reader. It's equally easy to integrate RSS feeds from other sources and aggregate them all on your site.

Menu Manager

The Menu Manager allows you to create as many menus and menu items as you need. You can structure your menu hierarchy (and nested menu items) completely independent of your content structure. Put one menu in multiple places and in any style you want; use rollovers, dropdown, flyouts and just about any other navigation system you can think of. Also automatic breadcrumbs are generated to help navigate your site users.

Template Management

Templates in Joomla are a powerful way to make your site look exactly the way you want and either use a single template for the entire site or a separate template for each site section. The level of visual control goes a step further with powerful template overrides, allowing you to customize each part of your pages.

Integrated Help System

Joomla has a built-in help section to assist users with finding what they need. A glossary explains the terms in plain English, a version checker makes sure you're using the latest version, a system information tool helps you troubleshoot, and, if all else fails, links to a wealth of online resources for additional help and support.

System Features

Speedy page loads are possible with page caching, granular-level module caching, and GZIP page compression.
If your system administrator needs to troubleshoot an issue, debugging mode and error reporting are invaluable.
The FTP Layer allows file operations (like installing Extensions) without having to make all the folders and files writable, making your site administrator's life easier and increasing the security of your site.
Administators quickly and efficiently communicate with users one-on-one through private messaging or all site users via the mass mailing system.

Web Services

With Web services, you can use Remote Procedure Calls (via HTTP and XML). You can also integrate XML-RPC services with the Blogger and Joomla APIs.

Powerful Extensibility

These are just some of the basic Joomla features and the real power is in the way you customize Joomla. Visit the Joomla Extensions Directory to see thousands of ways to enhance Joomla to suit your needs

EXTEND, LEARN AND SHARE JOOMLA!


How can you use the power of Joomla to its fullest extent? How can you make Joomla even better? Here are a few ways:

Browse the Joomla! Extensions Directory™

Joomla was made to be highly extensible and customizable to your needs. Thousands of extensions are available in the Joomla Extensions Directory™, many of which are free of charge. If you're a developer wanting to write your own extensions, there are a number of resources available online.

Create and Find Translations

Joomla has been translated in many world languages and we're always looking to translate for more.

Engage in the Joomla! Forums

The Joomla Forums are a vibrant community of users asking for help and giving expert advice. Whether it's a general question about what Joomla can do, a deeply technical question, or help with installation, you're likely to find the answers in our multi-lingual forums.

Attend a Joomla! Event or Local Joomla! User Group

Joomla User Groups meet regularly all over the world and provide an excellent opportunity for users to share ideas and experiences with using Joomla.

Develop for Joomla!

Whether you want to contribute to core development, create an extension, or report issues the Joomla! development community provides you with many resources an opportunities for participation.

Get and Create Help Documentation

The extensive documentation resources for Joomla are constantly being expanded and updated. You'll find many helpful sections on just about every subject imaginable and your expertise is welcome to make it even better.

Visit the Joomla! Community Portal™

The Joomla Community Portal™ is the ideal place to find a variety of resources for novices and experts alike. It's a launching point for everything community-related, from our Joomla User Groups™ to the JoomlaConnect™ the news source created by the worldwide Joomla Community.

CONTRIBUTE TO JOOMLA!


Joomla is an open source project and contributions from the community are essential to its growth and success. Contributing to the Joomla Project is easy and you can give as little or as much time as you want. Anyone can contribute on any level, even newcomers can contribute to Joomla. Here are just a few ways you can get started:

Answer Questions in the Joomla! Forums

The Joomla community is well known for its helpfulness. Joomla forum users helping one another is one of the cornerstones of our community. Registering on the forum is quick and easy, and you can get started right away helping people just like you.

Write or Translate a Tutorial or Documentation

The Joomla Documentation Wiki is a living Web site for help documentation, tutorials, walkthroughs, and other helpful resources. You can help it grow by writing about anything you think might help other users, novice or expert. If you're not sure where to start, try looking in the Wiki Cookie Jar to see a list of things we need help with.
Joomla is translated into many world languages by members of the community. If you language isn't available, you can translate documentation, tutorials or even Joomla itself into your language. Visit our simple guidelines page to get started.

Develop an Extension or Template

One of Joomla's strengths is its extensibility and Joomla extensions provide users with specialized functionality. The Joomla Extensions Directory is a great place to get and overview of the types of extensions developers are writing. You can take an existing GPL extension and update it for the latest version of Joomla, fix bugs, or create a totally new component with cutting edge technology. The possibilities are limitless. See how you can get started.
If you're a designer and you don't know programming, you can design your own templates. Creating a slick template is easy and can be done in a simple text editor or Adobe DreamWeaver.

Test or Add a Comment to an Issue Report

We are always looking for more people to test patches, find and fix bugs, and help clarify issue reports on our bug tracker. Visit the bug tracker on JoomlaCode to help out. If you have programming skills, we recommend you inquire about joining the Joomla Bug Squad by contacting Ian MacLennan or Mark Dexter (or by posting in the JBS Google Group).

Join a Joomla! Working Group

Hundreds of community members contribute by participating in the Joomla Working Groups. Each group focuses on a specific aspect of Joomla essential to the Project's overall growth and all have formal expectations and goals. Anyone interested in helping Joomla grow is encouraged to join a working group where they feel their talents and interests lie. See the team pages and blogs below to find out more about each group and how you can help:

Help Out at a Joomla! Event

Joomla events are held all the time around the world and are staffed solely by volunteers. You can contact your local Joomla User Group or check our Joomla Events page for upcoming events.

Contribute in Other Ways

There are a number of other ways both individuals and companies can contribute to the Joomla Project. To discuss these options, contact Open Source Matters, the non-profit organization that manages financial and legal issues for the Joomla Project.