本文整理汇总了PHP中Kwc_Abstract::getComponentClasses方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Abstract::getComponentClasses方法的具体用法?PHP Kwc_Abstract::getComponentClasses怎么用?PHP Kwc_Abstract::getComponentClasses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwc_Abstract
的用法示例。
在下文中一共展示了Kwc_Abstract::getComponentClasses方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllMaintenanceJobs
public static function getAllMaintenanceJobs()
{
static $ret;
if (isset($ret)) {
return $ret;
}
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (is_instance_of($c, 'Kwf_Util_Maintenance_JobProviderInterface')) {
$providerClasses[] = $c;
}
}
foreach (Kwf_Model_Abstract::findAllInstances() as $model) {
if ($model instanceof Kwf_Util_Maintenance_JobProviderInterface) {
$providerClasses[] = get_class($model);
}
}
$jobClasses = array();
foreach ($providerClasses as $c) {
$jobClasses = array_merge($jobClasses, call_user_func(array($c, 'getMaintenanceJobs')));
}
$jobClasses = array_unique($jobClasses);
$ret = array();
foreach ($jobClasses as $i) {
$ret[] = new $i();
}
usort($ret, array('Kwf_Util_Maintenance_Dispatcher', '_compareJobsPriority'));
return $ret;
}
示例2: _build
protected function _build($options)
{
echo "\nsettings...\n";
if (!file_exists('build/component')) {
mkdir('build/component');
}
Kwf_Component_Settings::resetSettingsCache();
foreach (glob('build/component/*') as $f) {
unlink($f);
}
$fileName = 'build/component/settings';
try {
$data = Kwf_Component_Settings::_getSettingsCached();
} catch (Kwf_Trl_BuildFileMissingException $e) {
$originatingException = $e->getSettingsNonStaticTrlException();
if ($originatingException) {
throw $originatingException;
}
throw $e;
}
foreach ($data as $cmp => $settings) {
self::_checkSettings($cmp, $settings);
}
file_put_contents($fileName, serialize($data));
$componentClasses = Kwc_Abstract::getComponentClasses();
echo "masterLayouts...\n";
Kwf_Component_MasterLayout_Abstract::_buildAll($componentClasses);
echo "layouts...\n";
Kwf_Component_Layout_Abstract::_buildAll($componentClasses);
}
示例3: getLanguages
public static function getLanguages()
{
$config = Zend_Registry::get('config');
$langs = array();
if ($config->webCodeLanguage) {
$langs[] = $config->webCodeLanguage;
}
$possibleUserLanguages = array();
if ($config->languages) {
foreach ($config->languages as $lang => $name) {
$possibleUserLanguages[] = $lang;
}
}
$userModel = Kwf_Registry::get('userModel');
if (isset($userModel->getAuthedUser()->language) && $userModel->getAuthedUser()->language && in_array($userModel->getAuthedUser()->language, $possibleUserLanguages)) {
$langs[] = $userModel->getAuthedUser()->language;
}
if (Kwf_Component_Data_Root::getComponentClass()) {
$lngClasses = array();
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (Kwc_Abstract::hasSetting($c, 'baseProperties') && in_array('language', Kwc_Abstract::getSetting($c, 'baseProperties'))) {
$lngClasses[] = $c;
}
}
$lngs = Kwf_Component_Data_Root::getInstance()->getComponentsBySameClass($lngClasses, array('ignoreVisible' => true));
foreach ($lngs as $c) {
if (Kwf_Registry::get('acl')->getComponentAcl()->isAllowed($userModel->getAuthedUser(), $c)) {
$langs[] = $c->getLanguage();
}
}
}
return array_unique($langs);
}
示例4: getListeners
public function getListeners()
{
$ret = parent::getListeners();
$ret[] = array('class' => null, 'event' => 'Kwf_Component_Event_Page_ParentChanged', 'callback' => 'onPageParentChanged');
foreach (Kwc_Abstract::getComponentClasses() as $class) {
$classWithoutPoint = $class;
if (($pos = strpos($class, '.')) !== false) {
$classWithoutPoint = substr($class, 0, $pos);
}
if (Kwc_Abstract::getFlag($class, 'hasAlternativeComponent') && in_array($this->_class, call_user_func(array($classWithoutPoint, 'getAlternativeComponents'), $class))) {
$ret[] = array('class' => $class, 'event' => 'Kwf_Component_Event_Component_HasContentChanged', 'callback' => 'onParentHasContentChanged');
$ret[] = array('class' => $class, 'event' => 'Kwf_Component_Event_Component_RecursiveHasContentChanged', 'callback' => 'onParentRecursiveHasContentChanged');
}
foreach (Kwc_Abstract::getSetting($class, 'generators') as $generator) {
if ($generator['class'] == 'Kwf_Component_Generator_Box_StaticSelect' && is_array($generator['component']) && in_array($this->_class, $generator['component'])) {
foreach ($generator['component'] as $componentClass) {
if ($componentClass == $this->_class) {
continue;
}
$ret[] = array('class' => $componentClass, 'event' => 'Kwf_Component_Event_Component_HasContentChanged', 'callback' => 'onParentHasContentChanged');
$ret[] = array('class' => $componentClass, 'event' => 'Kwf_Component_Event_Component_RecursiveHasContentChanged', 'callback' => 'onParentRecursiveHasContentChanged');
}
}
}
}
return $ret;
}
示例5: _getAllLanguages
private function _getAllLanguages()
{
$config = Zend_Registry::get('config');
$langs = array();
if ($config->webCodeLanguage) {
$langs[] = $config->webCodeLanguage;
}
if ($config->languages) {
foreach ($config->languages as $lang => $name) {
$langs[] = $lang;
}
}
if (Kwf_Component_Data_Root::getComponentClass()) {
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (Kwc_Abstract::getFlag($c, 'hasAvailableLanguages')) {
foreach (call_user_func(array($c, 'getAvailableLanguages'), $c) as $i) {
if (!in_array($i, $langs)) {
$langs[] = $i;
}
}
}
}
}
$langs = array_unique($langs);
return $langs;
}
示例6: alterBackendOrderForm
public function alterBackendOrderForm(Kwc_Shop_AddToCartAbstract_FrontendForm $form)
{
$component = null;
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (is_instance_of($c, 'Kwc_Shop_Products_Directory_Component')) {
$detailClasses = Kwc_Abstract::getChildComponentClasses($c, 'detail');
foreach ($detailClasses as $key => $class) {
if (Kwc_Abstract::getChildComponentClass($class, 'addToCart') == $this->_class) {
$component = $key;
}
}
}
}
$m = Kwf_Model_Abstract::getInstance('Kwc_Shop_Products');
$s = $m->select();
$s->whereEquals('visible', 1);
if ($component) {
$s->whereEquals('component', $component);
}
$s->order('pos');
$data = array();
foreach ($m->getRows($s) as $product) {
$data[] = array($product->current_price_id, $product->__toString() . ' (' . $product->current_price . ' €)');
}
$form->prepend(new Kwf_Form_Field_Select('shop_product_price_id', trlKwfStatic('Product')))->setValues($data)->setAllowBlank(false);
}
示例7: findModels
public function findModels()
{
$ret = array();
foreach (Kwc_Abstract::getComponentClasses() as $componentClass) {
$cls = strpos($componentClass, '.') ? substr($componentClass, 0, strpos($componentClass, '.')) : $componentClass;
$m = call_user_func(array($cls, 'createOwnModel'), $componentClass);
if ($m) {
self::_findAllInstancesProcessModel($ret, $m);
}
$m = call_user_func(array($cls, 'createChildModel'), $componentClass);
if ($m) {
self::_findAllInstancesProcessModel($ret, $m);
}
foreach (Kwc_Abstract::getSetting($componentClass, 'generators') as $g) {
if (isset($g['model'])) {
self::_findAllInstancesProcessModel($ret, $g['model']);
}
}
}
if ($root = Kwf_Component_Data_Root::getInstance()) {
foreach ($root->getPlugins('Kwf_Component_PluginRoot_Interface_Models') as $plugin) {
foreach ($plugin->getModels() as $model) {
self::_findAllInstancesProcessModel($ret, $model);
}
}
}
return $ret;
}
示例8: getListeners
public function getListeners()
{
$ret = array();
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (Kwc_Abstract::getFlag($c, 'requestHttps')) {
$ret[] = array('class' => $c, 'event' => 'Kwf_Component_Event_Component_Added', 'callback' => 'onComponentAdded');
}
}
return $ret;
}
示例9: getItemDirectoryClasses
public static function getItemDirectoryClasses($directoryClass)
{
$ret = array();
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (is_instance_of($c, 'Kwc_Blog_Directory_Component')) {
$ret[] = $c;
}
}
return $ret;
}
示例10: getItemDirectoryClasses
public static function getItemDirectoryClasses($directoryClass)
{
$ret = array();
$class = self::getSetting($directoryClass, 'showDirectoryClass');
foreach (Kwc_Abstract::getComponentClasses() as $cls) {
if (is_instance_of($cls, $class)) {
$ret[] = $cls;
}
}
return $ret;
}
示例11: getListeners
public function getListeners()
{
$ret = parent::getListeners();
foreach (Kwc_Abstract::getComponentClasses() as $class) {
if (in_array('Kwc_Advanced_SearchEngineReferer_Component', Kwc_Abstract::getParentClasses($class))) {
$m = Kwc_Abstract::createChildModel($class);
$ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onRowInsert');
}
}
return $ret;
}
示例12: getListeners
public function getListeners()
{
$ret = parent::getListeners();
foreach (Kwc_Abstract::getComponentClasses() as $class) {
if ($this->_canCreateUsIndirectly($class)) {
$ret[] = array('class' => $class, 'event' => 'Kwf_Component_Event_ComponentClass_ContentChanged', 'callback' => 'onClassContentChanged');
$ret[] = array('class' => $class, 'event' => 'Kwc_Abstract_Image_ImageChangedEvent', 'callback' => 'onImageChanged');
}
}
return $ret;
}
示例13: getListeners
public function getListeners()
{
$ret = parent::getListeners();
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (Kwc_Abstract::getFlag($c, 'assetsPackage')) {
$ret[] = array('class' => $c, 'event' => 'Kwf_Component_Event_Component_Added', 'callback' => 'onComponentAddedRemoved');
$ret[] = array('class' => $c, 'event' => 'Kwf_Component_Event_Component_Removed', 'callback' => 'onComponentAddedRemoved');
}
}
return $ret;
}
示例14: _getCreatingClasses
/**
* Returns all component classes that can create $createdClass. Optionally filtering instances of $createClass.
*/
protected function _getCreatingClasses($createdClass, $createClass = null)
{
$ret = array();
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (!$createClass || in_array($createClass, Kwc_Abstract::getParentClasses($c))) {
if (Kwc_Abstract::getChildComponentClasses($c, array('componentClass' => $createdClass))) {
$ret[] = $c;
}
}
}
return $ret;
}
示例15: _build
protected function _build()
{
if (!file_exists('build/trl')) {
mkdir('build/trl');
}
foreach (glob('build/trl/*') as $f) {
unlink($f);
}
$config = Zend_Registry::get('config');
$langs = array();
if ($config->webCodeLanguage) {
$langs[] = $config->webCodeLanguage;
}
if ($config->languages) {
foreach ($config->languages as $lang => $name) {
$langs[] = $lang;
}
}
try {
if (Kwf_Component_Data_Root::getComponentClass()) {
foreach (Kwc_Abstract::getComponentClasses() as $c) {
if (Kwc_Abstract::getFlag($c, 'hasAvailableLanguages')) {
foreach (call_user_func(array($c, 'getAvailableLanguages'), $c) as $i) {
if (!in_array($i, $langs)) {
$langs[] = $i;
}
}
}
}
}
} catch (Kwf_Trl_BuildFileMissingException $e) {
$originatingException = $e->getSettingsNonStaticTrlException();
if ($originatingException) {
throw $originatingException;
}
throw $e;
}
foreach ($langs as $l) {
if ($l != $config->webCodeLanguage) {
$c = $this->_loadTrlArray(Kwf_Trl::SOURCE_WEB, $l, true);
file_put_contents(Kwf_Trl::generateBuildFileName(Kwf_Trl::SOURCE_WEB, $l, true), serialize($c));
$c = $this->_loadTrlArray(Kwf_Trl::SOURCE_WEB, $l, false);
file_put_contents(Kwf_Trl::generateBuildFileName(Kwf_Trl::SOURCE_WEB, $l, false), serialize($c));
}
if ($l != 'en') {
$c = $this->_loadTrlArray(Kwf_Trl::SOURCE_KWF, $l, true);
file_put_contents(Kwf_Trl::generateBuildFileName(Kwf_Trl::SOURCE_KWF, $l, true), serialize($c));
$c = $this->_loadTrlArray(Kwf_Trl::SOURCE_KWF, $l, false);
file_put_contents(Kwf_Trl::generateBuildFileName(Kwf_Trl::SOURCE_KWF, $l, false), serialize($c));
}
}
}