BEdita API doc | 4-cactus
  • Class
  • Tree
  • Deprecated
  • Download

Classes

  • Addon
  • AddressbookController
  • AddressbookShell
  • AdminController
  • Alias
  • Annotation
  • ApiAuthComponent
  • ApiBaseController
  • ApiFormatterComponent
  • ApiUploadComponent
  • ApiValidatorComponent
  • AppController
  • AppError
  • AppHelper
  • Application
  • AppModel
  • Area
  • AreasController
  • Audio
  • AuthenticationsController
  • BannedIp
  • BEAppModel
  • BEAppObjectModel
  • BeAuthComponent
  • BeAuthFacebookComponent
  • BeAuthGoogleComponent
  • BeAuthTwitterComponent
  • BeCallbackManager
  • BeConfigure
  • BeCustomPropertyComponent
  • BeditaAnnotationModel
  • BeditaBaseShell
  • BeditaCollectionModel
  • BeditaContentModel
  • BeditaExportFilter
  • BeditaImportFilter
  • BeditaObjectModel
  • BeditaProductModel
  • BeditaShell
  • BeditaSimpleObjectModel
  • BeditaSimpleStreamModel
  • BeditaStreamModel
  • BeEmbedFlashHelper
  • BeEmbedHtml5Helper
  • BeEmbedMediaHelper
  • BeErrorCode
  • BeExceptionHandler
  • BEFile
  • BeFileHandlerComponent
  • BeFormHelper
  • BeFrontHelper
  • BeHashComponent
  • BeHtmlHelper
  • BeLangTextComponent
  • BeLib
  • BeMailComponent
  • BEObject
  • BeObjectCache
  • BePaginatorToolbarHelper
  • BeSchema
  • BeSecurityComponent
  • BeSystem
  • BeSystemComponent
  • BeThumb
  • BeTimeHelper
  • BeToolbarHelper
  • BeTreeComponent
  • BeTreeHelper
  • BeUploadToObjComponent
  • BeurlHelper
  • BeVimeoComponent
  • BeYoutubeComponent
  • BuildFilterBehavior
  • CacheableBehavior
  • CacheShell
  • CallbackBehavior
  • CaptchaComponent
  • Caption
  • CaptionsBehavior
  • Card
  • CardsImportFilter
  • Category
  • CleanupDataTask
  • CleanupTask
  • Comment
  • CommentsController
  • CompactResultBehavior
  • Content
  • CreateIndexFieldsBehavior
  • DataShell
  • DataTransfer
  • DateItem
  • DbadminShell
  • DeleteDependentObjectBehavior
  • DeleteObjectBehavior
  • DeployShell
  • Document
  • DocumentsController
  • DumpModel
  • EditorialContentsShell
  • EditorNote
  • Event
  • EventLog
  • EventsController
  • FilesController
  • ForeignDependenceSaveBehavior
  • FrontendController
  • FrontendShell
  • GalleriesController
  • Gallery
  • GeoTag
  • GettextShell
  • Git
  • GravatarHelper
  • Group
  • HashJob
  • History
  • HomeController
  • Image
  • ImageInfoHelper
  • JsonExportFilter
  • JsonImportFilter
  • JsonView
  • LangText
  • Link
  • MailGroup
  • MailGroupCard
  • MailJob
  • MailLog
  • MailMessage
  • MailShell
  • MailTemplate
  • Mask
  • MediaShell
  • MigrateDumpModel
  • MigrateShell
  • Migration
  • MigrationBase
  • MigrationDateItemsShell
  • Module
  • ModulesController
  • ModuleShell
  • MultimediaController
  • NewsController
  • NewsletterController
  • NewsletterShell
  • NotifyBehavior
  • ObjectEditor
  • ObjectProperty
  • ObjectRelation
  • ObjectType
  • ObjectUser
  • PagesController
  • Permission
  • PermissionModule
  • PermsHelper
  • Product
  • Property
  • PropertyOption
  • PublicationShell
  • RedisShell
  • RelationCheck
  • RelationRepair
  • RelationShell
  • RelationStats
  • RemoveDummyNameBehavior
  • ResponseHandlerComponent
  • RestClientModel
  • Revision
  • RevisionObjectBehavior
  • SearchText
  • SearchTextSaveBehavior
  • Section
  • SectionDummy
  • SessionFilterComponent
  • SessionFilterHelper
  • ShortNews
  • SmartyView
  • SoapClientModel
  • SplitterSql
  • StatisticsController
  • Stream
  • StreamLog
  • StreamsController
  • Svn
  • TagsController
  • ThemeSmartyView
  • ThumbnailHelper
  • ThumbShell
  • TransactionComponent
  • TransactionFS
  • TranslationsController
  • Tree
  • TrHelper
  • User
  • UserProperty
  • UsersController
  • Utility
  • Version
  • Video
  • VimeoHelper
  • WebmarksController
  • XmlExportFilter
  • XmlImportFilter
  • XmlJsonConverter
  • XmlView
  • YoutubeHelper

Interfaces

  • ApiAuthInterface
  • MediaProviderInterface
  • UploadableInterface

Exceptions

  • BeditaAjaxException
  • BEditaAllowURLException
  • BeditaBadRequestException
  • BeditaConflictException
  • BEditaDeleteStreamObjException
  • BeditaException
  • BEditaFileExistException
  • BeditaForbiddenException
  • BeditaFrontAccessException
  • BeditaHashException
  • BEditaInfoException
  • BeditaInternalErrorException
  • BEditaIOException
  • BeditaLengthRequiredException
  • BeditaMailException
  • BEditaMediaProviderException
  • BeditaMethodNotAllowedException
  • BEditaMIMEException
  • BeditaNotFoundException
  • BeditaNotImplementedException
  • BeditaPublicationException
  • BeditaRuntimeException
  • BEditaSaveStreamObjException
  • BeditaServiceUnavailableException
  • BeditaUnauthorizedException
  • BEditaUploadPHPException
  • BEditaURLException
  1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 
<?php
/*-----8<--------------------------------------------------------------------
 *
 * BEdita - a semantic content management framework
 *
 * Copyright 2008 ChannelWeb Srl, Chialab Srl
 *
 * This file is part of BEdita: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * BEdita is distributed WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with BEdita (see LICENSE.LGPL).
 * If not, see <http://gnu.org/licenses/lgpl-3.0.html>.
 *
 *------------------------------------------------------------------->8-----
 */

if (!class_exists('ClassRegistry')) {
    App::import('Core', array('ClassRegistry'));
}

if (!class_exists('File')) {
    App::import('Core', 'File');
}

/**
 * BEdita libs class. Instantiate and put in the registry other classes
 *
 */

class BeLib {

    /**
     * used to flatten arrays in BeLib::arrayValues()
     * @var array
     */
    private $__arrayFlat = array();

    public static function &getInstance() {
        static $instance = array();
        if (!$instance) {
            $instance[0] =& new BeLib();
        }
        return $instance[0];
    }

    /**
     * return an instance of a class (by default search in libs dir)
     * If class is not instantiated do it and put in CakePHP registry
     *
     * @param string $name class name (file has to be underscorized MyClass => my_class.php)
     * @param string or array $paths paths where search class file (search in libs folder by default)
     * @return class instance
     */
    public static function &getObject($name, $paths=null) {
        if (!$libObject = ClassRegistry::getObject($name)) {
            if (!class_exists($name)) {
                $file = Inflector::underscore($name) . ".php";
                if (empty($paths)) {
                    App::import("Lib", $name);
                } else {
                    $paths = (is_array($paths))? $paths : array($paths);
                    if (!App::import("File", $name, true, $paths, $file)) {
                        $return = false;
                        return $return;
                    }
                }
            }
            if (class_exists($name)) {
                $libObject = new $name();
                ClassRegistry::addObject($name, $libObject);
            }
        }
        return $libObject;
    }

    /**
     * Return the instance of BeCallbackManager
     *
     * @return BeCallbackManager
     */
    public static function eventManager() {
        static $eventManager = null;
        if (!$eventManager) {
            $eventManager = self::getObject('BeCallbackManager');
        }
        return $eventManager;
    }

    /**
     * Return the instance of BeErrorCode or other specific error code object
     *
     * @param string $errorCode The error code
     * @param array $options An array of options to initialize the error code object
     * @return BeErrorCode
     */
    public static function errorCode($errorCode, array $options = array()) {
        $fileName = strtolower($errorCode);
        $className = Inflector::camelize($fileName);
        $errorCodePath = DS . 'libs' . DS . 'errors' . DS . 'codes' . DS; 
        $filePath = $errorCodePath . $fileName . '.php';

        $found = App::import('File', $className, array('file' =>  APP . $filePath)); 

        if (!$found && !BACKEND_APP) {
            $found = App::import('File', $className, array('file' => BEDITA_CORE_PATH . $filePath));
        }

        if ($found) {
            return new $className($errorCode, $options);
        }

        App::import('File', 'BeErrorCode', array('file' => BEDITA_CORE_PATH . $errorCodePath . 'be_error_code.php'));

        return new BeErrorCode($errorCode, $options);
    }

    /**
     * check if a class name is a BEdita object type
     *
     * @param string $name the class name
     * @param mixed $paths array of paths or string path where searching the class
     *                     leave empty to use ClassRegistry
     * @return boolean
     */
    public function isBeditaObjectType($name, $paths=null) {
        if (!$paths) {
            $classInstance = ClassRegistry::init($name);
        } else {
            $classInstance = $this->getObject($name, $paths);
        }
        if (!$classInstance) {
            return false;
        }
        $parents = class_parents($classInstance);
        if (empty($parents) || !in_array("BEAppObjectModel", $parents)) {
            return false;
        }
        return true;
    }

    /**
     * check if a file name is already used in Configure::$type."Paths"
     *
     * @param string $filename
     * @param string $type (models, controllers, ...) see App::path
     * @param array of path to exclude from search (paths have to end with DS trailing slash)
     * @return boolean
     */
    public function isFileNameUsed($filename, $type, $excludePaths=array()) {
        $typePaths = App::path($type);
        if (empty($typePaths)) {
            throw new BeditaException(__("No paths to search for " . $type, true));
        }
        $paths = array_diff($typePaths ,$excludePaths);
        $folder = new Folder();
        foreach ($paths as $p) {
            $folder->cd($p);
            $ls = $folder->read(true, true);
            if (!empty($ls[1]) && in_array($filename, $ls[1])) {
                return true;
            }
        }
        return false;
    }

    /**
     * Starting from a file `$name` return a unique file path
     *
     * For example passing `$name = 'filename.jpg'
     * it returns `/03/e6/filename.jpg` or `/03/e6/filename-1.jpg`
     * if the first path tested already exists and so on.
     * Use mediaRoot for base path.
     *
     * @param string $name The file name
     * @param string $prefix The prefix used for building path
     * @return string
    */
    public function uniqueFilePath($name, $prefix = null)  {
        $md5 = md5($name);
        preg_match('/(\w{2})(\w{2})/', $md5, $dirs);
        array_shift($dirs);
        
        $pointPosition = strrpos($name, '.');
        $filename = $tmpname = substr($name, 0, $pointPosition);
        $ext = substr($name, $pointPosition);
        $mediaRoot = Configure::read('mediaRoot');
        if ($prefix != null) {
            $mediaRoot.= DS . $prefix;
        }
        $dirsString = implode(DS, $dirs);
        $counter = 1;
        while (file_exists($mediaRoot . DS . $dirsString . DS . $filename . $ext)) {
            $filename = $tmpname . '-' . $counter++;
        }

        return DS . $dirsString . DS . $filename . $ext;
    }

    /**
     * Modify a string to get friendly url version.
     * With a regexp you can choose which characters to preserve.
     *
     *
     *
     * @param string $value
     * @param string $keep, regexp fragment with characters to keep, e.g. "\." will preserve points,
     *                      "\.\:" points and semicolons
     * @return string
     */
    public function friendlyUrlString($value, $keep = "") {
        if (empty($value)) {
            $value = "";
        }
        if (is_numeric($value)) {
            $value = "n" . $value;
        }

        $value = strtolower(htmlentities($value, ENT_NOQUOTES | ENT_IGNORE, "UTF-8"));

        // replace accent, uml, tilde,... with letter after & in html entities
        $value = preg_replace("/&(.)(uml);/", "$1e", $value);
        $value = preg_replace("/&(.)(acute|grave|cedil|circ|ring|tilde|uml);/", "$1", $value);
        // replace special chars and space with dash (first decode html entities)
        // exclude chars in $keep regexp fragment
        $regExp = "/[^a-z0-9\-_" . $keep . "]/i";
        $value = preg_replace($regExp, "-", html_entity_decode($value,ENT_NOQUOTES,"UTF-8" ) ) ;
        // replace two or more consecutive dashes with one dash
        $value = preg_replace("/[\-]{2,}/", "-", $value);

        // trim dashes in the beginning and in the end of nickname
        return trim($value,"-");
    }

    /**
     * Strip scripts, images, whitespace or all together on $data
     * using Sanitize::stripScripts, Sanitize::stripImages, Sanitize::stripWhitespace, Sanitize::stripAll methods
     * see Sanitize class of cakephp for more info
     *
     * @param mixed $data string or array
     * @param array $options, possible values are:
     *              "what" => "scripts" (default), "images", "whitespace", "all",
     *              "recursive" => true (default) strip recursively on $data
     *
     * @return mixed
     */
    public function stripData($data, array $options = array()) {
        $options = array_merge(array("what" => "scripts", "recursive" => true), $options);
        $method = "strip".ucfirst($options["what"]);
        App::import("Sanitize");

        if (method_exists("Sanitize", $method)) {
            if (is_array($data)) {
                foreach ($data as $key => $value) {
                    if (is_array($value) && $options["recursive"]) {
                        $data[$key] = $this->stripData($value, $options);
                    } else {
                        $data[$key] = Sanitize::$method($value);
                    }
                }
            } else {
                $data = Sanitize::$method($data);
            }
        }

        return $data;
    }

    /**
     * Return array with model name and eventually specific type (see $config[validate_resource][mime][Application])
     * from mime type
     *
     * @param string $mime  mime type
     * @return mixed array|boolean
     */
    public static function getTypeFromMIME($mime) {
        $conf = Configure::getInstance();
        if (empty($mime)) {
            return false;
        }
        $models = $conf->validate_resource['mime'];
        foreach ($models as $model => $regs) {
            foreach ($regs as $key => $reg) {
                if (is_array($reg)) {
                    foreach ($reg['mime_type'] as $val) {
                        if (preg_match($val, $mime)) {
                            return array('name' => $model, 'specificType' => $key);
                        }
                    }
                } elseif (preg_match($reg, $mime)) {
                    return array('name' => $model);
                }
            }
        }

        return false;
    }

    /**
     * return values of multidimensional array
     *
     * @param array $array
     * @param boolean $addStringKeys if it's true add string keys to the returned array
     * @return array
     */
    public function arrayValues(array $array, $addStringKeys = false) {
        $this->__arrayFlat = array();
        array_walk_recursive($array , array($this, "arrayValuesCallback"), $this);
        if ($addStringKeys) {
            $keys = $this->arrayKeys($array);
            $this->__arrayFlat = array_merge($this->__arrayFlat, $keys);
        }
        return $this->__arrayFlat;
    }

    /**
     * callback method used from BeLib::arrayValues
     *
     * @param mixed $item
     * @param mixed $key
     * @param array $values
     */
    static private function arrayValuesCallback(&$item, $key, $obj) {
        $obj->__arrayFlat[] = $item;
    }

    /**
     * return keys of multidimensional array
     *
     * @param array $ar
     * @param boolean $stringKeys if it's true add string keys to the returned array
     * @return array
     */
    public function arrayKeys(array $ar, $stringKeys = true) {
        $keys = array();
        foreach($ar as $k => $v) {
            if (!$stringKeys || ($stringKeys && is_string($k))) {
                $keys[] = $k;
            }
            if (is_array($ar[$k])) {
                $keys = array_merge($keys, $this->arrayKeys($ar[$k], $stringKeys));
            }
        }
        return $keys;
    }

    /**
     * Transform any numeric date in SQL date/datetime string format
     * Date types accepted: "little-endian"/"middle-endian"/"big-endian"
     *
     * if little endian, expected format id dd/mm/yyyy format, or dd.mm.yyyy, or dd-mm-yyyy
     * if middle endian, expected format is mm/dd/yyyy format, or mm.dd.yyyy (USA standard)
     * if big endian ==> yyyy-mm-dd
     * Examples:
     *
     *  Little endian
     *  "22/04/98", "22/04/1998", "22.4.1998", "22-4-98", "22 4 98", "1998", "98", "22.04", "22/4", "22 4"
     *
     *  Middle endian
     *  "4/22/98", "02/22/1998", "4.22.1998", "4-22-98", "4/22", "04.22"
     *
     * If format is not valid or string is not parsable, an exception maybe thrown
     *
     * @param string $val, string in generic numeric form
     * @param string $dateType, "little-endian"/"middle-endian"/"big-endian"
     *
     */
    public function sqlDateFormat($value, $dateType = "little-endian") {
        // check if it's already in SQL format
        $pattern = "/^[0-9]{4}-[0-9]{2}-[0-9]{2}$|^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/";
        if (preg_match($pattern, $value)) {
            return $value;
        }
        $pattern = "/^[0-9]{4}-[0-9]{2}-[0-9]{2}$|^[0-9]{4}-[0-9]{2}-[0-9]{2}$/";
        if (preg_match($pattern, $value)) {
            return $value;
        }
        $d = false;

        if($dateType === "little-endian") {
            // dd/mm/yyyy - dd.mm.yyy like formats
            $pattern = "/^([0-9]{1,2})(\/|-|\.|\s)([0-9]{1,2})(\/|-|\.|\s)([0-9]{1,4})$/";
            $match = array();
            if (preg_match($pattern, $value, $match)) {
                $d = $match[5] . "-" . $match[3] . "-" . $match[1];
            }
            // dd/mm - dd.mm like formats
            if($d === false) {
                $pattern = "/^([0-9]{1,2})(\/|-|\.|\s)([0-9]{1,2})$/";
                $match = array();
                if (preg_match($pattern, $value, $match)) {
                    $d = $match[3] . "/" . $match[1];
                }
            }
        } elseif($dateType === "middle-endian") {
            // mm/dd/yyyy - mm.dd.yyyy like formats
            $pattern = "/^([0-9]{1,2})(\/|-|\.|\s)([0-9]{1,2})(\/|-|\.|\s)([0-9]{1,4})$/";
            $match = array();
            if (preg_match($pattern, $value, $match)) {
                $d = $match[5] . "-" . $match[1] . "-" . $match[3];
            }
            // dd/mm - dd.mm like formats
            if($d === false) {
                $pattern = "/^([0-9]{1,2})(\/|-|\.|\s)([0-9]{1,2})$/";
                $match = array();
                if (preg_match($pattern, $value, $match)) {
                    $d = $match[1] . "/" . $match[3];
                }
            }
        }

        if($d === false) {
            $pattern = "/^([0-9]{4})$/";
            $match = array();
            if (preg_match($pattern, $value, $match)) {
                $d = $match[1] . "-01-01";
            }
        }

        if($d === false) {
            $pattern = "/^([0-9]{1,2})$/";
            $match = array();
            if (preg_match($pattern, $value, $match)) {
                $y = intval($match[1]);
                $date = new DateTime();
                // which year 08, 12, 18, 28 ??? - if earlier than current year add 2000, otherwise add 1900
                $yNow = intval($date->format("Y"));
                $ys = strval($y + ((2000 + $y > $yNow) ? 1900 : 2000));
                $d = $ys . "-01-01";
            }
        }

        if($d === false) {
            $d = $value; // use $value if pattern not recognized
        }
        $date = new DateTime($d);
        return $date->format('Y-m-d');
    }

    /**
     * return conventional variable/method name starting from nickname
     * replacing '-' with '_' and camelizing (not first char)
     *
     * example: this-is-my-nickname become thisIsMyNickName
     *
     * @param string $nickname
     * @return string
     */
    public function variableFromNickname($nickname) {
        $variableName = str_replace("-", "_", $nickname); // example: my-nickname => my_nickname
        $variableName = Inflector::variable($variableName); // example => sitemapXml, myNickname
        return $variableName;
    }

    /**
     * generate an array of frontend folders
     *
     * @return array
     */
    public function getFrontendFolders() {
        $sel = array();
        $folder = new Folder(BEDITA_FRONTENDS_PATH);
        $ls = $folder->read();
        foreach ($ls[0] as $dir) {
            if($dir[0] !== '.' ) {
                $sel[] = BEDITA_FRONTENDS_PATH. DS .$dir;
            }
        }
        return $sel;
    }

    /**
     * generate an array of addon folders
     *
     * @return array
     */
    public function getAddonFolders() {
        $sel = array();
        $folder = new Folder(BEDITA_ADDONS_PATH);
        $ls = $folder->read();
        foreach ($ls[0] as $dir) {
            if($dir[0] !== '.' ) {
                $sel[] = BEDITA_ADDONS_PATH. DS .$dir;
            }
        }
        return $sel;
    }

    /**
     * generate an array of plugin module folders
     *
     * @return array
     */
    public function getPluginModuleFolders() {
        $sel = array();
        $folder = new Folder(BEDITA_MODULES_PATH);
        $ls = $folder->read();
        foreach ($ls[0] as $dir) {
            if($dir[0] !== '.' ) {
                $sel[] = BEDITA_MODULES_PATH. DS .$dir;
            }
        }
        return $sel;
    }

    /**
     * update Addons after project update
     *
     * @param string $path
     * @return array
     */
    public function remoteUpdateAddons($path) {
        // update enabled addons
        if (strstr($path, BEDITA_ADDONS_PATH)) {
            $folder = new Folder(BEDITA_ADDONS_PATH);
            $type = trim(substr($path, strlen(BEDITA_ADDONS_PATH)), DS);
            if ($type != "vendors") {
                $Addon = ClassRegistry::init("Addon");
                $enabledFolder = $Addon->getEnabledFolderByType($type);
                $folder->cd($enabledFolder);
                $list = $folder->read();
                if (!empty($list[1])) {
                    foreach ($list[1] as $addonFile) {
                        if (strstr($addonFile, '.DS_Store') === false) {
                            $Addon->update($addonFile, $type);
                        }
                    }
                }
            }
        }
    }

}

?>
BEdita API doc | 4-cactus API documentation generated by ApiGen