Author: weaverryan
Date: 2010-01-18 05:19:09 +0100 (Mon, 18 Jan 2010)
New Revision: 26800
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/sfSympalAssetReplacer.class.php
Log:
[1.4][sfSympalPlugin][1.0] Adding url option to link syntax, [link:1 url=true],
which allows for just a url (not a full anchor tag) to be output.
Modified:
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/sfSympalAssetReplacer.class.php
===================================================================
---
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/sfSympalAssetReplacer.class.php
2010-01-18 04:18:57 UTC (rev 26799)
+++
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAssetsPlugin/lib/sfSympalAssetReplacer.class.php
2010-01-18 04:19:09 UTC (rev 26800)
@@ -131,10 +131,21 @@
foreach ($replacements as $replacement)
{
$contentObject = $contentObjects[$replacement['id']];
- $label = isset($replacement['options']['label']) ?
$this->replace($replacement['options']['label']) : 'Link to content id
#'.$replacement['id'];
- unset($replacement['options']['label']);
-
- $content = str_replace($replacement['replace'], link_to($label,
$contentObject->getRoute(), $replacement['options']), $content);
+
+ $urlOnly = isset($replacement['options']['url']) ?
$replacement['options']['url'] : false;
+ unset($replacement['options']['url']);
+
+ if ($urlOnly)
+ {
+ $content = str_replace($replacement['replace'],
url_for($contentObject->getRoute(), $replacement['options']), $content);
+ }
+ else
+ {
+ $label = isset($replacement['options']['label']) ?
$this->replace($replacement['options']['label']) : 'Link to content id
#'.$replacement['id'];
+ unset($replacement['options']['label']);
+
+ $content = str_replace($replacement['replace'], link_to($label,
$contentObject->getRoute(), $replacement['options']), $content);
+ }
}
return $content;
}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.