This has been done by a plug-in (I understand) by Yogi, and others have been playing around with it.
I am posting a new thread, as I would like to offer a suggestion for inclusion in the the base Links code as the ultimate solution to hiding certain database fields from editors (such as custom advertising fields etc).
The changes need to take place in browser.pm. I'll use the link add form as an example, but the other forms are essentially the same (very easy change). Just to re-iterate, this is not a suggestion to change your code, but rather a suggestion to GT Staff to change browser.pm for future versions of Links SQL.
In this example (Link add form), line 890-900 of Browser.pm (v2.1.1):
{
navbar => $navbar,
Name => $category_info->{Name},
category_id => $category_id,
form => $h->form ( { defaults => 1, skip => [ qw /CatLinks.LinkID Timestmp/ ],
hide => [qw/ID isNew isChanged isPopular Status Date_Checked Timestmp/],
file_field => 1, file_delete => 1
}) . "<input type=hidden name='CatLinks.CategoryID' value='$category_id'>"
} );
}Above is the current code.
I suggest two additional admin settings be created, which allow a list of columns to be hidden in both the Links and Category tables. The idea comes from your plugin list Yogi (thanks).
Admin->Settings->Misc: Hide table fields from editors:
Links_Table_Hide_List : isPopular, Advertising_Money..... etc
Category_Table_Hide_List : ImageURL, etc
This also alows the plugin developer to use these $CFG->{*_Table_Hide_List} settings on clients sites, when displaying table data. A big plus for developement.
The code would simply have the line changed where the hidden list is being made:
{
navbar => $navbar,
Name => $category_info->{Name},
category_id => $category_id,
form => $h->form ( { defaults => 1, skip => [ qw /CatLinks.LinkID Timestmp/ ],
hide => $CFG->{Links_Table_Hide_List},
file_field => 1, file_delete => 1
}) . "<input type=hidden name='CatLinks.CategoryID' value='$category_id'>"
} );
}
Now to me, this looks like such an easy solution, and much easier for GT to place this into the core Links code than for users to muck around with plug-ins, module changes or other methods. It is also apparent that this is a much wanted feature going by the posts in various threads, and requests I have personally received from users of my plug-ins.
Maybe my method above might be slightly incorrect, I am not sure. But the idea is certainly there.
http://www.iuni.com/...tware/web/index.html
Links Plugins
I am posting a new thread, as I would like to offer a suggestion for inclusion in the the base Links code as the ultimate solution to hiding certain database fields from editors (such as custom advertising fields etc).
The changes need to take place in browser.pm. I'll use the link add form as an example, but the other forms are essentially the same (very easy change). Just to re-iterate, this is not a suggestion to change your code, but rather a suggestion to GT Staff to change browser.pm for future versions of Links SQL.
In this example (Link add form), line 890-900 of Browser.pm (v2.1.1):
Code:
$self->print_template ( "browser_link_add_form.html", {
navbar => $navbar,
Name => $category_info->{Name},
category_id => $category_id,
form => $h->form ( { defaults => 1, skip => [ qw /CatLinks.LinkID Timestmp/ ],
hide => [qw/ID isNew isChanged isPopular Status Date_Checked Timestmp/],
file_field => 1, file_delete => 1
}) . "<input type=hidden name='CatLinks.CategoryID' value='$category_id'>"
} );
}
I suggest two additional admin settings be created, which allow a list of columns to be hidden in both the Links and Category tables. The idea comes from your plugin list Yogi (thanks).
Admin->Settings->Misc: Hide table fields from editors:
Links_Table_Hide_List : isPopular, Advertising_Money..... etc
Category_Table_Hide_List : ImageURL, etc
This also alows the plugin developer to use these $CFG->{*_Table_Hide_List} settings on clients sites, when displaying table data. A big plus for developement.
The code would simply have the line changed where the hidden list is being made:
Code:
$self->print_template ( "browser_link_add_form.html", {
navbar => $navbar,
Name => $category_info->{Name},
category_id => $category_id,
form => $h->form ( { defaults => 1, skip => [ qw /CatLinks.LinkID Timestmp/ ],
hide => $CFG->{Links_Table_Hide_List},
file_field => 1, file_delete => 1
}) . "<input type=hidden name='CatLinks.CategoryID' value='$category_id'>"
} );
}
Now to me, this looks like such an easy solution, and much easier for GT to place this into the core Links code than for users to muck around with plug-ins, module changes or other methods. It is also apparent that this is a much wanted feature going by the posts in various threads, and requests I have personally received from users of my plug-ins.
Maybe my method above might be slightly incorrect, I am not sure. But the idea is certainly there.
http://www.iuni.com/...tware/web/index.html
Links Plugins