public static function details($_model = null) { $module = static::$module; $modeler = $module::model()->modeler; $_model = $_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model)); $_o = (object) null; $_o->size = 'large'; $_o->icon_type = 'menu-icon'; $_o->icon_background = 'atom-icon-background'; $_o->menu = (object) null; $_o->menu->items = self::modelOperationsMenuItems(); $_o->head = 'Package Details'; $_o->body = array(''); $_o->body[] = (object) array('js' => 'registry.setContext({card:\'cards/package/details\',collection:\'packages\',node:\'' . $_model->id . '\'});'); $_o->body[] = CardKitHTML::sublineBlock('Name'); $_o->body[] = DOMElementKitJS::loadComponentHere(DOMElementKitJS::xhrCallObject('forms/package/name', array($_model->id)), $_model->name, 'settings'); $_o->body[] = CardKitHTML::sublineBlock('Package Sequode'); $_o->body[] = $_model->sequode_id != 0 && \Sequode\Application\Modules\Sequode\Modeler::exists($_model->sequode_id, 'id') ? DOMElementKitJS::loadComponentHere(DOMElementKitJS::xhrCallObject('forms/package/packageSequode', array($_model->id)), \Sequode\Application\Modules\Sequode\Modeler::model()->name, 'settings') : ModuleForm::render(static::$registry_key, 'packageSequode')[0]; $_o->body[] = CardKitHTML::sublineBlock('Package Token'); $_o->body[] = $_model->token; $_o->body[] = CardKitHTML::sublineBlock('<a target="_blank" href="/source/' . $_model->token . '">Download</a>'); $_o->body[] = CardKit::nextInCollection((object) array('model_id' => $_model->id, 'details_route' => 'cards/package/details')); if (\Sequode\Application\Modules\Account\Authority::isSystemOwner()) { $_o->body[] = CardKitHTML::modelId($_model); } return $_o; }
public static function search($_i, $limit = 100) { $modeler = static::$modeler; $_i->position = urldecode($_i->position); //$_i->field = urldecode($_i->field); if (!in_array($_i->position, array('=%', '%=%', '%=', '='))) { $_i->position = '=%'; } // if(!in_array($_i->field, array('name','ip_address'))){ $_i->field = 'name'; //} if (\Sequode\Application\Modules\Account\Authority::isSystemOwner()) { $where = array(); if (isset($shared_where)) { $where[] = $shared_where; } $where[] = array('field' => $_i->field, 'operator' => $_i->position, 'value' => $_i->search); $_model = new $modeler::$model(); $_model->getAll($where, 'id,name', $limit); $results = $_model->all; unset($_model); } else { $where = array(); if (isset($shared_where)) { $where[] = $shared_where; } $where[] = array('field' => $_i->field, 'operator' => $_i->position, 'value' => $_i->search); $where[] = array('field' => 'owner_id', 'operator' => '=', 'value' => \Sequode\Application\Modules\Account\Modeler::model()->id); $_model = new $modeler::$model(); $_model->getAll($where, 'id,name', $limit); $results = $_model->all; unset($_model); } return $results; }
public static function source($_model_token) { if (!(\Sequode\Application\Modules\Package\Modeler::exists($_model_token, 'token') && \Sequode\Application\Modules\Sequode\Modeler::exists(\Sequode\Application\Modules\Package\Modeler::model()->sequode_id, 'id') && (\Sequode\Application\Modules\Account\Authority::isOwner(\Sequode\Application\Modules\Package\Modeler::model()) || \Sequode\Application\Modules\Account\Authority::isSystemOwner()) && (\Sequode\Application\Modules\Account\Authority::isOwner(\Sequode\Application\Modules\Sequode\Modeler::model()) || \Sequode\Application\Modules\Account\Authority::isSystemOwner()))) { return; } header('Content-Type: text/plain', true); header('Content-Disposition: attachment; filename="' . \Sequode\Application\Modules\Package\Modeler::model()->name . '.class.php"'); echo \Sequode\Application\Modules\Package\Operations::download(); }
public static function details($_model_id = 0, $dom_id = 'CardsContainer') { $module = static::$module; $modeler = $module::model()->modeler; if (!($modeler::exists($_model_id, 'id') && (\Sequode\Application\Modules\Account\Authority::isOwner($modeler::model()) || \Sequode\Application\Modules\Account\Authority::isSystemOwner()))) { return; } return CardKitJS::placeCard(ModuleCard::render($module::$registry_key, __FUNCTION__), $dom_id); }
public static function name($_model_id, $dom_id) { $module = static::$module; $modeler = $module::model()->modeler; if (!($modeler::exists($_model_id, 'id') && (\Sequode\Application\Modules\Account\Authority::isOwner($modeler::model()) || \Sequode\Application\Modules\Account\Authority::isSystemOwner()))) { return; } return DOMElementKitJS::placeForm(ModuleForm::render($module::$registry_key, __FUNCTION__), $dom_id); }
public static function search($_i, $limit = 100) { $module = static::$module; $modeler = $module::model()->modeler; if ($_i->coded == 0 && $_i->sequenced == 0) { return array(); } elseif ($_i->coded == 1 && $_i->sequenced == 0) { $shared_where = array('field' => 'usage_type', 'operator' => '=', 'value' => '0'); } elseif ($_i->coded == 0 && $_i->sequenced == 1) { $shared_where = array('field' => 'usage_type', 'operator' => '=', 'value' => '1'); } $_i->position = urldecode($_i->position); if (!in_array($_i->position, array('=%', '%=%', '%=', '='))) { $_i->position = '=%'; } if (\Sequode\Application\Modules\Account\Authority::isSystemOwner()) { $where = array(); if (isset($shared_where)) { $where[] = $shared_where; } $where[] = array('field' => 'name', 'operator' => $_i->position, 'value' => $_i->search); $_model = new $modeler::$model(); $_model->getAll($where, 'id,name', $limit); $results = $_model->all; unset($_model); } else { $results = array(); if ($_i->my_sequodes == 1) { $where = array(); if (isset($shared_where)) { $where[] = $shared_where; } $where[] = array('field' => 'name', 'operator' => $_i->position, 'value' => $_i->search); $where[] = array('field' => 'owner_id', 'operator' => '=', 'value' => \Sequode\Application\Modules\Account\Modeler::model()->id); $_model = new $modeler::$model(); $_model->getAll($where, 'id,name', $limit); $results = array_merge($results, $_model->all); unset($_model); } if ($_i->shared_sequodes == 1) { $where = array(); if (isset($shared_where)) { $where[] = $shared_where; } $where[] = array('field' => 'name', 'operator' => $_i->position, 'value' => $_i->search); $where[] = array('field' => 'owner_id', 'operator' => '!=', 'value' => \Sequode\Application\Modules\Account\Modeler::model()->id); $where[] = array('field' => 'shared', 'operator' => '=', 'value' => '1'); $_model = new $modeler::$model(); $_model->getAll($where, 'id,name', $limit); $results = array_merge($results, $_model->all); unset($_model); } } return $results; }
public static function delete($_model_id) { $module = static::$module; $modeler = $module::model()->modeler; $operations = $module::model()->operations; $xhr_cards = $module::model()->xhr->cards; if (!($modeler::exists($_model_id, 'id') && (\Sequode\Application\Modules\Account\Authority::isOwner($modeler::model()) || \Sequode\Application\Modules\Account\Authority::isSystemOwner()))) { return; } forward_static_call_array(array($operations, __FUNCTION__), array()); $js = array(); $js[] = forward_static_call_array(array($xhr_cards, 'my'), array()); return implode(' ', $js); }
public static function details() { $module = static::$module; $modeler = $module::model()->modeler; $operations = $module::model()->operations; $_model = forward_static_call_array(array($modeler, 'model'), array()); $_o = (object) null; $_o->head = 'Account Detail'; $_o->icon_type = 'menu-icon'; $_o->icon_background = 'user-icon-background'; $_o->body[] = CardKitHTML::sublineBlock('Email'); $_o->body[] = $_model->email; if (\Sequode\Application\Modules\Account\Authority::isSystemOwner()) { $_o->body[] = CardKitHTML::modelId($_model); } return $_o; }
public static function main($key = null) { $module = static::$module; $modeler = $module::model()->modeler; $_model = new $modeler::$model(); if ($key == null) { if (\Sequode\Application\Modules\Account\Authority::isSystemOwner()) { $where = array(); $_model->getAll($where, 'id, process_description_node'); $nodes = array(); foreach ($_model->all as $object) { $nodes[] = '"' . $object->id . '":' . $object->process_description_node; } } else { $nodes = array(); $where = array(); $where[] = array('field' => 'owner_id', 'operator' => '!=', 'value' => \Sequode\Application\Modules\Account\Modeler::model()->id); $where[] = array('field' => 'shared', 'operator' => '=', 'value' => '1'); $_model->getAll($where, 'id, process_description_node'); foreach ($_model->all as $object) { $nodes[] = '"' . $object->id . '":' . $object->process_description_node; } $where = array(); $where[] = array('field' => 'owner_id', 'operator' => '=', 'value' => \Sequode\Application\Modules\Account\Modeler::model()->id); $_model->getAll($where, 'id, process_description_node'); foreach ($_model->all as $object) { $nodes[] = '"' . $object->id . '":' . $object->process_description_node; } } echo '{'; echo "\n"; if (0 < count($nodes)) { echo implode(",\n", $nodes); } echo "\n"; echo '}'; return; } elseif ($modeler::exists($key, 'id') && \Sequode\Application\Modules\Account\Authority::canView()) { echo $modeler::model()->process_description_node; return; } else { echo '{}'; return; } }
public static function details($_model = null) { $module = static::$module; $modeler = $module::model()->modeler; $_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model)); $_o = (object) null; $_o->size = 'large'; $_o->icon_type = 'menu-icon'; $_o->icon_background = 'user-icon-background'; $_o->menu = (object) null; $_o->menu->items = self::modelOperationsMenuItems(); $_o->head = 'User Detail'; $_o->body = array(''); $_o->body[] = CardKitHTML::sublineBlock('Name'); $_o->body[] = DOMElementKitJS::loadComponentHere(DOMElementKitJS::xhrCallObject('forms/user/updateName', array($modeler::model()->id)), $modeler::model()->name, 'settings'); $_o->body[] = CardKitHTML::sublineBlock('Password'); $_o->body[] = DOMElementKitJS::loadComponentHere(DOMElementKitJS::xhrCallObject('forms/user/updatePassword', array($modeler::model()->id)), 'Set Password', 'settings'); $_o->body[] = CardKitHTML::sublineBlock('Role'); \Sequode\Application\Modules\Role\Modeler::exists($modeler::model()->role_id, 'id'); $_o->body[] = DOMElementKitJS::loadComponentHere(DOMElementKitJS::xhrCallObject('forms/user/updateRole', array($modeler::model()->id)), \Sequode\Application\Modules\Role\Modeler::model()->name, 'settings'); $_o->body[] = CardKitHTML::sublineBlock('Active Status'); $_o->body[] = DOMElementKitJS::loadComponentHere(DOMElementKitJS::xhrCallObject('forms/user/updateActive', array($modeler::model()->id)), $modeler::model()->active == 1 ? 'Active' : 'Suspended', 'settings'); $_o->body[] = CardKitHTML::sublineBlock('Sign Up Date'); $_o->body[] = date('g:ia \\o\\n l jS F Y', $modeler::model()->sign_up_date); $_o->body[] = CardKitHTML::sublineBlock('Allowed Sequode Count'); $_o->body[] = $modeler::model()->allowed_sequode_count; $_o->body[] = CardKitHTML::sublineBlock('Favorite Sequodes'); $_o->body[] = $modeler::model()->sequode_favorites; $_o->body[] = CardKitHTML::sublineBlock('Email'); $_o->body[] = $modeler::model()->email; $_o->body[] = CardKit::ownedItemsCollectionTile('Sequode', 'Sequodes Created : ', $modeler::model()); $_o->body[] = CardKit::ownedItemsCollectionTile('Package', 'Packages Created : ', $modeler::model()); $_o->body[] = CardKit::ownedItemsCollectionTile('Token', 'Tokens Created : ', $modeler::model()); $_o->body[] = CardKit::nextInCollection((object) array('model_id' => $modeler::model()->id, 'details_route' => 'cards/user/details')); if (\Sequode\Application\Modules\Account\Authority::isSystemOwner()) { $_o->body[] = CardKitHTML::modelId($modeler::model()); } return $_o; }
public static function details($_model = null) { $module = static::$module; $modeler = $module::model()->modeler; $_model = $_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model)); $_o = (object) null; $_o->size = 'large'; $_o->icon_type = 'menu-icon'; $_o->icon_background = 'atom-icon-background'; $_o->menu = (object) null; $_o->menu->items = self::modelOperationsMenuItems(); $_o->head = 'Token Details'; $_o->body = array(''); $_o->body[] = (object) array('js' => 'registry.setContext({card:\'cards/token/details\',collection:\'tokens\',node:\'' . $_model->id . '\'});'); $_o->body[] = CardKitHTML::sublineBlock('Name'); $_o->body[] = DOMElementKitJS::loadComponentHere(DOMElementKitJS::xhrCallObject('forms/token/name', array($_model->id)), $_model->name, 'settings'); $_o->body[] = CardKitHTML::sublineBlock('Token'); $_o->body[] = $_model->token; $_o->body[] = CardKit::nextInCollection((object) array('model_id' => $_model->id, 'details_route' => 'cards/token/details')); if (\Sequode\Application\Modules\Account\Authority::isSystemOwner()) { $_o->body[] = CardKitHTML::modelId($_model); } return $_o; }
public static function updateActive($_model_id, $json) { $module = static::$module; $modeler = $module::model()->modeler; $operations = $module::model()->operations; $xhr_cards = $module::model()->xhr->cards; $input = json_decode(rawurldecode($json)); if (!(\Sequode\Application\Modules\Account\Authority::isSystemOwner() && $modeler::exists($_model_id, 'id'))) { return; } $operations::updateActive($input->active); return $xhr_cards::details($modeler::model()->id); }
public static function internalForms($_model = null) { $module = static::$module; $modeler = $module::model()->modeler; $_model = $_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model)); $_o = (object) null; $_o->size = 'large'; $_o->icon_type = 'menu-icon'; $_o->icon_background = 'sequode-icon-background'; $_o->menu = (object) null; $_o->menu->items = self::modelOperationsMenuItems(); $_o->head = $_model->name; $sequence = json_decode($_model->sequence); foreach ($sequence as $loop_sequence_key => $loop_model_id) { $_o->body[] = ModuleCard::render($module::$registry_key, 'internalPositionForms', array($loop_sequence_key)); } if (\Sequode\Application\Modules\Account\Authority::isSystemOwner()) { $_o->body[] = CardKitHTML::modelId($_model); } return $_o; }
public static function updateCodeSharing($sequode_model_id = 0, $value = 1) { if (!(\Sequode\Application\Modules\Account\Authority::isSystemOwner() && \Sequode\Application\Modules\Sequode\Modeler::exists($sequode_model_id, 'id') && \Sequode\Application\Modules\Sequode\Authority::isCode() && \Sequode\Application\Modules\Sequode\Authority::isCodingTypeFunction())) { return; } \Sequode\Application\Modules\Sequode\Operations::updateSharing($value); exit; }