Revision history for ControledLinks
Revision [19424]
Last edited on 2008-01-28 00:15:45 by JavaWoman [Modified links pointing to docs server]No Differences
Revision [17805]
Edited on 2007-12-12 10:11:07 by JavaWoman [prevent function references looking as page links]Additions:
=====Avoiding Errors with acls and link-handling=====
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->""LoadPage""($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->""HasAccess""("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->""HasAccess""("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->""LoadPage""($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->""LoadPage""($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->""HasAccess""("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->""HasAccess""("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->""LoadPage""($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
Deletions:
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->LoadPage($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->HasAccess("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->HasAccess("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->LoadPage($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
Additions:
=====Avoiding Errors with acls and link-handling=====
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->LoadPage($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->HasAccess("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->HasAccess("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->LoadPage($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->LoadPage($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->HasAccess("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->HasAccess("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->LoadPage($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
Deletions:
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->LoadPage($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->HasAccess("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->HasAccess("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->LoadPage($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
Additions:
=====Avoiding Errors with acls and link-handling=====
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->LoadPage($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->HasAccess("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->HasAccess("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->LoadPage($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->LoadPage($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->HasAccess("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->HasAccess("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->LoadPage($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
Deletions:
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->LoadPage($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->HasAccess("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->HasAccess("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->LoadPage($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
Additions:
=====Avoiding Errors with acls and link-handling=====
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->LoadPage($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->HasAccess("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->HasAccess("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->LoadPage($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
When building wakkalinks, wakkawiki doesn't care about acls of the target page and shows up an error-message, when s/o clicks on a link on which he has no apropriate rights. This is easy to avoid. We only have to tweak the $wakka->link function in wakka.php:
Lets have a look at the very last line in this function which looks similar to
return ($this->LoadPage($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->HasAccess("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->HasAccess("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->LoadPage($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
The $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. But then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----
Deletions:
lets have a look at the very last line in this function which looks similar to
return ($this->LoadPage($tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>");
replace it by these three lines:
$read = ($this->HasAccess("read", $tag) ? "<a href='".$this->href($method, $tag)."'>".$text."</a>" : $text);
$edit = ($this->HasAccess("write", $tag) ? "<a class='missingpage' href='".$this->href($missing, $tag)."'>$text</a>" : $text);
return ($this->LoadPage($tag) ? $read : $edit);
with this modification the hyperlink-stuff is dropped whereever the hasAccess-query failes and only the linking text is shown.
the $edit-variable is only useful, when the default write-access is restricted (configured in the index.php), because it always points to pages that don't exist. but then you can run a wakka-site with no "broken" links. dead links (i.e. those which normaly leads to an edit-form or to an error-page for those who have no write access) are only activated after an editor has createt the page, where that links points to, and thus your wakka-site won't look like to be "under construction".
----