Update of /cvsroot/phpslash/phpslash-ft/class
In directory usw-pr-cvs1:/tmp/cvs-serv1899/phpslash-ft/class
Modified Files:
slashPerm.class Author.class
Log Message:
perms html formatted in authorNew.tpl
Index: slashPerm.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/slashPerm.class,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** slashPerm.class 2001/11/07 21:35:34 1.2
--- slashPerm.class 2001/12/17 22:42:37 1.3
***************
*** 54,57 ****
--- 54,70 ----
return $ret;
}
+
+ /**
+ * getPerms just returns an array of the Perms list
+ *
+ */
+ function getPerms() {
+ reset($this->permissions);
+ while(list($k, $v) = each($this->permissions)) {
+ $ret[] .= $k;
+ }
+ return $ret;
+ }
+
}
?>
Index: Author.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Author.class,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Author.class 2001/12/17 18:20:16 1.13
--- Author.class 2001/12/17 22:42:37 1.14
***************
*** 80,84 ****
PASSWORD => $this->db->f("password"),
COUNT => $count,
- PERMSEL => $this->perm->perm_sel("permission[$count]", $this->db->f("perms")),
AMP => $this->psl['amp']
));
--- 80,83 ----
***************
*** 242,248 ****
titlebar("100%","Add a new Author");
$this->author_templ->set_var(array(
ACTION_URL => $this->psl['phpself'],
- PERMSEL => $this->perm->perm_sel("permission", $this->db->f("perms")),
AUTHOR_ID => "",
NAME => "",
--- 241,255 ----
titlebar("100%","Add a new Author");
+ $this->author_templ->set_block("newauthor","perm_row","perm_rows");
+ $this->author_templ->set_block("newauthor","permhave_row","permhave_rows");
+
+ $allperms_ary = $this->perm->getPerms();
+ for( $i=0; $i < count($allperms_ary); $i++) {
+ $this->author_templ->set_var( PERM, $allperms_ary[$i]);
+ $this->author_templ->parse("perm_rows","perm_row",true);
+ }
+
$this->author_templ->set_var(array(
ACTION_URL => $this->psl['phpself'],
AUTHOR_ID => "",
NAME => "",
***************
*** 284,287 ****
--- 291,307 ----
$author_id = $this->db->Record[author_id];
+ $author_perms = $this->db->Record[perms];
+ $this->author_templ->set_block("newauthor","perm_row","perm_rows");
+ $this->author_templ->set_block("newauthor","permhave_row","permhave_rows");
+
+ $allperms_ary = $this->perm->getPerms();
+ while(list($k, $v) = each($allperms_ary)) {
+ $this->author_templ->set_var( PERM, $v);
+ if ($this->perm->perm_islisted($author_perms,$v)) {
+ $this->author_templ->parse("perm_rows","permhave_row",true);
+ } else {
+ $this->author_templ->parse("perm_rows","perm_row",true);
+ }
+ }
$this->author_templ->set_var(array(
***************
*** 296,300 ****
SECLEV => $this->db->f("seclev"),
COUNT => $count,
- PERMSEL => $this->perm->perm_sel("permission", $this->db->f("perms")),
AMP => $this->psl['amp']
));
--- 316,319 ----
|