BUG 10459 I added validate to plugin disabled IMPROVEMENT
This commit is contained in:
@@ -347,23 +347,14 @@ class PMDashlet extends DashletInstance implements DashletInterface
|
||||
}
|
||||
}
|
||||
|
||||
private static function setIncludePath ()
|
||||
{
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginsDashlets = $oPluginRegistry->getDashlets();
|
||||
foreach ($pluginsDashlets as $pluginDashlet) {
|
||||
set_include_path( get_include_path() . PATH_SEPARATOR . PATH_PLUGINS . $pluginDashlet . PATH_SEP );
|
||||
}
|
||||
}
|
||||
|
||||
private static function verifyPluginDashlet ($className)
|
||||
public static function verifyPluginDashlet ($className)
|
||||
{
|
||||
// 1-- if name class is in core
|
||||
$fileExist = PATH_CORE . 'classes' . PATH_SEP . 'class.' . $className . '.php';
|
||||
if (file_exists($fileExist)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 2-- if name class is in plugin
|
||||
|
||||
//---- verify the name plugin of the class
|
||||
@@ -372,13 +363,13 @@ class PMDashlet extends DashletInstance implements DashletInterface
|
||||
$pluginsDashlets = $oPluginRegistry->getDashlets();
|
||||
|
||||
foreach ($pluginsDashlets as $pluginDashlet) {
|
||||
$fileExist = PATH_PLUGINS . $pluginDashlet . PATH_SEP . $pluginDashlet . PATH_SEP . 'classes' . PATH_SEP . 'class.' . $className . '.php';
|
||||
$fileExist = PATH_PLUGINS . $pluginDashlet . PATH_SEP . 'classes' . PATH_SEP . 'class.' . $className . '.php';
|
||||
if (file_exists($fileExist)) {
|
||||
$pluginName = $pluginDashlet;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//---- verify if the plugin is active
|
||||
if ($pluginName == '') {
|
||||
return false;
|
||||
@@ -402,4 +393,13 @@ class PMDashlet extends DashletInstance implements DashletInterface
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static function setIncludePath ()
|
||||
{
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginsDashlets = $oPluginRegistry->getDashlets();
|
||||
foreach ($pluginsDashlets as $pluginDashlet) {
|
||||
set_include_path( get_include_path() . PATH_SEPARATOR . PATH_PLUGINS . $pluginDashlet . PATH_SEP );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ class Dashboard extends Controller
|
||||
foreach ($dashletsExist as $key => $value) {
|
||||
$listDashletAux[$value['DAS_INS_UID']] = $key;
|
||||
}
|
||||
|
||||
|
||||
$dashletsShow['0'] = array();
|
||||
foreach ($aConfiguration['ORDER']['0'] as $value) {
|
||||
if (isset($listDashletAux[$value])) {
|
||||
@@ -425,6 +425,7 @@ class Dashboard extends Controller
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->addSelectColumn( DashletPeer::DAS_UID );
|
||||
$criteria->addSelectColumn( DashletPeer::DAS_TITLE );
|
||||
$criteria->addSelectColumn( DashletPeer::DAS_CLASS );
|
||||
//ORDER BY
|
||||
$criteria->addAscendingOrderByColumn( DashletPeer::DAS_TITLE );
|
||||
|
||||
@@ -432,8 +433,9 @@ class Dashboard extends Controller
|
||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$dataset->next();
|
||||
while ($row = $dataset->getRow()) {
|
||||
$dashlets[] = array ($row['DAS_UID'],$row['DAS_TITLE']
|
||||
);
|
||||
if ($this->pmDashlet->verifyPluginDashlet($row['DAS_CLASS'])) {
|
||||
$dashlets[] = array ($row['DAS_UID'],$row['DAS_TITLE']);
|
||||
}
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user