Ticket #274 (closed defect: fixed)
Cannot view the source code of any Plugin examples
| Reported by: | revvi | Owned by: | |
|---|---|---|---|
| Priority: | important | Milestone: | 1.1 |
| Component: | Plugin (not included in core distro) | Version: | |
| Keywords: | Cc: |
Description
It looks like the ViewSource?() javascript cannot get ExampleId?. It is always null at the moment.
I found that Examples::AddPluginExampleFile?() is using long relative path.
public static function AddPluginExampleFile($strPluginName, $strExampleFileName) {
array_push(Examples::$PluginExamples, '/../../../../assets/plugins/' . $strPluginName . "/" . $strExampleFileName);
}
Then this following code in Examples::GetExampleId?() may be wrong for any plugin examples because the length of $strScriptPath (eq. /../../../../assets/plugins/....) is always longer than the QApplication::$ScriptName? (eq. /assets/plugins/...).
if (strtolower(substr(QApplicationBase::$ScriptName, strlen(QApplicationBase::$ScriptName) - strlen($strScriptPath))) == strtolower($strScriptPath)) return $intExampleIndex;
Sorry I did not provide the correction, perhaps you have better understanding on the underlying code :).
Change History
Note: See
TracTickets for help on using
tickets.
