[vhffs-dev] [797] You can now put help urls almost everwhere ;)

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 797
Author:   gradator
Date:     2007-08-29 22:27:06 +0000 (Wed, 29 Aug 2007)

Log Message:
-----------
You can now put help urls almost everwhere ;)
Note: it uses the service name used inside vhffs API so it needs a lot of new fields in configuration (merge will be made later).

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Conf.pm
    trunk/vhffs-api/src/Vhffs/Panel/Main.pm
    trunk/vhffs-api/src/Vhffs/Services/Cvs.pm
    trunk/vhffs-api/src/Vhffs/Services/DNS.pm
    trunk/vhffs-api/src/Vhffs/Services/Httpd.pm
    trunk/vhffs-api/src/Vhffs/Services/Mail.pm
    trunk/vhffs-api/src/Vhffs/Services/Mysql.pm
    trunk/vhffs-api/src/Vhffs/Services/Postgres.pm
    trunk/vhffs-api/src/Vhffs/Services/Repository.pm
    trunk/vhffs-api/src/Vhffs/Services/Svn.pm
    trunk/vhffs-backend/conf/vhffs.conf.dist.in
    trunk/vhffs-panel/group/prefs.pl
    trunk/vhffs-panel/templates/group/info.tmpl
    trunk/vhffs-panel/templates/group/prefs.tmpl
    trunk/vhffs-panel/templates/misc/service_index.tmpl
    trunk/vhffs-panel/templates/user/mailuser.tmpl
    trunk/vhffs-panel/templates/user/prefs.tmpl
    trunk/vhffs-panel/user/prefs.pl


Modified: trunk/vhffs-api/src/Vhffs/Conf.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Conf.pm	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-api/src/Vhffs/Conf.pm	2007-08-29 22:27:06 UTC (rev 797)
@@ -166,7 +166,12 @@
     return $Config{"users"};    
 }
 
+sub get_group
+{
+    return $Config{"group"};    
+}
 
+
 #Open the file of bad username, fill a table with them and return a reference to it
 sub get_bad_username
 {

Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2007-08-29 22:27:06 UTC (rev 797)
@@ -533,6 +533,11 @@
         $template->param( TEXT_GENERAL => gettext('General') );
         $template->param( TEXT_FULLHISTORY => gettext('Full history') );
 
+	if( defined ( my $url = $config->get_group->{'url_doc'} ) )  {
+		$template->param( HELP_TEXT => gettext('Help') );
+		$template->param( HELP_URL => $url );
+	}
+
         if($config->use_web) {
             my $webs = Vhffs::Panel::Web::getall_per_group( $vhffs, $gid );
             $services_list .= $self->create_service_index('web', $webs);
@@ -814,8 +819,14 @@
     $template->param( HISTORY_TEXT => gettext('History') );
     $template->param( NEW => gettext('New') );
     $template->param( NO_SERVICE_TEXT => gettext('None') );
+    $template->param( SERVICES => $services);
 
-    $template->param( SERVICES => $services);
+    my $serviceconfig = $vhffs->get_config->get_service($service);
+    if( defined $serviceconfig && defined ( my $url = $serviceconfig->{'url_doc'} ) )  {
+        $template->param( HELP_TEXT => gettext('Help') );
+        $template->param( HELP_URL => $url );        
+    }
+
     return $template->output;
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Services/Cvs.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Cvs.pm	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-api/src/Vhffs/Services/Cvs.pm	2007-08-29 22:27:06 UTC (rev 797)
@@ -186,7 +186,12 @@
 	return $self->{'cvsroot'};
 }
 
+sub get_type
+{
+	return 'cvs';
+}
 
+
 sub get_dir
 {
     my $self = shift;

Modified: trunk/vhffs-api/src/Vhffs/Services/DNS.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/DNS.pm	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-api/src/Vhffs/Services/DNS.pm	2007-08-29 22:27:06 UTC (rev 797)
@@ -1063,6 +1063,10 @@
     return $self->{'domain'};
 }
 
+sub get_type
+{
+	return 'dns';
+}
 
 sub set_soa_ns
 {

Modified: trunk/vhffs-api/src/Vhffs/Services/Httpd.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Httpd.pm	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-api/src/Vhffs/Services/Httpd.pm	2007-08-29 22:27:06 UTC (rev 797)
@@ -146,6 +146,11 @@
 	return $self->{'servername'};
 }
 
+sub get_type
+{
+	return 'web';
+}
+
 sub getall
 {
     my ($vhffs, $state, $name, $group) = @_;

Modified: trunk/vhffs-api/src/Vhffs/Services/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mail.pm	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-api/src/Vhffs/Services/Mail.pm	2007-08-29 22:27:06 UTC (rev 797)
@@ -399,6 +399,11 @@
 	return $self->{'domain'};
 }
 
+sub get_type
+{
+	return 'mail';
+}
+
 sub get_domain
 {
 	my $self = shift;

Modified: trunk/vhffs-api/src/Vhffs/Services/Mysql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mysql.pm	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-api/src/Vhffs/Services/Mysql.pm	2007-08-29 22:27:06 UTC (rev 797)
@@ -183,6 +183,11 @@
 	return $self->{'dbname'};
 }
 
+sub get_type
+{
+	return 'mysql';
+}
+
 sub get_dbpassword
 {
 	my $self = shift;

Modified: trunk/vhffs-api/src/Vhffs/Services/Postgres.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Postgres.pm	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-api/src/Vhffs/Services/Postgres.pm	2007-08-29 22:27:06 UTC (rev 797)
@@ -187,6 +187,11 @@
 	return $self->{'dbname'};
 }
 
+sub get_type
+{
+	return 'postgresql';
+}
+
 sub get_label {
 	my $self = shift;
 	return $self->{dbname};

Modified: trunk/vhffs-api/src/Vhffs/Services/Repository.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Repository.pm	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-api/src/Vhffs/Services/Repository.pm	2007-08-29 22:27:06 UTC (rev 797)
@@ -233,6 +233,11 @@
 	return $self->{'name'};
 }
 
+sub get_type
+{
+	return 'repository';
+}
+
 sub get_name
 {
 	my $self = shift;

Modified: trunk/vhffs-api/src/Vhffs/Services/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Svn.pm	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-api/src/Vhffs/Services/Svn.pm	2007-08-29 22:27:06 UTC (rev 797)
@@ -197,6 +197,11 @@
     return $self->{'reponame'};
 }
 
+sub get_type
+{
+	return 'svn';
+}
+
 sub get_label
 {
     my $self = shift;

Modified: trunk/vhffs-backend/conf/vhffs.conf.dist.in
===================================================================
--- trunk/vhffs-backend/conf/vhffs.conf.dist.in	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-backend/conf/vhffs.conf.dist.in	2007-08-29 22:27:06 UTC (rev 797)
@@ -169,8 +169,15 @@
 	default_country		=	Disneyland
 	available_shells	=	/bin/bash /bin/tcsh /bin/zsh /bin/tuxshell
 	default_shell		=	/bin/bash
+
+	# URL to the documentation (optional)
+	url_doc			=	http://help.myhoster.net/user
 </users>
 
+<group>
+	# URL to the documentation (optional)
+	url_doc		=	http://help.myhoster.net/group
+</group>
 
 
 #####################################
@@ -212,6 +219,9 @@
 
 		# If it runs locally, where is apache2ctl ?
 		log_apachectl		=	/usr/sbin/apache2ctl
+
+		# URL to the documentation (optional)
+		url_doc			=	http://help.myhoster.net/web
 	</web>
 
 	#DNS configuration
@@ -247,31 +257,56 @@
 				ns2.hoster.org
 			</ns>
 		</init>
+
+		# URL to the documentation (optional)
+		url_doc		=	http://help.myhoster.net/dns
 	</dns>
+
 	<cvs>
 		cvsweb_url	=	"http://cvsweb.hoster";	
 		cvsdoc_url	=	"http://faq.hoster";
+
+		# URL to the documentation (optional)
+		url_doc		=	http://help.myhoster.net/cvs
 	</cvs>
+
 	<mysql>
 		host		=	localhost
 		username	=	root
 		password	=	mysecret
 		mysqldump_path	=	/usr/bin/mysqldump
+
+		# URL to the documentation (optional)
+		url_doc		=	http://help.myhoster.net/mysql
 	</mysql>
+
 	<postgresql>
 		host		=	localhost
 		username	=	vhffs
 		password	=	mysecret
 	</postgresql>
+	<pgsql>
+		# URL to the documentation (optional)
+		url_doc		=	http://help.myhoster.net/pgsql
+	</pgsql>
+
 	<subversion>
 		svnweb_url	=	"http://svnweb.hoster";	
 		help_url	=	"http://myhost.tld/file.html";
 		uid		=	33
 		gid		=	33
 	</subversion>
+	<svn>
+		# URL to the documentation (optional)
+		url_doc		=	http://help.myhoster.net/svn
+	</svn>
+
 	<mail>
 		use_nospam	=	yes
 		use_novirus	=	yes
+
+		# URL to the documentation (optional)
+		url_doc		=	http://help.myhoster.net/mail
 	</mail>
 
 	#The mailuser service allow a user to get a mail account on a default domain
@@ -283,6 +318,9 @@
 		groupneeded	=	yes
 		domain		=	users.myhost.org
 		user 		=	cat
+
+		# URL to the documentation (optional)
+		url_doc		=	http://help.myhoster.net/mailuser
 	</mailuser>
 
 	#The mailgroup service allow a group to get a mail account on a default domain
@@ -292,11 +330,18 @@
 		activate	=	no
 		domain		=	projects.myhost.org
 		user 		=	cat
+
+		# URL to the documentation (optional)
+		url_doc			=	http://help.myhoster.net/mailgroup
 	</mailgroup>
 
 	<mailing>
 		default_domain	=	lists.vhffs.org
 	</mailing>
+	<mailinglist>
+		# URL to the documentation (optional)
+		url_doc		=	http://help.myhoster.net/ml
+	</mailinglist>
 
 	#Configuration for listengine
 	<listengine>
@@ -322,6 +367,9 @@
 	<repository>
 		repository_url	=	"http://download.vhffs.org/";
 		default_quota	=	1024
+
+		# URL to the documentation (optional)
+		url_doc		=	http://help.myhoster.net/repository
 	</repository>
 </services>
 

Modified: trunk/vhffs-panel/group/prefs.pl
===================================================================
--- trunk/vhffs-panel/group/prefs.pl	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-panel/group/prefs.pl	2007-08-29 22:27:06 UTC (rev 797)
@@ -218,6 +218,11 @@
 			$template->param( CONTACT_EMAIL => $group->{'groupname'}.'@'.$mg->{config}->{domain} );
 			$template->param( CONTACT_EMAIL_MODIFY => gettext('Modify') );
 			$template->param( CONTACT_EMAIL_FORWARD => $mg->getforward );
+
+			if( defined ( my $url = $mg->{config}->{'url_doc'} ) )  {
+				$template->param( HELP_TEXT => gettext('Help') );
+				$template->param( HELP_URL => $url );
+			}
 		}
 	}
 	

Modified: trunk/vhffs-panel/templates/group/info.tmpl
===================================================================
--- trunk/vhffs-panel/templates/group/info.tmpl	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-panel/templates/group/info.tmpl	2007-08-29 22:27:06 UTC (rev 797)
@@ -12,6 +12,9 @@
 	</li>
         <li><a href="/group/history.pl"><tmpl_var name="TEXT_FULLHISTORY"></a></li>
         <li><a href="/group/prefs.pl"><tmpl_var name="TEXT_PREFS"></a></li>
+	<tmpl_if name="HELP_URL">
+        <li><a href="<tmpl_var name="HELP_URL">"><tmpl_var name="HELP_TEXT"></a></li>
+	</tmpl_if>
     </ul>
 </fieldset>
 

Modified: trunk/vhffs-panel/templates/group/prefs.tmpl
===================================================================
--- trunk/vhffs-panel/templates/group/prefs.tmpl	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-panel/templates/group/prefs.tmpl	2007-08-29 22:27:06 UTC (rev 797)
@@ -22,6 +22,9 @@
 Forward emails from <tmpl_var name="CONTACT_EMAIL"> to
 <input type="text" name="contact_email" id="contact_email" value="<tmpl_var name="CONTACT_EMAIL_FORWARD">"/> <input type="submit" value="<tmpl_var name="CONTACT_EMAIL_MODIFY">" name="contact_email_submit"/>
 </form>
+<tmpl_if name="HELP_URL">
+<a href="<tmpl_var name="HELP_URL">"><tmpl_var name="HELP_TEXT"></a>
+</tmpl_if>
 </p>
 </tmpl_if>
 

Modified: trunk/vhffs-panel/templates/misc/service_index.tmpl
===================================================================
--- trunk/vhffs-panel/templates/misc/service_index.tmpl	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-panel/templates/misc/service_index.tmpl	2007-08-29 22:27:06 UTC (rev 797)
@@ -16,5 +16,8 @@
         <li><tmpl_var name="NO_SERVICE_TEXT"></li>
 </tmpl_if>
         <li><a href="/<tmpl_var name="SERVICE">/create.pl"><tmpl_var name="NEW"></a></li>
+        <tmpl_if name="HELP_URL">
+        <li><a href="<tmpl_var name="HELP_URL">"><tmpl_var name="HELP_TEXT"></a></li>
+        </tmpl_if>
     </ul>
 </fieldset>

Modified: trunk/vhffs-panel/templates/user/mailuser.tmpl
===================================================================
--- trunk/vhffs-panel/templates/user/mailuser.tmpl	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-panel/templates/user/mailuser.tmpl	2007-08-29 22:27:06 UTC (rev 797)
@@ -30,7 +30,3 @@
 					</p>
 					</div>
 				</fieldset>
-
-
-
-

Modified: trunk/vhffs-panel/templates/user/prefs.tmpl
===================================================================
--- trunk/vhffs-panel/templates/user/prefs.tmpl	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-panel/templates/user/prefs.tmpl	2007-08-29 22:27:06 UTC (rev 797)
@@ -75,6 +75,9 @@
 
 				
 				<p class="button" id="buttonModify">
+					<tmpl_if name="HELP_URL">
+					<a href="<tmpl_var name="HELP_URL">"><tmpl_var name="HELP_TEXT"></a>
+					</tmpl_if>
 					<input  type="submit"  value="<tmpl_var name="TEXT_SEND">" name="prefs_submit" id="prefs_submit"/>
 				</p>
 			</form>

Modified: trunk/vhffs-panel/user/prefs.pl
===================================================================
--- trunk/vhffs-panel/user/prefs.pl	2007-08-29 20:04:51 UTC (rev 796)
+++ trunk/vhffs-panel/user/prefs.pl	2007-08-29 22:27:06 UTC (rev 797)
@@ -381,6 +381,11 @@
     $subtemplate->param( TEXT_MAILBOX => sprintf( gettext("Use VHFFS servers to manage this mail,<br>you should use use the host pop.%s or imap.%s to fetch your mails") , $config->{domain} , $config->{domain} ) );
     $subtemplate->param( TEXT_MAILFORWARD => sprintf( gettext("Forward emails from %s\@%s to %s"), $username, $config->{domain}, $usermail ) );
 
+	if( defined ( my $url = $config->{'url_doc'} ) )  {
+		$template->param( HELP_TEXT => gettext('Help') );
+		$template->param( HELP_URL => $url );
+	}
+
 	if( $vhffs->get_config->use_nospam == 1 )
 	{
 	    $subtemplate2 = new HTML::Template( filename => $templatedir."/panel/user/mailuserspam.tmpl" );


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/