Could it be possible to add multiple pages ala netvibes tabs ?

Comments

agentrickard’s picture

Status: Active » Postponed

Not right at the moment. This is part of a next-gen of feature requests. Here are the issues, which I am documenting here in case anyone wants to tackle them....

- The {mysite} table, which stores MySite user data and the {mysite_data} table, which stores the actual information for each item in your collection, both assume a one-to-one relationship between the User's UID (user id) and the data being stored.
- The UID column in both tables must be numeric, and must be a User's ID number.
- Permissions to edit or modify MySite content are attached to that single UID.

I mention the above because I think mutiple pages are similar to the request to have group MySite pages (tied to OG groups).

Adding an ability to have multiple tabbed-pages also reminds me of the concept of being able to create fuller HTML MySpace-style pages within MySite.

This is also related to a request to have access control settings for MySite content. I think all three issues are great features for the next release.

In order to make the current system work with multi-tabbed collections, we'd need a few things.

1) A concept of "page" in the {mysite_data} table.
2) A {mysite_page} table to store page information. Simple setup:

- mpid (INT), an internal identifer
- oid (INT), the MySite owner id (see #3, below).
- page_id (INT), the id # of this page, used for linking to the {mysite_data} table. Using this instead of mpid in the {mysite_data} table prevents us from needing an entry in the {mysite_page} table in order to save content.
- title (VARCHAR-80), the title of the page/tab.
- access (?), access rules for this page, if any?

3) Additions to {mysite} table
- owner (INT), the external USER ID or GROUP ID of the owner (this would replace the current UID)
- owner_type (string), the accunt type of the owner (likely 'user' as default or 'group')
- oid (INT, autoincrement), a new MySite owner ID value to use in MySite table instead of UID.

4) Additions to the {mysite_data} table.
- oid (INT), the ID of the owner (this would replace the current UID)
- page_id (INT), the MySite page id (from {mysite_page}, default would be 0.

5) A menu handler that is "page" sensitive.

6) Changes to the UI that let users define new pages and assign content items to those pages. This item is not a trivial task. When someone ads content, which page does it go to?

7) Probably a change to the variable settings that control how many elements can be added to a MySite page.

This is a ton of work, but probably in a good direction.

All that said, I/we really need to get 5.x.2 released before tackling any of this.

agentrickard’s picture

Version: 5.x-2.0-beta4 » master
Status: Postponed » Active

This is the foundation of the 5.x.3 series, in active development.

See http://drupal.org/node/170687 for more details.

agentrickard’s picture

I just started working on this on my local machine. Here's the first pass at the revised database schema

MySite db Schema 5.x.2

{mysite}
  uid
  title
  created
  updated
  layout
  style
  format
  message
  status
  theme
  confirm
  
{mysite_data}
  mid
  uid
  title
  type
  type_id
  sort
  format
  position
  settings
  locked
  
{mysite_content}  
  myid
  type
  type_key
  title
  content
  format
  base
  xml


MySite db Schema 5.x.3

{mysite}
  uid
  title
  created
  updated
  layout
  style
  format
  message
  status
  theme
  confirm

{mysite_page}
  pmid
  uid
  tmid
  page
  page_title
  layout
  style
  theme
  status
  
SQL query: 
CREATE TABLE `mysite_page` (
`pmid` INT NOT NULL AUTO_INCREMENT ,
`uid` INT NOT NULL ,
`tmid` INT DEFAULT '0' NOT NULL ,
`page` SMALLINT NOT NULL ,
`page_title` VARCHAR( 80 ) NOT NULL ,
`layout` VARCHAR( 40 ) NOT NULL ,
`style` VARCHAR( 40 ) NOT NULL ,
`theme` VARCHAR( 40 ) NOT NULL ,
`status` TINYINT( 1 ) NOT NULL ,
PRIMARY KEY ( `pmid` ) ,
INDEX ( `uid` , `tmid` , `page` )
) TYPE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;  
  
{mysite_data}
  mid
  uid
  pmid  
  title
  type
  type_id
  sort
  format
  position
  settings
  locked

SQL query: 
ALTER TABLE `mysite_data` ADD `pmid` INT DEFAULT '0' NOT NULL AFTER `uid` ;
ALTER TABLE `mysite_data` ADD INDEX ( `pmid` ) ;
  
{mysite_content}  
  myid
  type
  type_key
  title
  content
  format
  base
  xml  

{mysite_template}
  tmid
  cmid
  template
  description

SQL query: 
CREATE TABLE `mysite_template` (
`tmid` INT NOT NULL AUTO_INCREMENT ,
`cmid` INT NOT NULL ,
`template` VARCHAR( 80 ) NOT NULL ,
`description` VARCHAR( 255 ) ,
PRIMARY KEY ( `tmid` ) ,
INDEX ( `cmid` )
) TYPE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;  
  
{mysite_template_category}
  cmid
  category
  parent
  description
  

SQL query: 
CREATE TABLE `mysite_template_category` (
`cmid` INT NOT NULL AUTO_INCREMENT ,
`category` VARCHAR( 80 ) NOT NULL ,
`parent` INT NOT NULL ,
`description` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY ( `cmid` ) ,
INDEX ( `parent` )
) TYPE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;  
agentrickard’s picture

Assigned: Unassigned » agentrickard

The real issue here is that I'm going to have to rewrite the entire menu hook.

Arg.

agentrickard’s picture

StatusFileSize
new5.9 KB

Attached is the first pass at creating the new menu structure. It doesn't work right yet.

agentrickard’s picture

StatusFileSize
new141 bytes

Info file for testing the above.

agentrickard’s picture

StatusFileSize
new5.61 KB

I think this handles the menu the way it should.

agentrickard’s picture

I committed the first batch of changes to HEAD today. This puts most of the new menu structure in place, but breaks the module.

So be warned, HEAD is unstable.

summit’s picture

Hi Ken,
Subcribing to this also.
greetings,
Martijn

agentrickard’s picture

Just committed the new schema to HEAD. Now to exploit it in code.

Note that the schema I committed is slightly different from that listed above.

agentrickard’s picture

Status: Active » Needs review

Working version of this feature has been committed to HEAD. Testers appreciated.

mityok’s picture

I've made a clean 5.5 Drupal installation, installed the HEAD revision of MySite module. No other contributed modules installed.
I've opened MySite page for admin user and opened the "Settings" link (/mysite/1/edit/0). Module started an endless redirect.

After that I'm getting following error messages in my /admin page :

warning: key() [function.key]: Passed variable is not an array or object in
.......drupal.loc\www\sites\all\modules\mysite\mysite.module on line 923.

Looks like bug to me.

agentrickard’s picture

Very likely, I never said the code was stable.

MatBoy’s picture

On a 5.5 install I see the following error in the php-logs when I visit the MySite part when logged in as a user:

PHP Fatal error: Call to undefined function db_queryd()in /var/www/html/drupal/modules/mysite/mysite.module on line 366

agentrickard’s picture

Yes. That's a debug notice that requires the Devel module. Not surprising.

agentrickard’s picture

New commits today. Code should be more stable now.

MatBoy’s picture

I knew about the fact that it could be a bug :) But do I need more HEAD packages ? I thought the system was letting me know this after I installed the HEAD version... seemed to be quite OK all.

OK, great this is good news about the latest release.

Where to get these packages the best ? I now download the HEAD version here:

http://ftp.drupal.org/files/projects/

Or should I get a Dev version somewhere (form your site maybe ?)

Keep up the good work :)

agentrickard’s picture

I just rolled a 5.x.3-beta1 release to make testing easier.

Open new bugs as new issues, please.

http://drupal.org/node/204753

agentrickard’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.