query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Add an origin path and override path to make them linked.
public static function addOverridePath($origin, $override) { self::$overrides[$origin] = $override; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function addPathMap($origin_path, $mapped_path)\n {\n $origin_path = self::tidyPath($origin_path);\n $mapped_path = self::tidyPath($mapped_path);\n self::$path_map_list[$origin_path] = $mapped_path;\n }", "private function getPathOrigin()\n {\n return base_path($this->path_origin) . \"/\";\n }", "public function setOrigin($origin)\n {\n }", "public function setOrigin($origin)\n {\n $this->origin = $origin;\n }", "public function addPath($path);", "public function addPath($path);", "public function addPath($path);", "public function set_path() {\n\t\t$this->path = $this->get_base_path( explode( $this->path_delimiter , plugin_dir_path( __FILE__ ) ) );\n\t}", "public function prependPath($path);", "private function addPath(?string $path) : void\n {\n $this->path = $path ?: self::DEFAULT_PATH;\n }", "function setRealPaths (){\n $this->json_students['path'] = realpath(dirname(dirname(dirname(dirname(__FILE__))))).'/'.$this->json_main_folder_name.'/'.$this->json_students['name'].'.json';\n\t\t$this->json_students['url'] = URL.$this->json_main_folder_name.'/'.$this->json_students['name'].'.json';\n }", "public function prepandLocation($path)\n\t{\n\t\t$path = (array) $path;\n\n\t\t$this->paths = array_merge($path, $this->paths);\n\t}", "public function setPath( $path );", "public function set_url() {\n\t\t$this->url = $this->get_base_path( explode( '/' , plugins_url( '', __FILE__ ) ) );\n\t}", "function setPath($path = null);", "public function testUrlPathOverride()\n {\n $url = new TestObjectUrl(self::URL);\n $this->assertEquals(\n 'https://user:[email protected]:443/path/prefix/2015/10/01/36704-event/36704-2?param2=value2#fragment2',\n $url->getUrlOverride()\n );\n }", "public function pathLineToRelative ($x, $y) {}", "public function setOriginAttribute($value)\n {\n $this->attributes['origin'] = mb_strtolower(trim($value, '/'));\n }", "public function setPath($to)\n\t{\n\t\tstatic::$path = $to;\n\t}", "public function withPath(string $newPath): UrlInterface;", "function add_http($path) {\n\n\treturn ( strpos($path, \"http://\") === FALSE ) ? \"http://\" . $path : $path;\n}", "public function addPath(string $namespace, ?string $path = null): void;", "function setPath($path)\n {\n// Necessary, as the path may be posted from the backend, with the\n// ASCMS_PATH_OFFSET prepended!\n File::path_relative_to_root($path);\n// TODO: Use the inverse of self::getThumbnailPath()\n $path = preg_replace('/\\.thumb$/', '', $path);\n if ($path == self::PATH_NO_IMAGE) {\n $this->path = '';\n } else {\n $this->path = strip_tags($path);\n }\n }", "function setPath () {\r\n\t\t\t$num_args = func_num_args();\r\n\t\t\tif ($num_args < 1) {\r\n\t\t\t\t$this->OPTIONS['INCLUDE_PATHS'] = array();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tfor ($i = 0; $i < $num_args; $i++) {\r\n\t\t\t\t$thispath = func_get_arg($i);\r\n\t\t\t\tarray_push($this->OPTIONS['INCLUDE_PATHS'], realpath($thispath));\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "protected function setURI()\n {\n $this->uri = $this->protocol . $this->host . '/' . $this->prefix . $this->path;\n }", "public function pathMoveToRelative ($x, $y) {}", "static function link($path,$args=null)\n {\n // No Schema == Local\n if (!preg_match('/^\\w+:\\/\\//',$path)) {\n $path = sprintf('%s/%s',rtrim(self::$base,'/'),ltrim($path,'/'));\n }\n // Add Args\n if ( (is_array($args)) && (count($args)>0) ) {\n $path.= '?' . http_build_query($args);\n }\n return $path;\n }", "abstract public function setPath($path);", "public function setPath($path);", "function ssh_setpath($path){\n\t\t$this->path = $path;\n\t}" ]
[ "0.6131177", "0.6095395", "0.58867204", "0.5693606", "0.5558324", "0.5558324", "0.5558324", "0.5538396", "0.5498986", "0.54895294", "0.54708195", "0.530277", "0.5299851", "0.5296007", "0.52682483", "0.5259705", "0.52548325", "0.5249671", "0.524208", "0.5229896", "0.521867", "0.5203873", "0.52011335", "0.5200905", "0.5193086", "0.5191", "0.51894563", "0.51864207", "0.5176087", "0.5175552" ]
0.72530514
0
Remove an override path, make it unlinked with origin path.
public static function removeOverridePath($path) { unset(self::$overrides[$path]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function addOverridePath($origin, $override)\r\n\t{\r\n\t\tself::$overrides[$origin] = $override;\r\n\t}", "public function unsetLocationOverrides(): void\n {\n $this->locationOverrides = [];\n }", "public function remove($path);", "public function remove($path);", "public function remove($path);", "public function proccess_custom_path( $override_path = false ) {\n\t\tif ( false !== $override_path ) {\n\t\t\t $this->process_path = $override_path;\n\t\t}\n\t\t$i = $this->search_array();\n\t\tif ( false !== $i ) {\n\t\t\t$cnt = count( $this->process_path );\n\t\t\t$i++;\n\t\t\tfor ( $i; $i <= $cnt; $i++ ) {\n\t\t\t\t// trim off each library directory, end trimming at the base directory\n\t\t\t\tarray_pop( $this->process_path );\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "public function removeEntryPath($path)\n {\n unset($this->paths['entries'][$path]);\n }", "function drupal_clear_path_cache() {\n drupal_lookup_path('wipe');\n}", "public function removeModelForPath($model, $path);", "public function actionFixlink()\n\t{\n\t\t$symfile = YiiBase::getPathOfAlias('application').\"/views\";\n\t\t$strOriginal = YiiBase::getPathOfAlias('application.views').\"-\".strtolower(\"cities\");\n\t\t@unlink($symfile);\n\t\tsymlink($strOriginal, $symfile);\n\t}", "public function addOverwritePath($path) {\n\t\t$this->sanitizePath($path);\n\t\t$this->overwritePath[md5($path)] = $path;\n\t}", "protected function removeOverrides()\n {\n $override_files = array(\n _PS_OVERRIDE_DIR_ . 'classes/cache/CacheRedis.php',\n );\n\n foreach ($override_files as $override_file) {\n if (file_exists($override_file)) {\n try {\n unlink($override_file);\n } catch (\\Exception $e) {\n return false;\n }\n }\n }\n\n return true;\n }", "public function removeTaxonomyPath($path)\n {\n unset($this->paths['taxonomies'][$path]);\n }", "public static function getOverridePath($path)\r\n\t{\r\n\t\tif (!empty(self::$overrides[$path]))\r\n\t\t{\r\n\t\t\treturn self::$overrides[$path];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $path;\r\n\t\t}\r\n\t}", "public function redefineRelation()\n {\n $GLOBALS['dbi'] = new RelationCleanupDbiMock();\n unset($_SESSION['relation'][$GLOBALS['server']]);\n }", "public function getPathWithBaseRemoved()\n {\n if (null !== $this->removePath) {\n return str_replace(DIRECTORY_SEPARATOR, '/', str_replace($this->removePath, '', $this->getPath()));\n }\n \n return $this->getPath();\n }", "private function getOverridePath()\n\t{\n\t\treturn str_replace([CLASSOVERRIDER_BASE_NS, '\\\\'], [CLASSOVERRIDER_PATH, '/'], $this->class);\n\t}", "public function deletePath()\n {\n $this->getLogger()->info(\"Removing installation path {$this->getPath()}...\");\n $this->fs->remove($this->getPath());\n $this->getLogger()->info(\"Path {$this->getPath()} was successfully removed.\");\n }", "public function uninstallFallbackAcl();", "public function removeAlternateFieldOverride($overridden_field)\n\t{\n\t\t$this->removeFieldOverride('hl.alternateField', $overridden_field);\n\t}", "public function removeGlobalPath($path)\n {\n unset($this->paths['globals'][$path]);\n }", "public function remove_previous_icon($path = NULL) {\n\n if (empty($path)) {\n\n return;\n\n }\n\n $previous_original_path = str_ireplace(\"_thumb\", \"\", $path);\n\n unlink($path);\n\n unlink($previous_original_path);\n\n return;\n\n }", "function uninstall() {\n\t\t\\mod\\user\\Main::delRight('Manage paprasse');\n\t\t// delete route\n\t\t\\mod\\regroute\\Main::unregister($this->id);\n\t\tparent::uninstall();\n\t}", "public function delete_path_alias() {\n $source = $this->get_source_path();\n $destination_0 = $this->get_destination_path(0);\n $destination_1 = $this->get_destination_path(1);\n $destination_2 = $this->get_destination_path(2);\n\n if (empty($source) || empty($destination_0)) {\n return FALSE;\n }\n\n $transaction = db_transaction();\n\n $deleted = $this->p_delete_path_alias($source, $destination_0, $transaction);\n\n if ($deleted && !empty($destination_1)) {\n $deleted = $this->p_delete_path_alias($source, $destination_1, $transaction);\n }\n\n if ($deleted && !empty($destination_2)) {\n $deleted = $this->p_delete_path_alias($source, $destination_2, $transaction);\n }\n\n return $deleted;\n }", "public function deleteViewPath()\n {\n FileHelper::removeDirectory($this->getViewPath());\n }", "abstract public function unlink($filePath);", "public function replaceModelForPath($oldModel, $newModel, $path);", "protected function removeDublicates()\n {\n foreach ($this->possibleHookDefs AS $defPath) {\n if ($defPath != $this->getMainDefFile()) {\n $this->unlink($defPath);\n }\n }\n }", "public function setStripPath( $path )\n\t{\n\t\t/* Ensure that there is no trailing slash */\n\t\t$path = rtrim( $path, '/' );\n\t\t\n\t\t$this->_stripPathString = $path;\n\t}", "public static function clearPaths(): void\n {\n self::clearBasePaths();\n }" ]
[ "0.5982596", "0.5613561", "0.54954386", "0.54954386", "0.54954386", "0.53311044", "0.52966416", "0.5199683", "0.51937443", "0.51726973", "0.51293", "0.51204187", "0.51114494", "0.5101043", "0.5095012", "0.5094293", "0.5085607", "0.50783825", "0.5054119", "0.50396603", "0.49454153", "0.49451217", "0.4942962", "0.49289867", "0.49263823", "0.49110612", "0.48927754", "0.48722017", "0.48543376", "0.4849739" ]
0.7544257
0
Get Braintree Client Token
public function getClientToken() { $yaml = new Parser(); $parse = $yaml->parse(file_get_contents('../src/LoveThatFit/CartBundle/Resources/config/config.yml')); Braintree_Configuration::environment($parse[$this->env]["environment"]); Braintree_Configuration::merchantId($parse[$this->env]["merchant_id"]); Braintree_Configuration::publicKey($parse[$this->env]["public_key"]); Braintree_Configuration::privateKey($parse[$this->env]["private_key"]); $clientToken = Braintree_ClientToken::generate(); return $clientToken; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_token() {\r\n $token = $this->braintree_lib->create_client_token();\r\n return $token;\r\n }", "public function getClientToken(){\n\n try {\n\n $token = $this->braintreeApi->generateClientToken();\n \n $response = [ 'data' => [\n \"token\" => $token\n ]];\n\n }catch(\\Exception $e){\n $status = 500;\n $response = [\n 'errors' => $e->getMessage()\n ];\n \\Log::error('Module Icommercebraintree: Get Client Token - Message: '.$e->getMessage());\n \\Log::error('Module Icommercebraintree: Get Client Token - Code: '.$e->getCode());\n }\n\n return response()->json($response, $status ?? 200);\n }", "public function getClientToken();", "public function getToken(){\n\t $url = \\Drupal::state()->get('endpoint');\n\t\t$data = array('grant_type' => 'client_credentials', 'client_id' => \\Drupal::state()->get('cliend_id'),'client_secret' => \\Drupal::state()->get('cliend_secret'));\n\n\t\t// use key 'http' even if you send the request to https://...\n\t\t$options = array(\n\t\t 'http' => array(\n\t\t 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n\t\t 'method' => 'POST',\n\t\t 'content' => http_build_query($data)\n\t\t )\n\t\t);\n\t\t$context = stream_context_create($options);\n\t\t$result = file_get_contents($url, false, $context);\n\t $params = explode('\",\"',file_get_contents($url, false, $context));\n\n\t $token = explode('\":\"',array_shift($params));\n return $token[true];\n }", "function create_client_token($customerId = NULL){\n \tif($customerId != NULL)\n {\n $clientToken = Braintree_ClientToken::generate(array('customerId'=>$customerId));\n }else{\n $clientToken = Braintree_ClientToken::generate();\n\n }\n return $clientToken;\n\n }", "public static function get_token()\n\t{\n\t\treturn Charcoal::token( isset( Charcoal::$config['nonce'] ) ? Charcoal::$config['nonce'] : null );\n\t}", "public function token(){\n\n\t\tif ( empty( $this->token ) ) {\n\t\t\t$this->request_checkout_token();\n\t\t}\n\n\t\treturn $this->token;\n\t}", "protected function sandBoxToken()\n {\n $url = 'https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n $curl = curl_init();\n curl_setopt( $curl, CURLOPT_URL, $url );\n $credentials = base64_encode( $this -> key.':'.$this -> secret );\n curl_setopt( $curl, CURLOPT_HTTPHEADER, [ 'Authorization: Basic '.$credentials ] );\n curl_setopt( $curl, CURLOPT_HEADER, false );\n curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );\n\n $curl_response = curl_exec( $curl );\n\n return json_decode( $curl_response ) -> access_token;\n }", "public function getToken()\n {\n return $this->token();\n }", "public function getToken() {\n return $this->get('token')->value;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken()\r\n {\r\n return $this->token;\r\n }", "protected function getToken()\n {\n $this->token = $this->client->getToken($this->aID);\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }" ]
[ "0.8852185", "0.80409503", "0.73043454", "0.7022216", "0.70120806", "0.70094806", "0.6953533", "0.6816519", "0.6693476", "0.66896373", "0.6689475", "0.6670648", "0.6670648", "0.6670648", "0.6670648", "0.6670648", "0.66641986", "0.66260535", "0.6624101", "0.6624101", "0.6624101", "0.6624101", "0.6624101", "0.6624101", "0.6624101", "0.6624101", "0.6624101", "0.6624101", "0.6624101", "0.6624101" ]
0.8464261
1
Create a new Admin resource instance. The resource will be validated then returned. An event is dispatched before the validation and another after.
public function create(AdminResource $definition): AdminResource;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onCreate(CreateResourceEvent $event)\n {\n $request = $this->container->get('request');\n $form = $this->container->get('form.factory')->create(new ExampleType, new Example());\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n //gets the new resource.\n $example = $form->getData();\n //give it back to the event.\n $event->setResources(array($example));\n $event->stopPropagation();\n\n return;\n }\n\n //if the form is invalid, renders the form with its errors.\n $content = $this->container->get('templating')->render(\n 'ClarolineCoreBundle:Resource:createForm.html.twig',\n array(\n 'form' => $form->createView(),\n 'resourceType' => 'claroline_example'\n )\n );\n //give it back to the event.\n $event->setErrorFormContent($content);\n $event->stopPropagation();\n }", "public function create(Admin $admin)\n {\n //\n }", "public function createResource()\n {\n $this->call('make:resource', [\n 'name' => $this->singular() . \"Resource\",\n ]);\n }", "public function adminCreate()\n {\n $this->logedInTo = '/user';\n\n return $this->create();\n }", "public function onCreate(CreateResourceEvent $event)\n {\n // Create form\n $form = $this->container->get('form.factory')->create('innova_path', new Path());\n\n // Try to process form\n $request = $this->container->get('request');\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $path = $form->getData();\n\n $published = $form->get('published')->getData();\n $event->setPublished($published);\n\n $path->initializeStructure();\n\n // Send new path to dispatcher through event object\n $event->setResources(array ($path));\n }\n else {\n $content = $this->container->get('templating')->render(\n 'ClarolineCoreBundle:Resource:createForm.html.twig',\n array(\n 'form' => $form->createView(),\n 'resourceType' => 'innova_path'\n )\n );\n\n $event->setErrorFormContent($content);\n }\n\n $event->stopPropagation();\n }", "public function create(Admin $admin)\n {\n return $admin->checkPermissionAccess('admin-add');\n }", "public function create()\n {\n $this->data['titlePage'] = trans('admin.obj_new',['obj' => trans('admin.'.$this->titleSingle)]);\n $breadcrumbs = array();\n $breadcrumbs[] = [ 'title' => trans('admin.home'), 'link' => route($this->routeRootAdmin), 'icon' => $this->iconDashboard ];\n $breadcrumbs[] = [ 'title' => trans('admin.'.$this->titlePlural), 'link' => route(GetRouteAdminResource($this->resourceRoute)), 'icon' => $this->iconMain ];\n $breadcrumbs[] = [ 'title' => $this->data['titlePage'], 'icon' => $this->iconNew ];\n $this->data['breadcrumbs'] = $breadcrumbs;\n\n return view(GetViewAdminResource($this->resourceView, 'create'))->with($this->data);\n }", "public static function authorizedToCreate(AdminRequest $request)\n {\n return $request->newResource()->authorizedTo($request, 'create');\n }", "public function adminCreate()\n {\n //\n }", "public function store(RoleStoreValidate $request)\n {\n $role = Role::create($request->validated());\n $role->givePermissionTo($request->input('permission'));\n return new RoleResource($role);\n }", "public function create()\n {\n return view('admin.resource.create');\n }", "public function actionCreate()\n {\n $model = new ResourceManagement();\n $transaction = Yii::$app->getDb()->beginTransaction();\n if (Yii::$app->request->isPost) {\n try{\n if (!$model->load(Yii::$app->request->post()) || !$model->save()) {\n throw new Exception(Yii::t('app', $model->getFirstErrorMessage()));\n }\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->id]);\n }catch (Exception $e) {\n $transaction->rollBack();\n Helper::Alert(Yii::t('app', $e->getMessage()));\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //Check if user is authorized to access this page\n $request->user()->authorizeRoles(['admin', 'hrmanager', 'hruser']);\n }", "public function create()\n {\n $user = User::get();\n $group = Group::get();\n \n if(Module::hasAccess(\"Resources\", \"create\")) {\n $module = Module::get('Resources');\n \n return view('la.resources.create', [\n 'module' => $module,\n 'user' =>$user,\n 'group' =>$group]);\n } else {\n return redirect(config('laraadmin.adminRoute') . \"/\");\n }\n }", "public function store(CreateAdminAPIRequest $request)\n {\n $input = $request->all();\n\n $admins = $this->adminRepository->create($input);\n\n return $this->sendResponse($admins->toArray(), 'Admin saved successfully');\n }", "public function postCreate()\r\n\t{\r\n\t\t// Get the inputs, with some exceptions\r\n\t\t$inputs = Input::except('csrf_token');\r\n\r\n\t\t$role = new Role;\r\n\t\t$permission = new Permission;\r\n\r\n\t\t$role->name = $inputs['name'];\r\n\t\t\r\n\r\n\t\tif ($role->save())\r\n\t\t{\r\n\t\t\t// Save permissions\r\n\t\t\t$permissionIds = Input::get('permissions');\r\n\r\n\t\t\tif (is_array($permissionIds))\r\n\t\t\t{\r\n\t\t\t\t$permissionIds = array_keys($permissionIds);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$role->savePermissions($permissionIds);\r\n\r\n\t\t\t// Was the role created?\r\n\t\t\tif ($role->id)\r\n\t\t\t{\r\n\t\t\t\t// Redirect to the new role page\r\n\t\t\t\treturn Redirect::to('admin/roles/' . $role->id . '/edit')->with('success', Lang::get('form.create.success', array('resource' => Lang::get('role.resource.singular.lowercase'))));\r\n\t\t\t}\r\n\r\n\t\t\t// Redirect to the role create page\r\n\t\t\treturn Redirect::to('admin/roles/create')->withInput()->with('error', Lang::get('form.create.error', array('resource' => Lang::get('role.resource.singular.lowercase'))));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$error = $role->errors()->all();\r\n\r\n\t\t\t// Form validation failed\r\n\t\t\treturn Redirect::to('admin/roles/create')->withInput()->with('error', $error);\r\n\t\t}\r\n\t}", "public function handle(CreateResourceRequest $request)\n {\n $resource = $request->resource();\n\n $resource::authorizeToCreate($request);\n\n $resource::validateForCreation($request);\n\n $model = DB::transaction(function () use ($request, $resource) {\n [$model, $callbacks] = $resource::fill(\n $request, $request->findModelOrNew()\n );\n\n if(is_null($model->getKey()) && $request->viaSession == 'true') {\n return $model;\n }\n\n if ($request->viaRelationship()) {\n $request->findParentModelOrFail()\n ->{$request->viaRelationship}()\n ->save($model);\n } else {\n $model->save();\n }\n\n Nova::actionEvent()->forResourceCreate($request->user(), $model)->save();\n\n collect($callbacks)->each->__invoke();\n\n return $model;\n });\n\n $this->refreshTheResourceCheckpoint($request, $resource, $model);\n\n return response()->json([\n 'id' => $model->getKey(),\n 'resource' => $model->attributesToArray(),\n 'redirect' => $resource::redirectAfterCreate($request, $request->newResourceWith($model)),\n ], 200);\n }", "public function store(Request $request)\n {\n if(is_null($this->admin) || !$this->admin->can('admin.create')) {\n abort(403, 'Sorry, You are unauthorized to access this action !!');\n }\n // Validation...\n $this->validate($request, [\n 'name' => 'required|max:80',\n 'email' => 'required|max:150|email|unique:admins',\n 'username' => 'required|max:100|string|unique:admins',\n 'password' => 'required|max:6|confirmed',\n\n ], $message = [\n 'name.required' => 'The Admin name field is required!',\n 'name.max' => 'The Admin name must be less than 80 characters!',\n 'email.required' => 'The Admin email field is required!',\n 'email.max' => 'The Admin email must be less than 150 characters!',\n 'email.unique' => 'The Admin email has already been taken!',\n 'username.required' => 'The Admin username field is required!',\n 'username.max' => 'The Admin username must be less than 100 characters!',\n 'username.unique' => 'The Admin username has already been taken!',\n 'password.required' => 'The Password field is required!',\n 'password.max' => 'The Password must be at least 6 characters!',\n 'password.confirmed' => 'The Password and confirm password does\\'t matched!',\n ]);\n\n // Create new Admin...\n $admin = new Admin();\n $admin->name = $request->name;\n $admin->email = strtolower($request->email);\n $admin->username = strtolower($request->username);\n $admin->password = Hash::make($request->password);\n if($request->role) {\n // As an array\n $admin->assignRole($request->role);\n }\n if($admin->save()) {\n $msg = ucwords($admin->name) . 'admin has been created success.';\n setMessage('success', $msg);\n return redirect()->back();\n } else {\n setMessage('success', 'Something went wrong!');\n return redirect()->back();\n }\n }", "public function create(Admin $user)\n {\n //\n }", "public function create(Admin $user)\n {\n //\n }", "public function createAction()\n {\n $templateKey = 'edit';\n\n if (false === $this->admin->isGranted('CREATE')) {\n throw new AccessDeniedException();\n }\n\n $object = $this->admin->getNewInstance();\n\n $this->admin->setSubject($object);\n\n /** @var $form \\Symfony\\Component\\Form\\Form */\n $form = $this->admin->getForm();\n $form->setData($object);\n\n if ($this->getRestMethod()== 'POST') {\n $form->submit($this->get('request'));\n\n $isFormValid = $form->isValid();\n\n // persist if the form was valid and if in preview mode the preview was approved\n if ($isFormValid && (!$this->isInPreviewMode() || $this->isPreviewApproved())) {\n\t\t\t\t\t\n\t\t\t\t\tif($form->get('valide')->getData() && $form->get('membre')->getData()->getEmail() != \"\"){\n\t\t\t\t\t\t$mailer = $this->get('mailer');\n\t\t\t\t\t\t$message = \\Swift_Message::newInstance()\n\t\t\t\t\t\t ->setSubject('Nouveau remboursement accepté')\n\t\t\t\t\t\t ->setFrom('[email protected]')\n\t\t\t\t\t\t ->setTo($form->get('membre')->getData()->getEmail())\n\t\t\t\t\t\t ->setBody('Votre remboursement : '.$form->get('activite')->getData()->getNom().' a bien été remboursé.<br/><br/>Le CE.', 'text/html');\n\t\t\t\t\t\t // ->setBody($this->renderView('AnjJeuxBundle:Jeux:email.html.twig', array('lot' => $lot, 'participant' => $participant)), 'text/html');\n\t\t\t\t\t\t$mailer->send($message);\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n if (false === $this->admin->isGranted('CREATE', $object)) {\n throw new AccessDeniedException();\n }\n\n $this->admin->create($object);\n\n if ($this->isXmlHttpRequest()) {\n return $this->renderJson(array(\n 'result' => 'ok',\n 'objectId' => $this->admin->getNormalizedIdentifier($object)\n ));\n }\n\n $this->addFlash('sonata_flash_success', $this->admin->trans('flash_create_success', array('%name%' => $this->admin->toString($object)), 'SonataAdminBundle'));\n\n // redirect to edit mode\n return $this->redirectTo($object);\n }\n\n // show an error message if the form failed validation\n if (!$isFormValid) {\n if (!$this->isXmlHttpRequest()) {\n $this->addFlash('sonata_flash_error', $this->admin->trans('flash_create_error', array('%name%' => $this->admin->toString($object)), 'SonataAdminBundle'));\n }\n } elseif ($this->isPreviewRequested()) {\n // pick the preview template if the form was valid and preview was requested\n $templateKey = 'preview';\n $this->admin->getShow();\n }\n }\n\n $view = $form->createView();\n\n // set the theme for the current Admin Form\n $this->get('twig')->getExtension('form')->renderer->setTheme($view, $this->admin->getFormTheme());\n\t\t$repo = $this->getDoctrine()\n ->getManager()\n ->getRepository('GestionCoreBundle:Activite');\n return $this->render(\"GestionCoreBundle:Remboursement:base_edit.html.twig\", array(\n 'action' => 'create',\n 'form' => $view,\n 'object' => $object,\n\t\t\t'cinemaUGC' => $repo->find(1),\n\t\t\t'cinemaCGR' => $repo->find(2),\n\t\t\t'cinemaPATHE' => $repo->find(3),\n\t\t\t'chequeLire' => $repo->find(4),\n\t\t\t'aboSport' => $repo->find(5),\n\t\t\t'aboSpectacle' => $repo->find(6),\n\t\t\t\n ));\n }", "public function create() {\n \n //\n \n }", "public function create() { }", "public function actionNewAdmin()\n {\n $email = BaseConsole::input(\"Enter email: \");\n $password = BaseConsole::input(\"Enter password: \");\n try {\n if (empty($password) || empty($email)) {\n throw new \\Exception('Data is empty');\n }\n $user = new User();\n $user->setEmail($email);\n $user->setPassword($password);\n $user->generateAuthKey();\n $user->generatePasswordResetToken();\n $user->generateEmailVerificationToken();\n if ($user->save()) {\n // Set role admin\n $auth = Yii::$app->authManager;\n $role = $auth->getRole('admin');\n $auth->assign($role, $user->id);\n die('Administrator successful created!');\n } else {\n throw new \\Exception('Validation user error!');\n }\n } catch (\\Exception $exception) {\n die($exception->getMessage());\n }\n }", "public function create() {\n //\n \n }", "public function create()\n {\n // Not an API route\n }", "public function create(User $admin)\n {\n //\n return $admin->hasPermissionTo('create-users') ? Response::allow() : Response::deny('YOU HAVE NO PERMISSION');\n }", "public function actionCreate()\r\n {\r\n $model = new Resource();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function create()\n {\n //\n \n }", "public function create()\n {\n //\n \n }" ]
[ "0.65899444", "0.626622", "0.6167807", "0.60805106", "0.6043532", "0.60413915", "0.60130966", "0.598709", "0.5914262", "0.58408886", "0.5823087", "0.5799222", "0.5779833", "0.5774117", "0.5673659", "0.5667813", "0.566773", "0.5659225", "0.56484437", "0.56484437", "0.5642786", "0.56180227", "0.5612003", "0.5606625", "0.5604513", "0.55929387", "0.5590682", "0.5586026", "0.5577611", "0.5577611" ]
0.6762609
0
Get the shoe's category
public function shoe_category() { return $this->hasOne(ShoeCategory::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getCategory();", "public function getCategory();", "public function getCategory();", "public function getCategory()\n {\n return $this->_data[self::CATEGORY];\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function getCategory()\n {\n return $this->readOneof(6);\n }", "public function getCategory()\n {\n return $this->readOneof(6);\n }", "public function getPregnancyCategory();", "public function getCategory () \r\n {\r\n return $this->category;\r\n }", "public function getCategory() \n {\n return $this->category;\n }", "function get_category()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_CATEGORY);\r\n }", "public function getCategory(){\n\t\treturn $this->category;\t\n\t}", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory(): string\n {\n return $this->category;\n }", "public function getCategorie();", "public function category()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->_category;\n }", "public function getCategory()\n\t{\n\t\treturn $this->category; \n\n\t}", "public function category(): string\n {\n return $this->category;\n }" ]
[ "0.7178695", "0.6867432", "0.6867432", "0.6857235", "0.6805961", "0.6785191", "0.6785191", "0.67536104", "0.66755205", "0.6673578", "0.6658696", "0.66383564", "0.66238505", "0.66238505", "0.66238505", "0.66238505", "0.66238505", "0.66238505", "0.66238505", "0.66238505", "0.66238505", "0.66238505", "0.66238505", "0.66238505", "0.66235006", "0.6618878", "0.6610145", "0.6607222", "0.656563", "0.6540072" ]
0.74395305
0
Smart str_split, does not split if in a middle of a word... Goes to next file then. If words are bigger then $size it will use generic str_split. Created because google has 100chars limit. This makes many files, and does nice splitting when it comes to words and limit of chars.
private function strSplitWordFriendly($str, $size){ $str = trim(strip_tags($str)); $length = strlen($str); $ex = explode(' ',$str); $op = array(); $newarr = ''; foreach($ex as $word){ if (strlen(' '.$word) > $size){ $op[] = $newarr; $newarr = ''; $splitA = str_split($word, $size); $op = array_merge($op, $splitA); echo "DASS"; }elseif (strlen($newarr.' '.$word) <= $size && !( ($size-strlen($newarr)) > $size*0.15 && strstr($newarr,'.')) ){ $newarr .= ' '.$word; }else { $op[] = $newarr; $newarr = ''; $newarr = $word; } } if ($newarr)$op[] = $newarr; return $op; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function str_split ($string, $split_length = 1) {}", "function split($length);", "function _my_split ($text = \"\", $split_token = \"\", $split_length = 0) {\n\t\tif (!strlen($split_token) || !$split_length) {\n\t\t\treturn array($text);\n\t\t}\n\t\t$splitted = array();\n\n\t\t$text_length\t= strlen($text);\n\t\t$num_parts\t\t= ceil($text_length / $split_length);\n\t\t$token_length\t= strlen($_split_token);\n\n\t\tfor ($i = 0; $i < $num_parts; $i++) {\n\t\t\t$_start_offset\t= $i * $split_length + $token_length;\n\t\t\t$offsets[$i]\t= strpos($text, $split_token, $_start_offset);\n\t\t}\n\t\t$offsets[$num_parts]\t= $text_length;\n\n\t\tforeach ((array)$offsets as $_num => $_offset) {\n\t\t\t$_prev_offset\t\t= $_num ? $offsets[$_num - 1] : 0;\n\t\t\t$splitted[$_num]\t= substr($text, $_prev_offset, $_offset - $_prev_offset + $token_length);\n\t\t}\n\t\treturn $splitted;\n\t}", "function mzz_str_split($str, $split_len = 1)\n{\n return $GLOBALS['charsetDriver']->str_split($str, $split_len);\n}", "function m_split ( $s , $nMax, $br = \"\\n\", $pre=\"&lt; \" ) {\n\n $a= explode( \" \", $s);\n $ret = $pre;\n $actual = 0;\n\n foreach ( $a as $c) {\n if (strlen($c)+$actual > $nMax ) {\n $actual = 0 ;\n $ret .= \"$br$pre$c\";\n } else {\n $ret .= ( $actual==0 ? \"\" : \" \") . $c;\n }\n $actual += strlen($c);\n }\n return $ret;\n}", "static public function Split($str, $delimiter_or_chunksize = 1)\n {\n if (is_null($delimiter_or_chunksize))\n {\n throw new \\Exceptions\\NullArgumentException('delimiter_or_chunksize');\n }\n\n if (is_int($delimiter_or_chunksize))\n {\n return str_split($str, $delimiter_or_chunksize);\n }\n else\n {\n return explode($delimiter_or_chunksize, $str);\n }\n }", "function mb_str_split($string, $split_length = 1) {\n\t\t$split_length = ($split_length <= 0) ? 1 : $split_length;\n\t\t$mb_strlen = mb_strlen($string, 'utf-8');\n\t\t$array = array();\n\t\tfor($i = 0; $i < $mb_strlen; $i = $i + $split_length) {\n\t\t\t$array[] = mb_substr($string, $i, $split_length);\n\t\t}\n\t\treturn $array;\n\t}", "public static function word_split($str, $words = 15)\r\n\t{\r\n\t\t$arr = preg_split(\"/[\\s]+/\", $str,$words+1);\r\n\t\t$arr = array_slice($arr,0,$words);\r\n\t\treturn join(' ',$arr).((count($arr)>$words) ? \"...\" : null);\r\n\t}", "private static function mb_chunk_split($str, $len, $glue)\n\t{\n\t\tif (empty($str)) return false;\n\t\t$array = self::mbStringToArray ($str);\n\t\t$n = -1;\n\t\t$new = Array();\n\t\tforeach ($array as $char) {\n\t\t\t$n++;\n\t\t\tif ($n < $len) $new []= $char;\n\t\t\telseif ($n == $len) {\n\t\t\t\t$new []= $glue . $char;\n\t\t\t\t$n = 0;\n\t\t\t}\n\t\t}\n\t\treturn $new;\n\t}", "function explode ($delimiter, $string, $limit = null) {}", "public static function split($filename, $output_dir = NO, $piece_size = 10) {\n\t\t// Find output dir\n\t\t$output_dir = ($output_dir == NO) ? pathinfo(str_replace('\\\\', '/', realpath($filename)), PATHINFO_DIRNAME) : str_replace('\\\\', '/', realpath($output_dir));\n\t\t$output_dir = rtrim($output_dir, '/').'/';\n\n\t\t// Open files for writing\n\t\t$input_file = fopen($filename, 'rb');\n\n\t\t// Change the piece size to bytes\n\t\t$piece_size = 1024 * 1024 * (int) $piece_size; // Size in bytes\n\n\t\t// Set up reading variables\n\t\t$read = 0; // Number of bytes read\n\t\t$piece = 1; // Current piece\n\t\t$chunk = 1024 * 8; // Chunk size to read\n\n\t\t// Split the file\n\t\twhile(!feof($input_file)) {\n\t\t\t// Open a new piece\n\t\t\t$piece_name = $filename.'.'.str_pad($piece, 3, '0', STR_PAD_LEFT);\n\t\t\t$piece_open = @fopen($piece_name, 'wb+') or die('Could not write piece '.$piece_name);\n\n\t\t\t// Fill the current piece\n\t\t\twhile($read < $piece_size and $data = fread($input_file, $chunk)) {\n\t\t\t\tfwrite($piece_open, $data) or die('Could not write to open piece '.$piece_name);\n\t\t\t\t$read += $chunk;\n\t\t\t}\n\n\t\t\t// Close the current piece\n\t\t\tfclose($piece_open);\n\n\t\t\t// Prepare to open a new piece\n\t\t\t$read = 0;\n\t\t\t$piece++;\n\n\t\t\t// Make sure that piece is valid\n\t\t\t($piece < 999) or die('Maximum of 999 pieces exceeded, try a larger piece size');\n\t\t}\n\n\t\t// Close input file\n\t\tfclose($input_file);\n\n\t\t// Returns the number of pieces that were created\n\t\treturn ($piece - 1);\n\t}", "function split($start, $length = null);", "function ft_split($str)\n {\n $str = trim($str);\n if ($str == '')\n return 0;\n $arr = preg_split(\"/[[:space:]]+/\", $str);\n return $arr;\n }", "function divideWord($content,$maxWordLength = \"30\")\r\n\t{\r\n\t\t$newContent = wordwrap($content, $maxWordLength, \" \", 1);\r\n\t\treturn $newContent;\r\n\t}", "function solution($str) {\n if (strlen($str) % 2 !== 0) {\n $str .= \"_\";\n }\n return explode(' ', wordwrap($str, 2, ' ', true));\n}", "function ft_split($str)\n{\n\t$res = array();\n\t$tab = explode(\" \",$str);\n\t$tab = array_filter($tab);\n\tsort($tab);\n\tforeach($tab as $elem)\n\t{\n\t\t$res[] = $elem;\n\t}\t\n\treturn ($res);\n}", "function chunk_split ($body, $chunklen = 76, $end = \"\\r\\n\") {}", "function fixed_chunk( $str )\n{\n return wordwrap( $str , 1 , '.' , true );\n}", "function split_source_into_chunks( $source ) {\n\t\n\t$maxCharsPerLine = 85;\n\t$i = 0;\n\t\n\t// get make # of lines it could be. multiply by three to be safe.\n\t\n\t$l = ceil( strlen( $source ) / $maxCharsPerLine ) * 3;\n\tfor ( $i; $i < $l; $i = $i + 1 ) {\n\t\t\n\t\t// check if strlen is less than one line long.\n\t\t// if so return it and end\n\t\t\n\t\tif ( strlen( $source ) <= $maxCharsPerLine ) {\n\t\t\t$array[] = $source;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// break off a chunk of the source\n\t\t\n\t\t$chunk = substr( $source, 0, $maxCharsPerLine );\n\t\t\n\t\t// get the position end of the last full word in the chunk\n\t\t\n\t\t$lastSpace = strrpos( $chunk, ' ' );\n\t\t\n\t\t// if it's just be long string return it\n\t\t\n\t\tif ( $lastSpace === -1 ) {\n\t\t\t$array[] = $chunk;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// clean up the chunk by trimming it to the last full word\n\t\t\n\t\t$chunk = substr( $chunk, 0, $lastSpace + 1 );\n\t\t\n\t\t// add the chunk to the array\n\t\t\n\t\t$array[] = $chunk;\n\t\t\n\t\t// remove the chunk from the source\n\t\t\n\t\t$source = substr( $source, strlen( $chunk ) );\n\t}\n\t\n\treturn $array;\n}", "function explode($delimiter, $limit = 0xFFFFFF) {\n // split in utf-8 characters\n if ($delimiter == \"\") {\n $l = min($this->len(), $limit);\n $r = array();\n for ($i = 0; $i < $l; $i++) {\n $r[] = $this->substr($i, 1);\n };\n return $r;\n } else {\n return explode($delimiter, $this->s, $limit);\n }\n }", "function words($str,$num)\n {\n $limit = $num - 1 ;\n $str_tmp = '';\n $str = str_replace(']]>', ']]&gt;', $str);\n $str = strip_tags($str);\n $arrstr = explode(\" \", $str);\n if ( count($arrstr) <= $num ) { return $str; }\n if (!empty($arrstr))\n {\n for ( $j=0; $j< count($arrstr) ; $j++) \n {\n $str_tmp .= \" \" . $arrstr[$j];\n if ($j == $limit) \n {\n break;\n }\n }\n }\n return $str_tmp.\"...\";\n }", "function splitText($text, $maxLength) {\n if(strlen($text) > $maxLength) {\n /* Trim the text to $maxLength characters */\n $text = substr($text, 0, $maxLength - 1);\n\n /* Split words only at boundaries. This will be\n accomplished by moving back each character from\n the end of the split string until a space is found.\n */\n while(substr($text, -1) != ' ') {\n $text = substr($text, 0, -1);\n }\n\n /* Remove the whitespace at the end. */\n $text = rtrim($text);\n }\n return $text;\n }", "public static function Split(string $i, int $s) : int\n\t{\n\t\t$fs = filesize($i);\n\t\t$p = 1;\n\t\t$date = IO::FileMTime($i);\n\t\tif($date === false)\n\t\t\t$date = time();\n\t\tfor($c = 0; $c < $fs; $c = $c + $s)\n\t\t{\n\t\t\t$fileData = file_get_contents($i, false, null, $c, $s);\n\t\t\t$fn = $i . \".\" . $p . \".part\";\n\t\t\tfile_put_contents($fn, $fileData);\n\t\t\t$p++;\n\t\t\tunset($fileData);\n\t\t\ttouch($fn, $date);\n\t\t}\n\t\tIO::Delete($i);\n\t\treturn $p - 1;\n\t}", "function split_string($string, $count = 2)\n{\n $arr_ph = explode(\" \", $string, $count);\n\n if (!isset($arr_ph[1]))\n $arr_ph[1] = '';\n return $arr_ph;\n\n}", "function wordwrap ($str, $width = 75, $break = \"\\n\", $cut = false) {}", "function split(string $string, string $delimiter, ?int $limit = null): array\n{\n if ('' === $delimiter) {\n if (null === $limit || $limit >= length($string)) {\n return chunk($string);\n }\n\n if (1 === $limit) {\n return [$string];\n }\n\n Psl\\invariant($limit > 1, 'Expected a non-negative limit.');\n $result = chunk(slice($string, 0, $limit - 1));\n $result[] = slice($string, $limit - 1);\n\n return $result;\n }\n\n if (null === $limit) {\n /** @var list<string>|false $result */\n $result = explode($delimiter, $string);\n } else {\n /** @var list<string>|false $result */\n $result = explode($delimiter, $string, $limit);\n }\n\n /**\n * @psalm-suppress MissingThrowsDocblock - should not throw\n * @psalm-suppress ImpureFunctionCall - see https://github.com/azjezz/psl/issues/130\n * @psalm-suppress ImpureMethodCall - see https://github.com/azjezz/psl/issues/130\n */\n return Type\\vec(Type\\string())->coerce($result);\n}", "function ft_split($line)\n{\n\t$split = preg_split(\"/[\\s]+/\", rtrim($line));\n\tif ($line != NULL)\n\t\tsort($split);\n\treturn $split;\n}", "function split($separator = NULL, $limit = 0xFFFFFF) {\n if ($separator === NULL) return array($this->s);\n return $this->explode($separator, $limit);\n }", "function string_limit_words($string, $word_limit) {\r\n$words = explode(' ', $string, ($word_limit + 1));\r\nif(count($words) > $word_limit)\r\narray_pop($words);\r\nreturn implode(' ', $words);\r\n}", "public static function SplitWords($delim, $s)\r\n\t{\r\n\t\treturn $s=='' ? array() : preg_split(\"/\\s*($delim)\\s*/\", $s);\r\n\t}" ]
[ "0.6936796", "0.62099534", "0.6134478", "0.6055376", "0.5765552", "0.5746446", "0.57441676", "0.5738609", "0.56804633", "0.5630556", "0.5557914", "0.55386454", "0.5503044", "0.5381594", "0.53233624", "0.53050303", "0.5284998", "0.52728117", "0.5264186", "0.5225303", "0.5174786", "0.51513636", "0.5139526", "0.5130016", "0.5123889", "0.5074664", "0.50725293", "0.5064567", "0.505385", "0.49924642" ]
0.70231164
0
getCoreScriptIncludes Gets the javascript to print in your element. Returns javascript for includes and setups generic functions aswell as global javascript variables needed for the instance(s). Tested Valid XHTML.
public function getCoreScriptIncludes(){ return ' <script type="text/javascript"> var CURRENT_AUDIO_FOR_HTML_SITE=0; var SONGS_FOR_HTML_SITE = new Array(); function playListNextHtmlGoogleTTS() { $("#jquery_jplayerHtmlGoogleTTS").jPlayer("setMedia", { mp3: SONGS_FOR_HTML_SITE[++CURRENT_AUDIO_FOR_HTML_SITE] }).jPlayer("play"); } function playListPrevHtmlGoogleTTS() { $("#jquery_jplayerHtmlGoogleTTS").jPlayer("setMedia", { mp3: SONGS_FOR_HTML_SITE[--CURRENT_AUDIO_FOR_HTML_SITE] }).jPlayer("play"); } </script> '; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function getScriptIncludes();", "public function getCoreJs(){\n\t\treturn \"<script src=\\\"\".$this->core_js_file.\"\\\"></script>\\n\";\n\t}", "public function getCoreJs(){\n\t\treturn \"<script src=\\\"\".$this->core_js_file.\"\\\"></script>\\n\";\n\t}", "public function rel_include_scripts() {\n \n }", "private function printJsIncludes($includes) {\n foreach($includes as $include) {\n echo \"\\t\" . '<script src=\"' . $include . '\"></script>' . \"\\n\";\n }\n }", "public function GetHtmlHeadIncludes()\n {\n $aIncludes = parent::GetHtmlHeadIncludes();\n $aIncludes[] = '<link href=\"'.TGlobal::GetStaticURL('/chameleon/blackbox/pkgShop/MTShopStatistics.css').'\" rel=\"stylesheet\" type=\"text/css\" /> ';\n $aIncludes[] = '<link href=\"'.TGlobal::GetStaticURL('/chameleon/blackbox/pkgShop/MTShopStatisticsPrint.css').'\" rel=\"stylesheet\" type=\"text/css\" media=\"print\" /> ';\n\n return $aIncludes;\n }", "public function getIncludes(){\n\t\t$CLASSPATH=$this->get(\"CLASSPATH\");\n\t\treturn array(\n\t\t\t\t$CLASSPATH.\"criptclass.php\",\n\t\t\t\t$CLASSPATH.\"dbclass.php\",\n\t\t\t\t$CLASSPATH.\"filesclass.php\",\n\t\t\t\t$CLASSPATH.\"mainpageclass.php\",\n\t\t\t\t$CLASSPATH.\"htmlloaderclass.php\",\n\t\t\t\t$CLASSPATH.\"pageclass.php\",\n\t\t\t\t$CLASSPATH.\"themesclass.php\"\n\t\t\t);\n\t}", "protected function addIncludes(&$script)\n {\n $script .= \"\nrequire '\" . $this->getObjectBuilder()->getClassFilePath() . \"';\n\";\n }", "public function getFrontendScripts() {\n }", "public function includeScripts ()\n {\n foreach ($this->extScripts as $incFile_table => $incFile) {\n if (@is_file($incFile)) {\n include($incFile);\t// Always start the incFiles with a check of the object fe_tce. is_object($this);\n } else {\n $this->logger->error('\"' . $incFile . '\" file not found!');\n }\n }\n }", "function getJavaScript() {\n\t?>\n\t<script type=\"text/javascript\" src=\"js/jquery-2.2.1.min.js\"></script>\n\t<script type=\"text/javascript\" src=\"js/jquery-ui-1.11.4.min.js\"></script>\n\t\n\t<script type=\"text/javascript\" src=\"js/jquery.validate.min.js\"></script>\n\t<script type=\"text/javascript\" src=\"js/additional-methods.min.js\"></script>\n\t\n\t<script type=\"text/javascript\" src=\"js/jquery.visible.min.js\"></script>\n\t<script type=\"text/javascript\" src=\"js/jquery.sticky.js\"></script>\n\t<script type=\"text/javascript\" src=\"js/bjqs-1.3.min.js\"></script>\n\t\n\t<script type=\"text/javascript\" src=\"js/script.js\"></script>\n\t<?php\n}", "function getScripts () {\r\n\r\n }", "protected function getScripts()\n {\n return implode( \"\\n\", array(\n '<script type=\"text/javascript\" src=\"lib/plugins/image.js\"></script>',\n '<script type=\"text/javascript\" src=\"lib/plugins/ajaxfileupload.min.js\"></script>',\n ) );\n }", "public function renderCoreScripts()\n\t{\n\t\tif($this->coreScripts===null)\n\t\t\treturn;\n\t\t$cssFiles=array();\n\t\t$jsFiles=array();\n\t\tforeach($this->coreScripts as $name=>$package)\n\t\t{\n\t\t\t$baseUrl=$this->getPackageBaseUrl($name);\n\t\t\tif(!empty($package['js']))\n\t\t\t{\n\t\t\t\tforeach($package['js'] as $js)\n\t\t\t\t\t$jsFiles[$baseUrl.'/'.$js]=$baseUrl.'/'.$js;\n\t\t\t}\n\t\t\tif(!empty($package['css']))\n\t\t\t{\n\t\t\t\tforeach($package['css'] as $css)\n\t\t\t\t\t$cssFiles[$baseUrl.'/'.$css]='';\n\t\t\t}\n\t\t}\n\t\t// merge in place\n\t\tif($cssFiles!==array())\n\t\t{\n\t\t\tforeach($this->cssFiles as $cssFile=>$media)\n\t\t\t\t$cssFiles[$cssFile]=$media;\n\t\t\t$this->cssFiles=$cssFiles;\n\t\t}\n\t\tif($jsFiles!==array())\n\t\t{\n\t\t\tif(isset($this->scriptFiles[$this->coreScriptPosition]))\n\t\t\t{\n\t\t\t\tforeach($this->scriptFiles[$this->coreScriptPosition] as $url => $value)\n\t\t\t\t\t$jsFiles[$url]=$value;\n\t\t\t}\n\t\t\t$this->scriptFiles[$this->coreScriptPosition]=$jsFiles;\n\t\t}\n\t}", "public function includes() {\n //core includes\n\t\tinclude_once {%= prefix %}_INCLUDES . '/core-functions.php';\n\t\tinclude_once {%= prefix %}_INCLUDES . '/class-install.php';\n\t\tinclude_once {%= prefix %}_INCLUDES . '/class-post-types.php';\n\n\t\t//admin includes\n\t\tif ( $this->is_request( 'admin' ) ) {\n include_once {%= prefix %}_INCLUDES . '/class-upgrades.php';\n\t\t}\n\n\t\t//frontend includes\n\t\tif ( $this->is_request( 'frontend' ) ) {\n\t\t\t\n\t\t}\n\n }", "public function getJavaScript();", "function load_js_funcs(){\r\r\n if (count($GLOBALS['core']->js_func)){\r\r\n $info = '<script type=\"text/javascript\" language=\"JavaScript\">\r\r\n//<![CDATA[';\r\r\n foreach ($GLOBALS['core']->js_func as $js_functions){\r\r\n $info .= $js_functions.\"\\n\";\r\r\n }\r\r\n $info .= '//]]>\r\r\n</script>';\r\r\n\r\r\n return $info;\r\r\n }\r\r\n }", "function includeScriptFiles()\n {\n $hsf = &Horde_Script_Files::singleton();\n $hsf->includeFiles();\n }", "public function getIncludesObject();", "private function loadScripts()\r\n\t{\r\n\t//load jQuery by default unless minimal javascript is used in the page\r\n\t//\r\n\t\t$this->scripts = NULL;\r\n\t\t$this->scripts .= $this->loader->loadScripts('jquery.js');\r\n\t\t$this->scripts .= $this->loader->loadScripts('front.js');\r\n\t\treturn $this->scripts;\r\n\t\t\r\n\t}", "public static function inclureJs(){\n foreach (self::$_instance->script as $fich){\n echo '<script type=\"text/javascript\" src=\"'.$fich.'\"></script>';\n }\n }", "public function generateIncludes($indent = \"\")\n {\n /**\n * Switch framework types\n */\n $scripts = Array();\n switch ($this->jsFramework) {\n case self::JSFRAMEWORK_JQUERY:\n $scripts[] = \"<script src=\\\"//ajax.googleapis.com/ajax/libs/jquery/{$this->jQueryVersion}/jquery.min.js\\\"></script>\";\n $scripts[] = \"<script>window.jQuery || document.write('<script src=\\\"{$this->jsDir}/jquery-{$this->jQueryVersion}.min.js\\\"><\\/script>')</script>\";\n break;\n }\n\n\n /**\n * Add asyncphp.js\n */\n $scripts[] = \"<script src='{$this->jsDir}/{$this->jsAsyncPhp}' type='text/javascript'></script>\";\n\n\n /**\n * Build and return\n */\n return $indent.implode(\"\\n{$indent}\", $scripts).\"\\n\";\n }", "public function renderJavascripts()\n {\n $scripts = array(\n '<script charset=\"UTF-8\" type=\"text/javascript\" src=\"http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0\"></script>'\n );\n \n return implode('', $scripts);\n }", "public static function getJS()\n {\n return implode(\"\\n\", self::$renderedScripts);\n }", "public function getScriptElements()\r\n\t{\r\n\t\treturn $this->scriptElements;\r\n\t}", "function includeScript($script = \"\", $options = array()) {\n\t\tif ($script == \"\") {\n\t\t\t$files = scandir(JS);\n\t\t\t$javascript = '';\n\n\t\t\tforeach ($files as $file) {\n\t\t\t\tif (substr($file, -3) == '.js') {\n\t\t\t\t\t$javascript .= file_get_contents(JS . \"{$file}\") . \"\\n\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$javascript = file_get_contents(JS . \"$script.js\") . \"\\n\\n\";\n\t\t}\n\t\treturn $this->codeBlock(\"\\n\\n\" . $javascript, $options);\n\t}", "public function includes() {\n //core includes\n\t\tinclude_once WPECP_INCLUDES . '/core-functions.php';\n\t\tinclude_once WPECP_INCLUDES . '/class-install.php';\n\t\tinclude_once WPECP_INCLUDES . '/class-post-types.php';\n\n\t\t//admin includes\n\t\tif ( $this->is_request( 'admin' ) ) {\n\t\t\tinclude_once WPECP_INCLUDES . '/admin/class-admin.php';\n\t\t}\n\n\t\t//frontend includes\n\t\tif ( $this->is_request( 'frontend' ) ) {\n\t\t\tinclude_once WPECP_INCLUDES . '/class-frontend.php';\n\t\t}\n\n }", "public function getIncludes()\n {\n return '';\n }", "function includeFiles()\n {\n foreach ($this->listFiles() as $app => $files) {\n foreach ($files as $file) {\n echo '<script type=\"text/javascript\" src=\"' . $file['u'] . '\"></script>' . \"\\n\";\n }\n }\n }", "public static function includeList() \n {\n echo '<h2>Include List</h2>';\n $includeArray = get_included_files();\n $this->p($includeArray);\n }" ]
[ "0.74996126", "0.62976557", "0.62976557", "0.60584754", "0.59678996", "0.59062415", "0.5878391", "0.58602", "0.57640177", "0.5744009", "0.57341576", "0.5702388", "0.56928986", "0.5657695", "0.56440985", "0.5641502", "0.56226486", "0.5619012", "0.5570459", "0.55530953", "0.5542995", "0.5535835", "0.5488884", "0.5487092", "0.54775393", "0.54659075", "0.54559445", "0.54548764", "0.54318064", "0.5408448" ]
0.71289504
1
getPlayerDiv Gets the player div, this can be invisible. It is invisible by default! Run one time (NOT one time per class instance) Tested Valid XHTML.
public function getPlayerDiv(){ $ret = ' <div id="jquery_jplayerHtmlGoogleTTS"></div> '; return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Player $player)\n {\n //\n }", "public function get_playerid(){return $this->_playerid;}", "public function getPlayer(): string {\n\t\treturn $this->player;\n\t}", "function set_player(){\n\t\t//Se obtiene el array de usuarios que se ha generado y se printa en forma de tarjetas con un boton que las permite eliminar.\n\t\tforeach ($_SESSION['users'] as $key => $value) {\n\t\t\t?>\n\t\t\t<div class=\"player\">\n\t\t\t\t<div class=\"row\">\t\n\t\t\t\t\t\t<div class=\"col-8\">\n\t\t\t\t\t\t\t<span><?= $value['nombre']?></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"col-4\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t \t//Este boton permite eliminar esta tarjeta si se quiere prescindir de un jugador creado.\n\t\t\t\t\t\t\t ?>\n\t\t\t\t\t\t\t<button class=\"btn-danger btn-delete\" id-data='<?=$key?>'>Eliminar</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t</div>\t\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}", "public function getPlayer() : Player {\n\t\treturn $this->player;\n\t}", "public function getPlayer()\n {\n if( isset($this->data['player_id']) )\n {\n $player = new OTS_Player();\n $player->load($this->data['player_id']);\n return $player;\n }\n // not set\n else\n {\n return null;\n }\n }", "private function getDiv() {\n return $this->div;\n }", "public function playerOpen() {\n\n $this->moveto($this->byCssSelector('div.player.jp-player'));\n $this->wait(1);\n $this->byXPath('//div[@class=\"player jp-player over\"]/div[1]/div[1]/a')->click();\n }", "public function getDiv() {\n\t\t$cssclass = $this->wrapperClassName;\n\t\tif ($this->hidden) {\n\t\t\t$cssclass .= ' verborgen';\n\t\t}\n\t\treturn '<div id=\"wrapper_' . $this->getId() . '\" class=\"' . $cssclass . '\">';\n\t}", "function createDiv($characterNumber, $username, $row) {\n //echos a div onto the actual DOM\n echo \"<div class='char_div'>\n <div class='charSelectBorder'>\n <div name='\".$username.\"level\".$characterNumber.\"' class='char_info'>\n Level: <span class='numberCircle'> \".$row['level'].\" </span>\n </div>\n <div name='\".$username.\"charName\".$characterNumber.\"' class='char_info'> Name: \".$row['characterName'].\"</div>\n <div name='\".$username.\"race\".$characterNumber.\"' class='char_info'> Race: \".$row['race'].\"</div>\n <div name='\".$username.\"class\".$characterNumber.\"' class='char_info'> Class: \".$row['class'].\"</div>\n <form class='characterIDForm' method='post' action='\".$_SERVER['PHP_SELF'].\"'>\n <input type='hidden' name='characterID' value='\".$row['characterID'].\"'>\n <button class='characterSelectButton' type='submit'>></button>\n </form>\n <br>\n </div>\n </div>\";\n }", "public function show(Player $player)\n {\n $player->load('team');\n return $player;\n }", "protected function getPlayer()\n {\n return $this->fixtures->getReference('player-1');\n }", "public function getCurrentPlayer()\r\n\t{\r\n\t\treturn $this->currentPlayer;\r\n\t}", "function display() {\r\n\t\tglobal $bp;\r\n\t\t$root_url = get_bloginfo( \"url\" ) . \"/\";\r\n\t\t\r\n\t\t$baseurl=$root_url . \"wp-content/plugins/videowhisper-video-presentation/vp/\";\r\n\t\t$swfurl=$baseurl.\"consultation.swf?room=\".urlencode($bp->groups->current_group->slug);\r\n\t\t?>\r\n\t <div id=\"videowhisper_videopresentation\" style=\"height:650px\" >\r\n\t\t<object width=\"100%\" height=\"100%\">\r\n <param name=\"movie\" value=\"<?=$swfurl?>\" /><param name=\"base\" value=\"<?=$baseurl?>\" /><param name=\"scale\" value=\"noscale\" /><param name=\"salign\" value=\"lt\"></param><param name=\"wmode\" value=\"transparent\" /><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed width=\"100%\" height=\"100%\" scale=\"noscale\" salign=\"lt\" src=\"<?=$swfurl?>\" base=\"<?=$baseurl?>\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed>\r\n </object>\r\n\t\t<noscript>\r\n\t\t<p align=\"center\"><strong>Video Whisper <a href=\"http://www.videowhisper.com/?p=WordPress+Video+Presentation\">Live Web Video presentation Software</a> requires the Adobe Flash Player:\r\n\t\t<a href=\"http://get.adobe.com/flashplayer/\">Get Latest Flash</a></strong>!</p>\r\n\t\t</noscript>\r\n\t\t</div>\r\n\t\t\t<?php\r\n\t}", "public function loadPlayerInfo() {\n $options = array();\n $options['url'] = base64_decode($this->params->getParamFromUrl('id'));\n $options['game'] = $this->params->getParam('game');\n if (isset( $options['url'])) {\n $options = GeneralUtils::getDefaults(SC2Player::$PLAYER_INFO_DEFAULT_PARAMS, $options);\n $urlconnect = new URLConnect($options['url'], 100, FALSE);\n if ( $urlconnect->getHTTPCode() != 200 ) {\n /* TODO: error handle */\n exit;\n }\n $options['content'] = $urlconnect->getContent();\n $sc2player = new SC2Player($options['content'], $options['url'], $options['game']);\n $data = $sc2player->getJsonData();\n $this->done(array('data' => $data));\n return;\n }\n /* TODO display error message */\n }", "public function getCurrentPlayer() : string\n {\n return $this->currentPlayer;\n }", "public function printPlayersByDivision($jugXdiv, $error = null) {\n $this->smarty->assign('jugadoresXdivisiones', $jugXdiv);\n $this->smarty->assign('error', $error);\n $this->smarty->display('templates/printPlayersByDivision.tpl');\n }", "function GetVideoElem($video_info)\n{\n\t$video_xref = $video_info[\"xref\"];\n\t$video_desc = $video_info[\"vname\"];\n\t$items = explode('\\\\',$video_xref);\n\t$items_ct = count($items);\n $video_path = $_SESSION[\"web_video_basepath\"] .\"/\".$items[$items_ct-3] .\"/\". $items[$items_ct-2].\"/\". $items[$items_ct-1];\n\techo \"<div class=\\\"video\\\">\\n\";\n\t//echo \"<video id='vidvid' controls>\\n\";\n //echo \"<source src=\\\"\".$video_path.\"\\\" type=\\\"video/mp4\\\">\\n\";\n //echo \"</video>\\n\";\n\techo \"<a href=\\\"\".$video_path.\"\\\" id=\\\"player\\\" style=\\\"display:block;width:320px;height:220px\\\" ></a>\";\n\techo \"<script>\\n\";\n\techo \"flowplayer(\\\"player\\\", \\\"flowplayer-3.2.16.swf\\\")\";\n\techo \"</script>\\n\";\n\t//echo \"<div id=\\\"vid_desc\\\">$video_desc</div>\\n\";\n\techo \"<div id=\\\"vid_desc\\\"></div>\\n\";\n echo \"</div>\\n\";\n}", "public function show(Player $player)\n {\n //\n $player = Player::where('id', $player->id)->first();\n\n return view('players.show', ['player'=>$player]);\n }", "public function loadPlayerDivision() {\n $options = array();\n $options['url'] = base64_decode($this->params->getParamFromUrl('divisionUrlId'));\n $options['game'] = $this->params->getParam('game');\n if (isset($options['url'])) {\n $options = GeneralUtils::getDefaults(SC2Player::$PLAYER_INFO_DEFAULT_PARAMS, $options);\n $urlconnect = new URLConnect($options['url'], 100, FALSE);\n if ( $urlconnect->getHTTPCode() != 200 ) {\n /* TODO: error handle */\n exit; \n }\n $options['content'] = $urlconnect->getContent();\n $sc2division = new SC2Division($options);\n $divisionData = $sc2division->parseDivision();\n $this->done(array('data' => json_encode($divisionData)));\n }\n /* TODO display error message */\n }", "public function show(Player $player)\n {\n $player = Player::findOrFail($player->id);\n return view('players.show',compact('player')); \n }", "public function show(Player $player)\n {\n return response()->json(['player' => $player]);\n }", "public function playerScript()\n {\n // TODO create secure token dynamically instead of static\n if($this->request->isPost())\n {\n $video_id=$this->request->getPost('video_id');\n $video=Videos::findFirst($video_id)->toArray();\n $filename=$video->name;\n\n echo '<script type=\"text/javascript\">jwplayer(\"video-body\").setup({',\n 'file: \"'.$filename.'\",',\n 'height: 300,\n width: 550,\n rtmp: {\n securetoken: \"d18bfcb0aa2416d5\"\n }\n });';\n\n $this->view->disable();\n }\n }", "function createNewplayer($player){\n\t\tinclude \"/settings/settings.php\";\n\t\t// TODO Complete the creation of the player\n\t}", "public function players_get() {\n\t\t$id = $this->get('id');\n\n\t\tif(isset($id)) {\n\t\t\t// If ID is provided then get individual player\n\t\t\t$data = $this->pm->get_player($this->get('id'));\n\n\t\t\tif(isset($data)) {\n\t\t\t\t// Send specific player details with 200 status code\n\t\t\t\t$this->response($data, 200);\n\t\t\t} else {\n\t\t\t\t// No players available, send 200 status code\n\t\t\t\t$this->response(\"No players available\", 200);\n\t\t\t}\n\t\t} else {\n\t\t\t// else get all players from database\n\t\t\t$data = $this->pm->get_all_players();\n\n\t\t\tif(isset($data)) {\n\t\t\t\t// Send all players with 200 status code\n\t\t\t\t$this->response($data, 200);\n\t\t\t} else {\n\t\t\t\t$data = [];\n\t\t\t\t// No players available, send 200 status code\n\t\t\t\t$this->response($data, 200);\n\t\t\t}\n\t\t}\n\t}", "function player() {\n\t\t$playerid = Session::getCookie('spieler_id');\n\t\tif (empty($playerid))\n\t\t\t$playerid = 0;\n\t\treturn $playerid;\n\t}", "function playerNew() {\n # declare globals\n global $page_id;\n\n# initialize the player form\nrequire(BASE_URI . \"modules/player/player.form.init.php\");\n\n dbg(\"+\".__FUNCTION__.\"\");\n\n # Get the next available player id number\n $plyr->get_next_id();\n $error_msgs['errorDiv'] = \"Add new player:\";\n\n dbg(\"-\".__FUNCTION__.\"={$plyr->get_member_id()}\");\n\n# Show the player form\nrequire(BASE_URI . \"modules/player/player.form.php\");\n\n}", "function showplayersettings()\n\t{\n\t\t$db = JFactory::getDBO();\n\t\t//query to fetch player settings\n\t\t$query = \"SELECT `player_values` FROM #__hdflv_player_settings\";\n\t\t$db->setQuery( $query);\n\t\treturn $db->loadResult();\n}", "public function get_places_whouse_player($player_id) {\n return $this->db->select(\"id_place, pname\")->distinct()\n ->from(\"v_places_whouse_players\")\n ->where(\"id_player\",$player_id)\n ->get()->result();\n }", "public function getPlayer()\n {\n return $this->hasOne(Player::class, ['id' => 'player_id']);\n }" ]
[ "0.584869", "0.5778643", "0.5705919", "0.5618324", "0.5543869", "0.5447563", "0.5388979", "0.53344226", "0.5303895", "0.52731055", "0.52317643", "0.51876086", "0.51705575", "0.5131327", "0.506242", "0.50311357", "0.50227493", "0.50197953", "0.49958992", "0.49813175", "0.49651745", "0.4958532", "0.49569583", "0.49297264", "0.4912496", "0.4909014", "0.48651627", "0.48493987", "0.4841093", "0.48093352" ]
0.71859187
0
Returns a cache name based on parameters
public function getCacheName($params) { $ext = $this->ext; if($params['ext']){ $ext = $params['ext']; } return $this->id . '_' . md5(implode('', $params)) . '.' . $ext; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function cacheKey() {\n\t\treturn 'cache_' . md5(\n\t\t\t$this->requestMethod . ':' .\n\t\t\t( !empty($this->options['base_url']) ? $this->options['base_url'] : '' ) .\n\t\t\t$this->url . '-' .\n\t\t\tserialize($this->parameters) .\n\t\t\t(!empty($this->options['username']) ? '-' . $this->options['username'] : '')\n\t\t);\n\t}", "public function get_cache_name() {\n return md5($this->url->getURL() . $this->config['cache_seed']);\n }", "function cacheFilename($format, $arg1 = null, $arg2 = null) {\n\t\t$folder = $this->ParentID ? $this->Parent()->Filename : ASSETS_DIR . \"/\";\n\t\t\n\t\t$format = $format.$arg1.$arg2;\n\t\t\n\t\treturn $folder . \"_resampled/$format-\" . $this->Name;\n\t}", "public function cacheKey() {\n $params = $this->getParameters();\n $ret = '';\n $this->make_cache_key($params, $ret);\n\n return md5($ret);\n }", "public function createCacheIdentifier($params);", "public static function getCacheIdentifier();", "protected static function getCacheName()\r\n\t{\r\n\t\tstatic $strCacheName;\r\n\t\tif (!isset($strCacheName))\r\n\t\t{\r\n\t\t\t$strCacheName = __CLASS__;\r\n\t\t}\r\n\t\treturn $strCacheName;\r\n\t}", "protected static function getCacheName()\r\n\t{\r\n\t\tstatic $strCacheName;\r\n\t\tif (!isset($strCacheName))\r\n\t\t{\r\n\t\t\t$strCacheName = __CLASS__;\r\n\t\t}\r\n\t\treturn $strCacheName;\r\n\t}", "protected static function getCacheName()\r\n\t{\r\n\t\tstatic $strCacheName;\r\n\t\tif (!isset($strCacheName))\r\n\t\t{\r\n\t\t\t$strCacheName = __CLASS__;\r\n\t\t}\r\n\t\treturn $strCacheName;\r\n\t}", "abstract public function cacheKey(): string;", "public function getName()\n {\n return \"Cache\";\n }", "function getCacheFilename($account, $username) {\n $filename = \"cache/\";\n \n if (isset($_GET['project'])) {\n $filename .= $_GET['project'] . \"-\";\n }\n\n $filename .= \"$account-$username.txt\"; \n\n return $filename;\n}", "protected function getCacheFileName() {\n\t\treturn TranslateUtils::cacheFile( \"translate_groupcache-{$this->group->getId()}-{$this->code}.cdb\" );\n\t}", "private function cacheKey()\r\n {\r\n return 'server-' . $this->id;\r\n }", "public function getCachePath()\n {\n $request = RequestFactory::create(func_get_args(), $this->defaultManipulations);\n\n $params = $request->query->all();\n unset($params['s']);\n ksort($params);\n\n $path = md5($this->getSourcePath($request).'?'.http_build_query($params));\n\n if ($this->cachePathPrefix) {\n $path = $this->cachePathPrefix.'/'.$path;\n }\n\n return $this->getSourcePath($request).'/'.$path;\n }", "protected function getConfigName(): string\n {\n return 'cache';\n }", "function _cache_get_filename()\r\n\t{\r\n\t\t$fname = 'wowcd.cache.' . $this -> cache_hash . '.html';\r\n\t\treturn $this -> cache_dir . $fname;\r\n\t}", "public function getCachePath($params)\n {\n \t$cache_dir = $this->getCacheDir();\n\t\t\t\n \t$cache_name = $this->getCacheName($params);\n\t\t\n\t\treturn $cache_dir . '/' . $cache_name;\n\t}", "final protected function getCacheKey($cacheId = array())\n\t{\n\t\tif(!is_array($cacheId))\n\t\t\t$cacheId = array((string) $cacheId);\n\n\t\t$cacheId['SITE_ID'] = SITE_ID;\n\t\t$cacheId['LANGUAGE_ID'] = LANGUAGE_ID;\n\t\t// if there are two or more caches with the same id, but with different cache_time, make them separate\n\t\t$cacheId['CACHE_TIME'] = intval($this->arResult['CACHE_TIME']);\n\n\t\tif(defined(\"SITE_TEMPLATE_ID\"))\n\t\t\t$cacheId['SITE_TEMPLATE_ID'] = SITE_TEMPLATE_ID;\n\n\t\treturn implode('|', $cacheId);\n\t}", "protected function _getActualKey($cacheName, $key = NULL)\n\t{\n\t\t$return = $this->_prefix . '_' . $cacheName;\n\n\t\t!is_null($key) && $return .= '_' . md5($key);\n\n\t\treturn $return;\n\t}", "public function getCacheKey($name)\n {\n return $name;\n }", "public function cache_filename() {\r\n return $this->cache_dir . $this->sector . '.partcache';\r\n }", "function GenerateCacheId($name, $factors = NULL) {\n //TODO sequence of factors\n if (!empty($factors)) {\n $name.=implode('', $factors);\n }\n //SOLUTION 1:\n // $name = str_replace('/', '_', $name);\n // $name = str_replace('\\', '_', $name);\n // $name = str_replace(':', '_', $name);\n // return $name;\n //SOLUTION 2:\n // return md5($name);\n //SOLUTION 3:\n return urlencode($name);\n}", "private function cacheConfig()\n {\n $name = 'find-in-file';\n // try to get user setting\n $config = Cache::config($name);\n if (empty($config)) {\n // default setting\n Cache::config($name, $this->_defaultConfig);\n }\n return $name;\n }", "public static function generate_cache_key( $uri, $args = [] ) {\n\t\treturn 'wp101_' . substr( md5( $uri . wp_json_encode( $args ) ), 0, 12 );\n\t}", "public function getCacheId();", "public function getCacheKey()\n {\n return $this->cacheKey ?: md5($this->getSql() . serialize($this->params) . serialize($this->paramTypes));\n }", "public function getCacheKeyString() {\n $view_cache_key = array();\n $keys = array_keys($_GET);\n foreach ($keys as $key) {\n array_push($view_cache_key, $_GET[$key]);\n }\n if (MakerbaseSession::isLoggedIn()) {\n array_push($view_cache_key, MakerbaseSession::getLoggedInUser());\n }\n return '.ht'.$this->view_template.self::KEY_SEPARATOR.(implode($view_cache_key, self::KEY_SEPARATOR));\n }", "protected function GetCacheKey()\n\t{\n\t}", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->get_id() . '_' . $this->module() . '_' . $this->unique() );\n\t}" ]
[ "0.73169416", "0.7141809", "0.69401246", "0.6690255", "0.6660045", "0.66359276", "0.6634975", "0.6634975", "0.6634975", "0.6617226", "0.6601188", "0.65675354", "0.6554845", "0.6439311", "0.64347494", "0.6419884", "0.6340159", "0.6339178", "0.63298315", "0.6304731", "0.62699085", "0.62648755", "0.6254915", "0.62279737", "0.62123764", "0.6194989", "0.6189656", "0.6172962", "0.61359763", "0.6133048" ]
0.7991787
0
Convert this file into a swift attachment
public function toSwiftAttachment() { //create the swift attachment $attachment = \Swift_Attachment::fromPath($this->getAbsolutePath())->setFilename($this->getName()); //return the attachment return $attachment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nm_mandrill_process_attachment($path) {\n\t$struct = array();\n \n if (!@is_file($path))\n \treturn false;\n\n $filename = basename($path);\n \n $file_buffer = file_get_contents($path);\n $file_buffer = chunk_split(base64_encode($file_buffer), 76, \"\\n\");\n \n $mime_type = '';\n\tif ( function_exists('finfo_open') && function_exists('finfo_file') ) {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($finfo, $path);\n } elseif ( function_exists('mime_content_type') ) {\n $mime_type = mime_content_type($path);\n }\n\n if (!empty($mime_type)) \n \t$struct['type'] = $mime_type;\n \n $struct['name'] = $filename;\n $struct['content'] = $file_buffer;\n\n return $struct;\n}", "protected function createAttachmentFromPath($file)\n {\n return Swift_Attachment::fromPath($file);\n }", "public function getAttachment();", "public function attach($file);", "function _build_attachement()\n {\n \t$this->xheaders[\"Content-Type\"] = \"multipart/mixed;\\n boundary=\\\"$this->boundary\\\"\";\n \t$this->fullBody = \"This is a multi-part message in MIME format.\\n--$this->boundary\\n\";\n \t$this->fullBody .= \"Content-Type: text/html; charset=$this->charset\\nContent-Transfer-Encoding: $this->ctencoding\\n\\n\" . $this->body .\"\\n\";\n \t$sep= chr(13) . chr(10);\n \t$ata= array();\n \t$k=0;\n \t// for each attached file, do...\n \tfor( $i=0; $i < count( $this->aattach); $i++ ) {\n \t\t$filename = $this->aattach[$i];\n \t\t$basename = basename($filename);\n \t\t$ctype = $this->actype[$i];\t// content-type\n \t\t$disposition = $this->adispo[$i];\n \t\tif( ! file_exists( $filename) ) {\n \t\t\techo \"Class Mail, method attach : file $filename can't be found\"; exit;\n \t\t}\n \t\t$subhdr= \"--$this->boundary\\nContent-type: $ctype;\\n name=\\\"$basename\\\"\\nContent-Transfer-Encoding: base64\\nContent-Disposition: $disposition;\\n filename=\\\"$basename\\\"\\n\";\n \t\t$ata[$k++] = $subhdr;\n \t\t// non encoded line length\n \t\t$linesz= filesize( $filename)+1;\n \t\t$fp= fopen( $filename, 'r' );\n \t\t$ata[$k++] = chunk_split(base64_encode(fread( $fp, $linesz)));\n \t\tfclose($fp);\n \t}\n \t$this->fullBody .= implode($sep, $ata);\n }", "public function attachFile($file)\n {\n $this->message->attach(Swift_Attachment::fromPath(FILE_PATH.$file));\n }", "protected function createPartForAttachment()\n {\n $part = null;\n if ($this->isMime()) {\n $part = $this->mimePartFactory->newMimePart();\n $part->setRawHeader('Content-Transfer-Encoding', 'base64');\n if ($this->getHeaderValue('Content-Type') !== 'multipart/mixed') {\n $this->setMessageAsMixed();\n }\n } else {\n $part = $this->mimePartFactory->newUUEncodedPart();\n }\n return $part;\n }", "public function addAttachment(IFile $File);", "public function zip()\n {\n\n if (empty($this->filepath)) {\n throw(new \\Exception(\"Must set \\sb\\Email\\Attachment::file_path before zipping attachment\"));\n }\n\n if (empty($this->name)) {\n $this->name = basename($this->filepath);\n }\n\n $zip = new \\ZipArchive();\n $zipfile_path = \\ROOT . \"/private/cache/compression/\" . md5(microtime(true)) . '_' . $this->name . \".zip\";\n $zip_dir = dirname($zipfile_path);\n if (!is_dir($zip_dir) && !@mkdir($zip_dir, 0755, true)) {\n throw(new \\Exception(\"Cannot create /private/cache/compression directory\\n\"));\n }\n\n if ($zip->open($zipfile_path, \\ZIPARCHIVE::CREATE) !== true) {\n throw(new \\Exception(\"Cannot open <$zipfile_path>\\n\"));\n }\n\n $zip->addFromString($this->name, \\file_get_contents($this->filepath));\n\n $zip->close();\n\n $this->name .= '.zip';\n\n //this is the content, in this case I am ready the blob data from a saved image file but you could easily replace this with blob data from a database. The mime type will be added based on the extension using \\sb\\Files::extensionToMime. For bizarre mime-types that are not in \\sb\\Files::extensionToMime you can override this by setting the mime-type manually $myAttachment->mime_type ='bizarre/weird';\n $this->contents = \\file_get_contents($zipfile_path);\n\n //remove the tmp zip file\n \\unlink($zipfile_path);\n\n //add mime type for zip files, \\sb\\Files should handle this after 1.41\n $this->mime_type = 'application/x-zip-compressed';\n }", "function addAttachment( &$mail, &$data , $fileName )\n{\n $file = new eZFile();\n $file->dumpDataToFile( $data, $fileName );\n\n $uploadedFile = new eZVirtualFile();\n $uploadedFile->setName( $fileName );\n $uploadedFile->setDescription( \"\" );\n\n $uploadedFile->setFile( $file );\n \n $uploadedFile->store();\n\n $mail->addFile( $uploadedFile );\n}", "function add_attachment($message, $name = \"\", $ctype = \"application/octet-stream\") {\n\n $this->parts[] = array (\n\n \"ctype\" => $ctype,\n\n \"message\" => $message,\n\n \"encode\" => $encode,\n\n \"name\" => $name\n\n );\n\n }", "public function Send()\n\t{\n\t\t$separator = md5(time());\n\t\t//carriage return type (RFC)\n\t\t$eol = \"\\r\\n\";\n\t\t$mime_boundary = \"==Multipart_Boundary_x{$separator}x\";\n\n\t\t//header\n\t\t$Headers = \"MIME-Version: 1.0\" .$eol;\n\t\t$Headers .= \"Content-Type: multipart/mixed; boundary=\\\"{$mime_boundary}\\\"\" .$eol;\n\n\t\t//body\n\t\t$Body = \"--{$mime_boundary}\".$eol;\n\t\t$Body .= \"Content-Type:text/html; charset=\\\"iso-8859-1\\\"\".$eol;\n\t\t$Body .= \"Content-Transfer-Encoding: 7bit\".$eol.$eol;\n\t\t$Body .= $this->Body .= \"\".$eol;\n\n\t\t//attachments\n\t\tforeach ($this->Attachment as $Index => $Attachment){\n\t\t\t//get the file extention\n\t\t\t$ext = pathinfo($Attachment, PATHINFO_EXTENSION);\n\n\t\t\t//add attachment to body\n\t\t\t$Body .= \"--{$mime_boundary}\".$eol;\n\t\t\t$Body .= \"Content-Type: application/octet-stream; name=\\\"\".$Attachment.\"\\\"\".$eol;\n\t\t $Body .= \"Content-Transfer-Encoding: base64\".$eol;\n\t\t $Body .= \"Content-Disposition: attachment; filename=$Index.$ext\".$eol.$eol;\n\t\t $Body .= chunk_split(base64_encode(file_get_contents($Attachment)));\n\t\t $Body .= $eol;\n\t\t}\n\t\t/*\n\t\t$Body .= \"--{$mime_boundary}\".$eol;\n\t\t$Body .= \"Content-Type: application/octet-stream; name=\\\"{$this->Attachment[0]}\\\"\".$eol;\n\t\t$Body .= \"Content-Transfer-Encoding: base64\".$eol;\n\t\t$Body .= \"Content-Disposition: attachment; filename={$this->Attachment[0]}\".$eol.$eol;\n\t\t$Body .= chunk_split(base64_encode(file_get_contents($this->Attachment[0])));\n\t\t$Body .= $eol;\n\t\t*/\n\n\n\n\t\t//add headers\n\t\t//$Headers = \"MIME-Version: 1.0\". $eol;\n\t\t//$Headers .= \"Content-type: text/html; charset=iso-8859-1\\r\\n\";\n\n\t\t//add cc's\n\t\t$Cc = \"\";\n\t\tforeach ($this->CC as $Index => $arrAddress){\n\t\t\t//$Cc = $arrAddress[$Index].\"<\".$arrAddress[1].\">,\";\n\t\t\t$Cc .= \"$Index<$arrAddress>,\";\n\t\t}\n\t\t$Headers .= \"Cc: \". $Cc. $eol;\n\n\t\t//add from\n\t\t$Headers .= \"From: \". $this->FROM[0].\"<\".$this->FROM[1].\">\". $eol;\n\n\t\t//add reply to\n\t\t$Headers .= \"Reply-To: \". (isset($this->REPLY[0])?$this->REPLY[0].\"<\".$this->REPLY[1].\">,\":$this->FROM[0].\"<\".$this->FROM[1].\">,\"). $eol;\n\n\t\t//mailer\n\t\t$Headers .= \"X-Mailer: PHP/\" . phpversion();\n\n\n\t\t//to\n\t\t$To = \"\";\n\t\tforeach ($this->TO as $Index => $arrAddress){\n\t\t\t//$To .= $arrAddress[$Index].\"<\".$arrAddress[1].\">,\";\n\t\t\t$To .= \"$Index<$arrAddress>,\";\n\t\t}\n\n\n\t\t//send mail\n\t\tif (!mail($To, $this->Subject, /*$this->Body*/$Body, $Headers)){\n\t\t\techo \"mail failed\";\n\t\t}\n\n\t\treturn 0;\t//false is failed, true if succeded\n\t}", "public function createAttachment()\n {\n $validatedData = $this->validate([\n 'name' => ['required', 'string', 'max:255'],\n 'attachment' => ['mimes:jpeg,bmp,png,csv,txt,pdf,xls,xlm,doc,docx,xml,json,xlsx', 'max:10240'],\n ]);\n\n $name = Str::snake($this->name.\"_\".time()).'.'.$this->attachment->extension();\n $this->attachment->storeAs('attachments', $name);\n\n \\App\\Models\\Attachment::create([\n 'name' => $this->name,\n 'file_name' => $name,\n ]);\n\n notify()->success('Dokument zapisany!', 'Sukces');\n \n return redirect()->route('attachments');\n }", "public function getVoucherAttachment();", "public function uploadEmailAttachment($file,$attachment) {\n $folder = '';\n $U = $this->settings->attachpath.'/'.$file;\n $Y = date('Y',$this->datetime->mswTimeStamp());\n $M = date('m',$this->datetime->mswTimeStamp());\n // Create folders..\n if (!is_dir($this->settings->attachpath.'/'.$Y)) {\n $omask = @umask(0); \n @mkdir($this->settings->attachpath.'/'.$Y,msAPI::ATTACH_CHMOD_VALUE);\n @umask($omask);\n }\n if (is_dir($this->settings->attachpath.'/'.$Y)) {\n if (!is_dir($this->settings->attachpath.'/'.$Y.'/'.$M)) {\n $omask = @umask(0); \n @mkdir($this->settings->attachpath.'/'.$Y.'/'.$M,msAPI::ATTACH_CHMOD_VALUE);\n @umask($omask);\n }\n if (is_dir($this->settings->attachpath.'/'.$Y.'/'.$M)) {\n $U = $this->settings->attachpath.'/'.$Y.'/'.$M.'/'.$file;\n $folder = $Y.'/'.$M.'/';\n }\n }\n $fp = @fopen($U,'wb');\n if ($fp) {\n @fwrite ($fp, base64_decode($attachment));\n @fclose ($fp);\n }\n return $folder;\n}", "public function addAttachement(string $file): void\r\n {\r\n if (!isset($this->mime_boundary)) $this->setBoundary();\r\n if (!isset($this->backupBody)) $this->backupBody = $this->getBody();\r\n\r\n // $this->mime_boundary = $this->setBoundary();\r\n\r\n if (!isset($this->messageHead)) {\r\n $this->messageHead = \"--{$this->mime_boundary}\\n\" . \"Content-Type: text/html; charset=\\\"UTF-8\\\"\\n\" .\r\n \"Content-Transfer-Encoding: Content-Transfer-Encoding\\n\\n\";\r\n }\r\n\r\n $this->messageAttachment = $this->file($file);\r\n\r\n $message = $this->messageHead . $this->backupBody . \"\\n\\n\" . $this->messageAttachment . \"--{$this->mime_boundary}--\";\r\n // $message = $this->messageHead . $this->backupBody . \"\\n\\n\". $this->messageAttachment . $this->message .= \"--{$this->mime_boundary}--\";\r\n\r\n $this->addBody($message);\r\n // echo $this->addBody($message);\r\n\r\n\r\n }", "public function inlineAttachment(IFile $File);", "protected function file(string $file): string\r\n {\r\n if (!empty($file) > 0) {\r\n if (is_file($file)) {\r\n\r\n if (!isset($this->message)) {\r\n $this->message = \"--{$this->mime_boundary}\\n\";\r\n } else {\r\n $this->message .= \"--{$this->mime_boundary}\\n\";\r\n }\r\n\r\n $fp = @fopen($file, \"rb\");\r\n $data = @fread($fp, filesize($file));\r\n\r\n @fclose($fp);\r\n $data = chunk_split(base64_encode($data));\r\n\r\n $this->message .= \"Content-Type: application/octet-stream; name=\\\"\" . basename($file) . \"\\\"\\n\" .\r\n \"Content-Description: \" . basename($file) . \"\\n\" .\r\n \"Content-Disposition: attachment;\\n\" . \" filename=\\\"\" . basename($file) . \"\\\"; size=\" . filesize($file) . \";\\n\" .\r\n \"Content-Transfer-Encoding: base64\\n\\n\" . $data . \"\\n\\n\";\r\n }\r\n }\r\n // $this->message .= \"--{$this->mime_boundary}--\" .\"\\n\\n\";\r\n return $this->message;\r\n }", "public function downloadAttachment($id){\n $attach = Attachment::find($id);\n if ($attach->num_prot){\n $app = TitulusHelper::downloadAttachment($attach->nrecord);\n if ($app){\n $attach['filevalue'] = base64_encode($app->content); \n if ($attach->filetype == 'link'){\n $attach['filename'] = $app->title.'.pdf';\n }\n }\n }else{\n $attach['filevalue'] = base64_encode(Storage::get($attach->filepath));\n } \n return $attach; \n }", "public function createAttachment( $data, $size, $fileName );", "function montaEnvioAnexo($arquivo, $nome, $boundary) {\n if (file_exists($arquivo)) {\n $myfile = fopen($arquivo, \"r\") or die(\"Unable to open file!\");\n $attachment = chunk_split(base64_encode(fread($myfile, filesize($arquivo))));\n fclose($myfile);\n\n $ret = \"--$boundary\\r\\n\"\n . \"Content-Type: application/octet-stream; name=\\\"\" . $nome . \"\\\"\\r\\n\"\n . \"Content-Transfer-Encoding: base64\\r\\n\"\n . \"Content-Disposition: attachment; filename=\\\"$nome\\\"\\r\\n\"\n . \"\\r\\n\" . $attachment . \"\\r\\n\"\n . \"\\r\\n\\r\\n\\r\\n\";\n\n return $ret;\n } else {\n return \"\";\n }\n}", "function attach($file,$inline=FALSE,$ctype='application/octet-stream',$name=null){\n\t\tif(! file_exists($file)) return FALSE;\n\t\t$datas = array(); # must do this to use anonymous method set_header()\n\t\t$datas['name'] = is_null($name)?basename($file):$name;\n\t\tself::set_header(\n\t\t\t$datas,'Content-Type',\n\t\t\t((is_null($ctype) && function_exists('mime_content_type'))?mime_content_type($file):$ctype).';'\n\t\t);\n\t\tself::set_header($datas,'Content-Type',\"name=\\\"$datas[name]\\\"\",TRUE);\n\t\tself::set_header($datas,'Content-Transfer-Encoding',$this->parts_encoding,FALSE);\n\t\tself::set_header($datas,'Content-Disposition',($inline?'inline':'attachment').';',FALSE);\n\t\tself::set_header($datas,'Content-Disposition',\"filename=\\\"$datas[name]\\\"\",TRUE);\n\t\tif($inline){\n\t\t\t$datas['cid'] = md5($datas['name'].uniqid(rand()));\n\t\t\tself::set_header($datas,'Content-ID',\"<$datas[cid]>\",FALSE);\n\t\t}\n\t\tif(!($f = fopen($file,'r')) )\n\t\t\treturn FALSE;\n\t\t#@todo correctly handle encoding regarding the parts_encoding property\n\t\t$datas['datas'] = chunk_split(base64_encode(fread($f,filesize($file))),76,\"\\n\");\n\t\tfclose($f);\n\n\t\t$this->parts[($inline?'inline':'attachment')][] = $datas;\n\t\treturn $inline?$datas['cid']:$datas['name'];\n\t}", "public function attachFile($file)\n {\n if (!($file instanceof Message\\Attachment) && is_string($file)) {\n $file = new Message\\Attachment($file);\n }\n return $this->addPart($file);\n }", "public function attach_plain_image(){\n if(isset($this->_query['file']) and is_array($this->_query['file'])){\n return;\n }\n \n // if file received from POST request \n \n // default mode\n if(!empty($_FILES)){\n\n if(NULL == ($tmpfile = Arr::path($_FILES, key($_FILES).'.tmp_name')) or !file_exists($tmpfile)){\n throw new HTTP_Exception_406('File not found.');\n return;\n }\n \n if(!is_readable($tmpfile)){\n throw new HTTP_Exception_403('Access denied to read tmpfile');\n return;\n }\n\n $stream = file_get_contents($tmpfile);\n\n if(FALSE === ($tmpfile = Model::factory('Filesystem')->create_tmpfile_stream($stream))){\n throw new Exception('Cannot create tmpfile');\n }\n \n \n $this->_query['file'] = array(array(\n 'file' => $tmpfile['file'],\n 'name' => $tmpfile['file'],\n 'main' => 0\n ));\n \n // from base64 code \n \n } else if(isset($this->_query['file']) and is_string($this->_query['file'])){\n \n $base64code = base64_decode($this->_query['file']);\n \n if(FALSE === ($tmpfile = Model::factory('Filesystem')->create_tmpfile_stream($base64code))){\n throw new Exception('Cannot create tmpfile');\n }\n \n $this->_query['file'] = $tmpfile['file'];\n \n }\n\n \n }", "function addAttachment(\n\t\t$file,\n\t\t$c_type = 'application/octet-stream',\n\t\t$name = '',\n\t\t$isfile = true,\n\t\t$encoding = 'base64',\n\t\t$disposition = 'attachment',\n\t\t$charset = '',\n\t\t$language = '',\n\t\t$location = '')\n\t{\n\t\t$filedata = ($isfile === true) ? $this->_file2str($file) : $file;\n\t\tif ($isfile === true) {\n\t\t\t// Force the name the user supplied, otherwise use $file\n\t\t\t$filename = (strlen($name)) ? $name : $file;\n\t\t} else {\n\t\t\t$filename = $name;\n\t\t}\n\t\tif (!strlen($filename)) {\n\t\t\tthrow new RuntimeException(\"The supplied filename for the attachment can't be empty\");\n\t\t}\n//\t\t$filename = basename($filename);\n\n\t\t$this->_parts[] = array(\n\t\t\t'body' => $filedata,\n\t\t\t'name' => $filename,\n\t\t\t'c_type' => $c_type,\n\t\t\t'encoding' => $encoding,\n\t\t\t'charset' => $charset,\n\t\t\t'language' => $language,\n\t\t\t'location' => $location,\n\t\t\t'disposition' => $disposition\n\t\t\t);\n\t\treturn true;\n\t}", "function &_addAttachmentPart(&$obj, $value)\n\t{\n\t\t$params['dfilename'] = $value['name'];\n\t\t$params['encoding'] = $value['encoding'];\n\t\tif ($value['charset']) {\n\t\t\t$params['charset'] = $value['charset'];\n\t\t}\n\t\tif ($value['language']) {\n\t\t\t$params['language'] = $value['language'];\n\t\t}\n\t\tif ($value['location']) {\n\t\t\t$params['location'] = $value['location'];\n\t\t}\n\t\t$params['content_type'] = $value['c_type'];\n\t\t$params['disposition'] = isset($value['disposition']) ? \n\t\t\t\t\t\t\t\t $value['disposition'] : 'attachment';\n\t\t$ret = $obj->addSubpart($value['body'], $params);\n\t\treturn $ret;\n\t}", "function add_attachment( $message, $name = \"\", $ctype = \"application/octet-stream\" )\n {\n global $internalMailParts; \n\n $internalMailParts[] = array (\n \"ctype\" => $ctype,\n \"message\" => $message,\n \"encode\" => $encode,\n \"name\" => $name\n );\n }", "function AttachAll() {\n // Return text of body\n $mime = array();\n\n // Add all attachments\n for($i = 0; $i < count($this->attachment); $i++)\n {\n // Check for string attachment\n $bString = $this->attachment[$i][5];\n if ($bString)\n $string = $this->attachment[$i][0];\n else\n $path = $this->attachment[$i][0];\n\n $filename = $this->attachment[$i][1];\n $name = $this->attachment[$i][2];\n $encoding = $this->attachment[$i][3];\n $type = $this->attachment[$i][4];\n $disposition = $this->attachment[$i][6];\n $cid = $this->attachment[$i][7];\n \n $mime[] = sprintf(\"--%s%s\", $this->boundary[1], $this->LE);\n $mime[] = sprintf(\"Content-Type: %s; name=\\\"%s\\\"%s\", $type, $name, $this->LE);\n $mime[] = sprintf(\"Content-Transfer-Encoding: %s%s\", $encoding, $this->LE);\n\n if($disposition == \"inline\")\n $mime[] = sprintf(\"Content-ID: <%s>%s\", $cid, $this->LE);\n\n $mime[] = sprintf(\"Content-Disposition: %s; filename=\\\"%s\\\"%s\", \n $disposition, $name, $this->LE.$this->LE);\n\n // Encode as string attachment\n if($bString)\n {\n $mime[] = $this->EncodeString($string, $encoding);\n if($this->IsError()) { return \"\"; }\n $mime[] = $this->LE.$this->LE;\n }\n else\n {\n $mime[] = $this->EncodeFile($path, $encoding); \n if($this->IsError()) { return \"\"; }\n $mime[] = $this->LE.$this->LE;\n }\n }\n\n $mime[] = sprintf(\"--%s--%s\", $this->boundary[1], $this->LE);\n\n return join(\"\", $mime);\n }", "function sendWithAttachment($atchfilename, $atchfilepath , $tmppath='', $set_tmp_replace_var='') {\n\t\t\n\t\tif($tmppath != '')\n \t$this->getTemplate($tmppath ,$set_tmp_replace_var);\n \t\n\t\t$file = $atchfilepath.$atchfilename;\n\t\t$file_size = filesize($file);\n\t\t$handle = fopen($file, \"r\");\n\t\t$content = fread($handle, $file_size);\n\t\tfclose($handle);\n\t\t$content = chunk_split(base64_encode($content));\n\t\t$uid = md5(uniqid(time()));\n\t\t$name = basename($file);\n\t\t\n\t\t$this->addHeader(\"From: \".$this->from.\"\\r\\n\");\n\t\t$this->addHeader(\"Reply-To: \".$this->from.\"\\r\\n\");\n\t\t$this->addHeader(\"MIME-Version: 1.0\\r\\n\");\n\t\t$this->addHeader(\"Content-Type: multipart/mixed; boundary=\\\"\".$uid.\"\\\"\\r\\n\\r\\n\");\n\t\t$this->addHeader(\"This is a multi-part message in MIME format.\\r\\n\");\n\t\t$this->addHeader(\"--\".$uid.\"\\r\\n\");\n\t\t$this->addHeader(\"Content-type:text/html; charset=iso-8859-1\\r\\n\");\n\t\t$this->addHeader(\"Content-Transfer-Encoding: 7bit\\r\\n\\r\\n\");\n\t\t$this->addHeader($this->body.\"\\r\\n\\r\\n\");\n\t\t$this->addHeader(\"--\".$uid.\"\\r\\n\");\n\t\t$this->addHeader(\"Content-Type: application/octet-stream; name=\\\"\".$atchfilename.\"\\\"\\r\\n\"); // use different content types here\n\t\t$this->addHeader(\"Content-Transfer-Encoding: base64\\r\\n\");\n\t\t$this->addHeader(\"Content-Disposition: attachment; filename=\\\"\".$atchfilename.\"\\\"\\r\\n\\r\\n\");\n\t\t$this->addHeader($content.\"\\r\\n\\r\\n\");\n\t\t$this->addHeader(\"--\".$uid.\"--\");\n\t\t\n\t\treturn $this->sendMail(); // Final mail sending\n\t\t\n\t}", "function attachFiles ($fp, $session, $rn=\"\\r\\n\") {\n global $attachments, $attachment_dir, $username;\n\n $length = 0;\n\n $hashed_attachment_dir = getHashedDir($username, $attachment_dir);\n if (isMultipart($session)) {\n foreach ($attachments as $info) {\n if ($info['session'] == $session) {\n if (isset($info['type'])) {\n $filetype = $info['type'];\n }\n else {\n $filetype = 'application/octet-stream';\n }\n \n $header = '--' . mimeBoundary() . \"$rn\";\n if ( isset($info['remotefilename']) \n && $info['remotefilename'] != '') {\n $header .= \"Content-Type: $filetype; name=\\\"\" .\n $info['remotefilename'] . \"\\\"$rn\";\n $header .= \"Content-Disposition: attachment; filename=\\\"\"\n . $info['remotefilename'] . \"\\\"$rn\";\n } else {\n $header .= \"Content-Type: $filetype$rn\";\n }\n\n \n /* Use 'rb' for NT systems -- read binary\n * Unix doesn't care -- everything's binary! :-)\n */\n \n $filename = $hashed_attachment_dir . '/' \n . $info['localfilename'];\n $file = fopen ($filename, 'rb');\n if (substr($filetype, 0, 5) == 'text/' ||\n substr($filetype, 0, 8) == 'message/' ) {\n $header .= $rn;\n\t\t\t\t\tif ($fp) {\n\t\t\t\t\t fputs ($fp, $header);\n\t\t\t\t\t}\n $length += strlen($header);\n while ($tmp = fgets($file, 4096)) {\n $tmp = str_replace(\"\\r\\n\", \"\\n\", $tmp);\n $tmp = str_replace(\"\\r\", \"\\n\", $tmp);\n if ($rn == \"\\r\\n\"){\n $tmp = str_replace(\"\\n\", \"\\r\\n\", $tmp);\n }\n /**\n * Check if the last line has newline ($rn) in it\n * and append if it doesn't.\n */\n if ($fp && feof($fp) && !strstr($tmp, \"$rn\")){\n $tmp .= $rn;\n }\n if ($fp) {\n fputs($fp, $tmp);\n }\n $length += strlen($tmp);\n }\n } else {\n $header .= \"Content-Transfer-Encoding: base64\" \n . \"$rn\" . \"$rn\";\n if ($fp) fputs ($fp, $header);\n $length += strlen($header);\n while ($tmp = fread($file, 570)) {\n $encoded = chunk_split(base64_encode($tmp));\n $length += strlen($encoded);\n if ($fp) fputs ($fp, $encoded);\n }\n }\n fclose ($file);\n }\n }\n }\n return $length;\n}" ]
[ "0.64041317", "0.63601476", "0.6189841", "0.6025416", "0.5984726", "0.58776927", "0.57879084", "0.5766378", "0.57620126", "0.5759737", "0.5720179", "0.56973785", "0.56903374", "0.56145805", "0.55999875", "0.5578529", "0.55772156", "0.5541191", "0.5537505", "0.55163234", "0.55155224", "0.54915893", "0.54567045", "0.54549307", "0.54502064", "0.5363611", "0.5340903", "0.53261745", "0.531385", "0.5277283" ]
0.7454816
0
excel( $quincena, $estado ): Exporta el listado a excel
function excel( $quincena, $estado) { $datos['quincena'] = $quincena; // obtiene el listado de observaciones $datos['consulta'] = $this->observaciones_itarh_model->get_observaciones( $quincena, $estado ); // estructura de la página $this->load->view('itarh/observaciones/excel',$datos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dExcel(){\n\t\t$result = $this->m->getNinos();\n\t\t$this->export_excel->to_excel($result, 'lista_de_niños');\n\t}", "public function excel()\n\t{\t \n\t\t header('Content-Disposition: attachment; filename=duplicados.xls');\n\t\t header('Content-Type: application/vnd.ms-excel; charset=iso-8859-1');\n\t//\texit($_GET['idapertura']);\n\t\tif (!isset($_GET['fechabuscar'])) {\n\t\t\t $buscar = (isset($_POST['loquita']) ? $_POST['loquita']: '' );\n\t\t\t $grilla='Excel';\n\t\t} else { \n\t\t\t$buscar = $_GET['fechabuscar'];\n\t\t\t$grilla='Excelbus';\n\t\t}\n\t\t$libro = $this->Duplicados_model->$grilla($buscar);\n\n\t\t echo \"<table >\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>#</th>\n\t\t\t\t\t<th>CODIGO</th>\n\t\t\t\t\t<th>DNI</th>\n\t\t\t\t\t<th>ESTUDIANTE</th>\n\t\t\t\t\t<th>TIPO</th>\n\t\t\t\t\t<th>CURSO</th>\n\t\t\t\t\t<th>PERIODO</th>\n\t\t\t\t\t<th>FOLIO</th>\n\t\t\t\t\t<th>CORRELATIVO</th>\n\t\t\t\t\t<th>FECHA DE IMPRESIÓN</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\";\n\t\t\t$num=1;\n\t\t\tif (!empty($libro)) : \n\t\t\t\tforeach ($libro as $libros) :\n\t\t\t\t\techo \"<tr>\";\n\t\t\t\t\t\techo \"<td>\". $num.\"</td>\";\n\t\t\t\t\t\techo \"<td>\". $libros->id.\"</td>\";\n\t\t\t\t\t\techo \"<td>\". $libros->num_documento.\"</td>\";\n\t\t\t\t\t\techo \"<td>\".utf8_decode($libros->estudiante).\"</td>\";\n\t\t\t\t\t\techo \"<td>\". utf8_decode($libros->descripcion).\"</td>\";\n\t\t\t\t\t\techo \"<td>\". utf8_decode($libros->curso).\"</td>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\techo \"<td> DEL \".date('d/m/Y', strtotime($libros->fecha_ini)).\" AL \".date('d/m/Y', strtotime($libros->fecha_fin)).\"</td>\";\n\t\t\t\t\t\techo \"<td>\". $libros->folio.\"</td>\";\n\t\t\t\t\t\techo \"<td>\". $libros->correlativo.\"</td>\";\n\t\t\t\t\t\techo \"<td>\". $libros->fecha_dupli.\"</td>\";\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t$num=$num+1;\n\t\t\t\t\t\t endforeach;\n\t\t\t\t\t endif; \n\t\t\t\techo \"</tbody>\n\t\t\t</table>\n\t\t\";\n\t\t//return $varlo;\n\t}", "public function exportExcel(){\n $clients = Client::all();\n\n if(!$clients->isEmpty()){\n\n $title = 'Clientes';\n\n \t\tforeach ($clients as $client) {\n \t\t\t$array[] = [\n \t\t\t\t'Nombre' => $client->name,\n \t\t\t\t'Empresa' => $client->company,\n \t\t\t\t'Origen' => $client->origin,\n \t\t\t\t'Correo electrónico' => $client->email,\n \t\t\t\t'Teléfono' => $client->phone,\n 'Fecha de registro' => $client->created_at\n \t\t\t];\n \t\t}\n\n $xls = Excel::create($title . ' ' . time(), function($excel) use ($title, $array) {\n $excel->setTitle($title);\n $excel->sheet($title, function($sheet) use ($array) {\n $sheet->fromArray($array);\n });\n });\n return $xls->download('xls');\n }\n \treturn abort(404);\n\n }", "public function exportar(){\n\t\t$entradaAlmacen=$this->EntradaAlmacen_model->mostrar_lista();\n\t\t$data['entradaAlmacen']=$entradaAlmacen;\n\t\t$this->load->view('inventarios/excel/entradaAlmacen_tabla',$data);\n\t}", "public function exportarExcel($id_lista){\n\n $this->load->library('libreriaExcel/PHPExcel');\n $objPHPExcel = new PHPExcel();\n $objPHPExcel->setActiveSheetIndex(0); \n\n $lista = $this->getListaPorID($id_lista);\n $contactos = $this->getDatosContactosLista($id_lista);\n\n $letra_gen = 65;\n $numero_gen = 1;\n\n //cargar nombre de las columnas al Excel\n foreach ($contactos['nombre_columnas'] as $nombres) {\n $objPHPExcel->getActiveSheet()->SetCellValue((chr($letra_gen)).($numero_gen),$nombres);\n $letra_gen++;\n }\n\n $letra_gen = 65; \n $numero_gen++;\n\n //cargar datos de las columnas al archivo Excel\n foreach ($contactos['valores'] as $row_index => $row) {\n foreach ($row as $cell_index => $cell_value) {\n if ($cell_index!='id_contacto') {\n $objPHPExcel->getActiveSheet()->SetCellValue((chr($letra_gen)).($numero_gen), $cell_value);\n $letra_gen++;\n //columna ancho autosize\n $objPHPExcel->getActiveSheet()->getColumnDimension(chr($letra_gen))->setAutoSize(true);;\n \n }\n }\n $letra_gen = 65;\n $numero_gen++;\n }\n\n $nombre_archivo = $lista['nombre']. '.xlsx'; \n $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);\n $export_result = $objWriter->save(DIR_DOWNLOAD. \"Archivos_descargados/\". utf8_encode($nombre_archivo ));\n \n $path = DIR_FILE. utf8_encode($nombre_archivo);\n return $path;\n }", "public function exportIntoExcel()\n {\n return Excel::download(new EmployeeExport, 'employeelist.xlsx');\n }", "public function index()\n {\n \n Excel::create('Articulos', function($excel) {\n \n $excel->sheet('Articulos', function($sheet) {\n \n $products = Articulo::all();\n \n $sheet->fromArray($products);\n \n });\n })->download('xls');\n \n }", "public function exportarAction() {\n $hijos = $this->getDoctrine()\n ->getRepository('UsuariosBundle:Hijo')\n ->findHijos();\n\n $response = $this->render(\n 'UsuariosBundle:Hijo:list.xls.twig', array('hijos' => $hijos)\n );\n $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');\n $response->headers->set('Content-Disposition', 'attachment; filename=\"export-hijos.xls\"');\n return $response;\n }", "public function exportExcel(){\r\n\t\t$objPHPExcel = new PHPExcel();\r\n\t\t$data = $this->getList(1,1000);\r\n\t\t$data = $data['data'];\r\n\r\n\t\t$objPHPExcel->setActiveSheetIndex(0);\r\n\t\t$objPHPExcel->getActiveSheet()->setTitle($this->lang['user']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A1', $this->c->siteName.'_'.$this->lang['exportFile']);\r\n\t\t\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A2', $this->lang['username']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B2', $this->lang['password']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C2', $this->lang['money']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D2', $this->lang['credits']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('E2', $this->lang['photo']);\r\n\r\n\t\t$index = 2;\r\n\t\tfor($i=0;$i<count($data);$i++){\r\n\t\t\t$index ++;\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$index, $data[$i]['username']);\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$index, $data[$i]['password']);\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$index, $data[$i]['money']);\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$index, $data[$i]['credits']);\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$index, $data[$i]['photo']);\r\n\t\t}\r\n\t\t$objStyle = $objPHPExcel->getActiveSheet()->getStyle('E2');\r\n\t\t$objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\r\n\t\t$objPHPExcel->getActiveSheet()->duplicateStyle($objStyle, 'E2:E'.(count($data)+1));\r\n\t\t$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);\r\n\t\t$file = \"download/\".date('YmdHis').\".xls\";\r\n\t\t$objWriter->save($this->c->filePath.$file);\r\n\t\treturn $file;\r\n\t}", "public function GenereInformeDepartamento($Mes,$Anio,$Vector) {\r\n $FechaIni=$Anio.\"-\".$Mes.\"01\";\r\n $FechaFin=$Anio.\"-\".$Mes.\"31\";\r\n require_once '../librerias/Excel/PHPExcel.php';\r\n $objPHPExcel = new PHPExcel(); \r\n $Consulta= $this->obCon->ConsultarTabla(\"prod_departamentos\", \"\"); \r\n $i=0;\r\n while($DatosDepartamentos=$this->obCon->FetchArray($Consulta)){\r\n $objPHPExcel->setActiveSheetIndex(0)\r\n ->setCellValue($this->Campos[$i].\"1\",$DatosDepartamentos[\"Nombre\"]);\r\n $i++;\r\n }\r\n \r\n \r\n \r\n //Informacion del excel\r\n $objPHPExcel->\r\n getProperties()\r\n ->setCreator(\"www.technosoluciones.com\")\r\n ->setLastModifiedBy(\"www.technosoluciones.com\")\r\n ->setTitle(\"Exportar Informe desde base de datos\")\r\n ->setSubject(\"Informe\")\r\n ->setDescription(\"Documento generado con PHPExcel\")\r\n ->setKeywords(\"techno soluciones\")\r\n ->setCategory(\"Informe Departamentos\"); \r\n \r\n header('Content-Type: application/vnd.ms-excel');\r\n header('Content-Disposition: attachment;filename=\"'.\"Informe_Departamentos\".'.xls\"');\r\n header('Cache-Control: max-age=0');\r\n $objWriter=PHPExcel_IOFactory::createWriter($objPHPExcel,'Excel2007');\r\n $objWriter->save('php://output');\r\n exit; \r\n \r\n \r\n}", "function history_harga_jual_export_excel(){\r\n\t\t//POST varibale here\r\n\t\t$hjual_no=trim(@$_POST[\"hjual_no\"]);\r\n\t\t$hjual_no=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$hjual_no);\r\n\t\t$hjual_no=str_replace(\"'\", '\"',$hjual_no);\r\n\t\t$hjual_tanggal=trim(@$_POST[\"hjual_tanggal\"]);\r\n\t\t$hjual_harga=trim(@$_POST[\"hjual_harga\"]);\r\n\t\t$hjual_jenis=trim(@$_POST[\"hjual_jenis\"]);\r\n\t\t$hjual_jenis=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$hjual_jenis);\r\n\t\t$hjual_jenis=str_replace(\"'\", '\"',$hjual_jenis);\r\n\t\t$hjual_update=trim(@$_POST[\"hjual_update\"]);\r\n\t\t$hjual_update=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$hjual_update);\r\n\t\t$hjual_update=str_replace(\"'\", '\"',$hjual_update);\r\n\t\t$hjual_date_update=trim(@$_POST[\"hjual_date_update\"]);\r\n\t\t$hjual_revised=trim(@$_POST[\"hjual_revised\"]);\r\n\t\t$option=$_POST['currentlisting'];\r\n\t\t$filter=$_POST[\"query\"];\r\n\t\t\r\n\t\t$query = $this->m_history_harga_jual->history_harga_jual_export_excel($hjual_no ,$hjual_tanggal ,$hjual_harga ,$hjual_jenis ,$hjual_update ,$hjual_date_update ,$hjual_revised ,$option,$filter);\r\n\t\t\r\n\t\tto_excel($query,\"history_harga_jual\"); \r\n\t\techo '1';\r\n\t\t\t\r\n\t}", "public function exportar_excel_simple()\n {\n $fecha_inicio = $this->input->post('fecha_inicio');\n $fecha_fin = $this->input->post('fecha_fin');\n $monto_total_ingreso = ($this->flujo->total_ingreso($fecha_inicio, $fecha_fin));\n $monto_total_egreso = ($this->flujo->total_egreso($fecha_inicio, $fecha_fin));\n $monto_flujo_caja = $monto_total_ingreso - $monto_total_egreso;\n $ingresos = $this->flujo->lista_ingreso_detalle($fecha_inicio, $fecha_fin);\n $egresos = $this->flujo->lista_egreso_detalle($fecha_inicio, $fecha_fin);\n //load librarynya terlebih dahulu\n //jika digunakan terus menerus lebih baik load ini ditaruh di auto load\n $this->load->library(\"excel/PHPExcel\");\n\n /* Creamos Objeto excel */\n $objPHPExcel = new PHPExcel();\n\n /* unimos la celda */\n $objPHPExcel->getActiveSheet()->mergeCells('A1:G1');\n $objPHPExcel->setActiveSheetIndex(0)//elegimos hoja donde vamos a escribir\n /*empesamos a escribir en la hoja de excel*/\n\n ->setCellValue('A1', 'FLUJO DE CAJA')\n ->setCellValue('A3', 'Fecha inicial: ')\n ->setCellValue('B3', date('d-m-Y', strtotime($fecha_inicio)))\n ->setCellValue('D3', 'Fecha final: ')\n ->setCellValue('E3', date('d-m-Y', strtotime($fecha_fin)))\n ->setCellValue('A5', 'Total ingreso(Bs.): ')\n ->setCellValue('B5', number_format($monto_total_ingreso, 2))\n ->setCellValue('D5', 'Total egreso( Bs.): ')\n ->setCellValue('E5', number_format($monto_total_egreso, 2))\n ->setCellValue('A7', 'Flujo caja(Bs.): ')\n ->setCellValue('B7', number_format($monto_flujo_caja, 2));\n\n $objPHPExcel->getActiveSheet()->getStyle('B5')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT)\n ->getActiveSheet()->getStyle('E5')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT)\n ->getActiveSheet()->getStyle('B7')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n //poner negritas\n $objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(TRUE)\n ->getActiveSheet()->getStyle('A3')->getFont()->setBold(TRUE)\n ->getActiveSheet()->getStyle('A5')->getFont()->setBold(TRUE)\n ->getActiveSheet()->getStyle('D3')->getFont()->setBold(TRUE)\n ->getActiveSheet()->getStyle('D5')->getFont()->setBold(TRUE)\n ->getActiveSheet()->getStyle('A7')->getFont()->setBold(TRUE);\n\n //centrar los titulos\n $objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\n $borders = array(\n 'borders' => array(\n 'top' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('argb' => 'FF000000'),\n )\n ),\n );\n $objPHPExcel->getActiveSheet()->getStyle('B10:D10')->applyFromArray($borders);\n\n $fila = 10;\n $total_filas_ingresos = $ingresos['row_tipo_ingreso'];\n /*combinamos para crear columna INGRESO*/\n $cantidad_filas_ingresos = $this->obtener_cantidad_ingresos($ingresos);\n /* $objPHPExcel->getActiveSheet()->mergeCells('B10:B' . ($total_filas_ingresos + $fila - 1))\n ->setCellValue('B10', 'Ingresos');*/\n\n //centrar los titulos\n $objPHPExcel->getActiveSheet()->getStyle('B10')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\n $fila_inicio = $fila;\n $lista_ingresos = $ingresos['lista_ingresos'];\n\n /* cabezera */\n /* coloreamos las cabezeras*/\n $objPHPExcel->getActiveSheet()->getStyle('B' . ($fila_inicio - 1) . ':D' . ($fila_inicio - 1))->getFill()->applyFromArray(\n array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'startcolor' => array(\n 'rgb' => '2d2828'\n )\n ));\n\n $styleArray = array(\n 'font' => array(\n 'color' => array('rgb' => 'FFFFFF')\n ));\n $objPHPExcel->getActiveSheet()->getStyle('B' . ($fila_inicio - 1) . ':D' . ($fila_inicio - 1))->applyFromArray($styleArray);\n /* seteamos titulos de cabezera */\n $objPHPExcel->getActiveSheet()\n ->setCellValue('B' . ($fila_inicio - 1), 'Flujo')\n ->setCellValue('C' . ($fila_inicio - 1), 'Descripcion')\n ->setCellValue('D' . ($fila_inicio - 1), 'Monto total(Bs.)');\n /* Graficado de los datos de Ingreso */\n foreach ($lista_ingresos as $ingreso):\n $cantidad_datos = $ingreso['cantidad_datos'];\n $fila_final = $fila_inicio;\n $objPHPExcel->setActiveSheetIndex(0);\n $objPHPExcel->getActiveSheet()->setCellValue('C' . $fila_inicio, $ingreso['descripcion']);\n $objPHPExcel->getActiveSheet()->getStyle('C' . $fila_inicio)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\n\n $borders = array(\n 'borders' => array(\n 'top' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('argb' => 'FF000000'),\n )\n ),\n );\n $objPHPExcel->getActiveSheet()->getStyle('C' . $fila_inicio . ':D' . $fila_inicio)->applyFromArray($borders);\n /* cargamos las filas de los datos obtenidos */\n $ingreso_lista_filas = $ingreso['lista'];\n\n $objPHPExcel->getActiveSheet()\n ->setCellValue('D' . $fila_final, $ingreso['monto_total_tipo']);\n $objPHPExcel->getActiveSheet()->getStyle('D' . $fila_final)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n $fila_inicio = $fila_final + 1;\n endforeach;\n /* Graficado de los datos de Egreso */\n $total_filas_egresos = $egresos['row_tipo_egreso'];\n /*combinamos para crear columna INGRESO*/\n $cantidad_filas_ingresos = $this->obtener_cantidad_ingresos($egresos);\n /* $objPHPExcel->getActiveSheet()->mergeCells('B' . $fila_inicio . ':B' . ($total_filas_egresos + $fila_inicio - 1))\n ->setCellValue('B' . $fila_inicio, 'Egresos');*/\n $objPHPExcel->getActiveSheet()->getStyle('B' . $fila_inicio)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n $lista_egresos = $egresos['lista_egresos'];\n\n $borders = array(\n 'borders' => array(\n 'top' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('argb' => 'FF000000'),\n )\n ),\n );\n $objPHPExcel->getActiveSheet()->getStyle('B' . $fila_inicio . ':D' . $fila_inicio)->applyFromArray($borders);\n\n foreach ($lista_egresos as $egreso):\n $cantidad_datos = $egreso['cantidad_datos'];\n $fila_final = $fila_inicio;\n $objPHPExcel->setActiveSheetIndex(0);\n $objPHPExcel->getActiveSheet()\n ->setCellValue('C' . $fila_inicio, $egreso['descripcion']);\n $objPHPExcel->getActiveSheet()->getStyle('C' . $fila_inicio)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\n $borders = array(\n 'borders' => array(\n 'top' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('argb' => 'FF000000'),\n )\n ),\n );\n $objPHPExcel->getActiveSheet()->getStyle('C' . $fila_inicio . ':D' . $fila_inicio)->applyFromArray($borders);\n /* cargamos las filas de los datos obtenidos */\n $egreso_lista_filas = $egreso['lista'];\n $objPHPExcel->getActiveSheet()\n ->setCellValue('D' . $fila_final, number_format($egreso['monto_total_tipo'], 2));\n $objPHPExcel->getActiveSheet()->getStyle('D' . $fila_final)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n $fila_inicio = $fila_final + 1;\n endforeach;\n $borders = array(\n 'borders' => array(\n 'bottom' => array(\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\n 'color' => array('argb' => 'FF000000'),\n )\n ),\n );\n $fila_inicio--;\n $objPHPExcel->getActiveSheet()->getStyle('B' . $fila_inicio . ':D' . $fila_inicio)->applyFromArray($borders);\n\n $objPHPExcel->getActiveSheet()\n ->getColumnDimension('A')\n ->setAutoSize(true);\n $objPHPExcel->getActiveSheet()\n ->getColumnDimension('B')\n ->setAutoSize(true);\n $objPHPExcel->getActiveSheet()\n ->getColumnDimension('C')\n ->setAutoSize(true);\n $objPHPExcel->getActiveSheet()\n ->getColumnDimension('D')\n ->setAutoSize(true);\n $objPHPExcel->getActiveSheet()\n ->getColumnDimension('E')\n ->setAutoSize(true);\n $objPHPExcel->getActiveSheet()\n ->getColumnDimension('F')\n ->setAutoSize(true);\n\n /*mulai menyimpan excel format xlsx, kalau ingin xls ganti Excel2007 menjadi Excel5*/\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n /*sesuaikan headernya*/\n header(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n header(\"Cache-Control: no-store, no-cache, must-revalidate\");\n header(\"Cache-Control: post-check=0, pre-check=0\", false);\n header(\"Pragma: no-cache\");\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n /*ubah nama file saat diunduh*/\n header('Content-Disposition: attachment;filename=\"Flujo_caja.xlsx\"');\n /*unduh file*/\n $objWriter->save(\"php://output\");\n }", "public function exportar_excel($status, $id = false)\n {\n $nombre_excel = 'Empleado Info';\n $empleados = Empleado::select(DB::raw(\"empleados.*, \n IF(documentacion.comprobante_domicilio = 1, 'Si', 'No') as 'Comprobante domicilio', \n IF(documentacion.identificacion = 1, 'Si', 'No') as 'Identificación',\n IF(documentacion.curp = 1, 'Si', 'No') as 'CURP',\n IF(documentacion.rfc = 1, 'Si', 'No') as 'RFC',\n IF(documentacion.hoja_imss = 1, 'Si', 'No') as 'Hoja del IMSS',\n IF(documentacion.carta_no_antecedentes_penales = 1, 'Si', 'No') as 'Carta de no antecedentes penales',\n IF(documentacion.acta_nacimiento = 1, 'Si', 'No') as 'Acta de nacimiento',\n IF(documentacion.comprobante_estudios = 1, 'Si', 'No') as 'Comprobante de estudios',\n IF(documentacion.resultado_psicometrias = 1, 'Si', 'No') as 'Resultado de psicometrías',\n IF(documentacion.examen_socieconomico = 1, 'Si', 'No') as 'Examen socieconómico',\n IF(documentacion.examen_toxicologico = 1, 'Si', 'No') as 'Examen toxicológico',\n IF(documentacion.solicitud_frente_vuelta = 1, 'Si', 'No') as 'Solicitud frente y vuelta',\n IF(documentacion.deposito_uniforme = 1, 'Si', 'No') as 'Depósito de uniforme',\n IF(documentacion.constancia_recepcion_uniforme = 1, 'Si', 'No') as 'Constancia de recepción de uniforme',\n IF(documentacion.comprobante_recepcion_reglamento_interno_trabajo = 1, 'Si', 'No') as 'Comprobante de recepción del reglamento interno de trabajo',\n IF(documentacion.autorizacion_pago_tarjeta = 1, 'Si', 'No') as 'Autorización pago con tarjeta',\n IF(documentacion.carta_aceptacion_cambio_lugar = 1, 'Si', 'No') as 'Carta de aceptación por cambio de lugar',\n IF(documentacion.finiquito = 1, 'Si', 'No') as 'Finiquito',\n IF(documentacion.calendario = 1, 'Si', 'No') as 'Calendario',\n IF(documentacion.formato_datos_personales = 1, 'Si', 'No') as 'Formato de datos personales',\n IF(documentacion.solicitud_autorizacion_consulta = 1, 'Si', 'No') as 'Solicitud de autorización de consulta',\n IF(documentacion.cartilla_militar = 1, 'Si', 'No') as 'Cartilla militar',\n IF(ISNULL(documentacion.licencia_conduccion),'',documentacion.licencia_conduccion) as 'Licencia de conducir',\n IF(uniformes.playera_polo = 1, 'Si', 'No') as 'Playera polo',\n IF(uniformes.camisa = 1, 'Si', 'No') as 'Camisa',\n IF(uniformes.pantalones = 1, 'Si', 'No') as 'Pantalones',\n IF(uniformes.chaleco = 1, 'Si', 'No') as 'Chaleco',\n IF(uniformes.sueter = 1, 'Si', 'No') as 'Sueter',\n IF(uniformes.chamarra = 1, 'Si', 'No') as 'Chamarra',\n IF(uniformes.gorra = 1, 'Si', 'No') as 'Gorra',\n IF(uniformes.botas = 1, 'Si', 'No') as 'Botas',\n IF(uniformes.traje = 1, 'Si', 'No') as 'Traje',\n IF(uniformes.corbata = 1, 'Si', 'No') as 'Corbata',\n IF(ISNULL(uniformes.otros),'',uniformes.otros) as 'Otros uniformes',\n IF(aditamentos.fornitura = 1, 'Si', 'No') as 'Fornitura',\n IF(aditamentos.tolete = 1, 'Si', 'No') as 'Tolete',\n IF(aditamentos.gas = 1, 'Si', 'No') as 'Gas',\n IF(aditamentos.aros_aprehensores = 1, 'Si', 'No') as 'Aros aprehensores',\n IF(aditamentos.radio = 1, 'Si', 'No') as 'Radio',\n IF(aditamentos.celular = 1, 'Si', 'No') as 'Celular',\n IF(aditamentos.lampara = 1, 'Si', 'No') as 'Lampara',\n IF(ISNULL(aditamentos.otros),'',aditamentos.otros) as 'Otros aditamentos'\n \"\n ))\n ->leftJoin('documentacion', 'empleados.id', '=', 'documentacion.empleado_id')\n ->leftJoin('aditamentos', 'empleados.id', '=', 'aditamentos.empleado_id')\n ->leftJoin('uniformes', 'empleados.id', '=', 'uniformes.empleado_id');\n\n\n if ($id) {\n $empleados = $empleados->where('empleados.id', $id)->get();\n $nombre_excel = \"Empleado \".$empleados[0]->nombre;\n\n } else {\n $empleados = $empleados->where('empleados.status', $status)->get();\n $nombre_excel = \"Empleados\";\n }\n\n Excel::create($nombre_excel, function($excel) use($empleados) {\n $excel->sheet('Hoja 1', function($sheet) use($empleados) {\n $sheet->cells('A:BP', function($cells) {\n $cells->setAlignment('center');\n $cells->setValignment('center');\n });\n \n $sheet->cells('A1:BP1', function($cells) {\n $cells->setFontWeight('bold');\n });\n\n $sheet->fromArray($empleados);\n });\n })->export('xlsx');\n\n return ['msg'=>'Excel creado'];\n }", "public function relatorioConsultaEstoqueExcel() {\n \n //Explode string parametros\n $sDados = $_REQUEST['campos'];\n\n $sCampos = htmlspecialchars_decode($sDados);\n\n $sCampos .= $this->getSget();\n\n $sSistema = \"app/relatorio\";\n $sRelatorio = 'relConsultaEstoqueExcel.php?';\n\n $sCampos .= '&output=email';\n $oMensagem = new Mensagem(\"Aguarde\", \"Seu excel está sendo processado\", Mensagem::TIPO_INFO);\n echo $oMensagem->getRender();\n\n $oWindow = 'var win = window.open(\"' . $sSistema . '/' . $sRelatorio . '' . $sCampos . '\",\"MsgWindow\",\"width=500,height=100,left=375,top=330\");'\n . 'setTimeout(function () { win.close();}, 30000);';\n echo $oWindow;\n\n $oMenSuccess = new Mensagem(\"Sucesso\", \"Seu excel foi gerado com sucesso, acesse sua pasta de downloads!\", Mensagem::TIPO_SUCESSO);\n echo $oMenSuccess->getRender();\n }", "public function exportexcel()\n {\n return Excel::download(new HistoryExport, 'Hasil Pemilihan.xlsx');\n }", "public function exportTablesToExcel(){\n return Excel::download(new OrderExport, 'Order.xlsx');\n }", "function promo_export_excel($promo_acara ,$promo_tempat ,$promo_tglmulai ,$promo_tglselesai ,\r\n\t\t\t\t\t\t\t\t\t$promo_diskon ,$option,$filter){\r\n\t\t\t//full query\r\n\t\t\t$query=\"select promo_acara as Acara, promo_tempat as Tempat, promo_tglmulai as 'Tanggal Mulai'\r\n\t\t\t\t\t,promo_tglselesai as 'Tanggal Selesai', promo_diskon as Diskon, promo_keterangan as Keterangan \r\n\t\t\t\t\tfrom promo\";\r\n\t\t\tif($option=='LIST'){\r\n\t\t\t\t$query .=eregi(\"WHERE\",$query)? \" AND \":\" WHERE \";\r\n\t\t\t\t$query .= \" (promo_acara LIKE '%\".addslashes($filter).\"%' OR \r\n\t\t\t\t\t\t\t promo_tempat LIKE '%\".addslashes($filter).\"%' OR \r\n\t\t\t\t\t\t\t promo_keterangan LIKE '%\".addslashes($filter).\"%')\";\r\n\t\t\t} else if($option=='SEARCH'){\r\n\t\t\t\t\r\n\t\t\t\tif($promo_acara!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" promo_acara LIKE '%\".$promo_acara.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($promo_tempat!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" promo_tempat LIKE '%\".$promo_tempat.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($promo_keterangan!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" promo_keterangan LIKE '%\".$promo_keterangan.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($promo_tglmulai!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" promo_tglmulai LIKE '%\".$promo_tglmulai.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($promo_tglselesai!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" promo_tglselesai LIKE '%\".$promo_tglselesai.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tif($promo_diskon!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" promo_diskon LIKE '%\".$promo_diskon.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$result = $this->db->query($query);\r\n\t\t\treturn $result;\r\n\t\t}", "public function exportExcel(Request $request)\n {\n $rut = $request->input('rutExcel');\n $apellido_paterno = $request->input('apellido_paternoExcel'); \n $email = $request->input('emailExcel');\n\n $administradores = DB::table('administradores')->select('*')\n ->where('estado', '=', true);\n\n if(!is_null($rut)){\n if (strpos($rut, 'k') || strpos($rut, 'K')) {\n if (strpos($rut, 'k')) {\n $administradores = $administradores->where(function ($q) use ($rut) {\n $q = $q->orWhere('rut', '=', $rut);\n $q = $q->orWhere('rut', '=', str_replace('k', 'K', $rut));\n });\n }elseif(strpos($rut, 'K')) {\n $administradores = $administradores->where(function ($q) use ($rut) {\n $q = $q->orWhere('rut', '=', $rut);\n $q = $q->orWhere('rut', '=', str_replace('K', 'k', $rut));\n });\n }\n }else{\n $administradores = $administradores->where('rut','=', $rut);\n }\n }\n\n if(!is_null($apellido_paterno)){\n $administradores = $administradores->where('apellido_paterno','like','%'.$apellido_paterno.'%');\n }\n\n if(!is_null($email)){\n $administradores = $administradores->where('email','like','%'.$email.'%');\n }\n\n $administradores = $administradores->orderBy('email', 'asc')->get();\n\n return Excel::create('ListadoAdministradores', function($excel) use ($administradores) {\n $excel->sheet('Administradores', function($sheet) use ($administradores)\n {\n $count = 2;\n \n $sheet->row(1, ['Rut', 'Nombres', 'Apellido paterno', 'Apellido materno', 'Email']);\n foreach ($administradores as $key => $value) {\n $sheet->row($count, [$value->rut, $value->nombres, $value->apellido_paterno, $value->apellido_materno, $value->email]);\n $count = $count +1;\n }\n });\n })->download('xlsx');\n }", "function exportar_excel_contratos_y_anexos(){\n\t\t//es reemplazado por estos header para respetar los acentos y ñ al exportar\\\\\n\t\theader(\"Content-Type: application/vnd.ms-excel charset=iso-8859-1\");\n\t\theader(\"Content-Disposition: filename=ficheroExcel.xls\");\n\t\theader(\"Pragma: no-cache\");\n\t\theader(\"Expires: 0\");\n\t\techo utf8_decode($_POST['datos_a_enviar']);\n\t}", "public function exportIntoCSV()\n {\n return Excel::download(new EmployeeExport, 'employeelist.csv');\n\n }", "public function export_list_rekening_deposito()\n\t{\n $cif_no \t= $this->uri->segment(3);\n $no_rek \t= $this->uri->segment(4);\n $produk \t= $this->uri->segment(5);\n $from_date1 \t= $this->uri->segment(6);\n $from_date \t= substr($from_date1,4,4).'-'.substr($from_date1,2,2).'-'.substr($from_date1,0,2);\n $thru_date1 \t= $this->uri->segment(7); \n $thru_date \t= substr($thru_date1,4,4).'-'.substr($thru_date1,2,2).'-'.substr($thru_date1,0,2); \n\n\t\t$datas \t\t\t= $this->model_laporan->export_list_rekening_deposito($cif_no,$no_rek,$produk,$from_date,$thru_date);\n $produk_name\t= $this->model_laporan->get_produk_deposito($produk);\n $nama\t\t\t= $this->model_laporan->get_nama($cif_no);\n \n\t\t// ----------------------------------------------------------\n \t// [BEGIN] EXPORT SCRIPT\n\t\t// ----------------------------------------------------------\n\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = $this->phpexcel;\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setLastModifiedBy(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setTitle(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setSubject(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setDescription(\"REPORT, generated using PHP classes.\")\n\t\t\t\t\t\t\t\t\t ->setKeywords(\"REPORT\")\n\t\t\t\t\t\t\t\t\t ->setCategory(\"Test result file\");\n\n\t\t$objPHPExcel->setActiveSheetIndex(0); \n\n\t\t$styleArray = array(\n \t\t'borders' => array(\n\t\t 'outline' => array(\n\t\t 'style' => PHPExcel_Style_Border::BORDER_THIN,\n\t\t 'color' => array('rgb' => '000000'),\n\t\t ),\n\t\t ),\n\t\t);\n\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('E1:G1');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('E1',strtoupper($this->session->userdata('institution_name')));\n\t\t$objPHPExcel->getActiveSheet()->getStyle('E1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('E2:G2');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('E2',\"History Transaksi Deposito\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('E2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('C4:E4');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C4',\"No. Rekening : \".$no_rek);\n\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('C5:E5');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C5',\"Nama : \".$nama);\n\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('C6:E6');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C6',\"Produk : \".$produk_name);\n\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('C7:E7');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C7',\"Periode : \".$from_date.\" s/d \".$thru_date);\n\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('C9:C10');\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('D9:D10');\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('E9:E10');\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('F9:G9');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C9',\"No.\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D9',\"Tanggal\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('E9',\"Keterangan\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('F9',\"Jumlah\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('F10',\"DB\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('G10',\"CR\");\n\n\t\t\n\t\t\n\t\t$objPHPExcel->getActiveSheet()->getStyle('E1:E4')->getFont()->setBold(true);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('E1:E4')->getFont()->setSize(12);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C9:G9')->getFont()->setSize(9);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C9:G10')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C9:G10')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C9:C10')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D9:D10')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('E9:E10')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('F9:F10')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('F9:F9')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('G9:G9')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('G9:G10')->applyFromArray($styleArray);\n\t\t\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(7);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(10);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(35);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(25);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(25);\n\n\t\t\t$ii = 11;\n\t $total_saldo = 0;\n\t $total_bahas = 0;\n\t $total_pajak = 0;\n\t $total_depo = 0;\n\t\t\t$row_total = count($datas)+13;\n\t\t\tfor( $i = 0 ; $i < count($datas) ; $i++ )\n\t\t\t{\n\n\t\t\t\t$total_saldo \t\t\t+= $datas[$i]['nominal'];\n\t\t $total_bahas \t\t\t+= $datas[$i]['nominal_bahas'];\n\t\t $total_pajak \t\t\t+= $datas[$i]['pajak_bahas'];\n\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$ii,($i+1));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$ii,\" \".$this->format_date_detail($datas[$i]['trx_date'],'id',false,'-'));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$ii,$datas[$i]['description']);\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('F'.$ii,\" \".number_format($datas[$i]['nominal'],0,',','.'));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('G'.$ii,\" \".number_format($datas[$i]['nominal_bahas'],0,',','.'));\n\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle('C'.$ii.':C'.$ii)->applyFromArray($styleArray);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle('D'.$ii.':D'.$ii)->applyFromArray($styleArray);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle('E'.$ii.':E'.$ii)->applyFromArray($styleArray);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle('F'.$ii.':F'.$ii)->applyFromArray($styleArray);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle('G'.$ii.':G'.$ii)->applyFromArray($styleArray);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle('C'.$ii.':G'.$ii)->getFont()->setSize(9);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle('C'.$ii.':E'.$ii)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t\t\t$objPHPExcel->getActiveSheet()->getStyle('C'.$ii.':G'.$ii)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\n\t\t\t\t$ii++;\n\t\t\t\n\t\t\t}//END FOR*/\n\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$row_total,\"Buka Deposito\");\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.($row_total+1),\"Bagi Hasil\");\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.($row_total+2),\"Pajak Bagi Hasil\");\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.($row_total+3),\"Pencairan Deposito\");\n\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('F'.$row_total,\" \".number_format($total_saldo,0,',','.'));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('F'.($row_total+1),\" \".number_format($total_bahas,0,',','.'));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('F'.($row_total+2),\" \".number_format($total_pajak,0,',','.'));\n\t\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('F'.($row_total+3),\" \".number_format($total_depo,0,',','.'));\n\n\t\t\t// Redirect output to a client's web browser (Excel2007)\n\t\t\t// Save Excel 2007 file\n\n\t\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\t\t\theader('Content-Disposition: attachment;filename=\"LIST-HISTORY-TRX-DEPOSITO.xlsx\"');\n\t\t\theader('Cache-Control: max-age=0');\n\n\t\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t\t$objWriter->save('php://output');\n\n\t\t\t// ----------------------------------------------------------------------\n\t\t\t// [END] EXPORT SCRIPT\n\t\t\t// ----------------------------------------------------------------------\n\t}", "public function Exportar(){\n\t\t\tExcel::create('LaravelExcel', function($excel) { \n\t\t $excel->sheet('Productos', function($sheet) {\n\t\t $products = Exportar::all();\n\t\t $sheet->fromArray($products);\n\t\t });\n\t\t })->store('csv', storage_path('excel/exports'));\n\t\t $ruta='app/storage/excel/exports/LaravelExcel.csv';\n\t\t\tMail::send('emails.auth.reminder',array('archivo'=>$ruta),function($message){\n\t\t\t\t$message->to('[email protected]')->subject('Nuevo Documento');\n\t\t\t//elimina archivo de la carpeta donde se guarda despues de enviar el correo\n\t\t\tunlink('app/storage/excel/exports/LaravelExcel.csv');\n\t\t\t});\n\t\t\t\n\t}", "public function actionExportExcel(){\n header('Content-Type: application/vnd.ms-excel');\n $filename = \"aksessuar_\".date(\"d-m-Y-His\").\".xls\";\n header('Content-Disposition: attachment;filename='.$filename .' ');\n header('Cache-Control: max-age=0');\n \\moonland\\phpexcel\\Excel::export([\n 'models' => ToquvKalite::find()->select([\n 'id',\n ])->all(),\n 'columns' => [\n 'id',\n ],\n 'headers' => [\n 'id' => 'Id',\n ],\n 'autoSize' => true,\n ]);\n }", "function anamnesa_export_excel($anam_id ,$anam_cust ,$anam_tanggal ,$anam_petugas ,$anam_pengobatan ,$anam_perawatan ,$anam_terapi ,\r\n\t\t\t\t\t\t\t\t\t $anam_alergi ,$anam_obatalergi ,$anam_efekobatalergi ,$anam_hamil ,$anam_kb ,$anam_harapan ,$option,$filter){\r\n\t\t\t//full query\r\n\t\t\t$query = \"SELECT cust_no as 'No Cust', cust_nama 'Customer', anam_tanggal as Tanggal, karyawan_nama as Petugas,\r\n\t\t\t\t\t\tanam_pengobatan as Pengobatan, anam_perawatan as Perawatan, anam_terapi as Terapi, anam_alergi as Alergi,\r\n\t\t\t\t\t\tanam_obatalergi as 'Alergi terhadap Obat', anam_efekobatalergi as 'Efek Alergi', anam_hamil as Hamil, \r\n\t\t\t\t\t\tanam_kb 'Alat KB yang digunakan', anam_harapan as Harapan FROM anamnesa,customer,karyawan\r\n\t\t\t\t\t\tWHERE anam_cust=cust_id AND anam_petugas=karyawan_id\";\r\n\t\t\t\t\t\t\r\n\t\t\tif($option=='LIST'){\r\n\t\t\t\t$query .=eregi(\"WHERE\",$query)? \" AND \":\" WHERE \";\r\n\t\t\t\t$query .= \" (cust_nama LIKE '%\".addslashes($filter).\"%' OR \r\n\t\t\t\t\t\t\t karyawan_nama LIKE '%\".addslashes($filter).\"%' OR \r\n\t\t\t\t\t\t\t anam_alergi LIKE '%\".addslashes($filter).\"%' OR \r\n\t\t\t\t\t\t\t anam_obatalergi LIKE '%\".addslashes($filter).\"%' )\";\r\n\t\t\t} else if($option=='SEARCH'){\r\n\t\t\t\t\r\n\t\t\t\tif($anam_cust!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_cust LIKE '%\".$anam_cust.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_tanggal!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_tanggal LIKE '%\".$anam_tanggal.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_petugas!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_petugas LIKE '%\".$anam_petugas.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_pengobatan!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_pengobatan LIKE '%\".$anam_pengobatan.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_perawatan!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_perawatan LIKE '%\".$anam_perawatan.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_terapi!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_terapi LIKE '%\".$anam_terapi.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_alergi!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_alergi LIKE '%\".$anam_alergi.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_obatalergi!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_obatalergi LIKE '%\".$anam_obatalergi.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_efekobatalergi!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_efekobatalergi LIKE '%\".$anam_efekobatalergi.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_hamil!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_hamil LIKE '%\".$anam_hamil.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_kb!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_kb LIKE '%\".$anam_kb.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\tif($anam_harapan!=''){\r\n\t\t\t\t\t$query.=eregi(\"WHERE\",$query)?\" AND \":\" WHERE \";\r\n\t\t\t\t\t$query.= \" anam_harapan LIKE '%\".$anam_harapan.\"%'\";\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$result = $this->db->query($query);\r\n\t\t\treturn $result;\r\n\t\t}", "public function exportToxls(){\n\t\t//echo \"exportToxls\";exit;\n\t\t$getDepartments = MlstBmsbDepartment::select('id','department_name','vertical_id')->where('deleted_status','=', 0)->get();\n $getCount = $getDepartments->count();\n\n if ($getCount < 1) { \n\t\t\t return false;\t\t\t \n } else {\n\t\t\t//export to excel\n\t\t\tExcel::create('Export Data', function($excel) use($getDepartments){\n\t\t\t\t$excel->sheet('Verticals', function($sheet) use($getDepartments){\n\t\t\t\t\t$sheet->fromArray($getDepartments);\n\t\t\t\t});\n\t\t\t})->export('xlsx');\t\t\t\t\n\t\t}\t\t\t\t\n\t}", "public function export_excel()\n {\n return Excel::download(new DataKaryawanExport, 'Data_karyawan.xlsx');\n }", "public function VerifiqueExport($Vector) {\r\n \r\n if(isset($_REQUEST[\"BtnExportarExcel\"])){\r\n $statement= urldecode($_REQUEST[\"TxtL\"]);\r\n require_once '../librerias/Excel/PHPExcel.php';\r\n $objPHPExcel = new PHPExcel(); \r\n \r\n //$Tabla[\"Tabla\"]=$Vector[\"Tabla\"];\r\n $tbl= base64_decode($_REQUEST[\"TxtT\"]);\r\n $Tabla[\"Tabla\"]=$tbl;\r\n $Titulo=$Vector[\"Titulo\"];\r\n $VerDesde=$Vector[\"VerDesde\"];\r\n $Limit=$Vector[\"Limit\"];\r\n $Order=$Vector[\"Order\"];\r\n \r\n $tbl=$Vector[\"Tabla\"];\r\n \r\n \r\n $Columnas=$this->Columnas($Tabla); //Se debe disenar la base de datos colocando siempre la llave primaria de primera\r\n \r\n $i=0;\r\n $a=0;\r\n foreach($Columnas as $NombreCol){ \r\n if(!isset($Vector[\"Excluir\"][$NombreCol])){\r\n $objPHPExcel->setActiveSheetIndex(0)\r\n ->setCellValue($this->Campos[$a].\"1\",$NombreCol);\r\n $VisualizarRegistro[$i]=1;\r\n $a++;\t\r\n }\r\n if(isset($Vector[$NombreCol][\"Vinculo\"])){\r\n $VinculoRegistro[$i][\"Vinculado\"]=1;\r\n $VinculoRegistro[$i][\"TablaVinculo\"]=$Vector[$NombreCol][\"TablaVinculo\"];\r\n $VinculoRegistro[$i][\"IDTabla\"]=$Vector[$NombreCol][\"IDTabla\"]; \r\n $VinculoRegistro[$i][\"Display\"]=$Vector[$NombreCol][\"Display\"];\r\n }\r\n $i++;\r\n }\r\n \r\n \r\n $IndexFiltro=\"Filtro_\".$NombreCol; //Campo que trae el valor del filtro a aplicar\r\n $IndexCondicion=\"Cond_\".$NombreCol; // Condicional para aplicacion del filtro\r\n $IndexTablaVinculo=\"TablaVinculo_\".$NombreCol; // Si hay campos vinculados se encontra la tabla vinculada aqui \r\n $IndexIDTabla=\"IDTabla_\".$NombreCol; // Id de la tabla vinculada\r\n $IndexDisplay=\"Display_\".$NombreCol; // Campo que se quiere ver\r\n \r\n \r\n \r\n //Informacion del excel\r\n $objPHPExcel->\r\n getProperties()\r\n ->setCreator(\"www.technosoluciones.com\")\r\n ->setLastModifiedBy(\"www.technosoluciones.com\")\r\n ->setTitle(\"Exportar $tbl desde base de datos\")\r\n ->setSubject(\"$tbl\")\r\n ->setDescription(\"Documento generado con PHPExcel\")\r\n ->setKeywords(\"techno soluciones\")\r\n ->setCategory(\"$tbl\"); \r\n $NumCols=count($Columnas);\r\n \r\n \r\n $i=0;\r\n $a=0;\r\n $c=2;\r\n $sql=\"SELECT * FROM $statement \";\r\n \r\n $Consulta= $this->obCon->Query($sql);\r\n while($DatosTabla=$this->obCon->fetch_object($Consulta)){\r\n foreach($Columnas as $NombreCol){\r\n if(isset($VisualizarRegistro[$i])){\r\n if(!isset($VinculoRegistro[$i][\"Vinculado\"])){\r\n $objPHPExcel->setActiveSheetIndex(0)\r\n ->setCellValue($this->Campos[$a].$c, (utf8_encode($DatosTabla->$NombreCol)));\r\n }else{\r\n $TablaVinculo=$VinculoRegistro[$i][\"TablaVinculo\"];\r\n $ColDisplay=$VinculoRegistro[$i][\"Display\"];\r\n $idTablaVinculo=$VinculoRegistro[$i][\"IDTabla\"];\r\n $ID=$DatosTabla->$NombreCol;\r\n //print(\"datos: $TablaVinculo $ColDisplay $idTablaVinculo $ID\"); \r\n $sql1=\"SELECT $ColDisplay FROM $TablaVinculo WHERE $idTablaVinculo ='$ID'\";\r\n $Consul=$this->obCon->Query($sql1);\r\n $DatosVinculo= $this->obCon->FetchArray($Consul);\r\n $objPHPExcel->setActiveSheetIndex(0)\r\n ->setCellValue($this->Campos[$a].$c,(utf8_encode($DatosVinculo[$ColDisplay])));\r\n }\r\n $a++;\r\n \r\n }\r\n \r\n $i++;\r\n if($i==$NumCols){\r\n $i=0;\r\n $c++;\r\n $a=0;\r\n }\r\n }\r\n }\r\n header('Content-Type: application/vnd.ms-excel');\r\n header('Content-Disposition: attachment;filename=\"'.$tbl.'.xls\"');\r\n header('Cache-Control: max-age=0');\r\n $objWriter=PHPExcel_IOFactory::createWriter($objPHPExcel,'Excel2007');\r\n $objWriter->save('php://output');\r\n exit; \r\n \r\n } \r\n \r\n \r\n}", "public function getExportarlasreservasdeldia(){\n\n\tExcel::create('Reservas del día', function($excel) {\n\t\t\t$excel->sheet('Sheetname', function($sheet) {\n\t\t $data=[];\n\n\t $date = date('Y-m-d');\n\n\t\t $reserva = DB::table('reserva')\n\t \t\t\t\t\t ->where('fecha', $date)\n\t\t\t\t\t\t ->join('cliente', 'reserva.cliente_id', '=', 'cliente.id')\n\t\t\t\t\t ->select('reserva.id', 'num_reserva', 'lugar_entrega', 'direccion1_e','direccion2_e', 'colonia_e', 'estado_e', 'municipio_e', 'cp_e', 'referencias_e', 'telefono1_e', 'telefono2_e', 'telefono3_e', 'telefono4_e', 'fecha_entrega', 'hora_entrega', 'lugar_devolucion', 'direccion1_d','direccion2_d', 'colonia_d', 'estado_d', 'municipio_d', 'cp_d', 'referencias_d', 'telefono1_d', 'telefono2_d', 'telefono3_d', 'telefono4_d', 'fecha_devolucion', 'hora_devolucion', 'nombre', 'apellidos', 'dias', 'tarifa_por_dia', 'total', 'vehiculo', 'transmision', 'reserva.created_at', 'email', 'telefono', 'num_licencia', 'comentarios', 'diamas')\n\t\t\t\t\t ->orderBy('created_at', 'desc')\n\t\t\t\t\t \t ->get();\n\n\t array_push($data, array('N° de reserva', 'Lugar de entrega', 'Direccion 1', 'Direccion 2', 'Colonia', 'Estado', 'Municipio', 'CP', 'Referencias', 'Teléfono', 'Fecha de entrega', 'Hora de entrega', 'Lugar de devolucion', 'Direccion 1', 'Direccion 2', 'Colonia', 'Estado', 'Municipio', 'CP', 'Referencias', 'Teléfono', 'Fecha de devolucion', 'Hora de devolucion', 'Tarifa por día', 'Días', 'Total', 'Vehiculo', 'Transmision', 'Fecha de registro', 'Cliente', 'Email', 'Teléfono', 'N° de Licencia', 'Comentarios'));\n\n\t foreach ($reserva as $key => $value) {\n\t \tif($value->transmision == 1){\n\n if($value->diamas == 1){\n\n array_push($data, array(\n $value->num_reserva,\n $value->lugar_entrega,\n $value->direccion1_e,\n $value->direccion2_e,\n $value->colonia_e,\n $value->estado_e,\n $value->municipio_e,\n $value->cp_e,\n $value->referencias_e,\n $value->telefono1_e.\" \".$value->telefono2_e.\" \".$value->telefono3_e.\" \".$value->telefono4_e,\n $value->fecha_entrega,\n $value->hora_entrega,\n $value->lugar_devolucion,\n $value->direccion1_d,\n $value->direccion2_d,\n $value->colonia_d,\n $value->estado_d,\n $value->municipio_d,\n $value->cp_d,\n $value->referencias_d,\n $value->telefono1_d.\" \".$value->telefono2_d.\" \".$value->telefono3_d.\" \".$value->telefono4_d,\n\n $value->fecha_devolucion,\n $value->hora_devolucion,\n '$ '.number_format($value->tarifa_por_dia, 2),\n $value->dias + 1,\n '$ '.number_format($value->total + $value->tarifa_por_dia, 2),\n $value->vehiculo,\n 'Automático',\n $value->created_at,\n $value->nombre.' '.$value->apellidos,\n $value->email,\n $value->telefono,\n $value->num_licencia,\n $value->comentarios\n ));\n\n } else {\n\n if($value->diamas == 1){\n\n array_push($data, array(\n $value->num_reserva,\n $value->lugar_entrega,\n $value->direccion1_e,\n $value->direccion2_e,\n $value->colonia_e,\n $value->estado_e,\n $value->municipio_e,\n $value->cp_e,\n $value->referencias_e,\n $value->telefono1_e.\" \".$value->telefono2_e.\" \".$value->telefono3_e.\" \".$value->telefono4_e,\n $value->fecha_entrega,\n $value->hora_entrega,\n $value->lugar_devolucion,\n $value->direccion1_d,\n $value->direccion2_d,\n $value->colonia_d,\n $value->estado_d,\n $value->municipio_d,\n $value->cp_d,\n $value->referencias_d,\n $value->telefono1_d.\" \".$value->telefono2_d.\" \".$value->telefono3_d.\" \".$value->telefono4_d,\n\n $value->fecha_devolucion,\n $value->hora_devolucion,\n '$ '.number_format($value->tarifa_por_dia, 2),\n $value->dias + 1,\n '$ '.number_format($value->total + $value->tarifa_por_dia, 2),\n $value->vehiculo,\n 'Automático',\n $value->created_at,\n $value->nombre.' '.$value->apellidos,\n $value->email,\n $value->telefono,\n $value->num_licencia,\n $value->comentarios\n ));\n\n } else {\n \t\t\t\t\tarray_push($data, array(\n \t\t\t\t\t\t$value->num_reserva,\n \t\t\t\t\t\t$value->lugar_entrega,\n $value->direccion1_e,\n $value->direccion2_e,\n $value->colonia_e,\n $value->estado_e,\n $value->municipio_e,\n $value->cp_e,\n $value->referencias_e,\n $value->telefono1_e.\" \".$value->telefono2_e.\" \".$value->telefono3_e.\" \".$value->telefono4_e,\n \t\t\t\t\t\t$value->fecha_entrega,\n \t\t\t\t\t\t$value->hora_entrega,\n \t\t\t\t\t\t$value->lugar_devolucion,\n $value->direccion1_d,\n $value->direccion2_d,\n $value->colonia_d,\n $value->estado_d,\n $value->municipio_d,\n $value->cp_d,\n $value->referencias_d,\n $value->telefono1_d.\" \".$value->telefono2_d.\" \".$value->telefono3_d.\" \".$value->telefono4_d,\n\n \t\t\t\t\t\t$value->fecha_devolucion,\n \t\t\t\t\t\t$value->hora_devolucion,\n \t\t\t\t\t\t'$ '.number_format($value->tarifa_por_dia, 2),\n \t\t\t\t\t\t$value->dias,\n \t\t\t\t\t\t'$ '.number_format($value->total, 2),\n \t\t\t\t\t\t$value->vehiculo,\n \t\t\t\t\t\t'Automático',\n \t\t\t\t\t\t$value->created_at,\n \t\t\t\t\t\t$value->nombre.' '.$value->apellidos,\n \t\t\t\t\t\t$value->email,\n \t\t\t\t\t\t$value->telefono,\n \t\t\t\t\t\t$value->num_licencia,\n \t\t\t\t\t\t$value->comentarios\n \t\t\t\t\t ));\n\n }\n\n\n } //end else\n\n\n\t \t } else {\n\n\t \t \tarray_push($data, array(\n $value->num_reserva,\n \t\t\t\t\t\t$value->lugar_entrega,\n $value->direccion1_e,\n $value->direccion2_e,\n $value->colonia_e,\n $value->estado_e,\n $value->municipio_e,\n $value->cp_e,\n $value->referencias_e,\n $value->telefono1_e.\" \".$value->telefono2_e.\" \".$value->telefono3_e.\" \".$value->telefono4_e,\n \t\t\t\t\t\t$value->fecha_entrega,\n \t\t\t\t\t\t$value->hora_entrega,\n \t\t\t\t\t\t$value->lugar_devolucion,\n $value->direccion1_d,\n $value->direccion2_d,\n $value->colonia_d,\n $value->estado_d,\n $value->municipio_d,\n $value->cp_d,\n $value->referencias_d,\n $value->telefono1_d.\" \".$value->telefono2_d.\" \".$value->telefono3_d.\" \".$value->telefono4_d,\n \t\t\t\t\t\t$value->fecha_devolucion,\n \t\t\t\t\t\t$value->hora_devolucion,\n \t\t\t\t\t\t'$ '.number_format($value->tarifa_por_dia, 2),\n \t\t\t\t\t\t$value->dias,\n \t\t\t\t\t\t'$ '.number_format($value->total, 2),\n \t\t\t\t\t\t$value->vehiculo,\n \t\t\t\t\t\t'Estándard',\n \t\t\t\t\t\t$value->created_at,\n \t\t\t\t\t\t$value->nombre.' '.$value->apellidos,\n \t\t\t\t\t\t$value->email,\n \t\t\t\t\t\t$value->telefono,\n \t\t\t\t\t\t$value->num_licencia,\n \t\t\t\t\t\t$value->comentarios\n \t\t\t\t\t ));\n\n \t }\n \t }\n\n\t\t\t$sheet->fromArray($data, null, 'A1', false, false);\n\n\t\t\t});\n\t\t})->download('xlsx');\n}", "public function excelExport()\n \t{\n \n $where_str = \"1 = ?\";\n $where_params = array(1);\n if (Input::has('sSearch'))\n {\n $search = Input::get('sSearch');\n\n $where_str .= \" and ( name like '%{$search}%'\"\n \t\t\t. \" or email like '%{$search}%'\"\n . \")\";\n }\n\n $columns = array('name','email');\n\n $role_count = Admin::select('id')\n\t\t\t\t\t\t\t->whereRaw($where_str, $where_params)\n\t\t\t\t\t\t\t->count();\n\n\t\t$role = Admin::select($columns)\n\t \t\t->whereRaw($where_str, $where_params);\n \n\n $role = $role->get()->toArray();\n $objPHPExcel = new PHPExcel();\n $objPHPExcel->getProperties()->setCreator(\"ConsultantDB\")\n ->setTitle(\"ConsultantDB: Excel Export\")\n ->setSubject(\"Consultant search result export\")\n ->setDescription(\"Excel export of customized search result from consultant database\")\n ->setKeywords(\"office 2007 openxml\");\n\n $objPHPExcel->setActiveSheetIndex(0);\n $objPHPExcel->getActiveSheet()->setTitle('consultant_search_export');\n\n $header = array(\n 'Admin user Name' => 'name',\n 'Email Address' => 'email',\n );\n\n $objPHPExcel->getActiveSheet()->fromArray( array_keys($header), NULL, 'A1');\n $objPHPExcel->getActiveSheet()->getStyle('A1:B1')->getFont()->setBold(true);\n\n $link_style_array = [\n 'font' => [\n 'color' => ['rgb' => '0000FF'],\n 'underline' => 'single'\n ]\n ];\n $rowNumber = 2;\n $col = 'A';\n foreach ($role as $role_data) \n {\n $insert_data = array();\n foreach ($header as $column_name) {\n $insert_data[$column_name] = $role_data[$column_name];\n }\n $objPHPExcel->getActiveSheet()->fromArray($role_data, NULL, 'A' . $rowNumber );\n \t\n \tif($insert_data['email'] != \"\"){\n\n\t\t\t $objPHPExcel->getActiveSheet()->getCell('B' . $rowNumber)->getHyperlink()->setUrl(strip_tags(\"mailto:\".$insert_data['email']));\n\t\t\t $objPHPExcel->getActiveSheet()->getStyle('B' . $rowNumber)->applyFromArray($link_style_array);\n\t\t\t}\n\n $rowNumber++;\n }\n\n for($j='A'; $j<'No';$j++){\n \n $objPHPExcel->getActiveSheet()->getColumnDimension($j)->setAutoSize(true);\n }\n\n $filename = 'AdminUser_export_' . date('d_m_Y') . '.xlsx';\n header(\"Pragma: public\");\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Content-Type: application/force-download\");\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Type: application/download\");;\n header(\"Content-Disposition: attachment;filename=$filename\");\n header(\"Content-Transfer-Encoding: binary \");\n\n $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel); \n $objWriter->setOffice2003Compatibility(true);\n $objWriter->save('php://output');\n exit();\n }", "public function export(){\n $products = $this->Paginator->paginate($this->Products->find());\n\n $this->autoRender = false;\n $this->layout = false;\n $fileName = \"bookreport_\".date(\"d-m-y:h:s\").\".xls\";\n\n $headerRow = array(\"ID\", \"Title\", \"Type\", \"Description\", \"Price\", \"Rating\");\n $data = array();\n foreach ($products as $product) {\n array_push($data, array($product->id, $product->description, $product->title, $product->price, $product->rating));\n }\n //debug($data);\n ini_set('max_execution_time', 1600); //increase max_execution_time to 10 min if data set is very large\n $fileContent = implode(\"\\t \", $headerRow).\"\\n\";\n foreach($data as $result) {\n $fileContent .= implode(\"\\t \", $result).\"\\n\";\n }\n header('Content-type: application/ms-excel'); /// you can set csv format\n header('Content-Disposition: attachment; filename='.$fileName);\n echo $fileContent;\n }" ]
[ "0.7437809", "0.69016474", "0.68244916", "0.6808324", "0.68076473", "0.6745884", "0.67107654", "0.6662433", "0.6626812", "0.6595637", "0.6588819", "0.656745", "0.6558276", "0.65469", "0.65285903", "0.6479234", "0.64706504", "0.6459825", "0.6455889", "0.6414907", "0.6410994", "0.63913095", "0.6380372", "0.637756", "0.6366843", "0.6366493", "0.63631177", "0.63602304", "0.6336198", "0.63324183" ]
0.78356373
0
Sets Sobek web service online.
public function webServiceIsOnline() { $this->statusWebService = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOnline(): void\n {\n $this->offline = false;\n }", "public function webServiceIsOffline() {\n\t\t$this->statusWebService = false;\n\t}", "public function setOffline(): void\n {\n $this->offline = true;\n }", "function set_web_enabled($name, $enabled)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // TODO: kludgy, the realm name is now automatically set to the flexshare description\n $share = $this->get_share($name);\n $this->_set_parameter($name, 'WebRealm', $share['ShareDescription']);\n\n $this->_set_parameter($name, 'WebEnabled', ($enabled ? 1: 0));\n $this->_generate_web_flexshares();\n }", "public function onlineAction()\n\t{\n\n\t}", "public function setIsonline(bool $isonline)\n\t{\n\t\t$this->addKeyValue('Isonline', $isonline); \n\n\t}", "public function turnOn() \n {\n $this->on = true;\n }", "protected function setServer()\n {\n if (Arr::get($this->config, 'sandbox', false)) {\n $this->serverUrl = self::SERVER_SANDBOX_URL;\n } else {\n $this->serverUrl = self::SERVER_URL;\n }\n }", "public function enable()\n {\n $this->status = true;\n }", "public function isWsOnline() {\n\t\t\n\t\t$data = array(\n\t\t\t'freeTextQuery' => '',\n\t\t\t'propertyDetailsList' => array()\n\t\t);\n\t\t\n\t\t$result = $this->sendRequest( 'search', $data );\n\t\t\n\t\tif ( empty( $result['type'] ) || $result['type'] != 'success' ) {\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function online()\n {\n return $this->httpGet('cgi-bin/customservice/getonlinekflist');\n }", "function setObserv_est($sobserv_est = '')\n {\n $this->sobserv_est = $sobserv_est;\n }", "public function setMwsServiceUrl($url);", "public static function enable()\n {\n self::$enabled = true;\n }", "public function isOnline(): bool\n {\n return $this->status === self::ONLINE;\n }", "public function makeOnline()\n {\n $this->online_at = new \\DateTime();\n\n $this->save();\n }", "function setModulWebinterface($value)\n\t{\n\t\tif($value != '')\n\t\t{\n\t\t\t$status\t\t\t=\t\tsetModul($value, \"webinterface\");\n\t\t\t\n\t\t\tif($status)\n\t\t\t{\n\t\t\t\twriteInLog(4, $_SESSION['user']['benutzer'].\": Set Modul \\\"Webinterface\\\" to '\".$value.\"'\", true);\n\t\t\t\t\n\t\t\t\techo 'done';\n\t\t\t};\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"No Value!\";\n\t\t};\n\t}", "Public function SetPower($state){\n\t\t$host = $this->ReadPropertyString('IPAddress');\n\t\t$url = \"http://$host:80/goform/formiPhoneAppPower.xml\";\n\t\tif ($state == true){\n $this->SendDebug('SetPower', 'Power: '.'einschalten', 0);\n\t\t\t$cmd = '1+PowerOn';\n\t\t\t$power=true;\n\t\t}\n\t\tif ($state == false){\n\t\t\t$cmd = '1+PowerStandby';\n\t\t\t$power=false;\n\t\t}\n\t\t$xml = $this->curl_get($url, $cmd);\n //$this->SendDebug('SetPower:XMLcreateArray_IN: ', $xml, 0);\n\t\t//$output = XML2Array::createArray($xml);\n $output = json_decode(json_encode((array)simplexml_load_string($xml)),true);\n //$this->SendDebug('SetPower:XMLcreateArray_IN: ', $output, 0);\n \t\t//$status = ($output['item']['Power']['value']);\n $status = ($output['Power']['value']);\n $this->SetValue(\"CeolPower\", $power);\n\t\treturn $status;\t\n\t}", "private function _setAlo()\n {\n if (!empty(self::$_hostalo)) {\n return;\n }\n if (!$this->get('hostalo')->isValid()) {\n self::$_hostalo = self::getSetting('FOG_CLIENT_AUTOLOGOFF_MIN');\n } else {\n self::$_hostalo = $this->get('hostalo')->get('time');\n }\n return;\n }", "public function isOnline() : bool\n {\n return $this->online;\n }", "public function enable();", "public function enable();", "public function isOnline() {\n\t\treturn $this -> data['online'] == 1;\n\t}", "public function setUpMode()\n {\n $this->maintenance->setUpMode();\n $this->info('Application is now live.');\n }", "function set_online(){\r\n $this->db->where('id', $this->session->userId);\r\n $this->db->set('online', 1);\r\n $this->db->update('user');\r\n }", "public function setOnlineCharge()\n {\n $value = config('sslcommerzpayment.sslcommerz.online_charge');\n \t$this->onlineCharge = $value/100;\n \treturn;\n }", "public function setStatusEndpoint($url) {\n\t\t$this->endpoint_status = $url;\n\t}", "public function setWebsite(?string $value): void {\n $this->getBackingStore()->set('website', $value);\n }", "function set_web_php($name, $web_php)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // If PHP enabled, check e-mail restricts access\n $prevent = TRUE;\n if ($web_php) {\n $share = $this->get_share($name);\n if (isset($share['EmailRestrictAccess']) && $share['EmailRestrictAccess'])\n $prevent = FALSE;\n if (!isset($share['EmailEnabled']) || !$share['EmailEnabled'])\n $prevent = FALSE;\n if (!isset($share['WebEnabled']) || !$share['WebEnabled'])\n $prevent = FALSE;\n if (isset($share['WebReqAuth']) && $share['WebReqAuth'])\n $prevent = FALSE;\n if (isset($share['WebAccess']) && (int)$share['WebAccess'] == self::ACCESS_LAN)\n $prevent = FALSE;\n\n } else {\n $prevent = FALSE;\n }\n\n if ($prevent)\n throw new Engine_Exception(FLEXSHARE_LANG_WARNING_CONFIG, COMMON_WARNING);\n\n $this->_set_parameter($name, 'WebPhp', $web_php);\n }", "private function setEnvironment()\n {\n if (isset($_SERVER['PAYPLUG_API_URL'])) {\n $this->api_url = $_SERVER['PAYPLUG_API_URL'];\n } else {\n $this->api_url = 'https://api.payplug.com';\n }\n\n if (isset($_SERVER['PAYPLUG_SITE_URL'])) {\n $this->site_url = $_SERVER['PAYPLUG_SITE_URL'];\n } else {\n $this->site_url = 'https://www.payplug.com';\n }\n }" ]
[ "0.6732849", "0.61901224", "0.58647925", "0.56070524", "0.54768354", "0.54410523", "0.53315735", "0.52594656", "0.5254621", "0.5251319", "0.5187153", "0.51849824", "0.5181018", "0.51786447", "0.51541", "0.51346743", "0.51293546", "0.51093036", "0.5107301", "0.5100818", "0.50948393", "0.50948393", "0.50931287", "0.5087372", "0.50783664", "0.5071024", "0.50413275", "0.50288856", "0.5022281", "0.49961302" ]
0.7326947
0
Sets Sobek web service offline.
public function webServiceIsOffline() { $this->statusWebService = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOffline(): void\n {\n $this->offline = true;\n }", "public function setOnline(): void\n {\n $this->offline = false;\n }", "public function i_switch_offline_mode(string $offline) {\n $this->getSession()->evaluateScript('appProvider.setForceOffline(' . $offline . ');');\n }", "public function webServiceIsOnline() {\n\t\t$this->statusWebService = true;\n\t}", "public function setOffline($value)\n {\n return $this->set(self::OFFLINE, $value);\n }", "public function setOffline($value)\n {\n return $this->set(self::OFFLINE, $value);\n }", "public function setOffSiteValue(): void\n {\n cache([config(\"gateway.provider_callback\") => config(\"gateway.providers.{$this->identifier()}\")],\n now()->addMinutes(30));\n cache([$this->getPaymentId() => [\n 'order' => $this->order(),\n 'data' => $this->data(),\n ]], now()->addMinutes(30));\n }", "public function setMwsServiceUrl($url);", "public function setDownMode()\n {\n $this->maintenance->setDownMode();\n $this->info('Application is now in maintenance mode.');\n }", "public function requestWriteMode() {\r\n\t\tif (!$this->mEnableWrite)\r\n\t\t\t$this->dieUsage('Editing of this site is disabled. Make sure the $wgEnableWriteAPI=true; ' .\r\n\t\t\t'statement is included in the site\\'s LocalSettings.php file', 'readonly');\r\n\t}", "function set_offline($config, $num_off, $stats, $login) {\n\n foreach($stats as $stat) {\n if(strstr($stat['ps_status'], 'ONLINE')) {\n\n // ONLINE but should be taken out of rotation\n if($stat['secs_behind'] > TH_OFFLINE) {\n\n // Cant take any more out of rotation this cycle.\n if($num_off >= $config['max_offline']) {\n return;\n }\n\n $status = call_agent(\"OFF\", $stat['vdb']);\n $num_off++;\n }\n }\n }\n\n }", "public function isDownForMaintenance()\n {\n return $this->config('offline');\n }", "public function go_offline() {\n $this->CI =& get_instance();\n \n $mode = $this->CI->config->item('maintenance_mode');\n \n if(isset($mode) && $this->CI->config->item('maintenance_mode') === TRUE){\n //include(APPPATH.'views/maintenance_view.php');\n echo $this->CI->load->view('maintenance_view', '', TRUE); exit;\n }\n \n }", "public function isOffline(): bool\n {\n return $this->offline;\n }", "private static function checkOffline(): void\n {\n Debug::setBacklog()::bypassGenericMessage();\n\n if (Parameters::getOffline()) {\n throw new Exception(Parameters::getOfflineMessage(), self::DEFAULT_OFFLINE_MESSAGE[0]);\n }\n\n PerformanceAnalysis::flush(PERFORMANCE_ANALYSIS_LABEL);\n }", "function setObserv_est($sobserv_est = '')\n {\n $this->sobserv_est = $sobserv_est;\n }", "protected function setServer()\n {\n if (Arr::get($this->config, 'sandbox', false)) {\n $this->serverUrl = self::SERVER_SANDBOX_URL;\n } else {\n $this->serverUrl = self::SERVER_URL;\n }\n }", "public function getOffline()\n {\n return $this->get(self::OFFLINE);\n }", "public function getOffline()\n {\n return $this->get(self::OFFLINE);\n }", "public function setLayeredSearchOffAction()\n {\n $request = $this->getRequest();\n $response = $this->getResponse();\n $authkey = $request->getParam('authentication_key');\n $uuid = $request->getParam('uuid');\n $scope = $request->getParam('scope', 'stores');\n $scopeId = $request->getParam('store_id', 1);\n\n if (!$this->valid($uuid, $authkey)) {\n $resp = json_encode(\n array(\n 'status' => 'error: '.'Authentication failed'\n )\n );\n\n $response->setBody($resp);\n\n return;\n }\n\n try {\n $this->_getConfig()->disableLayeredNavigation($scope, $scopeId);\n $this->_getConfig()->disableMiniFormUrlRewrite($scope, $scopeId);\n Mage::app()->getCacheInstance()->cleanType('config');\n } catch (Exception $e) {\n $resp = json_encode(array('status' => 'error: '.$e->getMessage()));\n $response->setBody($resp);\n\n Mage::logException($e);\n\n return;\n }\n\n $resp = array('new_state' => 0,\n 'status' => 'ok',\n );\n\n $response->setBody(json_encode($resp));\n }", "function set_offline(){\r\n $this->db->where('id', $this->session->userId);\r\n $this->db->set('online', 0);\r\n $this->db->update('user'); \r\n }", "public function saveOfflineData(){\n\t\n\theader('Access-Control-Allow-Origin: *');\n\t$this->Att_services_model->saveOfflineData(); \n}", "public function setSettings() {\n //get a new instance of the call\n $getSettingsCall = new GetSettingsCall();\n\n //generate the body\n $body = ['takeawayID' => $this->takeaway->getId(),\n 'domain' => $this->request->host(),\n 'subDomain' => '',\n ];\n\n //make the request\n $response = $getSettingsCall->makeRequest(\n '/api/Takeaway/GetSettings', $getSettingsCall->createRequestMessage($body)\n );\n\n //handle the response\n $getSettingsCall->handleResult($response);\n }", "public function setOfflineOffers($offlineOffers)\n {\n $this->offlineOffers = $offlineOffers;\n return $this;\n }", "public function getOfflineOffers()\n {\n return $this->offlineOffers;\n }", "public function turnOff() \n {\n $this->on = false;\n }", "public function register_switch_off()\n {\n $off = new Off($this->app['file']);\n $off->register_in_wp();\n }", "public function ignoreUpgrade()\n {\n $result = $this->loadModel('setting')->setItems('system.common.global', array('ignoreUpgrade' => true), 'all');\n if($result) $this->send(array('result' => 'success', 'locate' => inlink('index')));\n $this->send(array('result' => 'fail', 'message' => $this->lang->fail));\n }", "function fyndiq_deactivate()\n {\n if (!$this->checkCredentials()) {\n $data = array(\n FyndiqUtils::NAME_PRODUCT_FEED_URL => '',\n FyndiqUtils::NAME_PING_URL => '',\n FyndiqUtils::NAME_NOTIFICATION_URL => ''\n );\n try {\n FmHelpers::callApi('PATCH', 'settings/', $data);\n } catch (Exception $e) {\n }\n }\n // Delete all settings\n delete_option('wcfyndiq_ping_token');\n delete_option('wcfyndiq_username');\n delete_option('wcfyndiq_apitoken');\n }", "public function setLedOff()\n {\n $this->soap(\"DeviceProperties\", \"SetLEDState\", [\n \"Channel\" => \"Master\",\n \"DesiredLEDState\" => 'Off',\n ]);\n\n return $this;\n }" ]
[ "0.71644264", "0.6549325", "0.57554173", "0.57098204", "0.5669311", "0.5669311", "0.56394476", "0.5269122", "0.5188718", "0.5168742", "0.512525", "0.5054979", "0.50048405", "0.4992299", "0.4990976", "0.49905518", "0.4956583", "0.49529657", "0.49529657", "0.49337596", "0.49166578", "0.49082267", "0.48974687", "0.4886537", "0.48718828", "0.4862445", "0.4787316", "0.47676128", "0.47466728", "0.4735955" ]
0.6871562
1
Get simulated Sobek web service status.
public function getFakeWebServiceStatus() { // Check Sobek webserive status object. if ($this->statusWebService) { // Returns online fake data. return json_decode( file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "fake_service_online.json"), true); } // Returns offline fake data. return json_decode( file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "fake_service_offline.json"), true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetServiceStatus(){\n\t\t\t$uri = parent::createMWSUri('GetServiceStatus', $this->api_endpoint, $this->api_version);\n\t\t\treturn parent::mwsCurlRetrieve($uri);\n\t\t}", "function getWSstatus() {\n return $this->ws->status;\n }", "function getStatus()\n\t{\n\t\t$this->checkSettings();\n\t\t$this->request_xml \t\t\t\t= \t$this->createStatusRequest();\n\t\t$this->api_url \t\t\t\t= \t$this->getApiUrl();\n\t\t$this->reply_xml \t\t\t\t= \t$this->xmlPost($this->api_url, $this->request_xml);\n\n\t\tif (!$this->reply_xml)\n\t\t\treturn false;\n \n\t\t$rootNode \t\t\t\t\t\t= \t$this->parseXmlResponse($this->reply_xml);\n\t\tif (!$rootNode)\n\t\t\treturn false;\n\n\t\t$details \t\t\t\t\t\t= \t$this->processStatusReply($rootNode);\n\t\t$this->details \t\t\t\t\t= \t$details;\n\n\t\t$this->status \t\t\t\t\t= \t$rootNode['ewallet']['status']['VALUE'];\n\t\treturn $this->status;\n\t}", "protected function getStatus() {\n\t\treturn app()->getModule('pvpgn')->getServerStatus();\n\t}", "public function getServerStatus()\n {\n return $this->request('GET', 'server');\n }", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public static function serviceStatuses() {\n\t\t\n\t\t//initialize client\n\t\t$client = new Client();\n\t\t\n\t\ttry {\n\t\t\t//send request\n\t\t\t$response = $client->get('https://status.mojang.com/check');\n\t\t\t\n\t\t\t//get data\n\t\t\t$data = $response->getBody()->getContents();\n\t\t\t\n\t\t\t//decode json\n\t\t\t$data = \\GuzzleHttp\\json_decode($data, true);\n\t\t\t\n\t\t\t//convert the template\n\t\t\t$services = [];\n\t\t\tforeach($data as $item) {\n\t\t\t\t$services[array_keys($item)[0]] = array_values($item)[0];\n\t\t\t}\n\t\t\t\n\t\t\t//return the services\n\t\t\treturn $services;\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "abstract public function get_status();", "public function status()\n {\n return $this->service->call(array(\n 'method' => 'glpi.status'\n ));\n }", "public function status()\n {\n return $this->suite()->status();\n }", "public function status()\n {\n return $this->gateway->status();\n }", "public function webServiceIsOnline() {\n\t\t$this->statusWebService = true;\n\t}", "private function getStatus()\n {\n $this->curl->get($this->status_url);\n }", "public function status()\n\t{\n\t\treturn $this->info('http_code');\n\t}", "public function getJsonApiStatus(): string;", "public function getStatus() {\n\t\treturn Geko_Wp_Ext_WatuPro_Timing::calculateStatus( $this );\n\t}", "public function status();", "public function status();", "public function status();", "public function status();", "public function getStatus()\n {\n $this->output(\n array(\n 'status' => $this->controller->getStatus(),\n 'downloadUrl' => UrlService::getEndpointUrl('Debug', 'getSystemInfo'),\n )\n );\n }" ]
[ "0.731981", "0.67367834", "0.666811", "0.6576003", "0.6510958", "0.6402267", "0.6402267", "0.6402267", "0.6402267", "0.6402267", "0.6402267", "0.6402267", "0.6402267", "0.6402267", "0.6402267", "0.6374828", "0.63720393", "0.63351494", "0.6271905", "0.6244647", "0.62193793", "0.62071383", "0.6205475", "0.61460894", "0.61370885", "0.61341673", "0.61341673", "0.61341673", "0.61341673", "0.60989803" ]
0.79118633
0
Create an Sobek integrator object.
public function create() { return $this->sobekIntegrator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function newInstance() {\n\t\tif (!\\F3::get('form_price_calculator'))\n\t\t\tthrow new \\Exception('form_price_calculator configuration cannot be empty. Enter the full classpath of the \\models\\PriceCalculator implementation.');\n\n\t\t$priceCalculatorName = \\F3::get('form_price_calculator');\n\t\treturn new $priceCalculatorName;\n\t}", "protected function _integratorFactory($integrator_dsn_or_conn, $integrator_options, $API)\n\t{\n\t\t$Driver = QuickBooks_Driver_Factory::create($integrator_dsn_or_conn, $integrator_options);\n\t\treturn new QuickBooks_Integrator_OSCommerce($Driver, $integrator_options, $API);\n\t}", "public static function create()\n {\n return new \\Legalesign\\Document\\SigningRequest;\n }", "public static function init()\n {\n $o = new static();\n $o->key = Config::get('clake.pusher::key');\n $o->secret = Config::get('clake.pusher::secret');\n $o->appid = Config::get('clake.pusher::appid');\n array_push($o->options, 'encrypted', Config::get('clake.pusher::encrypted'));\n $o->pusher = new \\Pusher($o->key, $o->secret, $o->appid, $o->options);\n return $o;\n }", "public function createWgerDriver()\n\t{\n return new Wger(\n config('services.wger.secret')\n );\n\t}", "public static function create()\n {\n $args = func_get_args();\n\n $gateway = Config::inst()->get('Omnipayable', 'Gateway');\n\n $paymentFormClass = \"OmnipayableForm_{$gateway}\";\n\n if(!class_exists($paymentFormClass)) {\n user_error('There is no OmnipayableForm implemented for the currently configured gateway.', E_USER_ERROR);\n }\n\n return Injector::inst()->createWithArgs($paymentFormClass, $args);\n }", "protected function create()\n {\n createFTSLogicHook();\n }", "function getInstance ($varsToSave = FALSE ) {\n\t\tstatic $instance;\n\t\tif (!isset($instance)) {\n\t\t\t$instance = new WPU_Integration($varsToSave);\n } \n return $instance;\n }", "public function newInstance()\n {\n return new TranslatorLocator(\n new PackageLocator,\n new FormatterLocator([\n 'basic' => function () {\n return new \\Aura\\Intl\\BasicFormatter;\n },\n 'intl' => function () {\n return new \\Aura\\Intl\\IntlFormatter;\n },\n ]),\n new TranslatorFactory,\n 'en_US'\n );\n }", "public static function create();", "public static function create();", "public static function create();", "abstract protected function createInstance();", "function create($builder, array $args)\n{\t\n\t// last argument is path of Tine 2.0\n\t$args[] = realpath(dirname(__FILE__) . '/../tine20');\n\n\t$className = 'Tool_CodeGenerator_' . $builder;\n\t$tcg = new $className();\n\t$tcg->build($args);\n}", "public function Create()\n\t\t{\n\t\t\tparent::Create();\n\n\t\t\t$this->RegisterPropertyString(\"account\", \"0x7866f187f30cd52Bdbd5c4184fD3ee6168Ae0dB4\");\n\n\t\t\t// this is ugly .. not a nicer way to trigger Self counter...\n\t\t\t$this->RegisterTimer(\"UpdateTimer\", 900 * 1000, 'SKO_update($_IPS[\\'TARGET\\']);');\n\t\t}", "public function oGateway(){\n\t\t$gateway = GatewayFactory::create($this->Gateway, self::$httpclient, self::$httprequest);\n\t\t$parameters = Config::inst()->forClass('Payment')->parameters;\n\t\tif(isset($parameters[$this->Gateway])) {\n\t\t\t$gateway->initialize($parameters[$this->Gateway]);\n\t\t}\n\n\t\treturn $gateway;\n\t}", "public static function instance(): self\n {\n if (!self::$instance) {\n self::$instance = new self(\n Sequencer::sequence('stub-label'),\n MatcherFactory::instance(),\n MatcherVerifier::instance(),\n Invoker::instance(),\n InvocableInspector::instance(),\n EmptyValueFactory::instance(),\n GeneratorAnswerBuilderFactory::instance(),\n InlineExporter::instance()\n );\n }\n\n return self::$instance;\n }", "public function createPaymentBuilder(): PaymentBuilderInterface;", "public static function init(): self\n {\n return new self(new Payment());\n }", "public static function create()\n {\n $_cls = get_called_class();\n $_obj = new $_cls;\n call_user_func_array(array($_obj, 'init'), func_get_args());\n return $_obj;\n }", "public function create(IntegrationTester $I): void\n {\n $users = Users::create([\n 'firstname'=>'testSDK',\n 'lastname'=> 'testSDK',\n 'displayname'=> 'sdktester',\n 'password'=> $this->userPassword,\n 'default_company'=> 'Company'. $this->random->base58(),\n 'email'=> $this->userEmail,\n 'verify_password'=> $this->userPassword\n ]);\n\n $I->assertTrue($users instanceof Users);\n $this->userId = $users->id;\n }", "static function newInstance() {\n\t\tif (!\\F3::get('statistics_dao'))\n\t\t\tthrow new \\Exception('statistics_dao configuration cannot be empty. Enter the full classpath of the \\models\\StatisticsDao implementation.');\n\n\t\t$statisticsDaoName = \\F3::get('statistics_dao');\n\t\treturn new $statisticsDaoName;\n\t}", "private function encryptorFactory($classFullName, $secretKey, $suffix) {\n $refClass = new \\ReflectionClass($classFullName);\n if ($refClass->implementsInterface(self::ENCRYPTOR_INTERFACE_NS)) {\n return new $classFullName($secretKey, $suffix);\n } else {\n throw new \\RuntimeException('Encryptor must implements interface EncryptorInterface');\n }\n }", "public function newInstance();", "public function newInstance();", "public function newInstance();", "public function newInstance();", "public function newInstance();", "public static function instance() {\n\t\tif ( ! isset( self::$instance ) ) {\n\t\t\t// Setup the setup\n\t\t\tself::$instance = new Mai_Engine_Installer;\n\t\t\t// Methods\n\t\t\tself::$instance->setup_constants();\n\t\t\tself::$instance->includes();\n\t\t\tself::$instance->hooks();\n\t\t}\n\t\treturn self::$instance;\n\t}", "protected function setUp()\n {\n $this->object = new SMSMobiltek;\n $this->object\n ->setGateURL('https://gw2.mobiltek.pl/api/')\n ->setGateUser('user')\n ->setGatePassword('password')\n ->setGateServiceId('1') \n ->setOriginator('11111');\n }" ]
[ "0.57266724", "0.5532357", "0.52856207", "0.50722575", "0.504832", "0.503825", "0.5025787", "0.49548605", "0.49452212", "0.49337158", "0.49337158", "0.49337158", "0.49031746", "0.48918787", "0.4878893", "0.48502934", "0.4847805", "0.484187", "0.4823268", "0.4772179", "0.47706312", "0.4767547", "0.47669163", "0.47369102", "0.47369102", "0.47369102", "0.47369102", "0.47369102", "0.4728088", "0.4716745" ]
0.7811162
0
callServer($server, $port, $method, $params)
function callServer($url, $method, $params='') { require_once 'lib/xmlrpc.inc'; // init client with server-parameters $client = new xmlrpc_client($url); // $client->setDebug(2); // prepare parameters (if needed) $parameter_valid = array(); if(is_array($params)) { foreach($params as $value) array_push($parameter_valid, new xmlrpcval($value['value'], $value['type'])); } // prepare message for server (w/ ord w/o parameters) if(count($parameter_valid) > 0) $message = new xmlrpcmsg($method, $parameter_valid); else $message = new xmlrpcmsg($method); // send message to server $result = $client->send($message); // check response and create response-array if (!$result) $ret_array = array('success'=>false, "err" => "Could not connect to server."); elseif ($result->faultCode()) $ret_array = array('success'=>false, "err" => "XML-RPC Fault #".$result->faultCode()." : ".$result->faultString()); else $ret_array = array('success'=>true, "xmlrpc" => $result); // resturn response-array return $ret_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function callServer(array $params = array())\n {\n\n $no_store = array(\"create-domain\", \"create-user\", \"delete-user\", \"list-plans\");\n $no_session = true;\n\n //store session under default if no domain provided\n $domain = (isset($params['domain'])) ? $params['domain'] : 'default';\n $program = $params['program'];\n\n if (isset($params['no_cache']))\n $no_session = true;\n\n if (in_array($program, $no_store))\n $no_session = true;\n\n if ($no_session == true || ($response = $this->readSession($domain, $program)) == false) {\n\n $querySring = $this->buildQueryString($params);\n unset($params);\n $params = array(\n 'user' => $this->username,\n 'password' => $this->password,\n );\n $url = $this->protocol . $this->host . \":\" . $this->port . \"/virtual-server/remote.cgi?\" . $querySring;\n //echo $url;exit;\n //return $this->get($url, true, $params);\n \n $response = $this->get($url, true, $params);\n \n //want to store the plans\n //don't sotre\n if (!$no_session)\n $this->writeSession($response, $domain, $program);\n }\n\n return $response;\n\n\n }", "public function __call($method, $params);", "public static function _Call($method,$param){\n\t\tif(is_null(self::$_Server))\n\t\t\tself::$_Server=new SoapClient(self::$_WsdlUri);\n\t\treturn self::$_Server->__soapCall($method,$param);\n\t}", "public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)\n {\n $request = $this->createServerRequest($method, $uri, $parameters, $cookies, $files, $server, $content);\n\n $this->instance('request', $request);\n\n return $this->app->run($request);\n }", "public function __call($method, $params)\n {\n $system = $this->getSystem();\n if (!method_exists($system, $method)) {\n require_once 'Zend/XmlRpc/Server/Exception.php';\n throw new Zend_XmlRpc_Server_Exception('Unknown instance method called on server: ' . $method);\n }\n return call_user_func_array([$system, $method], $params);\n }", "public function __call($method, $parms);", "public function __invoke(ServerRequestInterface $request, ResponseInterface $response);", "public function run(ServerRequestInterface $request, ResponseInterface $response);", "function callRemoteFunc($server, $funcname, $params)\n {\n $url = $server . \"/BluePortailAdmin/BluePortailLang.php?function=$funcname\";\n foreach($params as $k => $v)\n\t{\n\t $url .= \"&$k=\".urlencode($v);\n\t}\n return $url;\n }", "public function runServer($arguments) {\n $keyHost = array_search('--host', $arguments);\n $keyPort = array_search('--port', $arguments);\n\n /*\n * Si $keyHost no es false se paso argumento --host, por lo\n * tanto el siguiente argumento deberia ser el host.\n */\n if ($keyHost) {\n $this->serverHost = $arguments[$keyHost + 1];\n }\n\n /*\n * Si $keyPort no es false se paso argumento --port, por lo\n * tanto el siguiente argumento deberia ser el puerto.\n */\n if ($keyPort) {\n $this->serverPort = $arguments[$keyPort + 1];\n }\n\n echo $this->fgColor('green', 'ForeverPHP') . \" version \\033[\" . $this->foreground['white'] . \"m\" . $this->getVersion() . \"\\033[0m 0.4.0\\n\";\n echo \"Server is running at \" . $this->fgColor('blue', 'http://' . $this->serverHost . ':' . $this->serverPort . '/') . \"\\n\";\n echo \"Quit with Ctrl-C.\\n\";\n\n // Ejecuto el comando para iniciar el servidor\n // NOTA hacerlo compatible con Windows\n shell_exec('cd public/ && php -S ' . $this->serverHost . ':' . $this->serverPort);\n shell_exec('cd ..');\n }", "public function __call(string $method, array $args);", "public function request(string $method, array $params) { return call($method, $params, true); }", "public function __call(string $method, $arguments = null) {}", "abstract public function call($path = null, $method = 'GET', $data = null) ;", "public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)\n {\n $resources = $this->prepareRequest($method, $uri, $parameters, $cookies, $files, $server, $content);\n list($method, $uri, $parameters, $cookies, $files, $server, $content) = $resources;\n\n $this->currentUri = $this->prepareUrlForRequest($uri);\n\n $request = Request::create(\n $this->currentUri, $method, $parameters,\n $cookies, $files, $server, $content\n );\n\n $request = $this->beforeRequest($request);\n\n return $this->response = $this->afterRequest($this->app->prepareResponse($this->app->handle($request)));\n }", "public static function __callStatic($method, $parameters);", "public function setServerParams($host, $port = 11211, $timeout = NULL, $retry_interval = false, $status = NULL, $failure_callback = NULL) {\n\n }", "public function call($method, $parameters = []) {\n\t\t$post = xmlrpc_encode_request($method, $parameters);\n\n\t\t$url_parts = parse_url($this->endpoint);\n\n\t\tswitch ($url_parts['scheme']) {\n\t\t\tcase 'http':\n\t\t\t\t$port = isset($url_parts['port']) ? $url_parts['port'] : 80;\n\t\t\t\t$socket = fsockopen($url_parts['host'], $port, $error_number, $error_string, 2);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$socket = stream_socket_client($this->endpoint, $error_number, $error_string, 2);\n\t\t}\n\n\t\tif (!$socket) {\n\t\t\tthrow new XMLRPC_Exception($error_string . '(' . $error_number . ')');\n\t\t} else {\n\t\t\tfwrite($socket, 'POST /RPC2 HTTP/1.0' . \"\\r\\n\");\n\t\t\tfwrite($socket, 'Content-type: text/xml' . \"\\r\\n\");\n\t\t\tfwrite($socket, 'Content-length: ' . strlen($post) . \"\\r\\n\");\n\t\t\tfwrite($socket, \"\\r\\n\");\n\t\t\tfwrite($socket, $post);\n\n\t\t\t$response = '';\n\t\t\twhile (!feof($socket)) {\n\t\t\t\t$response .= fgets($socket, 1024);\n\t\t\t}\n\n\t\t\tfclose($socket);\n\t\t}\n\n\t\tif (1 != preg_match(\"/^HTTP\\/[0-9\\.]* ([0-9]{3}) ([^\\r\\n]*)/\", $response, $matches)) {\n\t\t\tthrow new XMLRPC_Exception('Invalid HTTP response');\n\t\t}\n\n\t\tif ($matches[1] != '200') {\n\t\t\tthrow new XMLRPC_Exception('HTTP error: ' . $matches[1] . ' ' . $matches[2]);\n\t\t}\n\n\t\t$response = preg_replace(\"/^.*\\r\\n\\r\\n/Us\", '', $response);\n\t\treturn xmlrpc_decode($response);\n\t}", "function serve(){\n\t\t$this->core->load('vendor/xmlrpc_lib');\n\t\t$s = new xmlrpc_server($this->functions, false);\n\t\t$s->functions_parameters_type = 'phpvals';\n\t\t$s->service();\n\t}", "public function __call($method, $params) {\n if (!is_scalar($method)) throw new Exception('Method name has no scalar value');\n\n if (is_array($params)) {\n // no keys\n $params = array_values($params);\n } else {\n throw new Exception('Params must be given as array');\n }\n\n // prepares the request\n $request = array(\n 'method' => $method,\n 'params' => $params,\n 'id' => $this->id\n );\n $request = json_encode($request);\n if ($this->debug) $this->debug_output[] = 'Request: '.$request;\n\n // performs the HTTP POST\n // extract information from URL for proper authentication\n $url = parse_url($this->url);\n $ch = curl_init($url['scheme'].'://'.$url['host'].':'.$url['port'].$url['path']);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));\n curl_setopt($ch, CURLOPT_USERPWD, $url['user'] . \":\" . $url['pass']);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n $response = curl_exec($ch);\n if ($this->debug) $this->debug_output[] = 'Response: ' . $response;\n $response = json_decode($response, true);\n $resultStatus = curl_getinfo($ch);\n if ($resultStatus['http_code'] != '200') {\n if ($resultStatus['http_code'] == '401') throw new Exception('RPC call did not return 200: Authentication failed');\n throw new Exception('RPC call did not return 200: HTTP error: ' . $resultStatus['http_code'] . ' - JSON Response: [' . @$response['error']['code'] . '] ' . @$response['error']['message']);\n }\n if (curl_errno($ch)) throw new Exception('RPC call failed: ' . curl_error($ch));\n curl_close($ch);\n\n // final checks and return\n if (!is_null($response['error']) || is_null($response)) throw new Exception('Response error or empty: ' . @$response['error']);\n if ($response['id'] != $this->id) throw new Exception('Incorrect response id (request id: ' . $this->id . ', response id: ' . $response['id'] . ')');\n return $response['result'];\n }", "public function __call($method, array $arguments);", "public function __call($method, $args);", "public function __call($name, $arguments)\n {\n if ( ! is_callable(array($this->server, $name)))\n throw new BadMethodCallException(\"The method '$name' does not exist\");\n return call_user_func_array(array($this->server, $name), $arguments);\n }", "public function run(ServerRequestInterface $request, ResponseInterface $response, $next = null);", "public function __call($method, $arguments);", "public function __call($method, $arguments);", "function getservbyport ($port, $protocol) {}", "public function __call($method, $params) {\n\t$connection = $this->beanstalk();\n\treturn call_user_func_array([&$connection, $method], $params);\n }", "public function server($opt = ['port' => 8000])\n {\n $this->taskServer($opt['port'])\n ->dir('public/ phpserver.php')\n ->run();\n }", "public function trigger($server, $request);" ]
[ "0.6409285", "0.6327723", "0.6317235", "0.6285936", "0.6240386", "0.62385017", "0.61163616", "0.6037388", "0.60371095", "0.59787744", "0.57533276", "0.57228667", "0.56896365", "0.5672618", "0.5659881", "0.5622955", "0.5618773", "0.5611175", "0.56008047", "0.5580989", "0.5579616", "0.55777806", "0.5574098", "0.55579454", "0.55545866", "0.55545866", "0.55442065", "0.55404985", "0.5518465", "0.5507698" ]
0.7118621
0
Get Preview CMS Page dropdown options
public function getPreviewCmsPageOptions() { $theme = Theme::getActiveTheme(); $pages = CmsPage::listInTheme($theme, true); $result = []; foreach ($pages as $page) { if (!$page->hasComponent('blogPost')) { continue; } /* * Component must use a categoryPage filter with a routing parameter and post slug * eg: categoryPage = "{{ :somevalue }}", slug = "{{ :somevalue }}" */ $properties = $page->getComponentProperties('blogPost'); if (!isset($properties['categoryPage']) || !preg_match('/{{\s*:/', $properties['slug'])) { continue; } $baseName = $page->getBaseFileName(); $pos = strrpos($baseName, '/'); $dir = $pos !== false ? substr($baseName, 0, $pos).' / ' : null; $result[$baseName] = strlen($page->title) ? $dir.$page->title : $baseName; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function options_page() {\n\t\tpremise_field_section( array(\n\t\t\tarray(\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => 'pwps_theme_options',\n\t\t\t),\n\n\t\t\tarray(\n\t\t\t\t'type' => 'submit',\n\t\t\t)\n\t\t) );\n\t}", "function adverts_dropdown_pages( $field ) {\r\n \r\n if(isset($field[\"value\"])) {\r\n $value = $field[\"value\"];\r\n } else {\r\n $value = null;\r\n }\r\n \r\n $args = array(\r\n 'selected' => $value, \r\n 'echo' => 1,\r\n\t'name' => $field[\"name\"], \r\n 'id' => $field[\"name\"],\r\n\t'show_option_none' => ' ',\r\n 'option_none_value' => 0\r\n );\r\n \r\n wp_dropdown_pages( $args );\r\n}", "public function getPostPageOptions() {\n return Page::sortBy('baseFileName')->lists('baseFileName', 'baseFileName');\n }", "public function getPageOptions()\n {\n return Page::sortBy('baseFileName')->lists('baseFileName', 'baseFileName');\n }", "public function getPageOptions()\n {\n return Page::sortBy('baseFileName')->lists('baseFileName', 'baseFileName');\n }", "protected function BodyMenuOptions()\n\t{\t$options = array();\n\t\tif ($this->page->id)\n\t\t{\t$options['edit'] = array('link'=>'pageedit.php?id=' . $this->page->id, 'text'=>'Edit Page');\n\t\t\tif ($this->page->details['galleries'])\n\t\t\t{\t$options['galleries'] = array('link'=>'pagegalleries.php?id=' . $this->page->id, 'text'=>'Galleries');\n\t\t\t}\n\t\t}\n\t\treturn $options;\n\t}", "public function renderOptionsPage() {\n\t\tammm_get_template( 'Admin/Options/options-page', array(\n\t\t\t'fields' => self::OPT_GROUP,\n\t\t\t'options' => $this->_options_page_hook,\n\t\t) );\n\t}", "function iver_select_options() {\n\t\treturn iver_select_framework()->qodeOptions;\n\t}", "public function pageChoices() {\n\n // CONFIGURATION SETTINGS\n $config = $this->config('webny_secondary_nav.settings');\n $dbval = $config->get('webny_secondary_nav.options.page_choices');\n\n return array(\n '#type' => 'radios',\n '#title' => t('Choose where to display the Secondary Navigation - ' . $dbval),\n '#options' => array(\n 'none'=>t('Disabled'),\n 'all'=>t('All web pages'),\n 'home'=>t('Home page only'),\n //'specific'=>t('Choose a specific page'),\n ),\n '#default_value' => $dbval,\n '#attributes' => array()\n );\n }", "function ca_options_page_html(){\n\t\techo ca_admin_dependancy(admin_url('admin-ajax.php'));\t\n\t\techo ca_load_admin_body();\n\t}", "function adext_core_page_options() {\r\n \r\n if(adverts_request( \"adaction\" ) == \"gallery\" ) {\r\n _adext_core_page_options_gallery();\r\n } else {\r\n _adext_core_page_options_main();\r\n }\r\n}", "function optionsframework_options() {\t\n\n\n\t// Pull all the pages into an array\n\t$options_pages = array(); \n\t$options_pages_obj = get_pages('sort_column=post_parent,menu_order');\n\t$options_pages['default'] = 'Default Maintenance Page';\n\tforeach ($options_pages_obj as $page) {\n \t$options_pages[$page->ID] = $page->post_title;\n\t}\n\t\n\t\n\t// If using image radio buttons, define a directory path\n\t$imagepath = get_template_directory_uri() . '/images/';\n\t$admin_images_url = get_template_directory_uri().'/admin/images/';\n\t\n\t// TitleTypes \n\t$title_type = array(\n\t\t'cpmb_no' => 'No Title',\n\t\t'cpmb_title' => 'Page Title',\n\t\t'cpmb_title_center' => 'Page Title (Center)',\n\t\t'cpmb_breadcrumbs' => 'Page Title + Breadcrumbs',\n\t\t'cpmb_breadcrumbs_center' => 'Page Title + Breadcrumbs (Center)',\n\t\t'cpmb_image' => 'Featured Image',\n\t\t'cpmb_nivo' => 'Nivo Slider',\n\t\t'cpmb_flex' => 'Flex Slider',\n\t\t'cpmb_kwick' => 'Kwicks Slider',\n\t\t'cpmb_roundabout' => 'Roundabout Slider',\n\t\t'cpmb_liteaccordion' => 'Lite Accordion Slider',\n\t\t'cpmb_3dslice' => '3D Slice Slider'\n\t\t);\n\t\n\tif(class_exists('RevSlider')){\n\t\t$slider = new RevSlider();\n\t\t$arrSliders = $slider->getArrSliders();\n\t\tforeach($arrSliders as $revSlider) { \n\t\t\t$title_type[$revSlider->getAlias()] = $revSlider->getTitle().' (Revolution Slider)';\n\t\t}\n\t}\n\n\t\n\t$options = array();\n\t\n\n\t\n\t// Layout Settings /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"Layout\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"layout\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\n\t$pl_images = array('full'=>$admin_images_url.'wl.png','boxed'=>$admin_images_url.'bl.png','boxed-margin'=>$admin_images_url.'bm.png');\n\t$options[] = array( \"name\" => __(\"Layout Style\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select Website layout style: Wide, Boxed or Boxed with Margin on top and bottom\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"page_style\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"std\" =>\"full\",\n\t\t\t\t\t\t\"options\" => $pl_images);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Responsive?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Responsive\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"responsive\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\n\t\n\t$options[] = array( \"name\" => __(\"Zoom on Small Devices?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Zoom ability on small devices\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"zoom\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 0);\n\t\t\t\t\t\t\n\t\n\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Animate?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Animation Effect\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"animate\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\n\t\t\n\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array(\"name\" => __(\"Nice Scroll\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Nice Scroll?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Nice Scroll\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"nicescroll\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Scroll Bar Width\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter Scroll Bar Width (Thickness) (Default is 7px)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"nicescroll_width\",\n\t\t\t\t\t\t\"std\" => \"7px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Scroll Bar Border Radius\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter Scroll Bar Border Radius (Default is 7px)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"nicescroll_radius\",\n\t\t\t\t\t\t\"std\" => \"7px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array(\"name\" => __(\"Boxed & Blocked Layout Options (only work when Boxed or Blocked Layouts is selected)\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\t\t\t\t\t\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Boxed and Blocked Shadow\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Boxed and Blocked Shadow\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"wrap_shadow\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 0);\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Blocked Rounded Corners\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Blocked Rounded Corners\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blocked_corners\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Custom Background Image\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Upload Background Image or paste Image URL\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"bg_img\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\t\n\n\t$options[] = array( \"name\" => __(\"Background Repeat\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select Background Repeat Option for the Background.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"bg_repeat\",\n\t\t\t\t\t\t\"std\" => \"repeat\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('stretch' => __('Stretch Image','official'), 'repeat' => __('Repeat','official'), 'no-repeat' => __('No Repeat','official'), 'repeat-x' => __('Repeat Horizontal (X)','official'), 'repeat-y' => __('Repeat Vertical (Y)','official')));\t\n\t\n\t\t\t\t\t\t\n\t\n\t//Background Images Reader\n\t$bg_images_path = get_template_directory() . '/images/pattern/thumb/'; \n\t$bg_images_url = get_template_directory_uri().'/images/pattern/thumb/'; \n\n\t$bg_images = array();\n\t\n\tif ( is_dir($bg_images_path) ) {\n\t\tif ($bg_images_dir = opendir($bg_images_path) ) { \n\t\t\twhile ( ($bg_images_file = readdir($bg_images_dir)) !== false ) {\n\t\t\t\tif(stristr($bg_images_file, \".png\") !== false || stristr($bg_images_file, \".jpg\") !== false) {\n\t\t\t\t\t$bg_images[] = $bg_images_url . $bg_images_file;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}\n\tsort($bg_images);\n\n\t$options[] = array( \"name\" => __(\"Background Patterns\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"bg_img_select\",\n\t\t\t\t\t\t\"type\" => \"tiles\",\n\t\t\t\t\t\t\"std\" =>\"0\",\n\t\t\t\t\t\t\"options\" => $bg_images);\n\t\t\n\t\n\t\n\t// Frames\n\t$options[] = array(\"name\" => __(\"Boxed Layout Frames\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\n\t$drk = '';\n\tif (_option('dark_style',0)==1){$drk='d';}\n\t$fr_images = array(\n\t\t'noframe'=>$admin_images_url.'nofr.jpg',\n\t\t'frame_1'=>$admin_images_url.'fr1'.$drk.'.jpg',\n\t\t'frame_2'=>$admin_images_url.'fr2'.$drk.'.jpg',\n\t\t'frame_3'=>$admin_images_url.'fr3'.$drk.'.jpg',\n\t\t'frame_4'=>$admin_images_url.'fr4'.$drk.'.jpg',\n\t\t'frame_5'=>$admin_images_url.'fr5'.$drk.'.jpg',\n\t\t'frame_6'=>$admin_images_url.'fr6'.$drk.'.jpg',\n\t\t'frame_7'=>$admin_images_url.'fr7'.$drk.'.jpg',\n\t\t'frame_8'=>$admin_images_url.'fr8'.$drk.'.jpg',\n\t\t'frame_9'=>$admin_images_url.'fr9'.$drk.'.jpg',\n\t\t'frame_10'=>$admin_images_url.'fr10'.$drk.'.jpg',\n\t\t\n\t);\n\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Frames\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select frame for boxed style\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"frame\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"std\" =>\"noframe\",\n\t\t\t\t\t\t\"desc\" =>__(\"NOTE: Frames only works on Boxed layout\",\"official\"),\n\t\t\t\t\t\t\"options\" => $fr_images);\n\t\t\t\t\t\t\n\t\n\t// SEO SETTINGS /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"SEO Settings\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"seo\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\t\t\t\t\t\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Meta Description\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Description about your website (Good for SEO)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"meta_description\",\n\t\t\t\t\t\t\"std\" => get_bloginfo( 'description' ),\n\t\t\t\t\t\t\"type\" => \"textarea\");\n\t\n\t$options[] = array( \"name\" => __(\"Meta Keywords\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Keywords about your website, Separate them with comma ( , )\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"meta_keywords\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"textarea\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$meta_robots_array = array( \"index\" => \"Index\", \"follow\" => \"Follow\" );\n\t$meta_robots_defaults = array( \"index\" => \"1\", \"follow\" => \"1\" );\n\n\t$options[] = array( \"name\" => __(\"Meta Robots\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Should the robots index your site or not? Maybe you don`t want to let robots follow all your pages/folders?\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"meta_robots\",\n\t\t\t\t\t\t\"type\" => \"multicheck\",\n\t\t\t\t\t\t\"options\" => $meta_robots_array,\n\t\t\t\t\t\t\"std\" => $meta_robots_defaults);\n\n\t\n\t// Header ////////////////////////////////////////\n\t$options[] = array(\"name\" => __(\"Header\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"header\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Custom Header Background Image\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Upload Header Background Image or paste Image URL\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"header_bg_img\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\t\t\t\t\t\t\n\n\t$options[] = array( \"name\" => __(\"Sticky Menu?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Sticky Menu\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"is_sticky\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Header Top Line\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Header top line height, if you want to remove it please select 0\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"header_top_line\",\n\t\t\t\t\t\t\"std\" => \"5\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('0'=>'0px','1'=>'1px','2'=>'2px','3'=>'3px','4'=>'4px','5'=>'5px',\n\t\t\t\t\t\t\t\t\t\t\t'6'=>'6px','7'=>'7px','8'=>'8px','9'=>'9px','10'=>'10px','11'=>'11px',\n\t\t\t\t\t\t\t\t\t\t\t'12'=>'12px','13'=>'13px','14'=>'14px','15'=>'15px','16'=>'16px',\n\t\t\t\t\t\t\t\t\t\t\t'17'=>'17px','18'=>'18px','19'=>'19px','20'=>'20px'));\n\t\t\t\t\t\t\n\t\n\t$hdr_images = array(\n\t\t'v1'=>$admin_images_url.'header1.gif',\n\t\t'v2'=>$admin_images_url.'header2.gif',\n\t\t'v3'=>$admin_images_url.'header3.gif',\n\t\t'v4'=>$admin_images_url.'header4.gif',\n\t\t'v5'=>$admin_images_url.'header5.gif',\n\t\t'v6'=>$admin_images_url.'header6.gif',\n\t\t'v7'=>$admin_images_url.'header7.gif',\n\t\t'v8'=>$admin_images_url.'header8.gif',\n\t\t'v9'=>$admin_images_url.'header9.gif',\n\t\t'v10'=>$admin_images_url.'header10.gif',\n\t\t'v11'=>$admin_images_url.'header11.gif',\n\t\t'v12'=>$admin_images_url.'header12.gif',\n\t);\n\t$options[] = array( \"name\" => __(\"Header Style\",\"official\"),\n\t\t\t\t\t\t\"desc\" => \"\",\n\t\t\t\t\t\t\"id\" => \"header_style\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"std\" =>\"v1\",\n\t\t\t\t\t\t\"options\" => $hdr_images);\t\n\n\t$options[] = array( \"name\" => __(\"Main Menu Margin Top\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter Main Menu Margin from Top (Default is 40px) only works on Header style 2,5,9,10,12\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"menu_margin_top\",\n\t\t\t\t\t\t\"std\" => \"40px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t\n\t$options[] = array( \"name\" => __(\"Big Header Opacity\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Please select Big Header Opacity between 0 to 100\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"bh_opacity\",\n\t\t\t\t\t\t\"std\" => \"100\",\n\t\t\t\t\t\t\"range\" => \"0,100\",\n\t\t\t\t\t\t\"step\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"slider\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Small Header Opacity\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Please select Small Header Opacity between 0 to 100\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"sh_opacity\",\n\t\t\t\t\t\t\"std\" => \"100\",\n\t\t\t\t\t\t\"range\" => \"0,100\",\n\t\t\t\t\t\t\"step\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"slider\");\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Header Shadows?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the header shadow effects\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"header_shadow\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Sub Menu Opacity\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Please select Sub Menu Opacity between 0 to 100\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"submenu_opacity\",\n\t\t\t\t\t\t\"std\" => \"100\",\n\t\t\t\t\t\t\"range\" => \"0,100\",\n\t\t\t\t\t\t\"step\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"slider\");\n\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array(\"name\" => __(\"Logo\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Logo\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Use the upload button to upload your site's logo and then click '<strong>Use this image</strong>.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"logo\",\n\t\t\t\t\t\t\"std\" => $imagepath . \"logo.png\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\t\n\t$options[] = array( \"name\" => __(\"Logo Width\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter your logo width (Default is 220px)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"logo_width\",\n\t\t\t\t\t\t\"std\" => \"220px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Logo Margin Top\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter your logo Margin from Top (Default is 30px)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"logo_margin_top\",\n\t\t\t\t\t\t\"std\" => \"30px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Logo Margin Bottom\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter your logo Margin from Bottom (Default is 30px)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"logo_margin_bottom\",\n\t\t\t\t\t\t\"std\" => \"30px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __(\"Logo Width in Sticky\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter your logo Width in Sticky Menu (Default is 170px)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"logo_width_sticky\",\n\t\t\t\t\t\t\"std\" => \"170px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __(\"Logo Sticky Margin\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter your logo Margin from Bottom (Default is 5px 0px)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"menu_sticky_margin\",\n\t\t\t\t\t\t\"std\" => \"5px 0px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Custom Favicon\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Site favicon. (32x32 pixel or 16x16 pixel .PNG or .ICO file)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"favicon\",\n\t\t\t\t\t\t\"type\" => \"upload\",\n\t\t\t\t\t\t\"std\" => $imagepath . \"favicon.ico\");\n\t\n\t\n\t$options[] = array(\"name\" => __(\"Navigation Menu\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show Search?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Search bar on top right\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"search\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show Menu Separator\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Menu Separator\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"menu_sep\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\t\n\n\t\t\t\t\t\t\n\t$options[] = array(\"name\" => __(\"Email and Call Us Text\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Email and Call Us Text\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This text show in the top header area\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"right_sub_text\",\n\t\t\t\t\t\t\"std\" => '<span><i class=\"icon-envelope-alt\"></i> <a href=\"mailto:[email protected]\">[email protected]</a></span><span><i class=\"icon-phone\"></i> +1 (888) 0000</span>',\n\t\t\t\t\t\t\"type\" => \"editor\");\t\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Margin Top\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter Main Email and Call Us Margin from Top (Default is 56px) only works on Header style 1,3,6,7,8\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"info_margin_top\",\n\t\t\t\t\t\t\"std\" => \"56px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t//Breadcrumbs\n\t$options[] = array(\"name\" => __(\"Breadcrubs Area\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Default Breadcrumbs Background Image\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Upload Breadcrumbs Background Image or paste Image URL, if you add Breadcrumb Image to your page advanced settings that will override this default image.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"breadcrumbs_bg_img\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Breadcrumbs Height\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Breadcrumbs Height (Default is 110px)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"breadcrumbs_height\",\n\t\t\t\t\t\t\"std\" => \"110px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t//Extra Panel\n\t$options[] = array(\"name\" => __(\"Extra Panel\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\t\n\t\n\t$options[] = array( \"name\" => __(\"Show Top Extra Panel?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Top Extra Panel\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"extrapanel\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\t\n\t\n\t$options[] = array( \"name\" => __(\"Arrow Button Align\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select extra panel arrow button alignment\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"extra_align\",\n\t\t\t\t\t\t\"std\" => \"right\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array(\n\t\t\t\t\t\t\t\t\t'left'=>__(\"Left\",\"official\"),\n\t\t\t\t\t\t\t\t\t'center'=>__(\"Center\",\"official\"),\n\t\t\t\t\t\t\t\t\t'right'=>__(\"Right\",\"official\")\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t$col_images = array('1'=>$admin_images_url.'1c.png','2'=>$admin_images_url.'2c.png','3'=>$admin_images_url.'3c.png','4'=>$admin_images_url.'4c.png');\n\t$options[] = array( \"name\" => __(\"Number of Extra Panel Columns\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select how many columns you want to display in the Extra Panel widgets.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"extrapanel_col\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"std\" =>\"2\",\n\t\t\t\t\t\t\"options\" => $col_images);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\n\t\n\t// Custom WPML Language Selector ==================================================================================\t\n\tif (function_exists('icl_get_languages')){\n\t\t\t\t\t\n\t$options[] = array(\"name\" => __(\"WPML Settings\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show WPML Language Selector\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the WPML Language Selector on top right\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"wpml_lang_selector\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 0);\n\t\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Show WPML Language Selector in which Menu?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select your menu you want to show WPML Language Selector in.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"wpml_menu\",\n\t\t\t\t\t\t\"std\" => \"Main Menu\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('primary'=>'Main Menu','secondary'=>'Footer Menu'));\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"WPML Language Selector Style?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select WPML Language Selector style.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"wpml_style\",\n\t\t\t\t\t\t\"std\" => \"3\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array(1=>'Flag + Native Name',\n\t\t\t\t\t\t\t\t\t\t 2=>'Flag + Translated Name',\n\t\t\t\t\t\t\t\t\t\t 3=>'Flags (In a Line)',\n\t\t\t\t\t\t\t\t\t\t 4=>'Flags (Dropdown Menu)',\n\t\t\t\t\t\t\t\t\t\t 5=>'Native Name',\n\t\t\t\t\t\t\t\t\t\t 6=>'Translated Name',\n\t\t\t\t\t\t));\n\n\t}\t\n\t\n\t\n\t\n\t\t\t\t\t\t\t\t\t \t\t\t\t\t\n\t// Colors ////////////////////////////////////////\n\t$options[] = array(\"name\" => __(\"Colors\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"appearance\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Dark Style?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Dark style\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"dark_style\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 0);\n\n\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( 'name' => __('Note', 'official'),\n\t\t\t\t\t\t'type' => 'note',\n\t\t\t\t\t\t'class' =>'note_info',\n\t\t\t\t\t\t'desc' => __('For Live Colors settings please go to <a href=\"customize.php\">Theme Customize</a> &gt; <strong>Colors</strong> ','official')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\n\t// Typography\n\t$options[] = array( 'name' => __('Typography', 'official'),\n\t\t\t\t\t\t'class' =>'typography',\n\t\t\t\t\t\t'type' => 'heading');\n\t\n\t$options[] = array( 'desc' => __('Body font.', 'official'),\n\t\t\t\t\t\t'name' =>__('Text font:', 'official'),\n\t\t\t\t\t\t'id' => 'font_text',\n\t\t\t\t\t\t'class' => 'hty',\n\t\t\t\t\t\t'std' => array('size' => '12px','face' => 'Tahoma','style' => 'normal','color' => '#7A7A7A'),\n\t\t\t\t\t\t'type' => 'typography');\n\t\n\t$options[] = array( 'desc' => __('Menu font.', 'official'),\n\t\t\t\t\t\t'name' =>__('Menu font:', 'official'),\n\t\t\t\t\t\t'id' => 'font_menu',\n\t\t\t\t\t\t'class' => 'hty',\n\t\t\t\t\t\t'std' => array('size' => '12px','face' => 'Tahoma','style' => 'bold','color' => '#ffffff'),\n\t\t\t\t\t\t'type' => 'typography');\n\n\t\t\t\t\t\t\n\t\n\t$options[] = array(\"name\" => __(\"Heading\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t$options[] = array( 'desc' => __('Header H1 font.', 'official'),\n\t\t\t\t\t\t'name' =>__('H1 font:', 'official'),\n\t\t\t\t\t\t'id' => 'font_h1',\n\t\t\t\t\t\t'class' => 'hty',\n\t\t\t\t\t\t'std' => array('size' => '32px','face' => 'Marcellus','style' => 'bold','color' => '#48C8C2'),\n\t\t\t\t\t\t'type' => 'typography');\n\t\n\t$options[] = array( 'desc' => __('Header H2 font.', 'official'),\n\t\t\t\t\t\t'name' =>__('H2 font:', 'official'),\n\t\t\t\t\t\t'id' => 'font_h2',\n\t\t\t\t\t\t'class' => 'hty',\n\t\t\t\t\t\t'std' => array('size' => '26px','face' => 'Marcellus','style' => 'bold','color' => '#48C8C2'),\n\t\t\t\t\t\t'type' => 'typography');\n\t\n\t$options[] = array( 'desc' => __('Header H3 font.', 'official'),\n\t\t\t\t\t\t'name' =>__('H3 font:', 'official'),\n\t\t\t\t\t\t'id' => 'font_h3',\n\t\t\t\t\t\t'class' => 'hty',\n\t\t\t\t\t\t'std' => array('size' => '20px','face' => 'Marcellus','style' => 'bold','color' => '#48C8C2'),\n\t\t\t\t\t\t'type' => 'typography');\n\t\n\t$options[] = array( 'desc' => __('Header H4 font.', 'official'),\n\t\t\t\t\t\t'name' =>__('H4 font:', 'official'),\n\t\t\t\t\t\t'id' => 'font_h4',\n\t\t\t\t\t\t'class' => 'hty',\n\t\t\t\t\t\t'std' => array('size' => '18px','face' => 'Marcellus','style' => 'bold','color' => '#48C8C2'),\n\t\t\t\t\t\t'type' => 'typography');\n\t\n\t$options[] = array( 'desc' => __('Header H5 font.', 'official'),\n\t\t\t\t\t\t'name' =>__('H5 font:', 'official'),\n\t\t\t\t\t\t'id' => 'font_h5',\n\t\t\t\t\t\t'class' => 'hty',\n\t\t\t\t\t\t'std' => array('size' => '14px','face' => 'Marcellus','style' => 'bold','color' => '#48C8C2'),\n\t\t\t\t\t\t'type' => 'typography');\n\t\n\t$options[] = array( 'desc' => __('Header H6 font.', 'official'),\n\t\t\t\t\t\t'name' =>__('H6 font:', 'official'),\n\t\t\t\t\t\t'id' => 'font_h6',\n\t\t\t\t\t\t'class' => 'hty',\n\t\t\t\t\t\t'std' => array('size' => '12px','face' => 'Marcellus','style' => 'bold','color' => '#48C8C2'),\n\t\t\t\t\t\t'type' => 'typography');\t\n\t\n\t\n\t\n\t$options[] = array( 'name' => __('Note', 'official'),\n\t\t\t\t\t\t'type' => 'note',\n\t\t\t\t\t\t'class' =>'note_info',\n\t\t\t\t\t\t'desc' => __('For Other Colors settings please <a href=\"customize.php\" >Click Here</a> ','official')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\n\t\n\t\n\t// Blog Page Settings /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"Blog Settings\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"blog\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Blog Sidebar Position\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Choose which side you would like the sidebar to appear on the Blog.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_sidebar\",\n\t\t\t\t\t\t\"std\" => \"right\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"options\" => array('nosidebar'=> $admin_images_url.'ns.png','right' =>$admin_images_url.'rs.png','left' => $admin_images_url.'ls.png' ));\t\n\t\n\t$options[] = array( \"name\" => __(\"Blog Title\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Title of blog posts that you want to use in breadcrumb\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_title\",\n\t\t\t\t\t\t\"std\" => \"Blog\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __(\"Blog Slug (URI)\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Search engine friendly URL of Blog Title\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_slug\",\n\t\t\t\t\t\t\"std\" => \"blog\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Number of Blog items?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Number of blog items per page in blog pages for pagination.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"number_of_blog_item\",\n\t\t\t\t\t\t\"std\" => \"10\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Blog Excerpt Length\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Default is 30 words. Used for blog page, archives, Tags, Category Search and ... \",\"official\"),\n\t\t\t\t\t\t\"id\" => \"excerpt_blog\",\n\t\t\t\t\t\t\"std\" => \"30\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\"); \n\t\t\n\t$options[] = array( \"name\" => __(\"Show Author avatar?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the author's avatar in the bottom of the bolg posts.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_author_avatar\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\"); \n\t\n\t$options[] = array( \"name\" => __(\"Show meta data in Blog page?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the the meta data such as date and category in blog posts\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_metadata\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show Read More button?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the Read More button in the blogs page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_more_button\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\"); \t\t\n\n\t$options[] = array( \"name\" => __(\"Read More Button Text\",\"official\"),\n\t\t\t\t\t\"desc\" => __(\"This is the text that will appear on the Blog \\\"More button\\\". Default text is <strong>Read more &rsaquo;</strong>\",\"official\"),\n\t\t\t\t\t\"id\" => \"blog_button\",\n\t\t\t\t\t\"std\" => __(\"Read more &rsaquo;\",\"official\"),\n\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __(\"Blog Thumbnail Image Style\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select blog thumbnail style \",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_thumb\",\n\t\t\t\t\t\t\"std\" => \"c\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array(\n\t\t\t\t\t\t\t\t\t'c'=>'Cropped Thumbnail',\n\t\t\t\t\t\t\t\t\t'f'=>'Full Thumbnail'\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t$options[] = array( 'name' => __('Blog Details', 'official'),\n\t\t\t\t\t\t'type' => 'info');\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Blog single page title type\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select blog single page title type.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_title_type\",\n\t\t\t\t\t\t\"std\" => \"cpmb_title\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $title_type\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show meta data in Blog details?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the the meta data such as date and category in blog details page\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_single_metadata\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show Author Info on Blog Details?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the Author Name &amp; Biography in the Blog Posts. You can edit the Author Biography under Users > Profiles.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"author_info\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\n\t\n\t$options[] = array( \"name\" => __(\"Show Next and Previous buttons?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the next and previous Post links on blog details page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_nav\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Enable Comments?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the Comments in the Blog Posts.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_comment\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Show Share Buttons in Blog Details?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Share buttons in blog details\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"blog_share\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\n\t\n\t$options[] = array( \"name\" => __(\"Share Buttons Title\",\"official\"),\n\t\t\t\t\t\"desc\" => __(\"The Title of share buttons box, Default is <strong>Share This Post</strong>\",\"official\"),\n\t\t\t\t\t\"id\" => \"share_title_post\",\n\t\t\t\t\t\"std\" => __(\"Share This Post\",\"official\"),\n\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\"type\" => \"text\");\t\t\t\t\t\t\n\n\t\n\t// Portfolio Settings /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"Portfolio Settings\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"portfolio\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\t\t\t\t\t\t\t\t\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Portfolio slug\",\"official\"),\n\t\t\t\t\t\"desc\" => __(\"Portfolio slug is URL friendly string that will shows in your portfolio details link.\",\"official\"),\n\t\t\t\t\t\"id\" => \"portfolio_item_slug\",\n\t\t\t\t\t\"std\" => \"project\",\n\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Portfolio Page Name\",\"official\"),\n\t\t\t\t\t\"desc\" => __(\"Portfolio Page Name.\",\"official\"),\n\t\t\t\t\t\"id\" => \"portfolio_page_name\",\n\t\t\t\t\t\"std\" => \"Portfolio\",\n\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Portfolio Page slug\",\"official\"),\n\t\t\t\t\t\"desc\" => __(\"Portfolio page slug is URL friendly string that use for view all projects button in details page.\",\"official\"),\n\t\t\t\t\t\"id\" => \"portfolio_page_slug\",\n\t\t\t\t\t\"std\" => \"portfolio\",\n\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\n\t\t\t\t\t\n\t$options[] = array( 'name' => __('Note', 'official'),\n\t\t\t\t\t\t'type' => 'note',\n\t\t\t\t\t\t'class' =>'note_alert',\n\t\t\t\t\t\t'desc' => __('After Changing the <strong>Portfolio Slug</strong> you should go to <strong>Settings</strong> > <strong>Permalinks</strong> and click on <strong>Save Changes</strong> to set the new slug.','official')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Portfolio Filtering?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Filtering Portfolio by Categories.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"filtering\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\n\t\t\t\t\t\t\n\t$filter_images = array(\n\t\t'st1'=>$admin_images_url.'fst1.gif',\n\t\t'st2'=>$admin_images_url.'fst2.gif',\n\t\t'st3'=>$admin_images_url.'fst3.gif',\n\t\t'st4'=>$admin_images_url.'fst4.gif',\n\t\t'st5'=>$admin_images_url.'fst5.gif',\n\t\t'st6'=>$admin_images_url.'fst6.gif',\n\t\t'st7'=>$admin_images_url.'fst7.gif'\n\t);\n\t$options[] = array( \"name\" => __(\"Filtering Button Style\",\"official\"),\n\t\t\t\t\t\t\"desc\" => \"\",\n\t\t\t\t\t\t\"id\" => \"filter_style\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"std\" =>\"st1\",\n\t\t\t\t\t\t\"options\" => $filter_images);\t\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Filtering Button position\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select portfolio buttons position\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"filter_align\",\n\t\t\t\t\t\t\"std\" => \"tal\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array(\n\t\t\t\t\t\t\t\t\t'tal'=>__(\"Left\",\"official\"),\n\t\t\t\t\t\t\t\t\t'tac'=>__(\"Center\",\"official\"),\n\t\t\t\t\t\t\t\t\t'tar'=>__(\"Right\",\"official\")\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Number of Portfolio items?\",\"official\"),\n\t\t\t\t\t\"desc\" => __(\"Number of portfolio items per page in portfolio pages for pagination.\",\"official\"),\n\t\t\t\t\t\"id\" => \"number_of_portfolio_item\",\n\t\t\t\t\t\"std\" => \"12\",\n\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\"type\" => \"text\");\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Portfolio Excerpt Length\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Default is 30 words. Used for Portfolio pages.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"excerpt_portfolio\",\n\t\t\t\t\t\t\"std\" => \"30\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Show View Details button?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the Read More button in the Portfolio pages.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"portfolio_more_button\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\"); \t\t\n\n\t$options[] = array( \"name\" => __(\"View Details Button Text\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This is the text that will appear on the Portfolio \\\"More button\\\". Default text is <strong>View Details</strong>\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"portfolio_button\",\n\t\t\t\t\t\t\"std\" => __(\"View Details\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\n\n\t$options[] = array( \"name\" => __(\"Thumbnail Zoom Effect?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Zoom Effect on hover of thumbnails.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"zoom_effect\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( 'name' => __('Portfolio Details', 'official'),\n\t\t\t\t\t\t'type' => 'info');\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Portfolio Details Page Sidebar Position\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Choose which side you would like the sidebar to appear on the Portfolio Details page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"portfolio_sidebar\",\n\t\t\t\t\t\t\"std\" => \"left\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"options\" => array('nosidebar'=> $admin_images_url.'ns.png','right' =>$admin_images_url.'rs.png','left' => $admin_images_url.'ls.png' ));\t\n\t\n\t$options[] = array( \"name\" => __(\"Show Next and Previous buttons?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the next and previous Project links on project Details page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"portfolio_nav\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show Categories in detail?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the Categories of project in Details page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"portfolio_category\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show Share Buttons in Portfolio Details?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Share buttons in Portfolio details\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"portfolio_share\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 1);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show Author Info on Project Details?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the Author Name & Biography in the Project Details page. You can edit the Author Biography under Users > Profiles.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"portfolio_author_info\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\n\n\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Share Buttons Title\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"The Title of share buttons box, Default is <strong>Share This Project</strong>\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"share_title_portfolio\",\n\t\t\t\t\t\t\"std\" => __(\"Share This Project\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\n\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Show Related Projects on Portfolio Detail?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Related projects show in the bottom of project details page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"related_portfolio\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\"); \n\t\n\t$options[] = array( \"name\" => __(\"Related Projects Title\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"The Title of Related Projects, Default is <strong>Related Projects</strong>\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"related_portfolio_title\",\n\t\t\t\t\t\t\"std\" => __(\"Related Projects\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Enable Comments?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"This will display the Comments in the Portfolio details page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"portfolio_comment\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \t\n\t\t\t\t\t\t\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Project details show style\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select project details style to show in project details page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"project_details\",\n\t\t\t\t\t\t\"std\" => \"acc\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array(\n\t\t\t\t\t\t\t\t\t'simple'=>__(\"Simple\",\"official\"),\n\t\t\t\t\t\t\t\t\t'acc'=>__(\"Accordion Style\",\"official\")\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\t\t\t\t\n\t\n\t\n\t\n\t\n\t\n\t// Woocommerce Settings /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"Woocommerce\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"woo\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Shop Sidebar Position\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Choose which side you would like the sidebar to appear on the shop page. (Shop Page Layout)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_sidebar\",\n\t\t\t\t\t\t\"std\" => \"right\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"options\" => array('nosidebar'=> $admin_images_url.'ns.png','right' =>$admin_images_url.'rs.png','left' => $admin_images_url.'ls.png' ));\t\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Number of products columns\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select how many columns you want to display in the shop page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_col\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"std\" =>\"3\",\n\t\t\t\t\t\t\"options\" => $col_images);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Number of shop items?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Number of shop items per page in shop pages for pagination.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_item\",\n\t\t\t\t\t\t\"std\" => \"12\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Shop Page Title\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Please enter your shop page title\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_shop_title\",\n\t\t\t\t\t\t\"std\" => \"Shop\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Breadcrumbs Background Image\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Upload Breadcrumbs Background Image or paste Image URL, This will override the default breadcrumbs background image.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_breadcrumbs_bg_img\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Dark Text?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Dark Text style\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_dark_text\",\n\t\t\t\t\t\t\"std\" => 0,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t$options[] = array( \"name\" => __(\"Shop Page Title Type\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select Shop page Title type.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_title_type\",\n\t\t\t\t\t\t\"std\" => \"cpmb_breadcrumbs\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $title_type\n\t\t\t\t\t\t);\n\t\n\t$options[] = array( \"name\" => __(\"Featured Image\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Upload Featured Image or paste Image URL, This will appear if you choose Title Type as a Featured Image.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_featured_img\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Overlay Header\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On the overlay Header if you want to have header on top of featured image or slider\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_header_overlay\",\n\t\t\t\t\t\t\"std\" => 0,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( 'name' => __('Shopping Cart Icon', 'official'),\n\t\t\t\t\t\t'type' => 'info');\n\t\n\t$options[] = array( \"name\" => __(\"Show Shopping Cart in top Menu?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Shopping Cart icon in top menu.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_cart_icon\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\n\t$options[] = array( \"name\" => __(\"Shopping Cart Top Margin\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter Shopping Cart Margin from Top (Default is 52px)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_cart_margin\",\n\t\t\t\t\t\t\"std\" => \"52px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$sc_vk=array('bag2','bag21','bag22','basket17','basket4','cart1','cart2','cart4','cupcake2','ecommerce7','grocery6','picnic','shopping10','shopping101','shopping11','shopping111','shopping122','shopping140','shopping143','shopping20','shopping223','shopping31','shopping38','shopping58','shopping63','shopping64','shopping66','shopping69','shopping82','stock1');\n\t$sc_arr=array_combine($sc_vk,$sc_vk);\n\n\t$options[] = array( \"name\" => __(\"Shopping Cart Icon\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"woo_cart_type\",\n\t\t\t\t\t\t\"type\" => \"carticon\",\n\t\t\t\t\t\t\"std\" =>\"cart1\",\n\t\t\t\t\t\t\"options\" => $sc_arr);\n\t\t\t\t\t\t\t\t\n\t$options[] = array( 'name' => __('Woocommerce Colors', 'official'),\n\t\t\t\t\t\t'type' => 'info');\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( 'name' => __('Note', 'official'),\n\t\t\t\t\t\t'type' => 'note',\n\t\t\t\t\t\t'class' =>'note_info',\n\t\t\t\t\t\t'desc' => __('For Live Colors settings please go to <a href=\"customize.php\">Theme Customize</a> &gt; <strong>Woocommerce Colors</strong> ','official')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t// Footer Settings /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"Footer Settings\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"footer\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\t\n\t\t\t\n\t$options[] = array( \"name\" => __(\"Number of Footer Columns\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select how many columns you want to display in the footer.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"footer_col\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"std\" =>\"4\",\n\t\t\t\t\t\t\"options\" => $col_images);\t\t\n\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Footer Text\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Add your copyright phrase or any text to be displayed below the footer.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"footer_text\",\n\t\t\t\t\t\t\"std\" => \"Copyright &copy; 2014 Official Theme. Designed by <a href='http://themeforest.net/user/tohidgolkar?ref=tohidgolkar' target='_blank'>Tohid Golkar</a>.\",\n\t\t\t\t\t\t\"type\" => \"editor\");\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Show Go To Top button?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the <strong>Got To Top</strong> button\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"footer_gototop\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\n\t\n\t$options[] = array( \"name\" => __(\"Show Footer Menu?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the <strong>Menu</strong> in Footer\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"footer_menu\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Custom footer Background Image\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Upload footer Background Image or paste Image URL\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"footer_bg_img\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\t\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Footer Bottom Line\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Footer bottom line height, if you want to remove it please select 0\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"footer_line\",\n\t\t\t\t\t\t\"std\" => \"5px\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array( '0'=>'0px','1'=>'1px','2'=>'2px','3'=>'3px','4'=>'4px','5'=>'5px',\n\t\t\t\t\t\t\t\t\t\t\t'6'=>'6px','7'=>'7px','8'=>'8px','9'=>'9px','10'=>'10px','11'=>'11px',\n\t\t\t\t\t\t\t\t\t\t\t'12'=>'12px','13'=>'13px','14'=>'14px','15'=>'15px','16'=>'16px',\n\t\t\t\t\t\t\t\t\t\t\t'17'=>'17px','18'=>'18px','19'=>'19px','20'=>'20px'));\n\t\t\t\t\t\t\n\t\n\t\n\n\t\t\t\t\t\t\n\t//Sliders Settings /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"Sliders Settings\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"slider\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Revolution Slider custom style?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off Official custom style for Revolution Slider.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"rev_cs\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\n\t\n\t/*Nivo and Flex */\n\t$options[] = array(\"name\" => __(\"Global Settings\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\n\t\n\n\t\n\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Slider Pause Time\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter slider pause time in milisecond(for example: 4000 = 4sec)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"slider_pause_time\",\n\t\t\t\t\t\t\"std\" => \"4000\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Slider Transition Time\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter slider transition time in milisecond (for example: 700 = 0.7sec)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"slider_speed\",\n\t\t\t\t\t\t\"std\" => \"700\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\t\t\t\t\t\n\t\t\t\t\t\n\n\t\n\t/* Nivo Slider */\n\t$options[] = array(\"name\" => __(\"Nivo Slider Settings\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\n\t$options[] = array( \"name\" => __(\"Slider Style\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select Slider Style\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"nivo_slider_style\",\n\t\t\t\t\t\t\"std\" => \"full\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('full'=>'Full Width','boxed'=>'Boxed with Margin'));\n\t\n\t$options[] = array( \"name\" => __(\"Slider Shadow\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select Slider Shadow (Works on Boxed style of slider)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"nivo_slider_shadow\",\n\t\t\t\t\t\t\"std\" => \"noshadow\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('noshadow'=>'No Shadow','lightshadow'=>'Light Shadow','mediumshadow'=>'Medium Shadow','hardshadow'=>'Hard Shadow'));\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t/* Flex Slider */\n\t$options[] = array(\"name\" => __(\"Flex Slider Settings\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\n\t$options[] = array( \"name\" => __(\"Slider Direction\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select Slider direction of transition\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"flex_slider_direction\",\n\t\t\t\t\t\t\"std\" => \"horizontal\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('horizontal'=>'Horizontal','vertical'=>'Vertical','fade'=>'Fade'));\t\t\t\t\t\t\t\t\t\n\n\t\n\t/* Kwicks Slider */\n\t$options[] = array(\"name\" => __(\"Kwicks Slider Settings\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Kwick Slides Height\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter slides Height in Pixel (Default is 315)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"kwick_height\",\n\t\t\t\t\t\t\"std\" => \"315\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Kwick Slide Max Size\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter Max size of each slide on hover (Default is 750)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"kwick_maxsize\",\n\t\t\t\t\t\t\"std\" => \"750\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Kwick Slides Spacing\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter slides spacing (Default is 0)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"kwick_spacing\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Rounded Corners?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Rounded corners of Slider\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"kwicks_rounded\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t\n\t/* 3D Slice Slider */\n\t$options[] = array(\"name\" => __(\"3D Slice Slider Settings\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Slider Orientation\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Select Slider Orientation\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"slider_orientation\",\n\t\t\t\t\t\t\"std\" => \"r\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('r'=>'Random','v'=>'Vertical','h'=>'Horizontal'));\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show Shadow?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the shadow of slider.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"slice_shadow\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\t\t\t\t\t\n\n\t$options[] = array( \"name\" => __(\"Show Border\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Border of slider.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"slice_border\",\n\t\t\t\t\t\t\"std\" => 0,\n\t\t\t\t\t \"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Rounded Corners?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Rounded corners of Slider, Buttons and Caption\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"slice_rounded\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t/* Lite Accordion */\n\t$options[] = array(\"name\" => __(\"Lite Accordion Settings\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Lite Accordion Height\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter Lite Accordion height in px (default is 300)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"acc_height\",\n\t\t\t\t\t\t\"std\" => \"300\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __(\"Lite Accordion Theme\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Please select the Theme of Accordion\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"acc_theme\",\n\t\t\t\t\t\t\"std\" => \"light\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('flat' => __('Flat','official'),'basic' => __('Basic','official'), 'light' => __('Light','official'), 'dark' => __('Dark','official'), 'stitch' => __('Stitch','official')));\t\n\t\t\t\t\t\t\n\t\n\t/* Roundabout Slider */\n\t$options[] = array(\"name\" => __(\"Roundabout Slider Settings\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\n\t$options[] = array( \"name\" => __(\"Slider Hight\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"You can change the slider height (default: 260px)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"roundabout_height\",\n\t\t\t\t\t\t\"std\" => \"260px\",\n\t\t\t\t\t\t\"type\" => \"text\",\n\t\t\t\t\t\t\"class\" => \"mini\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t// Social Icons Settings /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"Social &amp; Shares\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"social\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\t$options[] = array( \"name\" => __(\"Show Social Icons in Header?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Social icons in the Header. Note: They will only appear if you have set a link below.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"header_social_icons\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\n\t$options[] = array( \"name\" => __(\"Margin Top\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter Header Social Icons Margin from Top (Default is 48px) only works on Header style 1,3,6\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"social_margin_top\",\n\t\t\t\t\t\t\"std\" => \"48px\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Social Icon Styles\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Please select the Style of Social Icons\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"social_style\",\n\t\t\t\t\t\t\"std\" => \"rs\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('rs' => __('Rounded Square','official'),'circular' => __('Circular','official')));\t\n\t\n\t$options[] = array( \"name\" => __(\"Border?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Social icons Border.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"social_border\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \n\t\n\t$options[] = array( \"name\" => __(\"Show Social Icons Tooltip?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Social icons Tooltip\",\"fficial\"),\n\t\t\t\t\t\t\"id\" => \"social_icons_tooltip\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \t\t\t\t\t\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Tooltip Style\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Please select the Tooltip Style\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"social_icons_tipstyle\",\n\t\t\t\t\t\t\"std\" => \"toptip\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('toptip' => __('Display on Top','official'),'righttip' => __('Display on Right','official'),'bottomtip' => __('Display on Bottom','official'),'lefttip' => __('Display on Left','official')));\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Open links in new window?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the links target (Open links in new window or in current window)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"social_icons_link_target\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t \"type\" => \"checkbox\"); \t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n $options[] = array( \"name\" => __(\"Twitter Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the Twitter Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"twitter_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Facebook Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the Facebook Link that you would like to use for the social-networking icons. Note: Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"facebook_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Pinterest Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the Pinterest Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"pinterest_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"GitHub Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the GitHub Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"github_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\n\t\n\t$options[] = array( \"name\" => __(\"Flickr Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the Flickr Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"flickr_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Google Plus Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the Google Plus Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"google_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __(\"YouTube Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the YouTube Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"youtube_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __(\"Dribbble Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the Dribbble Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"dribbble_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __(\"Instagram Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the Instagram Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"instagram_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"LinkedIn Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the LinkedIn Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"linkedin_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t\n\t$options[] = array( \"name\" => __(\"Skype Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the Skype Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"skype_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\t\t\t\t\t\t\t\t\t\n\t\n\n\t$options[] = array( \"name\" => __(\"Tumblr Link\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the Tumblr Link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"tumblr_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"RSS Feed\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the RSS Feed that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"rss_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Email Address\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the email address that you would like to use for the social-networking icons.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"email_address\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Sitemap\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter the Sitemap link that you would like to use for the social-networking icons. Use http://\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"sitemap_link\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t\n\t$options[] = array(\"name\" => __(\"Share Buttons\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\t\t\t\t\t\n\t\n\t$share_button_array = array( \"twitter\" => \"Twitter\", \"facebook\" => \"Facebook\", \"linkedin\" => \"LinkedIn\", \"xing\"=>\"Xing\", \"google\" => \"Google\", \"digg\" => \"Digg\" , \"reddit\" => \"Reddit\");\n\t$share_button_defaults = array( \"twitter\" => \"1\", \"facebook\" => \"1\", \"linkedin\" => \"1\", \"xing\" => \"1\", \"google\" => \"1\", \"digg\" => \"1\", \"reddit\" => \"1\");\n\n\t$options[] = array( \"name\" => __(\"Share Buttons\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off buttons you want to display in Blog or Portfolio details page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"share_button\",\n\t\t\t\t\t\t\"type\" => \"multicheck\",\n\t\t\t\t\t\t\"options\" => $share_button_array,\n\t\t\t\t\t\t\"std\" => $share_button_defaults);\t\t\t\t\n\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t// Recent Posts Carousel Settings /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"Blog Carousel\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"recentposts\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\n\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Carousel Speed\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter carousel speed time in milisecond (for example: 1000 = 1sec)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"rp_carousel_speed\",\n\t\t\t\t\t\t\"std\" => \"1000\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Carousel Pause Time\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter carousel pause time in milisecond (for example: 4000 = 4sec)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"rp_carousel_pause_time\",\n\t\t\t\t\t\t\"std\" => \"4000\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\t\t\n\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Posts Order by:\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Choose Date or Menu Order for Blog Posts carousel sort order.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"orderby_rp_carousel\",\n\t\t\t\t\t\t\"std\" => \"date\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('date' => __('Date','official'), 'menu_order' => __('Menu Order','official'),'rand' => __('Random','official'), 'title' => __('Title','official')));\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Posts Order\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Choose ASC (Ascending) or DESC (Descending) for Blog Posts order in carousel .\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"order_rp_carousel\",\n\t\t\t\t\t\t\"std\" => \"DESC\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('ASC' => __('ASC','official'), 'DESC' => __('DESC','official')));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\n\t// Portfolio Carousel Settings /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"Portfolio Carousel\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"portfolioc\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Carousel Speed\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter carousel speed time in milisecond (for example: 1000 = 1sec)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"portfolio_carousel_speed\",\n\t\t\t\t\t\t\"std\" => \"1000\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Carousel Pause Time\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter carousel pause time in milisecond (for example: 4000 = 4sec)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"portfolio_carousel_pause_time\",\n\t\t\t\t\t\t\"std\" => \"4000\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\t\t\t\t\n\n\t\n\t$options[] = array( \"name\" => __(\"Portfolio Order by:\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Choose Date or Menu Order for Portfolio carousel sort order.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"orderby_portfolio_carousel\",\n\t\t\t\t\t\t\"std\" => \"menu_order\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('date' => __('Date','official'), 'menu_order' => __('Menu Order','official'),'rand' => __('Random','official'), 'title' => __('Title','official')));\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Portfolio Order\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Choose ASC (Ascending) or DESC (Descending) for Portfolio order in carousel .\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"order_portfolio_carousel\",\n\t\t\t\t\t\t\"std\" => \"ASC\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('ASC' => __('ASC','official'), 'DESC' => __('DESC','official')));\n\t\t\t\n\t\n\t// Clients Carousel Settings /////////////////////////////////\t\n\t$options[] = array(\"name\" => __(\"Clients Carousel\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"clients\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Number of Items in Carousel\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter number of Item you want to display in carousel.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"number_of_clients\",\n\t\t\t\t\t\t\"std\" => \"10\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Carousel Pause Time\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter carousel pause time in milisecond (for example: 4000 = 4sec)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"carousel_pause_time\",\n\t\t\t\t\t\t\"std\" => \"4000\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Carousel Speed\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter carousel speed time in milisecond (for example: 1000 = 1sec)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"carousel_speed\",\n\t\t\t\t\t\t\"std\" => \"1000\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\t\t\t\t\n\n\t\n\t$options[] = array( \"name\" => __(\"Clients Order by:\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Choose Date or Menu Order for Clients carousel sort order.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"orderby_clients_carousel\",\n\t\t\t\t\t\t\"std\" => \"menu_order\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('date' => __('Date','official'), 'menu_order' => __('Menu Order','official'),'rand' => __('Random','official'), 'title' => __('Title','official')));\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Clients Order\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Choose ASC (Ascending) or DESC (Descending) for Clients order in carousel .\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"order_clients_carousel\",\n\t\t\t\t\t\t\"std\" => \"ASC\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => array('ASC' => __('ASC','official'), 'DESC' => __('DESC','official')));\n\t\t\t\t\t\t\n\n\n\t// Lightbox //////////////////////////////////////////////////////////////////////\t\t\t\t\t\n\t$options[] = array(\"name\" => __(\"Lightbox\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"lightbox\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\n\t$lb_images = array(\n\t\t'pp_default'=>$admin_images_url.'lb/pp.png',\n\t\t'light_rounded'=>$admin_images_url.'lb/lr.png',\n\t\t'dark_rounded'=>$admin_images_url.'lb/dr.png',\n\t\t'light_square' =>$admin_images_url.'lb/ls.png',\n\t\t'dark_square'=>$admin_images_url.'lb/ds.png',\n\t\t'facebook'=>$admin_images_url.'lb/fb.png',\n\t\t);\n\t$options[] = array( \"name\" =>__(\"Lightbox Theme\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lb_theme\",\n\t\t\t\t\t\t\"class\" => \"widelb\",\n\t\t\t\t\t\t\"type\" => \"images\",\n\t\t\t\t\t\t\"std\" =>'pp_default',\n\t\t\t\t\t\t\"options\" => $lb_images);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Animation Speed\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Speed of lightbox animation Slow, Normanl or Fast\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lb_animation_speed\",\n\t\t\t\t\t\t\"std\" => \"fast\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => array('fast' => __('Fast','official'), 'slow' => __('Slow','official'), 'normal' => __('Normal','official')));\n\t\n\t$options[] = array( \"name\" => __(\"Overlay Opacity\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Overlay background opacity a number between 0 to 1\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lb_opacity\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"std\" => \"0.8\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __(\"Show title?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the title showing in lightbox\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lightbox_title\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Show Gallery Thumbnails?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the gallery thumbnails in the lightbox\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lb_gallery\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\n\t$options[] = array( \"name\" => __(\"Autoplay Gallery?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the autoplay the lightbox gallery\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lb_autoplay\",\n\t\t\t\t\t\t\"std\" => 0,\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\n\t$options[] = array( \"name\" => __(\"Gallery Slideshow Speed\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"If autoplay is set to true, select the slideshow speed in ms. (Default: 5000, 1000 ms = 1 second)\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lb_slideshow_speed\",\n\t\t\t\t\t\t\"std\" => \"5000\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Resizable?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Resizing for big images.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lb_resize\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\");\t\t\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Gallery Separator\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"The separator for the gallery counter 1 \\\"of\\\" 2\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lb_sep\",\n\t\t\t\t\t\t\"std\" => \"of\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Social Icons\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the social sharing icons in lightbox\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lb_social\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\");\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Turn OFF Lightbox on Small Devices?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off the Lightbox on small devices such as smartphones. This will link directly to the image on small devices.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"lb_small\",\n\t\t\t\t\t\t\"std\" => 1,\n\t\t\t\t\t\t\"type\" => \"checkbox\");\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t// TOOLS //////////////////////////////////////////////////////////////////////\t\t\t\t\t\n\t$options[] = array(\"name\" => __(\"Tools\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"tools\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\n\t$options[] = array( \"name\" => __(\"Breadcrumb Text\",\"official\"),\n\t\t\t\t\t\"desc\" => __(\"This is the text will appear before the breadcrumb. Default is nothing (empty)\",\"official\"),\n\t\t\t\t\t\"id\" => \"breadcrumb_title\",\n\t\t\t\t\t\"std\" => \"You are here:\",\n\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Breadcrumb Separator\",\"official\"),\n\t\t\t\t\t\"desc\" => __(\"This is the text will separate breadcrumb items.\",\"official\"),\n\t\t\t\t\t\"id\" => \"bread_crumb_sep\",\n\t\t\t\t\t\"std\" => \"/\",\n\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\n\t\n\t$options[] = array( \"name\" => __(\"Date and Time Format\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __('Date and Time format, <a href=\"http://codex.wordpress.org/Formatting_Date_and_Time\" target=\"_blank\" >Documentation on date and time formatting</a>','official'),\n\t\t\t\t\t\t\"id\" => \"date_format\",\n\t\t\t\t\t\t\"std\" => \"jS M Y\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array(\"name\" => __(\"RTL Language Support\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\t\t\t\t\t\n\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Right to Left (RTL) Language Support?\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"If you want to run a RTL Language website on English WP back-end (any LTR Language) you can turn on this feature to add RTL Css to your website.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"rtl_support\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 0);\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\n\t$options[] = array(\"name\" => __(\"Error 404\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"info\");\n\t\t\t\t\t\t\t\t\t\n\n\t$options[] = array( \"name\" => __(\"404 Error Title\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter your custom 404 error title.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"e404_title\",\n\t\t\t\t\t\t\"std\" => __(\"404 Page Not Found\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __(\"404 Error Message Text\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Enter your custom 404 error message.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"e404_text\",\n\t\t\t\t\t\t\"std\" =>__(\"Sorry, We could not find the content you were looking for.\",\"official\"),\n\t\t\t\t\t\t\"type\" => \"textarea\"); \n\t\n\t\n\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t//Custom Codes //////////////////////////////////////////////////////////////\n\t$options[] = array(\"name\" => __(\"Custom Codes\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"custom\",\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\t\t\t\t\n\n\t$options[] = array( \"name\" => __(\"Custom CSS\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Paste your custom css here... <br /><strong>NOTE:</strong> You don't need to add &lt;style&gt; tags\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"custom_css\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"textarea\"); \n\t\n\t$options[] = array( \"name\" => __(\"Custom Javascript\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Paste your custom JavaScript code here... <br /><strong>NOTE:</strong> You don't need to add &lt;script&gt; tags<br/><br/>This will add to Footer of page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"custom_js\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"textarea\"); \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Track Code\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Paste your Track Code here (for example: Google Analytics) <br /><strong>NOTE:</strong> You don't need to add &lt;script&gt; tags<br/><br/>This will add to Footer of page.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"track_code\",\n\t\t\t\t\t\t\"type\" => \"textarea\"); \t\t\t\t\t\t\t\n\t\n\t\n\t\n\t\n\t// Maintenance ////////////////////////////////////////\n\t$options[] = array(\"name\" => __(\"Maintenance\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"main\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\n\n\n\t$options[] = array( \"name\" => __(\"Maintenance Mode\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Turn On/Off Maintenace mode.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"main_mode\",\n\t\t\t\t\t\t\"type\" => \"checkbox\",\n\t\t\t\t\t\t\"std\" => 0);\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Maintenance Page\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Please select maintenace mode page\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"main_page\",\n\t\t\t\t\t\t\"std\" => \"default\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"class\" => \"mini\",\n\t\t\t\t\t\t\"options\" => $options_pages\n\t\t\t\t\t\t);\n\t\n\t$options[] = array( \"name\" => __(\"Default Maintenance Page Text\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Please set your own text for Default Maintenance Page\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"main_html\",\n\t\t\t\t\t\t\"std\" => '<p style=\"text-align:center\">We are currently in maintenance mode, please check back shortly.</p>',\n\t\t\t\t\t\t\"type\" => \"editor\");\t\t\t\t\t\t\t\t\t\n\t\n\t// Sample Importer ////////////////////////////////////////////////////\n\t$options[] = array(\"name\" => __(\"Import Demo\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"demo\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\n\t$demo_images = array(\n\t\t'demo1'=>$admin_images_url.'demo/d1.jpg',\n\t\t'demo2'=>$admin_images_url.'demo/d2.jpg',\n\t\t'demo3'=>$admin_images_url.'demo/d3.jpg',\n\t\t'demo4'=>$admin_images_url.'demo/d4.jpg',\n\t\t'demo5'=>$admin_images_url.'demo/d5.jpg',\n\t\t'demo6'=>$admin_images_url.'demo/d6.jpg',\n\t\t'demo7'=>$admin_images_url.'demo/d7.jpg',\n\t\t'demo8'=>$admin_images_url.'demo/d8.jpg',\n\t\t'demo9'=>$admin_images_url.'demo/d9.jpg',\n\t\t'demo10'=>$admin_images_url.'demo/d10.jpg',\n\t\t'demo11'=>$admin_images_url.'demo/d11.jpg',\n\t\t'demo12'=>$admin_images_url.'demo/d12.jpg',\n\t\t'demo13'=>$admin_images_url.'demo/d13.jpg',\n\t\t'demo14'=>$admin_images_url.'demo/d14.jpg',\n\t\t'demo15'=>$admin_images_url.'demo/d15.jpg',\n\t\t'demo16'=>$admin_images_url.'demo/d16.jpg',\n\t\t'demo17'=>$admin_images_url.'demo/d17.jpg',\n\t\t'demo18'=>$admin_images_url.'demo/d18.jpg',\n\t\t'demo19'=>$admin_images_url.'demo/d19.jpg',\n\t\t'demo20'=>$admin_images_url.'demo/d20.jpg',\n\t\t'demo21'=>$admin_images_url.'demo/d21.jpg',\n\t\t'demo22'=>$admin_images_url.'demo/d22.jpg'\n\t\t\n\n\t);\n\t$options[] = array( \"name\" => __(\"One Click Demo Intaller\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Please select your sample demo and click on <strong>Import Demo</strong> button.<br/><br/><strong>NOTE:</strong> It will take some minutes, please wait for finishing the import process.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"demo\",\n\t\t\t\t\t\t\"type\" => \"demo\",\n\t\t\t\t\t\t\"options\" => $demo_images); \n\t\t\t\t\t\t\n\t$options[] = array( 'name' => __('Note', 'smartco'),\n\t\t\t\t\t\t'type' => 'note',\n\t\t\t\t\t\t'class' =>'note_alert',\n\t\t\t\t\t\t'desc' => __('All images used in the demo website are just for demonstration purposes, <strong>You do not have permission to use demo website images in your website. </strong> Do not use them in your live website.','smartco')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t// Backup //////////////////////////////////////////////////////////////\n\t$options[] = array(\"name\" => __(\"Backup\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"backup\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\n\t\n\t$options[] = array( \"name\" => __(\"Backup\",\"official\"),\n\t\t\t\t\t\t\"desc\" => __(\"Backup and restore your theme options<br /><strong>NOTE:</strong>For WPML Users: You should get backup for each language.\",\"official\"),\n\t\t\t\t\t\t\"id\" => \"track_code\",\n\t\t\t\t\t\t\"type\" => \"backup\"); \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t// Home page //////////////////////////////////////////////////////////////\n\t$options[] = array(\"name\" => __(\"Home Page\",\"official\"),\n\t\t\t\t\t\t\"class\" => \"home\",\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\t$options[] = array( \"name\" => __(\"Slogan\",\"official\"),\n\t\t\t\t\t\"desc\" => __(\"Slogan of your site\",\"official\"),\n\t\t\t\t\t\"id\" => \"slogan\",\n\t\t\t\t\t\"std\" => 'A leader in web hosting since 1998',\n\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __(\"Placeholder of Search field\",\"official\"),\n\t\t\t\t\t\"desc\" => __(\"Placeholder of Search field\",\"official\"),\n\t\t\t\t\t\"id\" => \"search_field_placeholder\",\n\t\t\t\t\t\"std\" => 'Search ipage.com',\n\t\t\t\t\t\"type\" => \"text\");\n\t$options[] = array( \"name\" => __(\"Help page link\",\"official\"),\n\t\t\"desc\" => __(\"\",\"official\"),\n\t\t\"id\" => \"help_page_link\",\n\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __(\"Phone Number\",\"official\"),\n\t\t\t\t\"desc\" => __(\"Phone Number\",\"official\"),\n\t\t\t\t\"id\" => \"phone_no\",\n\t\t\t\t\"std\" => '877-472-4399',\n\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __(\"Cover Photo\",\"official\"),\n\t\t\"desc\" => __(\"Cover Photo\",\"official\"),\n\t\t\"id\" => \"cover_photo\",\n\t\t\"type\" => \"upload\");\n\n\t$options[] = array( \"name\" => __(\"About us title\",\"official\"),\n\t\t\"desc\" => __(\"About us title\",\"official\"),\n\t\t\"id\" => \"about_us_title\",\n\t\t\"std\"\t=>\t'We are with you every step of the way',\n\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __(\"About us details\",\"official\"),\n\t\t\"desc\" => __(\"About us details\",\"official\"),\n\t\t\"id\" => \"about_us_details\",\n\t\t\"std\"\t=>\t'Hosting your website with iPage goes beyond unlimited disk space, a free domain name and unlimited email addresses. Our comprehensive tools and training help you launch your entire web presence above your competition.',\n\t\t\"type\" => \"textarea\");\n\n\t$options[] = array( \"name\" => __(\"Featured Product title\",\"official\"),\n\t\t\"desc\" => __(\"Featured Product title\",\"official\"),\n\t\t\"id\" => \"featured_product_title\",\n\t\t\"std\"\t=>\t'Featured Products',\n\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __(\"Bottom full width image\",\"official\"),\n\t\t\"desc\" => __(\"Bottom full width image\",\"official\"),\n\t\t\"id\" => \"bottom_full_width_image\",\n\t\t\"type\" => \"upload\");\n\t\n\t$options[] = array( \"name\" => __(\"1st footer menu title\",\"official\"),\n\t\t\"desc\" => __(\"\",\"official\"),\n\t\t\"id\" => \"first_footer_menu_title\",\n\t\t\"type\" => \"text\");\n\t$options[] = array( \"name\" => __(\"2nd footer menu title\",\"official\"),\n\t\t\"desc\" => __(\"\",\"official\"),\n\t\t\"id\" => \"second_footer_menu_title\",\n\t\t\"type\" => \"text\");\n\t$options[] = array( \"name\" => __(\"3rd footer menu title\",\"official\"),\n\t\t\"desc\" => __(\"\",\"official\"),\n\t\t\"id\" => \"third_footer_menu_title\",\n\t\t\"type\" => \"text\");\n\t$options[] = array( \"name\" => __(\"Facebook link\",\"official\"),\n\t\t\"desc\" => __(\"\",\"official\"),\n\t\t\"id\" => \"facebook_link\",\n\t\t\"type\" => \"text\");\n\t$options[] = array( \"name\" => __(\"Twitter link\",\"official\"),\n\t\t\"desc\" => __(\"\",\"official\"),\n\t\t\"id\" => \"twitter_link\",\n\t\t\"type\" => \"text\");\n\t$options[] = array( \"name\" => __(\"Youtube link\",\"official\"),\n\t\t\"desc\" => __(\"\",\"official\"),\n\t\t\"id\" => \"youtube_link\",\n\t\t\"type\" => \"text\");\n\t$options[] = array( \"name\" => __(\"Google plus link\",\"official\"),\n\t\t\"desc\" => __(\"\",\"official\"),\n\t\t\"id\" => \"google_plus_link\",\n\t\t\"type\" => \"text\");\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __(\"Instagram link\",\"official\"),\n\t\t\"desc\" => __(\"\",\"official\"),\n\t\t\"id\" => \"instagram_link\",\n\t\t\"type\" => \"text\");\n\t\n\n\t$options[] = array( \"name\" => __(\"Copyright text\",\"official\"),\n\t\t\"desc\" => __(\"\",\"official\"),\n\t\t\"id\" => \"copyright_text\",\n\t\t\"type\" => \"text\");\n\t\n\treturn $options;\n\t\n\t\n}", "function optionsframework_options() {\n\n// 将所有页面(pages)加入数组\n\t$options_pages = array();\n\t$options_pages_obj = get_pages('sort_column=post_parent,menu_order');\n\t$options_pages[''] = '选择页面:';\n\tforeach ($options_pages_obj as $page) {\n\t\t$options_pages[$page->ID] = $page->post_title;\n\t}\n\t// Pull all the cateries into an array\n\t$options_categories = array();\n\t$options_categories_obj = get_categories();\n\tforeach ($options_categories_obj as $category) {\n\t\t$options_categories[$category->cat_ID] = $category->cat_name;\n\t}\n\n\t$avatar_array = array(\n\t\t'1' => '一屏3展示'\n\t);\n\n\n $options_links = array();\n $options_links_obj = get_terms( 'link_category' );\n foreach ($options_links_obj as $link) {\n $options_links[$link->term_id] = $link->name;\n }\n\n\t$imagepath = get_template_directory_uri() . '/img/themestyle/';\n\n\t$options = array();\n\n\t/*****基本设置*****/\n\t$options[] = array(\n\t\t'name' => __('基本设置'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => __('网站标题'),\n\t\t'desc' => __('请设置网站标题'),\n\t\t'id' => 'stayma_info_title',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('网站关键字'),\n\t\t'desc' => __('请设置关键字,建议6-10个,请用英文逗号,隔开!'),\n\t\t'id' => 'stayma_info_keywords',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('网站描述信息'),\n\t\t'desc' => __('请设置描述信息,建议80-100字。'),\n\t\t'id' => 'stayma_info_description',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('备案号'),\n\t\t'desc' => __('请设置首页首屏较小文字信息。'),\n\t\t'id' => 'stayma_index_icp',\n\t\t'class' => 'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('建站时间'),\n\t\t'desc' => __('请设置建站日期,格式为:2018-5-2'),\n\t\t'id' => 'stayma_info_time',\n\t\t'class' => 'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('首页设置'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => '是否开启特别置顶文章',\n\t\t'id' => 'stayma_xxinfo_open',\n\t\t'std' => true,\n\t\t'desc' => __('开启后顶部展示区开启。'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('信息展示区图片'),\n\t\t'desc' => __('请上传信息展示区背景图片'),\n\t\t'id' => 'stayma_xxinfo_img',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('信息展示区文字1'),\n\t\t'desc' => __('请设置展示区文字1'),\n\t\t'id' => 'stayma_xxinfo_text1',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('信息展示区文字2'),\n\t\t'desc' => __('请设置展示区文字2'),\n\t\t'id' => 'stayma_xxinfo_text2',\n\t\t'type' => 'text');\n\n\n\t$options[] = array(\n\t\t'name' => '是否开启特别置顶文章',\n\t\t'id' => 'stayma_arttop_open',\n\t\t'std' => true,\n\t\t'desc' => __('开启后,启动特别文章推荐'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('特别推荐文章1 文章ID'),\n\t\t'desc' => __('请输入需要特别推荐的文章ID'),\n\t\t'id' => 'stayma_arttop_id1',\n\t\t'class' => 'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('特别推荐文章2 文章ID'),\n\t\t'desc' => __('请输入需要特别推荐的文章ID'),\n\t\t'id' => 'stayma_arttop_id2',\n\t\t'class' => 'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('特别推荐文章3 文章ID'),\n\t\t'desc' => __('请输入需要特别推荐的文章ID'),\n\t\t'id' => 'stayma_arttop_id3',\n\t\t'class' => 'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图设置'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => '是否开启轮播图',\n\t\t'id' => 'stayma_lbt_open',\n\t\t'std' => false,\n\t\t'desc' => __('开启后,启动顶部幻灯片'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('请选择轮播图样式'),\n\t\t'desc' => __('默认'),\n\t\t'id' => 'stayma_lbt_style',\n\t\t'std' => '1',\n\t\t'type' => 'radio',\n\t\t'options' => $avatar_array);\n\n\t$options[] = array(\n\t\t'name' => __('轮播图数量'),\n\t\t'desc' => __('请输入轮播图数量,最多8个!'),\n\t\t'id' => 'stayma_lbt_num',\n\t\t'class' => 'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【1】 图片上传'),\n\t\t'desc' => __('请上传≥952*420的图片'),\n\t\t'id' => 'stayma_lbt_img_1',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【1】 跳转链接'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_link_1',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【1】 文字描述'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_text1_1',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【2】 图片上传'),\n\t\t'desc' => __('请上传≥952*420的图片'),\n\t\t'id' => 'stayma_lbt_img_2',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【2】 跳转链接'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_link_2',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【2】 文字描述'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_text1_2',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【3】 图片上传'),\n\t\t'desc' => __('请上传≥952*420的图片'),\n\t\t'id' => 'stayma_lbt_img_3',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【3】 跳转链接'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_link_3',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【3】 文字描述'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_text1_3',\n\t\t'type' => 'text');\n\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【4】 图片上传'),\n\t\t'desc' => __('请上传≥952*420的图片'),\n\t\t'id' => 'stayma_lbt_img_4',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【4】 跳转链接'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_link_4',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【4】 文字描述'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_text1_4',\n\t\t'type' => 'text');\n\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【5】 图片上传'),\n\t\t'desc' => __('请上传≥952*420的图片'),\n\t\t'id' => 'stayma_lbt_img_5',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【5】 跳转链接'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_link_5',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【5】 文字描述'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_text1_5',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【6】 图片上传'),\n\t\t'desc' => __('请上传≥952*420的图片'),\n\t\t'id' => 'stayma_lbt_img_6',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【6】 跳转链接'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_link_6',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【6】 文字描述'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_text1_6',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【7】 图片上传'),\n\t\t'desc' => __('请上传≥952*420的图片'),\n\t\t'id' => 'stayma_lbt_img_7',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【17】 跳转链接'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_link_7',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【7】 文字描述'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_text1_7',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【8】 图片上传'),\n\t\t'desc' => __('请上传≥952*420的图片'),\n\t\t'id' => 'stayma_lbt_img_8',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【8】 跳转链接'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_link_8',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('轮播图【8】 文字描述'),\n\t\t'desc' => __('请设置轮播图跳转链接'),\n\t\t'id' => 'stayma_lbt_text1_8',\n\t\t'type' => 'text');\n\n\n\t$options[] = array(\n\t\t'name' => __('侧边栏设置'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => '是否开启个人介绍小工具',\n\t\t'id' => 'is_open_about',\n\t\t'std' => true,\n\t\t'desc' => __('开启后请设置下面个人信息'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('个人头像'),\n\t\t'desc' => __('设置个人介绍显示头像'),\n\t\t'id' => 'about_img',\n\t\t'type' => 'upload');\n\n\t$options[] = array(\n\t\t'name' => __('个人名称'),\n\t\t'desc' => __('设置个人介绍显示名称'),\n\t\t'id' => 'about_name',\n\t\t'class'=>'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('所在地址'),\n\t\t'desc' => __('设置个人介绍显示地址'),\n\t\t'id' => 'about_where',\n\t\t'class'=>'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('简短描述'),\n\t\t'desc' => __('设置个人介绍显示描述'),\n\t\t'id' => 'about_text',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('个人邮箱'),\n\t\t'desc' => __('设置个人邮箱'),\n\t\t'id' => 'about_email',\n\t\t'class'=>'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('个人QQ'),\n\t\t'desc' => __('设置个人QQ'),\n\t\t'id' => 'about_qq',\n\t\t'class'=>'mini',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => '是否开启最新文章小工具',\n\t\t'id' => 'is_open_newart',\n\t\t'std' => true,\n\t\t'desc' => __('是否开启最新文章小工具'),\n\t\t'type' => 'checkbox');\n\t$options[] = array(\n\t\t'name' => '是否开启标签小工具',\n\t\t'id' => 'is_open_tags',\n\t\t'std' => true,\n\t\t'desc' => __('是否开启标签小工具'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('安全设置'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => '是否禁止评论中有链接?',\n\t\t'id' => 'no_link',\n\t\t'std' => false,\n\t\t'desc' => __('开启后评论中不能有链接'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => '是否禁止纯英文评论?',\n\t\t'id' => 'open_chinese',\n\t\t'std' => false,\n\t\t'desc' => __('开启后评论不允许纯英文'),\n\t\t'type' => 'checkbox');\n\n\t$options[] = array(\n\t\t'name' => __('页尾设置'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => __('网站声明(说明)'),\n\t\t'desc' => __('设置页尾网站声明文字'),\n\t\t'id' => 'footer_text',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'name' => __('微博地址'),\n\t\t'desc' => __('请输入你的微博地址(请不要忘记http)'),\n\t\t'id' => 'social_weibo',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('github'),\n\t\t'desc' => __('请输入你的github地址(请不要忘记http)'),\n\t\t'id' => 'social_github',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('twitter'),\n\t\t'desc' => __('请输入你的twitter地址(请不要忘记http)'),\n\t\t'id' => 'social_twitter',\n\t\t'type' => 'text');\n\t$options[] = array(\n\t\t'name' => __('页尾自定义区域'),\n\t\t'desc' => __('页尾右侧社交区域下面自定义区域(支持HTML代码)'),\n\t\t'id' => 'footer_diy',\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('广告设置'),\n\t\t'type' => 'heading');\n\n\n\t$options[] = array(\n\t\t'name' => __('侧边栏广告位 HTML代码'),\n\t\t'desc' => __('请设置侧边栏广告位,支持HTML代码'),\n\t\t'id' => 'stayma_ggw_1text',\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('主题DIY'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => __('自定义css代码'),\n\t\t'desc' => __('自定义css代码,请勿添加style标签'),\n\t\t'id' => 'stayma_css',\n\t\t'type' => 'textarea');\n\n\t$options[] = array(\n\t\t'name' => __('自定义JavaScript代码'),\n\t\t'desc' => __('自定义JavaScript代码,请带上#script#标签'),\n\t\t'id' => 'stayma_javascript',\n\t\t'type' => 'textarea');\n\n\n\treturn $options;\n}", "public function show_option_page()\n\t{\n\t}", "function subsite_tools_options_page() {\n\t\t$this->template( 'options-tools-subsite' );\n\t}", "public function get_page_options() {\n\t\t\t// Get current page data\n\t\t\t$page = $this->get_page();\n\t\t\t// Prepare array for options\n\t\t\t$options = array();\n\t\t\t// This page have some options\n\t\t\tif ( isset( $page['options'] ) && is_array( $page['options'] ) )\n\t\t\t\t// Loop through page options\n\t\t\t\tforeach ( $page['options'] as $option ) {\n\t\t\t\t\t// Add option to resulting array\n\t\t\t\t\t$options[] = $option;\n\t\t\t\t}\n\t\t\t// Return options\n\t\t\treturn $options;\n\t\t}", "function of_options()\n\t{\n\t\t$of_categories = array(); \n\t\t\n\t\t$of_categories_obj = get_categories('hide_empty=0');\n\t\tforeach ($of_categories_obj as $of_cat) {\n\t\t\t$of_categories[$of_cat->cat_ID] = $of_cat->cat_name;\n\t\t\t}\n\n\t\t$categories_tmp = array_unshift($of_categories, \"all categories\"); \n\n\n\t\t//Access the WordPress Pages via an Array\n\t\t$of_pages = array();\n\t\t$of_pages_obj = get_pages('sort_column=post_parent,menu_order'); \n\t\tforeach ($of_pages_obj as $of_page) {\n\t\t\t$of_pages[$of_page->ID] = $of_page->post_name; }\n\t\t$of_pages_tmp = array_unshift($of_pages, \"Select a page:\"); \n\t\n\t\t//Testing \n\t\t$of_options_select = array(\"one\",\"two\",\"three\",\"four\",\"five\"); \n\t\t$of_options_radio = array(\"one\" => \"One\",\"two\" => \"Two\",\"three\" => \"Three\",\"four\" => \"Four\",\"five\" => \"Five\");\n\t\t\n\t\t//Sample Homepage blocks for the layout manager (sorter)\n\t\t$of_options_homepage_blocks = array\n\t\t( \n\t\t\t\"disabled\" => array (\n\t\t\t\t\"placebo\" \t\t=> \"placebo\", //REQUIRED!\n\t\t\t\t\"block_one\"\t\t=> \"Block One\",\n\t\t\t\t\"block_two\"\t\t=> \"Block Two\",\n\t\t\t\t\"block_three\"\t=> \"Block Three\",\n\t\t\t), \n\t\t\t\"enabled\" => array (\n\t\t\t\t\"placebo\" => \"placebo\", //REQUIRED!\n\t\t\t\t\"block_four\"\t=> \"Block Four\",\n\t\t\t),\n\t\t);\n\n\n\n\t\t//Background Images Reader\n\t\t$bg_images_path = get_template_directory() . '/img/bg/'; // change this to where you store your bg images\n\t\t$favico_urls = get_template_directory_uri().'/img';\n\t\t$bg_images_url = get_template_directory_uri().'/img/bg/'; // change this to where you store your bg images\n\t\t$default_bg = get_template_directory_uri().'/img/';\n\t\t$bg_images = array();\n\t\t\n\t\tif ( is_dir($bg_images_path) ) {\n\t\t\tif ($bg_images_dir = opendir($bg_images_path) ) { \n\t\t\t\twhile ( ($bg_images_file = readdir($bg_images_dir)) !== false ) {\n\t\t\t\t\tif(stristr($bg_images_file, \".png\") !== false || stristr($bg_images_file, \".jpg\") !== false) {\n\t\t\t\t\t\t$bg_images[] = $bg_images_url . $bg_images_file;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\n\t\t$ajax_images_path = get_stylesheet_directory() . '/img/ajax-gif/'; // change this to where you store your bg images\n\t\t$ajax_images_url = get_template_directory_uri().'/img/ajax-gif/'; // change this to where you store your bg images\n\t\t$ajax_images = array();\n\t\t\n\t\tif ( is_dir($ajax_images_path) ) {\n\t\t\tif ($ajax_images_dir = opendir($ajax_images_path) ) { \n\t\t\t\twhile ( ($ajax_images_file = readdir($ajax_images_dir)) !== false ) {\n\t\t\t\t\tif(stristr($ajax_images_file, \".gif\") !== false || stristr($ajax_images_file, \".png\") !== false) {\n\t\t\t\t\t\t$ajax_images[] = $ajax_images_url . $ajax_images_file;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t}\t\t\n\n\t\t/*-----------------------------------------------------------------------------------*/\n\t\t/* TO DO: Add options/functions that use these */\n\t\t/*-----------------------------------------------------------------------------------*/\n\t\t\n\t\t//More Options\n\t\t$uploads_arr = wp_upload_dir();\n\t\t$all_uploads_path = $uploads_arr['path'];\n\t\t$all_uploads = get_option('of_uploads');\n//\t\t$body_repeat = array(\"no-repeat\",\"repeat-x\",\"repeat-y\",\"repeat\");\n//\t\t$body_pos = array(\"top left\",\"top center\",\"top right\",\"center left\",\"center center\",\"center right\",\"bottom left\",\"bottom center\",\"bottom right\");\n\t\t\n\t\t// Image Alignment radio box\n\t\t$of_options_thumb_align = array(\"alignleft\" => \"Left\",\"alignright\" => \"Right\",\"aligncenter\" => \"Center\"); \n\t\t\n\t\t// Image Links to Options\n\t\t$of_options_image_link_to = array(\"image\" => \"The Image\",\"post\" => \"The Post\"); \n\n\t\t$type_of_pagination = array( 'Infinite Scroll' , 'Standard' );\n\n/*\n======================================================================================= \n*/\n\n// Type of Logo ( image or text )\n$ct_logotype = array( \"image\" , \"text\" );\n$ct_logo_width = array( \"standard\" , \"wide\" );\n\n$comments_type = array(\n\t\"facebook\" => \"Facebook\",\n\t\"disqus\" => \"Disqus\",\n);\n\n$menu_position = array(\n\t\"left\" => \"Left\",\n\t\"center\" => \"Center\",\n\t\"right\" => \"Right\"\n);\n\n$post_content_excerpt = array( \"Content\" , \"Excerpt\" );\n\n$ct_show_hide = array( \"Show\" , \"Hide\" );\n$ct_yes_no = array( \"Yes\" , \"No\" );\n$ct_enable_disable = array( \"Enable\" , \"Disable\" );\n\n$theme_bg_type = array( \"Uploaded\", \"Predefined\" , \"Color\" );\n$theme_bg_attachment = array( \"Scroll\" , \"Fixed\" );\n\n$theme_bg_repeat = array( \"No-Repeat\" , \"Repeat\", \"Repeat-X\" , \"Repeat-Y\" );\n$theme_bg_position = array( \"Left\" , \"Right\", \"Centered\" , \"Full Screen\" );\n$show_top_banner = array( \"Upload\" , \"Code\", \"None\" );\n\n$theme_bg_color = array( \"Background Image\" , \"Color\", \"Upload\" );\n$theme_bg_attachment = array( \"Scroll\" , \"Fixed\" );\n\n$ct_headline = array( \"Headline\" , \"Menu\" );\n\n$ct_meta_style = array( \"Left+Content\" , \"Standard\" );\n\n$type_of_pagination = array( 'Infinite Scroll' , 'Standard' );\n\n$ct_home_columns = array( \"3 Columns\" , \"4 Columns\", \"5 Columns\" , \"1 Column + Sidebar\", \"2 Columns + Sidebar\", \"3 Columns + Sidebar\" );\n$ct_category_columns = array( \"3 Columns\" , \"4 Columns\", \"5 Columns\" , \"1 Column + Sidebar\", \"2 Columns + Sidebar\", \"3 Columns + Sidebar\" );\n\n$ct_text_align = array( \"Left\" , \"Center\" , \"Right\" );\n\n$ct_block_width = array( \"span3\" , \"span4\" , \"span5\" , \"span6\" , \"span7\" , \"span8\" , \"span9\" );\n/*\n=======================================================================================\n*/\t\t\n/*-----------------------------------------------------------------------------------*/\n/* The Options Array */\n/*-----------------------------------------------------------------------------------*/\n\n$prefix = 'ct_';\n\n// Set the Options Array\nglobal $of_options;\n$of_options = array();\n\n\n/*\n=====================================================================================================================\n\t\t\t\t\tGENERAL SETTINGS\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"General Settings\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Select a Category for Home page\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a Category for the Home page\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}homepage_category\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Select a category:\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $of_categories\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Select a Layout for Home page\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select 3/4/5 columns for Home page\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}homepage_columns\",\n\t\t\t\t\t\t\"std\"\t\t=> \"three_columns\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $ct_home_columns\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Sidebar position for Home page\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select sidebar position for Home page\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}homepage_sidebar\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Right\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\" \t=> array( 'Left', 'Right')\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Select a Layout for Category page (tag page, etc.)\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select 3/4/5 columns for Category page (tag page, etc.)\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}categorypage_columns\",\n\t\t\t\t\t\t\"std\"\t\t=> \"three_columns\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $ct_category_columns\n\t\t\t\t);\n\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Sidebar position for Category page (tag page, etc.)\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select sidebar position for Category page (tag page, etc.)\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}categorypage_sidebar\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Right\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\" \t=> array( 'Left', 'Right')\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Type of Pagination\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select Standard or Infinite Scroll pagination\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}pagination_type\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Infinite Scroll\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $type_of_pagination\n\t\t\t\t); \n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Responsive Layout\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enable/Disable responsive layout\", \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}responsive_layout\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Enable\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Disable\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Exclude Pages From Search?\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select Yes, if you can exclude pages from search\", \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}exclude_search_page\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Yes\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"No\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\"\t\t\t\t\t\t\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Custom Favicon\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Upload a 16px x 16px Png/Gif image that will represent your website's favicon.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}custom_favicon\",\n\t\t\t\t\t\t\"std\"\t\t=> $favico_urls . \"/favicon.ico\",\n\t\t\t\t\t\t\"type\"\t\t=> \"upload\"\n\t\t\t\t); \n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Tracking Code\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Paste your Google Analytics (or other) tracking code here. This will be added into the footer template of your theme.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}google_analytics\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"textarea\"\n\t\t\t\t);\n\n\n/*\n=====================================================================================================================\n\t\t\t\t\tWELCOME BLOCK\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Welcome Block\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Welcome Block\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide Welcome Block\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}show_welcome\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Background Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a background color (default: #00AEFF).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}welcome_background\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#00AEFF\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\",\n\t\t\t\t\t\t\"fold\" \t\t=> \"{$prefix}show_welcome\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Background Opacity\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\" \t\t=> __(\"Set opacity for welcome block background<br /> Min: 0, max: 1, step: 0.01, default value: 0.5\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}welcome_opacity\",\n\t\t\t\t\t\t\"std\"\t\t=> \"0.5\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\",\n\t\t\t\t\t\t\"fold\"\t\t=> \"{$prefix}show_welcome\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Text and Headings Styles\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Choose parameters for welcome text and headings\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}welcome_text_font\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '22px','height' => '32px', 'style' => 'bold','color' => '#FFFFFF'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\",\n\t\t\t\t\t\t\"fold\"\t\t=> \"{$prefix}show_welcome\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Text Align\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select left/center/right align for welcome text\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}welcome_text_align\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Center\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $ct_text_align,\n\t\t\t\t\t\t\"fold\"\t\t=> \"{$prefix}show_welcome\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Welcome Block Text-Transform\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"The text-transform property controls the capitalization of text.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}welcome_text_transform\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Capitalize\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\" \t=> array(\n\t\t\t\t\t\t\t'none'\t\t\t=> 'None',\n\t\t\t\t\t\t\t'capitalize'\t=> 'Capitalize',\n\t\t\t\t\t\t\t'uppercase'\t\t=> 'Uppercase',\n\t\t\t\t\t\t\t'lowercase'\t\t=> 'Lowercase'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\"fold\"\t\t=> \"{$prefix}show_welcome\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Links Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a links color (default: #FFFFFF).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}welcome_links_color\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#FFFFFF\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\",\n\t\t\t\t\t\t\"fold\" \t\t=> \"{$prefix}show_welcome\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Remove Text Padding\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Remove text padding for Welcome Block\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}welcome_padding\",\n\t\t\t\t\t\t\"std\" \t\t=> 0,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Yes\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"No\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\",\n\t\t\t\t\t\t\"fold\" \t\t=> \"{$prefix}show_welcome\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Text/Code for Welcome Block\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter text or code\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}welcome_text\",\n\t\t\t\t\t\t\"std\"\t\t=> \"<h2>Welcome to the <a href='#'>Rule</a> Magazine Wordpress Theme. <a href='#'>Rule</a> Theme is <a href='#'>Unique</a> For Your Blog Or Magazine! <a href='#'>Fully</a> Responsive & Retina Ready!</h2>\",\n\t\t\t\t\t\t\"type\"\t\t=> \"textarea\",\n\t\t\t\t\t\t\"fold\" \t\t=> \"{$prefix}show_welcome\"\n\t\t\t\t);\n\n\n\n\n/*\n=====================================================================================================================\n\t\t\t\t\tHEADER SETTINGS\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Header Settings\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Search Block\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide the Search Block on the Home Page\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}search_block_homepage\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Logo Block Width\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select your logo block width\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}logo_block_width\",\n\t\t\t\t\t\t\"std\"\t\t=> 'span8',\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $ct_block_width\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Right Block Width (search, social icons, contacts)\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select your right block width\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}right_block_width\",\n\t\t\t\t\t\t\"std\"\t\t=> 'span4',\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $ct_block_width\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> \"Logo Settings\",\n\t\t\t\t\t\t\"desc\"\t\t=> \"\",\n\t\t\t\t\t\t\"id\"\t\t=> \"introduction\",\n\t\t\t\t\t\t\"std\"\t\t=> \"<h3 style=\\\"margin: 0;\\\">Logo Settings.</h3>\",\n\t\t\t\t\t\t\"icon\"\t\t=> true,\n\t\t\t\t\t\t\"type\"\t\t=> \"info\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __(\"Type of Logo\",\"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Select your logo type ( Image or Text )\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}type_logo\",\n\t\t\t\t\t\t\"std\"\t\t=> \"image\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $ct_logotype\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Logo Upload\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Upload image using the native media uploader, or define the URL directly\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}logo_upload\",\n\t\t\t\t\t\t\"std\"\t\t=> get_template_directory_uri() . \"/img/logo.png\",\n\t\t\t\t\t\t\"type\"\t\t=> \"upload\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Logo Text\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter text for logo\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}logo_text\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Logo Slogan\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter text for logo slogan\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}logo_slogan\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n/*\n=====================================================================================================================\n\t\t\t\t\tSOCIAL ICONS\n=====================================================================================================================\t\n*/\n\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Social Icons\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Social Icons\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide the Social Icons\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}sc_block\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> \"Social Icons Settings\",\n\t\t\t\t\t\t\"desc\"\t\t=> \"\",\n\t\t\t\t\t\t\"id\"\t\t=> \"introduction_social_icons\",\n\t\t\t\t\t\t\"std\"\t\t=> \"<h3 style=\\\"margin: 0;\\\">Social Icons Settings</h3> To hide any icon, just remove the URL from the appropriate field\",\n\t\t\t\t\t\t\"icon\"\t\t=> true,\n\t\t\t\t\t\t\"type\"\t\t=> \"info\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Text For Social Icons\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the text for social icons\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}sc_text\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Follow Us:\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Android\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}android_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Apple\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}apple_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"http://www.apple.com\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Dribble\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}dribbble_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"GitHub\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}github_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Flickr\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}flickr_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"http://www.flickr.com\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Youtube\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}youtube_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Instagram\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}instagram_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Skype\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}skype_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Pinterest\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}pinterest_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Google\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}google_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"http://www.google.com\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Twitter\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}twitter_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"http://www.twitter.com\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Facebook\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter the URL in the text field\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}facebook_url\",\n\t\t\t\t\t\t\"std\"\t\t=> \"http://www.facebook.com\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n\n/*\n=====================================================================================================================\n\t\t\t\t\tMENU SETTINGS\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Menu Settings\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Sticky Menu?\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Use sticky menu?\", \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}sticky_menu\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Yes\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"No\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\"\t\t\t\t\t\t\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Menu Layout Position\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Selectmenu position ( before logo/after logo )\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}menu_layout_position\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Before Logo\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\" \t=> array(\n\t\t\t\t\t\t\t'before'\t=> 'Before Logo',\n\t\t\t\t\t\t\t'after'\t\t=> 'After Logo'\n\t\t\t\t\t\t)\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Menu Position\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select menu position\", \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}menu_position\",\n\t\t\t\t\t\t\"std\"\t\t=> \"center\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $menu_position\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Menu Block Background Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a background color (default: #000000).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}menu_background\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#000000\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Menu Block Borders (top and bottom)\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}menu_border\",\n\t\t\t\t\t\t\"std\" \t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'width' => '1',\n\t\t\t\t\t\t\t\t\t\t\t'style' => 'solid',\n\t\t\t\t\t\t\t\t\t\t\t'color' => '#FFFFFF'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\"type\" \t\t=> \"border\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Menu Block Opacity\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\" \t\t=> __(\"Set opacity for menu block<br /> Min: 0, max: 1, step: 0.01, default value: 0.5\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}menu_opacity\",\n\t\t\t\t\t\t\"std\"\t\t=> \"0.5\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Top-level Menu Font\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Choose parameters for top-level menu font\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}menu_font\",\n\t\t\t\t\t\t\"std\"\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'size'\t=> '14px',\n\t\t\t\t\t\t\t\t\t\t\t'style'\t=> 'bold',\n\t\t\t\t\t\t\t\t\t\t\t'color'\t=> '#FFFFFF'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Top-level Menu Text-Transform\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"The text-transform property controls the capitalization of text.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}menu_transform\",\n\t\t\t\t\t\t\"std\"\t\t=> \"uppercase\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\" \t=> array(\n\t\t\t\t\t\t\t'none'\t\t\t=> 'None',\n\t\t\t\t\t\t\t'capitalize'\t=> 'Capitalize',\n\t\t\t\t\t\t\t'uppercase'\t\t=> 'Uppercase',\n\t\t\t\t\t\t\t'lowercase'\t\t=> 'Lowercase'\n\t\t\t\t\t\t)\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Drop-Down Menu Background Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a background color (default: #FFFFFF).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}dd_menu_background\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#FFFFFF\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Drop-Down Menu Hover Background Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a hover background color (default: #FFFFFF).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}dd_menu_hover_background\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#EBEBEB\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Background Opacity for Drop-Down Menu\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\" \t\t=> __(\"Set opacity for drop-down menu<br /> Min: 0, max: 1, step: 0.01, default value: 0.95\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}dd_menu_opacity\",\n\t\t\t\t\t\t\"std\"\t\t=> \"0.7\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n/*\n=====================================================================================================================\n\t\t\t\t\tSTYLING SETTINGS\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Styling Settings\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Body Background Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a background color (default: #3b3f41).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}body_background\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#3b3f41\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Links color\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Pick a color for the links (default: #00AEFF)\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}links_color\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#00AEFF\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> \"Default Background Settings\",\n\t\t\t\t\t\t\"desc\"\t\t=> \"\",\n\t\t\t\t\t\t\"id\"\t\t=> \"introduction\",\n\t\t\t\t\t\t\"std\"\t\t=> \"<h3 style=\\\"margin: 0 0 10px;\\\">Default Background Settings.</h3> The following settings allow you to set the default background behavior for each page. Each of these options can be overridden on the individual post/page/ level. You are in complete control.\",\n\t\t\t\t\t\t\"icon\"\t\t=> true,\n\t\t\t\t\t\t\"type\"\t\t=> \"info\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Use Predefined Background Image / BG Color / Upload Your Image\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select the type of usage background\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}default_bg_type\",\n\t\t\t\t\t\t\"std\"\t\t=> 'Color',\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $theme_bg_type\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Background Attachment\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select the background image property\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}default_bg_attachment\",\n\t\t\t\t\t\t\"std\"\t\t=> 'Fixed',\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $theme_bg_attachment\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Background Repeat\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select the default background repeat for the background image\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}default_bg_repeat\",\n\t\t\t\t\t\t\"std\"\t\t=> 'Repeat',\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $theme_bg_repeat\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Background Position\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select the default background position for the background image\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}default_bg_position\",\n\t\t\t\t\t\t\"std\"\t\t=> 'Left',\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $theme_bg_position\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Uploaded Background Image\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Upload image for background using the native media uploader, or define the URL directly\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}default_bg_image\",\n\t\t\t\t\t\t\"std\"\t\t=> $default_bg . \"default-bg.jpg\",\n\t\t\t\t\t\t\"type\"\t\t=> \"upload\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Predefined Background Images\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select a background pattern.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}default_predefined_bg\",\n\t\t\t\t\t\t\"std\"\t\t=> $bg_images_url.\"bg01.jpg\",\n\t\t\t\t\t\t\"type\"\t\t=> \"tiles\",\n\t\t\t\t\t\t\"options\"\t=> $bg_images,\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Custom CSS\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Quickly add some CSS to your theme by adding it to this block.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}custom_css\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"textarea\"\n\t\t\t\t);\n\n/*\n=====================================================================================================================\n\t\t\t\t\tHeadings Styles\n=====================================================================================================================\t\n*/\n\t\t\t\t\t\n$of_options[] = array(\t\"name\"\t\t=> __( \"Headings Styles\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Google Fonts for Headings\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Select Google Font for H1-H6 Headings \" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}google_fonts\",\n\t\t\t\t\t\t\"std\"\t\t=> array('face' =>'Carrois Gothic'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t);\n\n/*$of_options[] = array(\t\"name\"\t\t=> \"Body Font\",\n\t\t\t\t\t\t\"desc\"\t\t=> \"Specify the body font properties\",\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}body_font\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '14px','height' => '21px', 'style' => 'normal','color' => '#111111'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t); */\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"H1 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Choose parameters for H1 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}h_one\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '38px','height' => '40px', 'style' => 'normal','color' => '#000000'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"H2 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Choose parameters for H2 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}h_two\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '31px', 'height' => '40px', 'style' => 'normal','color' => '#000000'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"H3 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Choose parameters for H3 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}h_three\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '24px','height' => '40px','style' => 'normal','color' => '#000000'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"H4 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Choose parameters for H4 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}h_four\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '17px','height' => '20px','style' => 'normal','color' => '#000000'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"H5 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Choose parameters for H5 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}h_five\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '14px','height' => '20px','style' => 'normal','color' => '#000000'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"H6 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\"\t\t=> __(\"Choose parameters for H6 Heading\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}h_six\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '12px','height' => '16px','style' => 'normal','color' => '#000000'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t);\n\n\n/*\n=====================================================================================================================\n\t\t\t\t\tBLOG SETTINGS\n=====================================================================================================================\t\n*/\n\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Blog Settings\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Type of Featured Image\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Choose the type of featured image.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}blog_blocks_featured_type\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Original ratio\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\" \t=> array(\n\t\t\t\t\t\t\t'original'\t\t=> 'Original ratio',\n\t\t\t\t\t\t\t'cropped'\t\t=> 'Cropped'\n\t\t\t\t\t\t)\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Use Excerpt or Content Function\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Select a Excerpt (automatically) or Content (More tag)\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}excerpt_function\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Excerpt\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $post_content_excerpt\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Length of Excerpt\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\" \t\t=> __(\"Set length of excerpt in chars<br /> Min: 1, max: 500, step: 1, default value: 100\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}excerpt_length\",\n\t\t\t\t\t\t\"std\" \t\t=> \"100\",\n\t\t\t\t\t\t\"min\" \t\t=> \"1\",\n\t\t\t\t\t\t\"step\"\t\t=> \"1\",\n\t\t\t\t\t\t\"max\" \t\t=> \"500\",\n\t\t\t\t\t\t\"type\" \t\t=> \"sliderui\" \n\t\t\t\t);\n\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Background Color For Post Top Line\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a color (text, icons) (default: #000000).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}post_top_line_bg_color\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#000000\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Blog Post Title\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __ ( \"Specify the blog post title font properties\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}post_title_font\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '22px','height' => '26px', 'style' => 'normal','color' => '#111'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Blog Post Title Text-Transform\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"The text-transform property controls the capitalization of text.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}post_title_transform\",\n\t\t\t\t\t\t\"std\"\t\t=> \"uppercase\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\" \t=> array(\n\t\t\t\t\t\t\t'none'\t\t\t=> 'None',\n\t\t\t\t\t\t\t'capitalize'\t=> 'Capitalize',\n\t\t\t\t\t\t\t'uppercase'\t\t=> 'Uppercase',\n\t\t\t\t\t\t\t'lowercase'\t\t=> 'Lowercase'\n\t\t\t\t\t\t)\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Pagination Background Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a background color (default: #111111).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}pagination_background\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#111111\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Pagination Border\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}pagination_border\",\n\t\t\t\t\t\t\"std\" \t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'width' => '4',\n\t\t\t\t\t\t\t\t\t\t\t'style' => 'solid',\n\t\t\t\t\t\t\t\t\t\t\t'color' => '#a3a6a8'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\"type\" \t\t=> \"border\"\n\t\t\t\t);\n\n\n\n$of_options[] = array( \"name\"\t\t=> \"Blog Post Meta Settings\",\n\t\t\t\t\t\"desc\"\t\t\t=> \"\",\n\t\t\t\t\t\"id\"\t\t\t=> \"introduction_blog_post\",\n\t\t\t\t\t\"std\"\t\t\t=> \"<h3 style=\\\"margin: 0;\\\">Blog Post Meta Settings.</h3>\",\n\t\t\t\t\t\"icon\"\t\t\t=> true,\n\t\t\t\t\t\"type\"\t\t\t=> \"info\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Date\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post date\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}date_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\",\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Categories\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post categories\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}categories_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\",\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Author\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post author\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}author_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\",\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Comments\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post comments\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}comments_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Views\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post views\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}views_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\",\n\t\t\t\t);\n\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Likes\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post likes\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}likes_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\",\n\t\t\t\t);\n\n/*\n=====================================================================================================================\n\t\t\t\t\tSingle Page Settings\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Single Page Options\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\");\n\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Featured image\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Show or Hide featured image in the single post\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}featured_image_post\",\n\t\t\t\t\t\t\"std\"\t\t=> 1,\n\t\t\t\t\t\t\"on\"\t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\"\t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Type of Featured Image For Single Page\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Choose the type of featured image.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}featured_type\",\n\t\t\t\t\t\t\"std\"\t\t=> \"Original ratio\",\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\" \t=> array(\n\t\t\t\t\t\t\t'original'\t\t=> 'Original ratio',\n\t\t\t\t\t\t\t'cropped'\t\t=> 'Cropped'\n\t\t\t\t\t\t)\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\"\t\t=> __( \"Stretch thumbnail post images\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Stretch or Not thumbnail post images\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}thumb_posts_stretch\",\n\t\t\t\t\t\t\"std\" \t\t=> 0,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Yes\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"No\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array( \"name\"\t\t=> __( \"Add PrettyPhoto feature to all post images\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Add PrettyPhoto feature to all post images with links\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}add_prettyphoto\",\n\t\t\t\t\t\t\"std\"\t\t=> 1,\n\t\t\t\t\t\t\"on\"\t\t=> __( \"Yes\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\"\t\t=> __( \"No\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"About Author\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Show or Hide about author information in the single post\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}about_author\",\n\t\t\t\t\t\t\"std\"\t\t=> 1,\n\t\t\t\t\t\t\"on\"\t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\"\t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array( \"name\"\t\t=> \"Single Post Meta Settings\",\n\t\t\t\t\t\"desc\"\t\t\t=> \"\",\n\t\t\t\t\t\"id\"\t\t\t=> \"introduction_single_post\",\n\t\t\t\t\t\"std\"\t\t\t=> \"<h3 style=\\\"margin: 0;\\\">Single Post Meta Settings.</h3>\",\n\t\t\t\t\t\"icon\"\t\t\t=> true,\n\t\t\t\t\t\"type\"\t\t\t=> \"info\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Date\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post date\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}single_date_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\",\n\t\t\t\t\t\t\"fold\" \t\t=> \"{$prefix}single_entire_meta\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Categories\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post categories\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}single_categories_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\",\n\t\t\t\t\t\t\"fold\" \t\t=> \"{$prefix}single_entire_meta\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Comments\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post comments\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}single_comments_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Views\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post views\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}single_views_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\",\n\t\t\t\t\t\t\"fold\" \t\t=> \"{$prefix}single_entire_meta\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Likes\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post likes\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}single_likes_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\",\n\t\t\t\t\t\t\"fold\" \t\t=> \"{$prefix}single_entire_meta\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Tags\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\" \t\t=> __( \"Show/Hide blog post comments\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}single_tags_meta\",\n\t\t\t\t\t\t\"std\" \t\t=> 1,\n\t\t\t\t\t\t\"on\" \t\t=> __( \"Show\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"off\" \t\t=> __( \"Hide\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\" \t\t=> \"switch\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Code for About the author block\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Paste code for about the author block.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}code_about_author\",\n\t\t\t\t\t\t\"std\"\t\t=> \"<a href=\\\"#\\\"><i class=\\\"icon-facebook-sign\\\"></i></a><a href=\\\"#\\\"><i class=\\\"icon-twitter-sign\\\"></i></a><a href=\\\"#\\\"><i class=\\\"icon-google-plus-sign\\\"></i></a>\",\n\t\t\t\t\t\t\"type\"\t\t=> \"textarea\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Code for bookmarking and sharing services\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Paste code for bookmarking and sharing services (for example: www.addthis.com, www.sharethis.com, etc. )\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}code_blog_sharing\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"textarea\"\n\t\t\t\t);\n\n/*\n=====================================================================================================================\n\t\t\t\t\tPage Title Bar\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Page Title Bar\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\");\n\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Page Title Bar Opacity\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\" \t\t=> __(\"Set opacity for the page title block background<br /> Min: 0, max: 1, step: 0.01, default value: 0.7\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}page_bar_opacity\",\n\t\t\t\t\t\t\"std\"\t\t=> \"0.7\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Page Title Bar Background Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a background color forthe page title bar (default: #000000).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}page_bar_background\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#000000\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Page Title Bar Top Border\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}page_bar_top_border\",\n\t\t\t\t\t\t\"std\" \t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'width' => '1',\n\t\t\t\t\t\t\t\t\t\t\t'style' => 'solid',\n\t\t\t\t\t\t\t\t\t\t\t'color' => '#FFFFFF'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\"type\" \t\t=> \"border\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Page Title Bar Bottom Border\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}page_bar_bottom_border\",\n\t\t\t\t\t\t\"std\" \t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'width' => '1',\n\t\t\t\t\t\t\t\t\t\t\t'style' => 'solid',\n\t\t\t\t\t\t\t\t\t\t\t'color' => '#FFFFFF'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\"type\" \t\t=> \"border\"\n\t\t\t\t);\n\n\n/*\n=====================================================================================================================\n\t\t\t\t\tSidebar Settings\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Sidebar Settings\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\");\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Sidebar Opacity\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\" \t\t=> __(\"Set opacity for the sidebar background<br /> Min: 0, max: 1, step: 0.01, default value: 0.7\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}sidebar_opacity\",\n\t\t\t\t\t\t\"std\"\t\t=> \"0.7\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Widget Background Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a background color for widget block in the sidebar (default: #000000).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}widget_background\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#000000\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Widget Top Border\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}widget_top_border\",\n\t\t\t\t\t\t\"std\" \t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'width' => '1',\n\t\t\t\t\t\t\t\t\t\t\t'style' => 'solid',\n\t\t\t\t\t\t\t\t\t\t\t'color' => '#FFFFFF'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\"type\" \t\t=> \"border\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Widget Bottom Border\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}widget_bottom_border\",\n\t\t\t\t\t\t\"std\" \t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'width' => '0',\n\t\t\t\t\t\t\t\t\t\t\t'style' => 'solid',\n\t\t\t\t\t\t\t\t\t\t\t'color' => '#FFFFFF'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\"type\" \t\t=> \"border\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Widget Margin Bottom\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\" \t\t=> __(\"Set margin bottom in pixels<br /> Min: 0, max: 90, step: 5, default value: 0\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}widget_margin_bottom\",\n\t\t\t\t\t\t\"std\" \t\t=> \"0\",\n\t\t\t\t\t\t\"min\" \t\t=> \"0\",\n\t\t\t\t\t\t\"step\"\t\t=> \"5\",\n\t\t\t\t\t\t\"max\" \t\t=> \"90\",\n\t\t\t\t\t\t\"type\" \t\t=> \"sliderui\" \n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Sidebar Text Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a color for sidebar (default: #777777).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}sidebar_text_color\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#777777\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Widget Title Border Left\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}widget_title_border\",\n\t\t\t\t\t\t\"std\" \t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'width' => '3',\n\t\t\t\t\t\t\t\t\t\t\t'style' => 'solid',\n\t\t\t\t\t\t\t\t\t\t\t'color' => '#FFFFFF'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\"type\" \t\t=> \"border\"\n\t\t\t\t);\n\n\n$of_options[] = array(\t\"name\"\t\t=> \"Widget Title Font\",\n\t\t\t\t\t\t\"desc\"\t\t=> \"Specify the widget title font properties\",\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}widget_title_font\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '14px','height' => '20px', 'style' => 'bold','color' => '#FFFFFF'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t);\n\n/*\n=====================================================================================================================\n\t\t\t\t\tAds &Banner Settings\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Ads Banner Settings\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Show banner: \" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Show or hide banner\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}top_banner\",\n\t\t\t\t\t\t\"std\"\t\t=> 'Upload',\n\t\t\t\t\t\t\"type\"\t\t=> \"select\",\n\t\t\t\t\t\t\"options\"\t=> $show_top_banner\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Site Header Banner Upload\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Upload images using the native media uploader, or define the URL directly\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}banner_upload\",\n\t\t\t\t\t\t\"std\"\t\t=> get_template_directory_uri() . \"/img/banner_728x90.gif\",\n\t\t\t\t\t\t\"type\"\t\t=> \"upload\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Site Header Banner URL\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter clickthrough url for banner in top section\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}banner_link\",\n\t\t\t\t\t\t\"std\"\t\t=> \"http://themeforest.net/user/ZERGE?ref=zerge\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Site Header Ads\\Banner Code\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Paste your Google Adsense (or other) code here.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}banner_code\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"textarea\"\n\t\t\t\t);\n\n/*$of_options[] = array(\t\"name\"\t\t=> __( \"Custom Advertising Post (Sticky Post)\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Paste the HTML code or Adsense code\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}custom_ads_code\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"textarea\"\n\t\t\t\t);*/\n\n/*\n=====================================================================================================================\n\t\t\t\t\tFOOTER SETTINGS\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Footer Settings\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n$of_options[] = array( \"name\" => __( \"Number of Columns In Footer\" , \"color-theme-framework\" ),\n\t\t\t\t\t\"desc\" => __( \"Select number of columns for footer\" , \"color-theme-framework\" ),\n\t\t\t\t\t\"id\" => \"{$prefix}footer_columns\",\n\t\t\t\t\t\"std\" => \"4\",\n\t\t\t\t\t\"min\" => \"0\",\n\t\t\t\t\t\"step\"\t=> \"1\",\n\t\t\t\t\t\"max\" => \"4\",\n\t\t\t\t\t\"type\" => \"sliderui\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Footer Background Color\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Pick a background color (default: #111111).\" , \"color-theme-framework\" ), \n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}footer_background\",\n\t\t\t\t\t\t\"std\"\t\t=> \"#111111\",\n\t\t\t\t\t\t\"type\"\t\t=> \"color\"\n\t\t\t\t);\n\n$of_options[] = array( \t\"name\" \t\t=> __( \"Footer Opacity\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"desc\" \t\t=> __(\"Set opacity for the footer background<br /> Min: 0, max: 1, step: 0.01, default value: 0.7\" , \"color-theme-framework\"),\n\t\t\t\t\t\t\"id\" \t\t=> \"{$prefix}footer_opacity\",\n\t\t\t\t\t\t\"std\"\t\t=> \"0.7\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> \"Footer Font\",\n\t\t\t\t\t\t\"desc\"\t\t=> \"Specify the body font properties\",\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}footer_font\",\n\t\t\t\t\t\t\"std\"\t\t=> array('size' => '11px', 'color' => '#FFF'),\n\t\t\t\t\t\t\"type\"\t\t=> \"typography\"\n\t\t\t\t); \n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Copyrights for your theme\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter your copyrights.\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}copyright_info\",\n\t\t\t\t\t\t\"std\"\t\t=> '&copy; 2013 Copyright. Proudly powered by <a href=\"http://wordpress.com/\">WordPress.</a>',\n\t\t\t\t\t\t\"type\"\t\t=> \"textarea\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Additional Info\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter you additional info\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}add_info\",\n\t\t\t\t\t\t\"std\"\t\t=> '<a href=\"http://themeforest.net/user/ZERGE?ref=zerge\">Rule</a> Theme by <a href=\"http://color-theme.com/\">Color Theme</a><br /><a href=\"https://github.com/sy4mil/Options-Framework\">Slightly Modified Options Framework</a> by <a href=\"http://themeforest.net/user/SyamilMJ\">Syamil MJ</a>',\n\t\t\t\t\t\t\"type\"\t\t=> \"textarea\"\n\t\t\t\t);\n\n/*\n=====================================================================================================================\n\t\t\t\t\tTwitter Settings\n=====================================================================================================================\t\n*/\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Twitter Settings\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\n$of_options[] = array( \"name\"\t\t=> \"Auth Settings\",\n\t\t\t\t\t\"desc\"\t\t\t=> \"\",\n\t\t\t\t\t\"id\"\t\t\t=> \"introduction_oauth_settings\",\n\t\t\t\t\t\"std\"\t\t\t=> \"<h3 style=\\\"margin: 0;\\\">Auth Settings</h3> Visit <a target=\\\"_target\\\" href=\\\"https://dev.twitter.com/apps/\\\" title=\\\"Twitter\\\" rel=\\\"nofollow\\\">this link</a> in a new tab, sign in with your account, click on \\\"Create a new application\\\" and create your own keys in case you don't have already.\",\n\t\t\t\t\t\"icon\"\t\t\t=> true,\n\t\t\t\t\t\"type\"\t\t\t=> \"info\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Consumer Key:\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter Your Twitter App Consumer Key\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}consumer_key\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Consumer Secret:\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter Your Twitter App Consumer Key\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}consumer_secret\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Access Token:\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter Your Twitter App Consumer Key\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}user_token\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n$of_options[] = array(\t\"name\"\t\t=> __( \"Access Token Secret:\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"desc\"\t\t=> __( \"Enter Your Twitter App Consumer Key\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"{$prefix}user_secret\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"text\"\n\t\t\t\t);\n\n\t\t\t\t\t\n/*\n=====================================================================================================================\n\t\t\t\t\tBackup Options\n=====================================================================================================================\t\n*/\n$of_options[] = array(\t\"name\"\t\t=> __( \"Backup Options\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"type\"\t\t=> \"heading\"\n\t\t\t\t);\n\t\t\t\t\t\n$of_options[] = array(\t\"name\"\t\t=> __( \"Backup and Restore Options\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"of_backup\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"backup\",\n\t\t\t\t\t\t\"desc\"\t\t=> 'You can use the two buttons below to backup your current options, and then restore it back at a later time. This is useful if you want to experiment on the options but would like to keep the old settings in case you need it back.',\n\t\t\t\t);\n\t\t\t\t\t\n$of_options[] = array(\t\"name\"\t\t=> __( \"Transfer Theme Options Data\" , \"color-theme-framework\" ),\n\t\t\t\t\t\t\"id\"\t\t=> \"of_transfer\",\n\t\t\t\t\t\t\"std\"\t\t=> \"\",\n\t\t\t\t\t\t\"type\"\t\t=> \"transfer\",\n\t\t\t\t\t\t\"desc\"\t\t=> 'You can tranfer the saved options data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click \"Import Options\".',\n\t\t\t\t);\n\t\t\t\t\t\n\t}", "function optionsframework_options() {\n\n\t// Test data\n\n\t$flickrset_array = array(\n\t\t'set' => __('Set', 'options_framework_theme'),\n\t\t'collection' => __('Collection', 'options_framework_theme'),\n\t);\n\n\t// Pull all the pages into an array\n\t$options_pages = array();\n\t$options_pages_obj = get_pages('sort_column=post_parent,menu_order');\n\t$options_pages[''] = '';\n\tforeach ($options_pages_obj as $page) {\n\t\t$options_pages[$page->ID] = $page->post_title;\n\t}\n\n\n\n\t// If using image radio buttons, define a directory path\n\t$imagepath = get_template_directory_uri() . '/images/';\n\n\t$options = array();\n\n\t// Header options Start\n\n\t$options[] = array(\n\t\t'name' => __('Header Options', 'options_framework_theme'),\n\t\t'type' => 'heading');\n\t\n\t$options[] = array(\n\t\t'name' => __('Facebook URL', 'options_framework_theme'),\n\t\t'desc' => __('Enter Facebook URL.', 'options_framework_theme'),\n\t\t'id' => 'facebookurl',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('Twitter URL', 'options_framework_theme'),\n\t\t'desc' => __('Enter Twitter URL.', 'options_framework_theme'),\n\t\t'id' => 'twitterurl',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('YouTube URL', 'options_framework_theme'),\n\t\t'desc' => __('Enter YouTube URL.', 'options_framework_theme'),\n\t\t'id' => 'youtubeurl',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('YouTube URL', 'options_framework_theme'),\n\t\t'desc' => __('Enter YouTube URL.', 'options_framework_theme'),\n\t\t'id' => 'youtubeurl',\n\t\t'std' => '',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('Shopping Cart Page', 'options_framework_theme'),\n\t\t'desc' => __('Select Shopping Cart Page', 'options_framework_theme'),\n\t\t'id' => 'shoppingcarturl',\n\t\t'type' => 'select',\n\t\t'options' => $options_pages);\n\n\t$options[] = array(\n\t\t'name' => __('Upload Logo', 'options_framework_theme'),\n\t\t'desc' => __('Upload the Header Logo file. Prefer PNG files.', 'options_framework_theme'),\n\t\t'id' => 'headerlogo',\n\t\t'type' => 'upload');\n\t\n\t// Header options Ends\n\t\n\t// footer options Start\n\t\n\t$options[] = array(\n\t\t'name' => __('Footer Options', 'options_framework_theme'),\n\t\t'type' => 'heading');\n\t\n\t$wp_editor_settings = array(\n\t\t'wpautop' => true, // Default\n\t\t'textarea_rows' => 5,\n\t\t'tinymce' => array( 'plugins' => 'wordpress' )\n\t);\n\n\tfor ($i = 1; $i <= 4; $i++) {\n\t\t$footer_id = 'footer' . $i;\n\t\t$footer_name = 'Footer Column #' . $i;\n\t\t$footer_desc = 'Input Content for Column #' . $i;\n\t\t\n\t\t$options[] = array(\n\t\t\t'name' => __( $footer_name , 'options_framework_theme'),\n\t\t\t'desc' => __( $footer_desc , 'options_framework_theme' ),\n\t\t\t'id' => $footer_id,\n\t\t\t'type' => 'editor',\n\t\t\t'settings' => $wp_editor_settings );\n\t}\n\t\t\n\t// footer options Ends\n\n\t// Gallery Options Start\n\n\t$options[] = array(\n\t\t'name' => __('Gallery', 'options_framework_theme'),\n\t\t'type' => 'heading');\n\n\t$options[] = array(\n\t\t'name' => __('Flickr User ID', 'options_framework_theme'),\n\t\t'desc' => __('Please enter Flickr User ID - Across U-hub ID : 71262322@N08', 'options_framework_theme'),\n\t\t'id' => 'flickrid',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('Flickr API Key', 'options_framework_theme'),\n\t\t'desc' => __('Please enter Flickr API Key - Across U-hub API Key : 8905278cfedacf3e387a7315dba78f7c', 'options_framework_theme'),\n\t\t'id' => 'flickrapikey',\n\t\t'type' => 'text');\n\n\t$options[] = array(\n\t\t'name' => __('Flickr Photo Set', 'options_framework_theme'),\n\t\t'desc' => __('Select Set or Collection - Across U-hub : Set', 'options_framework_theme'),\n\t\t'id' => 'flickrset',\n\t\t'std' => 'Set',\n\t\t'type' => 'radio',\n\t\t'options' => $flickrset_array);\n\t\n\t// Gallery Options End\n\n\treturn $options;\n}", "public function displayOptions()\n {\n $data = $_POST;\n $listing = geoListing::getListing($data['listing']);\n $urlToListing = $listing->getFullUrl();\n\n $tpl = new geoTemplate('addon', 'sharing');\n $tpl->assign('listing_url', urlencode($urlToListing));\n $tpl->assign('title', $listing->title); //already urlencoded in the database, and needs to stay that way\n $tpl->assign('description', urlencode(strip_tags(geoString::fromDB($listing->description))));\n $tpl->assign('msgs', geoAddon::getText('geo_addons', 'sharing'));\n $html = $tpl->fetch('methods/linkedin_options.tpl');\n return $html;\n }", "protected function build_option_page()\n\t{\n\t\t/* intentionally left blank */\n\t}", "public function getSettingsPage();", "function mim_setting_callback_function() {\n $mim_private_page_id = esc_attr( get_option( 'mim_map_page_id' ) );\n \n $args = array(\n\t'sort_order' => 'asc',\n\t'sort_column' => 'post_title',\n\t'hierarchical' => 1,\n\t'exclude' => '',\n\t'include' => '',\n\t'meta_key' => '',\n\t'meta_value' => '',\n\t'authors' => '',\n\t'child_of' => 0,\n\t'parent' => -1,\n\t'exclude_tree' => '',\n\t'number' => '',\n\t'offset' => 0,\n\t'post_type' => 'page',\n\t'post_status' => 'publish'\n ); \n $pages = get_pages($args); \n echo \"<select name='mim_map_page_id'>\";\n foreach ($pages as $page){\n //print_r($page);\n $option_html = \"<option value='$page->ID'\";\n if ($page->ID === intval($mim_private_page_id)){\n $option_html .= \" selected='selected'\";\n }\n $option_html .= \" >$page->post_title</option>\";\n echo $option_html;\n }\n echo \"</select>\";\n}", "protected function getOptions()\r\n\t{\r\n\t\tstatic $options\t= null;\r\n\t\t\r\n\t\tif ( $options == null ) {\r\n\t\t\t\r\n\t\t\t$options[]\t= (object) array( 'value' => '', 'text' => '- Select a Page -');\r\n\t\t\t$config\t\t=\tdunloader( 'config', 'com_jblesta' );\r\n\t\t\t$pagetxt\t=\texplode( \"\\r\\n\", trim( $config->get( 'pagelist' ) ) );\r\n\t\t\t\r\n\t\t\tforeach( $pagetxt as $page ) {\r\n\t\t\t\t$page\t=\ttrim( $page );\r\n\t\t\t\tif ( empty( $page ) ) continue;\r\n\t\t\t\t$tmp\t=\texplode( \"=\", $page );\r\n\t\t\t\t$name\t=\tarray_shift( $tmp );\r\n\t\t\t\t$options[]\t=\t(object) array( 'value'\t=> base64_encode( implode( \"=\", $tmp ) ), 'text' => $name );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $options;\r\n\t}", "function bb_posts_as_paragraphs_options_page() {\n\n\t$html = bb_posts_as_paragraphs_settings_page_get_full_mark_up( 'bb-posts-as-paragraphs-options-group' );\n\techo $html;\n\n}", "public function displayOptions()\r\n\t{\r\n\t\t$data = $_POST;\r\n\t\t$listing = geoListing::getListing($data['listing']);\r\n\t\t$urlToListing = geoFilter::getBaseHref() . DataAccess::getInstance()->get_site_setting('classifieds_file_name').'?a=2&b='.$listing->id;\r\n\t\t\t\t\r\n\t\t$tpl = new geoTemplate('addon','sharing');\r\n\t\t$tpl->assign('listing_url', urlencode($urlToListing));\r\n\t\t$tpl->assign('title', $listing->title); //already urlencoded in the database, and needs to stay that way\r\n\t\t$tpl->assign('description', urlencode(strip_tags(geoString::fromDB($listing->description))));\r\n\t\t$tpl->assign('msgs', geoAddon::getText('geo_addons','sharing'));\r\n\t\t$html = $tpl->fetch('methods/reddit_options.tpl');\r\n\t\treturn $html;\r\n\t}", "public function getPageselect() {\n\t\tif(is_null($this->pageSelect))\n\t\t\t$this->pageSelect = t3lib_div::makeInstance('t3lib_pageSelect');\n\t\t\n\t\treturn $this->pageSelect;\n\t}", "function wpplugin_settings_subpage_markup()\n{\n if ( !current_user_can('manage_options') ) {\n return;\n }\n ?>\n <div class=\"wrap\">\n <h1><?php esc_html_e( get_admin_page_title() ); ?></h1>\n <!-- <p><?php // esc_html_e( 'Some content.', 'wpplugin' ); ?></p> -->\n <h2>To List Course Types</h2>\n\n <h4>Default:</h4>\n <code>\n [cg-member-area-taxonomy-list]\n </code>\n <p>\n This will display a list of Course types by default\n </p>\n\n <h4>Options:</h4>\n <code>\n [cg-member-area-taxonomy-list taxonomy_name=\"courses\"]\n </code>\n <p>\n This will display the same as the default (Course types). \n </p>\n\n <hr>\n <br>\n\n <h2>To List Lead Magnet Types</h2>\n\n <code>\n [cg-member-area-taxonomy-list taxonomy_name=\"lmag\"]\n </code>\n <p>\n This will display a list of Lead Magnet types.\n </p>\n\n <hr> \n\n </div>\n <?php\n}", "function optionsframework_options() {\t\n\t\n\t// Home Project Type\n\t$home_project_type = array(\"all\" => \"All projects\", \"featured\" => \"Featured\");\t\n\n\t$page_head_size = array(\"tera\" => \"Tera\", \"giga\" => \"Giga\", \"mega\" => \"Mega\", \"alpha\" => \"Alpha\", \"beta\" => \"Beta\", \"gamma\" => \"Gamma\", \"delta\" => \"Delta\", \"epsilon\" => \"Epsilon\", \"zeta\" => \"Zeta\");\t\n\t$background_size = array(\"cover\" => \"Cover\", \"contain\" => \"Contain\", \"repeat\" => \"Repeat\", \"repeat-x\" => \"Repeat X\", \"repeat-y\" => \"Repeat Y\");\n\t$background_position = array(\"center\" => \"Center\", \"top\" => \"Top\", \"right\" => \"Right\", \"bottom\" => \"Bottom\", \"left\" => \"Left\");\t\n\t$background_repeat = array(\"repeat\" => \"Repeat\", \"repeat-x\" => \"Repeat X\", \"repeat-y\" => \"Repeat Y\");\n\n\t$menu_type = array(\"block\" => \"Block\", \"parallax\" => \"Parallax\");\n\n\n\t$header_position = array(\n\t\t\"fixed-top\" => \"Fixed Top\", \n\t\t\"fixed-bottom\" => \"Fixed Bottom\", \n\t\t\"absolute-top\" => \"Absolute Top\"\n\t);\n\n\n\n\t$home_slideshows = array(\n\t\t\"flexslider-full-screen\" => \"Flexslider Full Screen\", \n\t\t\"flexslider\" => \"Flexslider Basic\", \n\t\t\"royal\" => \"Royal Basic\"\n\t\t);\n\n\n\n\t// Thumb Ratios\n\t$home_page_thumbs_per_row = array(\"one_half\" => \"Two\", \"one_third\" => \"Three\", \"one_fourth\" => \"Four\", \"one_fifth\" => \"Five\", \"one_sixth\" => \"Six\");\n\t\n\t// Post Featured Image Size\n\t$post_featured_image_size = array(\"large\" => \"Large\", \"small\" => \"Small\");\n\t\n\t// Slideshow Transition Effect\n\t$slideshow_effect = array(\"slide\" => \"Slide\", \"fade\" => \"Fade\");\n\t\n\t// Pull all the pages into an array\n\t$options_pages = array(); \n\t$options_pages_obj = get_pages('sort_column=post_parent,menu_order');\n\t$options_pages[''] = 'Select a page:';\n\tforeach ($options_pages_obj as $page) {\n \t$options_pages[$page->ID] = $page->post_title;\n\t}\n\t\t\n\t// If using image radio buttons, define a directory path\n\t$imagepath = get_bloginfo('stylesheet_directory') . '/images/';\n\t\t\n\t$options = array();\n\n\n\n\n\t///////////////////////////////////////\n\t// GENERAL\n\t//////////////////////////////////////\t\n\t\n\t$options[] = array( \"name\" => __('General','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\t$options[] = array( \"name\" => __('Nav Type','poxy'),\n\t\t\t\t\"desc\" => __(' ','poxy'),\n\t\t\t\t\"id\" => \"poxy_menu_type\",\n\t\t\t\t\"std\" => \"block\",\n\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\"options\" => $menu_type);\n\n\n\t$options[] = array( \"name\" => __('Header Position','poxy'),\n\t\t\t\t\t\"desc\" => __(' ','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_header_position\",\n\t\t\t\t\t\"std\" => \"Absolute Top\",\n\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\"options\" => $header_position);\n\n\n\n\t$options[] = array( \"name\" => __('Accent Color','poxy'),\n\t\t\t\t\t\"desc\" => __('Select an accent color for your site.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_color_accent\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Link Color','poxy'),\n\t\t\t\"desc\" => __('Select main link color. (#meat a)','poxy'),\n\t\t\t\"id\" => \"poxy_color_link\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Link Color Hover','poxy'),\n\t\t\t\"desc\" => __('Select main link hover color. (#meat a:hover)','poxy'),\n\t\t\t\"id\" => \"poxy_color_link_hover\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Logo','poxy'),\n\t\t\t\t\"desc\" => __('Upload a custom logo.','poxy'),\n\t\t\t\t\"id\" => \"logo\",\n\t\t\t\t\"type\" => \"upload\");\n\n\t$options[] = array( \"name\" => __('Mobile Logo','poxy'),\n\t\t\t\t\"desc\" => __('Upload a custom mobile logo. (1:1)','poxy'),\n\t\t\t\t\"id\" => \"mobile_logo\",\n\t\t\t\t\"type\" => \"upload\");\n\n\t$options[] = array( \"name\" => __('Favicon','poxy'),\n\t\t\t\t\t\"desc\" => __('Upload a custom favicon.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_favicon\",\n\t\t\t\t\t\"type\" => \"upload\");\n\n\n\n\t$options[] = array( \"name\" => __('Analytics/Tracking Code','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter your custom analytics code. (e.g. Google Analytics).','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_analytics\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"textarea\",\n\t\t\t\t\t\"validate\" => \"none\");\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\n\t$options[] = array( \"name\" => __('Custom CSS','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter custom CSS here.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_custom_css\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"textarea\");\t\n\n\t$options[] = array( \"name\" => __('Overlay Background Image','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter custom SVG code here.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_section_overlay\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"textarea\");\t\n\n\n\t$options[] = array( \"name\" => __('Line Spacer Background Image','poxy'),\n\t\t\t\t\t\"desc\" => __('Upload a custom header background image.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_line_spacer_background_image\",\n\t\t\t\t\t\"type\" => \"upload\");\n\t\n\n\t// $options[] = array( \"name\" => __('Font for Home Slideshow Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for home slideshow titles.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_slideshow_heading_font\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Font for Home Slideshow Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for home slideshow descriptions.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_slideshow_description_font\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\n\n\n\t///////////////////////////////////////\n\t// HOME PAGE\t\n\t//////////////////////////////////////\t\n\t$options[] = array( \"name\" => __('Home','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\n\t$options[] = array( \"name\" => __('Home Layout','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter Layout Number.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_home_layout\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t//Main Banner\n\t$options['poxy_slideshow_enabled'] = array( \"name\" => __('Enable Slideshow','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to enable the home page slideshow.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_slideshow_enabled\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Choose Slideshow','poxy'),\n\t\t\t\t\t\t\"desc\" => __(' ','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_home_slideshow_type\",\n\t\t\t\t\t\t\"std\" => \"flexslider\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $home_slideshows);\n\n\t$options[] = array( \"name\" => __('Slideshow Delay','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the delay in seconds between slides. Enter 0 to disable auto-playing.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_slideshow_delay\",\n\t\t\t\t\t\t\"std\" => \"6\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Slideshow Height','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the Height of the slideshow.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_slideshow_height\",\n\t\t\t\t\t\t\"std\" => \"1900\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Slideshow Effect','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Select the type of transition effect for the slideshow.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_slideshow_effect\",\n\t\t\t\t\t\t\"std\" => \"fade\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $slideshow_effect);\n\n\t// $options[] = array( \"name\" => __('Slideshow right arrow','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Upload right arrow for slideshow.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_slideshow_right_arrow\",\n\t// \t\t\t\t\t\"type\" => \"upload\");\n\n\t// $options[] = array( \"name\" => __('Slideshow left arrow','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Upload left arrow for slideshow.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_slideshow_left_arrow\",\n\t// \t\t\t\t\t\"type\" => \"upload\");\n\n\t$options[] = array( \"name\" => __('Featured Products Title','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the title that will appear above the featured pages section on the home page.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_title\",\n\t\t\t\t\t\t\"std\" => \"New & Featured Products\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Featured Products sub-heading','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the description that will appear above the featured pages section on the home page.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_description\",\n\t\t\t\t\t\t\"std\" => \"Featured Products Description.\",\n\t\t\t\t\t\t\"type\" => \"textarea\");\n\n\t$options[] = array( \"name\" => __('Featured Pages Title','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter the title that will appear above the featured pages section on the home page.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_featured_pages_title\",\n\t\t\t\t\t\"std\" => \"Our Services\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Featured Pages Description','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the description that will appear above the featured pages section on the home page.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_description\",\n\t\t\t\t\t\t\"std\" => \"A little about what we do.\",\n\t\t\t\t\t\t\"type\" => \"textarea\");\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Number of Featured Pages to Show','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the number of featured pages to show on the home page.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_count\",\n\t\t\t\t\t\t\"std\" => \"6\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Enable Featured Pages Links','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to have the featured pages link to their corresponding single page when clicked.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_links_enabled\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Featured Pages Background','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Upload an image for the featured pages section.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_featured_pages_bkg\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\n\n\n\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t// Header\n\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t$options[] = array( \"name\" => __('Header','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\t$options[] = array( \"name\" => __('Enable Odd/Even BG Colors','poxy'),\n\t\t\t\"desc\" => __('Enables alterntating odd even color sections.','poxy'),\n\t\t\t\"id\" => \"poxy_enable_header_odd_even_background_colors\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"checkbox\");\n\n\n\t$options[] = array( \"name\" => __('Is The Header Dark?','poxy'),\n\t\t\t\t\t\"desc\" => __('Check this the header is dark.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_dark_header\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Header Background Color','poxy'),\n\t\t\t\t\t\"desc\" => __('Select a header background color for your site.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_color_header\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\n\t$options[] = array( \"name\" => __('Enable Full Width Header','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to enable full width top header.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_full_width_header\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\n\n\t$options[] = array( \"name\" => __('Enable small Header Navigation','poxy'),\n\t\t\t\t\t\"desc\" => __('Check this box to enable small Header Navigation Bar.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_enable_top_header_menu\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Enable Small Main Navigation','poxy'),\n\t\t\t\t\t\"desc\" => __('Check this box to enable small Header Navigation Bar.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_enable_small_main_menu\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\n\n\t$options[] = array( \"name\" => __('Main Menu Text Color','poxy'),\n\t\t\"desc\" => __('Select main nav text color. (#main-nav a)','poxy'),\n\t\t\"id\" => \"poxy_main_nav_color\",\n\t\t\"std\" => \"\",\n\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Main Menu Background Color Hover','poxy'),\n\t\t\t\t\t\"desc\" => __('Select a header background color for your site.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_header_menu_background_hover\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\t\n\n\t$options[] = array( \"name\" => __('Header Sub Menu Background Color','poxy'),\n\t\t\t\t\t\"desc\" => __('Select a header sub menu background color for your site.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_header_sub_menu_background_color\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Header Sub Nav Color','poxy'),\n\t\t\t\t\"desc\" => __('Select a sub nav font color.','poxy'),\n\t\t\t\t\"id\" => \"poxy_header_sub_menu_color\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Line Spacer Header Border Color','poxy'),\n\t\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\t\"id\" => \"poxy_line_spacer_header_border_color\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Tagline Image','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Upload a custom favicon.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_tagline_image\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\n\n\t$options[] = array( \"name\" => __('Header Background Image','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Upload a custom header background image.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_header_background_image\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\n\t\n\t// $options[] = array( \"name\" => __('Background Size','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_header_background_size\",\n\t// \t\t\t\t\"std\" => \"repeat\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_size);\t\n\n\t// \t$options[] = array( \"name\" => __('Background Size','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_header_background_repeat\",\n\t// \t\t\t\t\"std\" => \"repeat\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_repeat);\t\n\n\t// \t$options[] = array( \"name\" => __('Background X Position','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_header_background_x_position\",\n\t// \t\t\t\t\"std\" => \"center\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_position);\t\n\n\t// \t$options[] = array( \"name\" => __('Background Y Position','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_header_background_y_position\",\n\t// \t\t\t\t\"std\" => \"center\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_position);\t\n\n\n\n\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t// Page Head\n\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t$options[] = array( \"name\" => __('Page Head','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\t$options[] = array( \"name\" => __('Enable Header Banners','poxy'),\n\t\t\t\"desc\" => __('Enables image banner section headers.','poxy'),\n\t\t\t\"id\" => \"poxy_enable_page_head_banners\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Enable breadcrumbs','poxy'),\n\t\t\t\t\"desc\" => __('Check this box to enable breadcrumbs.','poxy'),\n\t\t\t\t\"id\" => \"poxy_enable_breadcrumbs\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Page Head Size','poxy'),\n\t\t\t\t\t\"desc\" => __('Select font size of page heads.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_page_head_size\",\n\t\t\t\t\t\"std\" => \"beta\",\n\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\"options\" => $page_head_size);\t\n\n\t$options[] = array( \"name\" => __('Page Head Text Color','poxy'),\n\t\t\t\t\t\"desc\" => __('Select Page Head text color. (#page-head)','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_color_pagehead\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\t\n\n\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t// SECTION SETTINGS (Content)\n\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\t\n\t$options[] = array( \"name\" => __('MEAT','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\n\t\n\t$options[] = array( \"name\" => __('Enable Odd/Even BG Colors','poxy'),\n\t\t\t\t\"desc\" => __('Enables alterntating odd even color sections.','poxy'),\n\t\t\t\t\"id\" => \"poxy_enable_meat_odd_even_background_colors\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Divider Height','poxy'),\n\t\t\t\t\t\t\"desc\" => __('include unit(em or px)','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_meat_divider_height\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Is The Meat Dark?','poxy'),\n\t\t\t\t\"desc\" => __('Check this the meat/main content area is dark.','poxy'),\n\t\t\t\t\"id\" => \"poxy_dark_meat\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"checkbox\");\n\n\t// $options[] = array( \"name\" => __('Meat Background Color','poxy'),\n\t// \t\t\t\"desc\" => __('Select a background color for the main content area of the site.','poxy'),\n\t// \t\t\t\"id\" => \"poxy_background_meat\",\n\t// \t\t\t\"std\" => \"\",\n\t// \t\t\t\"type\" => \"color\");\n\n\t// $options[] = array( \"name\" => __('Even Section Background Color','poxy'),\n\t// \t\t\t\"desc\" => __('','poxy'),\n\t// \t\t\t\"id\" => \"poxy_even_section_background_color\",\n\t// \t\t\t\"std\" => \"\",\n\t// \t\t\t\"type\" => \"color\");\n\n\t// $options[] = array( \"name\" => __('Odd Section Background Color','poxy'),\n\t// \t\t\"desc\" => __('','poxy'),\n\t// \t\t\"id\" => \"poxy_odd_section_background_color\",\n\t// \t\t\"std\" => \"\",\n\t// \t\t\"type\" => \"color\");\n\n\t//Main Banner\n\t$options['poxy_full_width_spacers_enabled'] = array( \"name\" => __('Enable Full Width Spacers','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to enable full width spacers.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_full_width_spacers_enabled\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\n\t$options[] = array( \"name\" => __('Line Spacer Bottom Border Color','poxy'),\n\t\t\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_line_spacer_bottom_border_color\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\t\t\t\n\n\n\t\t$options[] = array( \"name\" => __('Line Spacer Top Border Color','poxy'),\n\t\t\t\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_line_spacer_top_border_color\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"color\");\n\n\n\t\t$options[] = array( \"name\" => __('Meat Background Image','poxy'),\n\t\t\t\t\t\"desc\" => __('Upload a custom meat background image.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_meat_background_image\",\n\t\t\t\t\t\"type\" => \"upload\");\n\n\t\t// $options[] = array( \"name\" => __('Background Size','poxy'),\n\t\t// \t\t\t\"desc\" => __(' ','poxy'),\n\t\t// \t\t\t\"id\" => \"poxy_meat_background_size\",\n\t\t// \t\t\t\"std\" => \"repeat\",\n\t\t// \t\t\t\"type\" => \"select\",\n\t\t// \t\t\t\"options\" => $background_size);\t\n\n\t\t// $options[] = array( \"name\" => __('Background Size','poxy'),\n\t\t// \t\t\t\"desc\" => __(' ','poxy'),\n\t\t// \t\t\t\"id\" => \"poxy_meat_background_repeat\",\n\t\t// \t\t\t\"std\" => \"repeat\",\n\t\t// \t\t\t\"type\" => \"select\",\n\t\t// \t\t\t\"options\" => $background_repeat);\t\n\n\t\t// $options[] = array( \"name\" => __('Background X Position','poxy'),\n\t\t// \t\t\t\"desc\" => __(' ','poxy'),\n\t\t// \t\t\t\"id\" => \"poxy_meat_background_x_position\",\n\t\t// \t\t\t\"std\" => \"center\",\n\t\t// \t\t\t\"type\" => \"select\",\n\t\t// \t\t\t\"options\" => $background_position);\t\n\n\t\t// $options[] = array( \"name\" => __('Background Y Position','poxy'),\n\t\t// \t\t\t\"desc\" => __(' ','poxy'),\n\t\t// \t\t\t\"id\" => \"poxy_meat_background_y_position\",\n\t\t// \t\t\t\"std\" => \"center\",\n\t\t// \t\t\t\"type\" => \"select\",\n\t\t// \t\t\t\"options\" => $background_position);\t\n\n\n\n\n\n\n\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t// Footer\n\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Footer','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\t$options[] = array( \"name\" => __('Home Layout','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter Layout Number.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_footer_widget_layout\",\n\t\t\t\t\t\"std\" => \"4\",\n\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Enable Odd/Even BG Colors','poxy'),\n\t\t\t\"desc\" => __('Enables alterntating odd even color sections.','poxy'),\n\t\t\t\"id\" => \"poxy_enable_footer_odd_even_background_colors\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"checkbox\");\n\n\n\n\t$options[] = array( \"name\" => __('Is The Footer Dark?','poxy'),\n\t\t\t\t\t\"desc\" => __('Check this the footer is dark.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_dark_footer\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Footer Background Color','poxy'),\n\t\t\t\t\"desc\" => __('Select a body/footer background color for your site.','poxy'),\n\t\t\t\t\"id\" => \"poxy_background_body\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"color\");\n\n\n\n\t$options[] = array( \"name\" => __('Footer Logo','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Upload a custom Footer logo.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_footer_logo\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\n\n\t$options[] = array( \"name\" => __('Line Spacer Footer Border Color','poxy'),\n\t\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\t\"id\" => \"poxy_line_spacer_footer_border_color\",\n\t\t\t\t\"std\" => \"\",\n\t\t\t\t\"type\" => \"color\");\n\n\n\t$options[] = array( \"name\" => __('Copywrite Background Color','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Select the copywrite background color for your site.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_background_copywrite\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"color\");\n\n\n\n\n\t$options[] = array( \"name\" => __('Footer Background Image','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Upload a custom footer background image.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_footer_background_image\",\n\t\t\t\t\t\t\"type\" => \"upload\");\n\t\n\t// $options[] = array( \"name\" => __('Background Size','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_footer_background_size\",\n\t// \t\t\t\t\"std\" => \"repeat\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_size);\t\n\n\t// \t$options[] = array( \"name\" => __('Background Size','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_footer_background_repeat\",\n\t// \t\t\t\t\"std\" => \"repeat\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_repeat);\t\n\n\t// \t$options[] = array( \"name\" => __('Background X Position','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_footer_background_x_position\",\n\t// \t\t\t\t\"std\" => \"center\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_position);\t\n\n\t// \t$options[] = array( \"name\" => __('Background Y Position','poxy'),\n\t// \t\t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_footer_background_y_position\",\n\t// \t\t\t\t\"std\" => \"center\",\n\t// \t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\"options\" => $background_position);\t\n\n\n\t\n\n\t// $options[] = array( \"name\" => __('Background Size','poxy'),\n\t// \t\t\t\"desc\" => __(' ','poxy'),\n\t// \t\t\t\"id\" => \"poxy_footer_background_size\",\n\t// \t\t\t\"std\" => \"repeat\",\n\t// \t\t\t\"type\" => \"select\",\n\t// \t\t\t\"options\" => $background_size;\t\n\n\t// $options[] = array( \"name\" => __('Background X Position','poxy'),\n\t// \t\t\"desc\" => __('','poxy'),\n\t// \t\t\"id\" => \"poxy_footer_background_x_position\",\n\t// \t\t\"std\" => \"repeat\",\n\t// \t\t\"type\" => \"select\",\n\t// \t\t\"options\" => $background_x_position;\t\n\n\t// $options[] = array( \"name\" => __('Background Y Position','poxy'),\n\t// \t\t\"desc\" => __('','poxy'),\n\t// \t\t\"id\" => \"poxy_footer_background_y_position\",\n\t// \t\t\"std\" => \"repeat\",\n\t// \t\t\"type\" => \"select\",\n\t// \t\t\"options\" => $background_y_position;\n\n\n\t\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Appearance','poxy'),\n\t// \t\t\t\t\t\"type\" => \"heading\");\n\t\n\t// $options[] = array( \"name\" => __('Header Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a header color for your theme.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_header\",\n\t// \t\t\t\t\t\"std\" => \"#74c9b4\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Accent Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select an accent color for your theme.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_accent\",\n\t// \t\t\t\t\t\"std\" => \"#74c9b4\",\n\t// \t\t\t\t\t\"type\" => \"color\");\t\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Menu Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a color for your menu links.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_menu\",\n\t// \t\t\t\t\t\"std\" => \"#8f8f8f\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Menu Hover Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a hover color for your menu links.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_menu_hover\",\n\t// \t\t\t\t\t\"std\" => \"#2e2e2e\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Button Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a color for your buttons.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_btn\",\n\t// \t\t\t\t\t\"std\" => \"#757575\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Button Hover Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a hover color for your buttons.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_btn_hover\",\n\t// \t\t\t\t\t\"std\" => \"#595959\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Link Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a color for your links.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_link\",\n\t// \t\t\t\t\t\"std\" => \"#4da7ca\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\n\t// $options[] = array( \"name\" => __('Link Hover Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a hover color for your links.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_color_link_hover\",\n\t// \t\t\t\t\t\"std\" => \"#4290ae\",\n\t// \t\t\t\t\t\"type\" => \"color\");\n\n\n\t\t\n\n\n\n\t\n\n\n\n\t\n\t\n\n\n\t///////////////////////////////////////\n\t// Info Bar\n\t//////////////////////////////////////\t\n\t// $options[] = array( \"name\" => __('Info Bar','poxy'),\n\t// \t\t\t\t\t\"type\" => \"heading\");\n\n\t// $options[] = array( \"name\" => __('Info Bar Main Title','poxy'),\n\t// \t\t\t\t\"desc\" => __('Main Title.','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_info_box_34_title\",\n\t// \t\t\t\t\"std\" => \"Info Box Title\",\n\t// \t\t\t\t\"type\" => \"text\");\n\n\t// $options[] = array( \"name\" => __('Main Section Copy','poxy'),\n\t// \t\t\t\t\"desc\" => __('Enter the copy for the large block.','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_info_box_34_content\",\n\t// \t\t\t\t\"std\" => \"3/4 Section Content\",\n\t// \t\t\t\t\"type\" => \"textarea\");\n\n\t// $options[] = array( \"name\" => __('Main Section Image','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Upload Main Info Box Image.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_info_box_34_image\",\n\t// \t\t\t\t\t\"type\" => \"upload\");\n\n\t// $options[] = array( \"name\" => __('Secondary Section Copy','poxy'),\n\t// \t\t\t\t\"desc\" => __('Enter the copy for the small block.','poxy'),\n\t// \t\t\t\t\"id\" => \"poxy_info_box_14_content\",\n\t// \t\t\t\t\"std\" => \"1/4 Section Content\",\n\t// \t\t\t\t\"type\" => \"textarea\");\n\n\t// $options[] = array( \"name\" => __('Secondary Section Button Title','poxy'),\n\t// \t\t\t\"desc\" => __('Button Title.','poxy'),\n\t// \t\t\t\"id\" => \"poxy_info_box_14_button_title\",\n\t// \t\t\t\"std\" => \"Shop Now!\",\n\t// \t\t\t\"type\" => \"text\");\n\n\t// $options[] = array( \"name\" => __('Secondary Section Button URL','poxy'),\n\t// \t\t\t\"desc\" => __('Secondary Section Button URL.','poxy'),\n\t// \t\t\t\"id\" => \"poxy_info_box_14_button_url\",\n\t// \t\t\t\"std\" => \"\",\n\t// \t\t\t\"type\" => \"text\");\n\n\n\n\n\n\n\n\n\t// Client Logos\n\t// $options['poxy_client_logos_enabled'] = array( \"name\" => __('Enable Client Logos','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Check this box to enable the home Client Logos.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_logos_enabled\",\n\t// \t\t\t\t\t\"std\" => \"1\",\n\t// \t\t\t\t\t\"type\" => \"checkbox\");\n\n\t// $options[] = array( \"name\" => __('Enable Client Logos','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Check this box to have the client logos link to their corresponding single page when clicked.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_logos_links_enabled\",\n\t// \t\t\t\t\t\"std\" => \"1\",\n\t// \t\t\t\t\t\"type\" => \"checkbox\");\n\n\t// $options[] = array( \"name\" => __('Number of Featured Pages to Show','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the number of featured pages to show on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_logos_count\",\n\t// \t\t\t\t\t\"std\" => \"6\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\n\t// $options[] = array( \"name\" => __('Client logos Per Row','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select the number of thumbs to display per row.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_thumbs_per_row\",\n\t// \t\t\t\t\t\"std\" => \"one_fourth\",\n\t// \t\t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\t\"options\" => $home_page_thumbs_per_row);\n\n\n\t// $options[] = array( \"name\" => __('Client Logos Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the title that will appear above the featured pages section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_logos_title\",\n\t// \t\t\t\t\t\"std\" => \"Featured Clients\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\n\n\t// $options[] = array( \"name\" => __('Client Logos Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the description that will appear above the featured pages section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_client_logos_description\",\n\t// \t\t\t\t\t\"std\" => \"Client Logos Description.\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\t\t\t\t\n\t\n\n\t\n\n\n\n\t//Twitter Feed\n\t// $options['poxy_twitter_feed_enabled'] = array( \"name\" => __('Enable Twitter Feed','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Check this box to enable the home twitter feed.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_twitter_feed_enabled\",\n\t// \t\t\t\t\t\"std\" => \"1\",\n\t// \t\t\t\t\t\"type\" => \"checkbox\");\n\n\t// $options[] = array( \"name\" => __('Twitter API','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the twitter API.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_twitter_api\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\n\t// $options[] = array( \"name\" => __('Twitter Feed Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the title that will appear above the twitter feed on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_twitter_feed_title\",\n\t// \t\t\t\t\t\"std\" => \"Twitter Feed\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\n\t// $options[] = array( \"name\" => __('Twitter Feed Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the description that will appear above the twitter feed on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_twitter_feed_description\",\n\t// \t\t\t\t\t\"std\" => \"Twitter Feed Description.\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\n\n\n\t\n\t\t\t\t\t\t\n\t\n\t//Featued Projects\t\t\t\n\t// $options[] = array( \"name\" => __('Recent Projects Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the title that will appear above the recent themes section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_recent_projects_title\",\n\t// \t\t\t\t\t\"std\" => \"Our Latest Work\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Recent Projects Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the description that will appear above the recent projects section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_recent_projects_description\",\n\t// \t\t\t\t\t\"std\" => \"Take a look at some of our recent projects.\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\t\t\t\t\t\t\n\t\n\t// $options[] = array( \"name\" => __('Number of Projects to Show','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the number of project to show on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_home_project_count\",\n\t// \t\t\t\t\t\"std\" => \"6\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Type of Projects to Show','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select the type of projects to show on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_home_project_type\",\n\t// \t\t\t\t\t\"std\" => \"latest\",\n\t// \t\t\t\t\t\"type\" => \"select\",\n\t// \t\t\t\t\t\"options\" => $home_project_type);\n\n\n\t//Testimonials\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Testimonials Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the title that will appear above the testimonials section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_testimonials_title\",\n\t// \t\t\t\t\t\"std\" => \"Testimonials\",\n\t// \t\t\t\t\t\"type\" => \"text\");\t\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Testimonials Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the description that will appear above the testimonials section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_testimonials_description\",\n\t// \t\t\t\t\t\"std\" => \"What our customers are saying.\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\t\n\t\n\t// $options[] = array( \"name\" => __('Number of Testimonials to Show','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the number of Testimonials to show on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_home_testimonial_count\",\n\t// \t\t\t\t\t\"std\" => \"3\",\n\t// \t\t\t\t\t\"type\" => \"text\");\t\n\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\n\t//Home Posts\t\n\t// $options[] = array( \"name\" => __('Recent Posts Title','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the title that will appear above the posts section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_recent_posts_title\",\n\t// \t\t\t\t\t\"std\" => \"From the Bog\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Recent Posts Description','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the description that will appear above the posts section on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_recent_posts_description\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Number of Recent Posts to Show','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the number of recent posts to show on the home page.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_recent_posts_count\",\n\t// \t\t\t\t\t\"std\" => \"3\",\n\t// \t\t\t\t\t\"type\" => \"text\");\n\t\n\t\t\t\t\n\n\t\t\n\n\n\n\n\n\n\t///////////////////////////////////////\n\t// Posts\n\t//////////////////////////////////////\t\n\t$options[] = array( \"name\" => __('Blog','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\n\n\t$options[] = array( \"name\" => __('Blog Layout','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter Layout Number.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_blog_layout\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Blog Single Post Layout','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter Layout Number.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_blog_single_layout\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Blog Banner Image','poxy'),\n\t\t\t\t\t\"desc\" => __('Upload a blog page banner image.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_blog_banner\",\n\t\t\t\t\t\"type\" => \"upload\");\n\t\n\t$options[] = array( \"name\" => \"Select a Page\",\n\t\t\t\t\t\t\"desc\" => \"Select the page you're using as your blog page. This is used to show the blog title at the top of your posts.\",\n\t\t\t\t\t\t\"id\" => \"poxy_blog_page\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $options_pages);\n\n\t$options[] = array( \"name\" => __('Post Heading Size','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Select font size of post titles.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_head_size\",\n\t\t\t\t\t\t\"std\" => \"beta\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $page_head_size);\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Author','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the author.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_author\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Date','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the publish date.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_date\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Category','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the category.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_category\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Comment Count','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the comment count.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_comments\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Featured Image Size','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Select the size of the post featured image.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_featured_img_size\",\n\t\t\t\t\t\t\"std\" => \"large\",\n\t\t\t\t\t\t\"type\" => \"select\",\n\t\t\t\t\t\t\"options\" => $post_featured_image_size);\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Featured Image on Single Posts','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the featured image on single post pages.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_featured_image\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Featured Image on Home Page','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show the featured image on the home page template.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_featured_image_on_home\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Enable Full Width Blog','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to make your posts span the width of the page.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_full_width\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Show Full Posts','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show full posts instead of excerpts on index and archive pages.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_post_show_full\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Read More Link Title','poxy'),\n\t\t\t\t\"desc\" => __('Main Title.','poxy'),\n\t\t\t\t\"id\" => \"poxy_read_more_title\",\n\t\t\t\t\"std\" => \"Read More\",\n\t\t\t\t\"type\" => \"text\");\n\n\n\t$options[] = array( \"name\" => __('Disqus Shortname','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter your disqus shortname.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_disqus_shortname\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\n\t\n\t\n\t///////////////////////////////////////\n\t// Footer \n\t//////////////////////////////////////\t\n\t// $options[] = array( \"name\" => __('Footer','poxy'),\n\t// \t\t\t\t\t\"type\" => \"heading\");\n\n\t// $options[] = array( \"name\" => __('Left Footer Text','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('This will appear on the left side of the footer.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_footer_left\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\n\t// $options[] = array( \"name\" => __('Right Footer Text','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('This will appear on the right side of the footer.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_footer_right\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\n\t// $options[] = array( \"name\" => __('Facebook Likes','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Check this box to display an Facebook likes.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_show_facebook_likes\",\n\t// \t\t\t\t\t\"std\" => \"0\",\n\t// \t\t\t\t\t\"type\" => \"checkbox\");\n\n\n\n\t\n\t// $options[] = array( \"name\" => __('Google Map Address','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter the address to display on your Google Map.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_google_map_address\",\n\t// \t\t\t\t\t\"std\" => \"\",\n\t// \t\t\t\t\t\"type\" => \"textarea\");\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Google Map Height','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Enter a height in pixels for your Google Map.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_google_map_height\",\n\t// \t\t\t\t\t\"std\" => \"350\",\n\t// \t\t\t\t\t\"type\" => \"text\");\t\n\t\t\t\t\t\t\n\t// $options[] = array( \"name\" => __('Google Map Tint Color','poxy'),\n\t// \t\t\t\t\t\"desc\" => __('Select a tint color for your Google Map.','poxy'),\n\t// \t\t\t\t\t\"id\" => \"poxy_google_map_tint\",\n\t// \t\t\t\t\t\"std\" => \"#79d1bb\",\n\t// \t\t\t\t\t\"type\" => \"color\");\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t///////////////////////////////////////\n\t// Social Networks\n\t//////////////////////////////////////\t\n\t\n\t$options[] = array( \"name\" => __('Social','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\t$options[] = array( \"name\" => __('Facebook Likes (Facebook ID)','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter the facebook page ID. Example (https://www.facebook.com/<stong>FACEBOOK_ID</strong>)','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_facebook_page_id\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Social Network Icons','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Check this box to show footer widgets.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_social_icons\",\n\t\t\t\t\t\t\"std\" => \"1\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Facebook','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Facebook URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_facebook_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Twitter','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Twitter URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_twitter_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Tumblr','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Tumblr URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_tumblr_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Google','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Google URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_google_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Linkedin','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Linkedin URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_linkedin_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Pinterest','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Pinterest URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_pinterest_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\t\n\t$options[] = array( \"name\" => __('Vimeo','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Vimeo URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_vimeo_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('YouTube','poxy'),\n\t\t\t\t\t\t\"desc\" => __('YouTube URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_youtube_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Instagram','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Instagram URL.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_instagram_url\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t///////////////////////////////////////\n\t// Typography\n\t//////////////////////////////////////\t\n\t\n\t$options[] = array( \"name\" => __('Typography','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\n\t$options[] = array( \"name\" => __('Paragraph Color','poxy'),\n\t\t\t\t\t\"desc\" => __('Select body text color.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_color_body\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Paragraph Font','poxy'),\n\t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for the body text.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_body_font\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Paragraph Line Height','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Paragraph Line Height (ems)','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_paragraph_line_height\",\n\t\t\t\t\t\t\"std\" => \"1.725\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Paragraph Letter Spacing','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Paragraph letter spacing (ems)','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_paragraph_letter_spacing\",\n\t\t\t\t\t\t\"std\" => \"0.03\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Heading Text Color','poxy'),\n\t\t\t\"desc\" => __('Select heading text color. (h1, h2, h3, h4, h5, h6)','poxy'),\n\t\t\t\"id\" => \"poxy_color_heading\",\n\t\t\t\"std\" => \"\",\n\t\t\t\"type\" => \"color\");\n\n\n\t$options[] = array( \"name\" => __('Heading Font','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for headings.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_heading_font\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\n\t$options[] = array( \"name\" => __('Heading Line Height','poxy'),\n\t\t\t\t\t\"desc\" => __('Heading Line Height (ems)','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_heading_line_height\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"text\");\n\n\t$options[] = array( \"name\" => __('Heading Letter Spacing','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Heading letter spacing (ems)','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_heading_letter_spacing\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\n\n\n\t$options[] = array( \"name\" => __('Heading Weight','poxy'),\n\t\t\t\t\t\"desc\" => __('Heading Font Weight (300, 500, 800, bold, light, normal)','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_heading_weight\",\n\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\"type\" => \"text\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Font for Sub Headings','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for sub headings.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_sub_heading_font\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\n\n\n\n\t$options[] = array( \"name\" => __('Font for Main Menu','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter the name of the <a href=\"http://www.google.com/webfonts\" target=\"_blank\">Google Web Font</a> you want to use for the main menu.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_menu_font\",\n\t\t\t\t\t\t\"std\" => \"\",\n\t\t\t\t\t\t\"type\" => \"text\");\t\n\t\n\n\n\t///////////////////////////////////////\n\t// Development\n\t//////////////////////////////////////\t\n\t$options[] = array( \"name\" => __('Post Types','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\t$options[] = array( \"name\" => __('Events','poxy'),\n\t\t\t\t\t\"desc\" => __('Check to enable events.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_event_post_type\",\n\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('FAQs','poxy'),\n\t\t\t\t\t\"desc\" => __('Check to enable events.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_faq_post_type\",\n\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Testimonials','poxy'),\n\t\t\t\t\t\"desc\" => __('Check to enable testimonials.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_testimonial_post_type\",\n\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Staff','poxy'),\n\t\t\t\t\"desc\" => __('Check to enable staff/team.','poxy'),\n\t\t\t\t\"id\" => \"poxy_staff_post_type\",\n\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Locations','poxy'),\n\t\t\t\t\"desc\" => __('Check to enable Locations.','poxy'),\n\t\t\t\t\"id\" => \"poxy_locations_post_type\",\n\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\"type\" => \"checkbox\");\n\n\n\t///////////////////////////////////////\n\t// Development\n\t//////////////////////////////////////\t\n\t$options[] = array( \"name\" => __('DEV','poxy'),\n\t\t\t\t\t\t\"type\" => \"heading\");\t\n\n\t$options[] = array( \"name\" => __('Wordpress Admin Bar.','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Hide admin bar.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_hide_admin_bar\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('DEV Styles.','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Show DEV Styles.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_dev_styles\",\n\t\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Option Styles.','poxy'),\n\t\t\t\t\t\"desc\" => __('Hide Options Styles.','poxy'),\n\t\t\t\t\t\"id\" => \"poxy_option_styles\",\n\t\t\t\t\t\"std\" => \"0\",\n\t\t\t\t\t\"type\" => \"checkbox\");\n\n\t$options[] = array( \"name\" => __('Placeholder Text Color','poxy'),\n\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\"id\" => \"poxy_placeholder_text_color\",\n\t\t\t\"std\" => \"#666\",\n\t\t\t\"type\" => \"color\");\n\n\t$options[] = array( \"name\" => __('Placeholder Background Color','poxy'),\n\t\t\t\"desc\" => __('','poxy'),\n\t\t\t\"id\" => \"poxy_placeholder_background_color\",\n\t\t\t\"std\" => \"#ccc\",\n\t\t\t\"type\" => \"color\");\n\t\t\t\t\t\t\n\t$options[] = array( \"name\" => __('Placeholder Text','poxy'),\n\t\t\t\t\t\t\"desc\" => __('Enter Placeholder Text.','poxy'),\n\t\t\t\t\t\t\"id\" => \"poxy_placeholder_text\",\n\t\t\t\t\t\t\"std\" => \"\n\t\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae mi gravida, imperdiet nisi non, egestas elit. Vivamus quis dapibus lectus. Aliquam in ornare urna. Donec aliquam eu neque eu facilisis. Fusce venenatis, ipsum at sagittis tincidunt, tellus arcu elementum ipsum, non tincidunt lorem velit ut nisl. Curabitur vulputate metus tortor. Fusce volutpat rutrum nunc, vel luctus lorem egestas eu. Etiam viverra quam in sapien mollis, quis egestas quam gravida. Morbi nec orci vulputate, volutpat magna in, placerat nisl. Vivamus luctus dui id gravida fermentum. Etiam aliquam urna dolor, eget ornare turpis tempus in. Nam id eros eget mi suscipit rutrum.\n\nUt rutrum posuere mauris. Nulla auctor ac leo at rutrum. Ut ultrices, mauris vitae faucibus lacinia, magna magna condimentum felis, non aliquet lorem purus eget leo. Nam id augue quis tortor tristique porttitor in ac turpis. Aliquam ullamcorper nulla id volutpat accumsan. Fusce interdum at magna at condimentum. Etiam vitae dolor faucibus, venenatis dui vitae, vulputate ipsum. Ut at tincidunt felis, at consectetur diam. Nulla consequat sodales fringilla.\n\nPhasellus tristique enim lorem, id vehicula risus egestas id. Quisque suscipit non nunc vitae vestibulum. Morbi porttitor turpis vehicula sollicitudin suscipit. Duis feugiat dapibus risus vel posuere. In placerat mi vel dapibus dictum. Nulla vitae sem lacinia, volutpat orci eget, dapibus dui. Cras sed rhoncus odio. Fusce luctus rutrum est sit amet tristique. Pellentesque tincidunt quam eget condimentum ornare. Vivamus odio sapien, lacinia vitae fermentum vitae, dictum et felis. Morbi vitae urna ultrices, imperdiet quam et, imperdiet augue. Quisque imperdiet elementum diam, a vestibulum nulla rhoncus eget. Ut et interdum turpis, vel euismod justo.\n\nMaecenas molestie sapien at ipsum blandit ultrices nec in dui. Morbi pellentesque pretium felis, at blandit justo lacinia nec. Suspendisse ultrices bibendum tristique. Curabitur adipiscing laoreet risus. Fusce convallis tempor mi quis consequat. In rutrum ligula at augue dictum, nec ultricies massa pretium. Donec molestie condimentum sagittis. Proin auctor laoreet nisi, eu cursus lorem vestibulum eu. Fusce vestibulum arcu a nibh cursus, nec congue mi convallis.\n\t\t\t\t\t\t\",\n\t\t\t\t\t\t\"type\" => \"textarea\",\n\t\t\t\t\t\t\"validate\" => \"none\");\n\n\t\n\t\t// $options[] = array( \"name\" => __('Analytics','poxy'),\n\t\t// \t\t\t\t\"desc\" => __('Enter your custom analytics code. (e.g. Google Analytics).','poxy'),\n\t\t// \t\t\t\t\"id\" => \"poxy_analytics\",\n\t\t// \t\t\t\t\"std\" => \"\",\n\t\t// \t\t\t\t\"type\" => \"textarea\",\n\t\t// \t\t\t\t\"validate\" => \"none\");\t\t\t\n\t\n\t\n\t\t\t\t\t\t\n\t\n\treturn $options;\n}", "static function get_options(){\n\t\t\t\tglobal $gdlr_core_item_pdb;\n\t\t\t\t\n\t\t\t\treturn array(\n\t\t\t\t\t'general' => array(\n\t\t\t\t\t\t'title' => esc_html__('General', 'goodlayers-core'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'content' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Content', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'tinymce',\n\t\t\t\t\t\t\t\t'default' => esc_html__('Blockquote item sample content', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'wrapper-class' => 'gdlr-core-fullsize'\n\t\t\t\t\t\t\t),\t\n\t\t\t\t\t\t\t'author' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('By ( Author )', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'default' => esc_html__('Blockquote Author', 'goodlayers-core'),\n\t\t\t\t\t\t\t),\t\n\t\t\t\t\t\t\t'author-position' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Author Position', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t),\t\t\t\t\t\t\t\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'style' => array(\n\t\t\t\t\t\t'title' => esc_html__('Style', 'goodlayers-core'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'text-align' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Text Align', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'radioimage',\n\t\t\t\t\t\t\t\t'options' => 'text-align',\n\t\t\t\t\t\t\t\t'default' => 'center'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'size' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Size', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'combobox',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'small' => esc_html__('Small', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t\t'medium' => esc_html__('Medium', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t\t'large' => esc_html__('Large', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'default' => 'medium'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'typography' => array(\n\t\t\t\t\t\t'title' => esc_html__('Typography', 'goodlayers-core'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'quote-size' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Quote Size', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'data-input-type' => 'pixel'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'content-size' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Content Size', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'data-input-type' => 'pixel'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'content-font-weight' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Content Font Weight', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'description' => esc_html__('Eg. lighter, bold, normal, 300, 400, 600, 700, 800', 'goodlayers-core')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'content-letter-spacing' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Content Letter Spacing', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'data-input-type' => 'pixel',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'content-text-transform' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Content Text Transform', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'combobox',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'' => esc_html__('None', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t\t'uppercase' => esc_html__('Uppercase', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t\t'lowercase' => esc_html__('Lowercase', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t\t'capitalize' => esc_html__('Capitalize', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'author-size' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Author Size', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'data-input-type' => 'pixel'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'author-font-weight' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Author Font Weight', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'description' => esc_html__('Eg. lighter, bold, normal, 300, 400, 600, 700, 800', 'goodlayers-core')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'position-size' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Position Size', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'data-input-type' => 'pixel'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'position-font-weight' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Position Font Weight', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'description' => esc_html__('Eg. lighter, bold, normal, 300, 400, 600, 700, 800', 'goodlayers-core')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'spacing' => array(\n\t\t\t\t\t\t'title' => esc_html__('Spacing', 'goodlayers-core'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'padding-bottom' => array(\n\t\t\t\t\t\t\t\t'title' => esc_html__('Padding Bottom', 'goodlayers-core'),\n\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t'data-input-type' => 'pixel',\n\t\t\t\t\t\t\t\t'default' => $gdlr_core_item_pdb\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}", "public function options() {\n if (isset($this->section_name)):\n $cp_layout = Customizer_Settings::add_section($this->section_id, $this->section_name, 'Manage theme(s) layout content', 100);\n else :\n $cp_layout = $this->section_id;\n endif;\n\n\n /**\n * create fields from options\n */\n if (!is_array($this->options))\n return;\n foreach ($this->options as $id => $name) {\n\n /** add selections control for post(s) * */\n Customizer_Settings::add_option($cp_layout, $id, $name, '')\n ->set_control_args(array('post_type' => $this->post_type))\n ->customizer('post_selections');\n }\n }" ]
[ "0.6602101", "0.64908177", "0.6480729", "0.6430274", "0.6430274", "0.64012945", "0.6296358", "0.628097", "0.6254816", "0.6252824", "0.61797225", "0.6175753", "0.6169782", "0.6154287", "0.6084066", "0.6080339", "0.6074368", "0.606007", "0.60386944", "0.6032129", "0.6025088", "0.601621", "0.6002497", "0.5997351", "0.59971076", "0.59922326", "0.59767777", "0.59753126", "0.5975198", "0.5971028" ]
0.6946492
0
convert a date into a string that tells how long ago that date was.... eg: 2 days ago, 3 minutes ago.
public function ago($date) { $c = getdate(); $p = array('year', 'mon', 'mday', 'hours', 'minutes', 'seconds'); $display = array('år', 'måneder', 'dage', 'timer', 'minutter', 'sekunder'); $factor = array(0, 12, 30, 24, 60, 60); $d = $this->datetoarr($date); for ($w = 0; $w < 6; $w++) { if ($w > 0) { $c[$p[$w]] += $c[$p[$w-1]] * $factor[$w]; $d[$p[$w]] += $d[$p[$w-1]] * $factor[$w]; } if ($c[$p[$w]] - $d[$p[$w]] > 1) { return ($c[$p[$w]] - $d[$p[$w]]).' '.$display[$w].' siden'; } } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tdd_how_long_ago( $the_date, $d ) {\n\t$the_date = strtotime( $the_date );\n\t$difference = time() - $the_date;\n\n\tif ( $difference >= 60 * 60 * 24 * 365 ) { // if more than a year ago\n\t\t//if more than a year, display the date according to date format.\n\t\t$r = date( get_option( 'date_format' ), $the_date );\n\t\t//\t$int = intval($difference / (60*60*24*365));\n\t\t//\t$s = ($int > 1) ? 's' : '';\n\t\t//\t$r = $int . ' year' . $s . ' ago';\n\t} elseif ( $difference >= 60 * 60 * 24 * 7 * 5 ) { // if more than five weeks ago\n\t\t$int = intval( $difference / ( 60 * 60 * 24 * 30 ) );\n\t\t$s = ( $int > 1 ) ? 's' : '';\n\t\t$r = $int . ' month' . $s . ' ago';\n\t} elseif ( $difference >= 60 * 60 * 24 * 7 ) { // if more than a week ago\n\t\t$int = intval( $difference / ( 60 * 60 * 24 * 7 ) );\n\t\t$s = ( $int > 1 ) ? 's' : '';\n\t\t$r = $int . ' week' . $s . ' ago';\n\t} elseif ( $difference >= 60 * 60 * 24 ) { // if more than a day ago\n\t\t$int = intval( $difference / ( 60 * 60 * 24 ) );\n\t\t$s = ( $int > 1 ) ? 's' : '';\n\t\t$r = $int . ' day' . $s . ' ago';\n\t} elseif ( $difference >= 60 * 60 ) { // if more than an hour ago\n\t\t$int = intval( $difference / ( 60 * 60 ) );\n\t\t$s = ( $int > 1 ) ? 's' : '';\n\t\t$r = $int . ' hour' . $s . ' ago';\n\t} elseif ( $difference >= 60 ) { // if more than a minute ago\n\t\t$int = intval( $difference / ( 60 ) );\n\t\t$s = ( $int > 1 ) ? 's' : '';\n\t\t$r = $int . ' minute' . $s . ' ago';\n\t} else { // if less than a minute ago\n\t\t$r = 'moments ago';\n\t}\n\n\treturn $r;\n}", "function timeAgo($date)\n{\n date_default_timezone_set('Europe/Stockholm');\n $timeAgo = strtotime($date);\n $currentTime = time();\n $timeDifference = $currentTime - $timeAgo;\n $seconds = $timeDifference;\n\n $minutes = round($seconds / 60); // value 60 is seconds\n $hours = round($seconds / 3600); //value 3600 is 60 minutes * 60 sec\n $days = round($seconds / 86400); //86400 = 24 * 60 * 60;\n $weeks = round($seconds / 604800); // 7*24*60*60;\n $months = round($seconds / 2629440); //((365+365+365+365+366)/5/12)*24*60*60\n $years = round($seconds / 31553280); //(365+365+365+365+366)/5 * 24 * 60 * 60\n\n if ($seconds <= 60) {\n return 'Just now';\n } elseif ($minutes <= 60) {\n if ($minutes === 1) {\n return 'one minute ago';\n } else {\n return \"$minutes minutes ago\";\n }\n } elseif ($hours <= 24) {\n if ($hours === 1) {\n return 'an hour ago';\n } else {\n return \"$hours hours ago\";\n }\n } elseif ($days <= 7) {\n if ($days === 1) {\n return 'yesterday';\n } else {\n return \"$days days ago\";\n }\n } elseif ($weeks <= 4.3) {\n if ($weeks === 1) {\n return 'a week ago';\n } else {\n return \"$weeks weeks ago\";\n }\n } elseif ($months <= 12) {\n if ($months === 1) {\n return 'a month ago';\n } else {\n return \"$months months ago\";\n }\n } else {\n if ($years === 1) {\n return 'one year ago';\n } else {\n return \"$years years ago\";\n }\n }\n}", "function time_ago($date) {\n if (empty($date)) {\n return \"No date provided\";\n }\n $periods = array(\"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"year\", \"decade\");\n $lengths = array(\"60\", \"60\", \"24\", \"7\", \"4.35\", \"12\", \"10\");\n $now = time();\n $unix_date = strtotime($date);\n // check validity of date\n if (empty($unix_date)) {\n return \"Bad date\";\n }\n // is it future date or past date\n if ($now > $unix_date) {\n $difference = $now - $unix_date;\n $tense = \"ago\";\n } else {\n $difference = $unix_date - $now;\n $tense = \"from now\";\n }\n for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths) - 1; $j++) {\n $difference /= $lengths[$j];\n }\n $difference = round($difference);\n if ($difference != 1) {\n $periods[$j].= \"s\";\n }\n return \"$difference $periods[$j] {$tense}\";\n}", "public function ago(DateTime $date)\n {\n $secondsDelta = time() - $date->getTimestamp();\n if ($secondsDelta === 0) {\n return 'just now';\n }\n\n $format = $secondsDelta < 0 ? 'in %s' : '%s ago';\n\n $tokens = array (\n 31536000 => 'year',\n 2592000 => 'month',\n 604800 => 'week',\n 86400 => 'day',\n 3600 => 'hour',\n 60 => 'minute',\n 1 => 'second',\n );\n\n $secondsDelta = abs($secondsDelta);\n foreach ($tokens as $unit => $text) {\n if ($secondsDelta < $unit) {\n continue;\n }\n $numberOfUnits = floor($secondsDelta / $unit);\n $inWords = $numberOfUnits . ' ' . $text . (($numberOfUnits > 1) ? 's' : '');\n break;\n }\n\n return sprintf($format, $inWords);\n }", "function display_date($date)\n{\n\tif(is_numeric($date))\n\t{\n\t\t$diff = time() - $date;\n\n\t\t$min = $diff / 60;\n\t\t$hrs = $min / 60;\n\t\tif($hrs >= 1)\n\t\t{\n\t\t\t$days = $hrs / 24;\n\t\t\tif($days >= 1)\n\t\t\t{\n\t\t\t\treturn round($days) . \" days ago\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn round($hrs) . \" hours ago\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn round($min) . \" minutes ago\";\n\t\t}\n\t}\n\n\telse\n\t{\n\t\treturn $date;\n\t}\n}", "function how_long_ago( $date ) {\n $current = time();\n $difference = $current - $date;\n\n if ( strtotime( '-1 min', $current ) < $date)\n $output = 'less than a minute ago';\n elseif ( strtotime( '-1 hour', $current ) < $date )\n $output = ( floor($difference / 60 ) == 1 ) ? '1 minute ago' : floor( $difference / 60 ) . ' minutes ago';\n elseif ( strtotime( '-1 day', $current ) < $date )\n $output = ( floor( $difference / 60 / 60 ) == 1 ) ? 'about 1 hour ago' : 'about ' . floor( $difference / 60 / 60 ) . ' hours ago';\n else\n $output = date( get_option('date_format') . ' ' . get_option( 'time_format' ), ( $date + ( get_option('gmt_offset') * 3600 ) ) );\n\n return $output;\n }", "function time_Ago($time) {\n // time and given timestamp in seconds \n $diff = time() - $time; \n \n // Time difference in seconds \n $sec = $diff; \n \n // Convert time difference in minutes \n $min = round($diff / 60 ); \n \n // Convert time difference in hours \n $hrs = round($diff / 3600); \n \n // Convert time difference in days \n $days = round($diff / 86400 ); \n \n // Convert time difference in weeks \n $weeks = round($diff / 604800); \n \n // Convert time difference in months \n $mnths = round($diff / 2600640 ); \n \n // Convert time difference in years \n $yrs = round($diff / 31207680 ); \n \n // Check for seconds \n if($sec <= 60) { \n return \"$sec seconds ago\"; \n } \n \n // Check for minutes \n else if($min <= 60) { \n if($min==1) { \n return \"one minute ago\"; \n } \n else { \n return \"$min minutes ago\"; \n } \n } \n \n // Check for hours \n else if($hrs <= 24) { \n if($hrs == 1) { \n return \"an hour ago\"; \n } \n else { \n return \"$hrs hours ago\"; \n } \n } \n \n // Check for days \n else if($days <= 7) { \n if($days == 1) { \n return \"Yesterday\"; \n } \n else { \n return \"$days days ago\"; \n } \n } \n \n // Check for weeks \n else if($weeks <= 4.3) { \n if($weeks == 1) { \n return \"a week ago\"; \n } \n else { \n return \"$weeks weeks ago\"; \n } \n } \n \n // Check for months \n else if($mnths <= 12) { \n if($mnths == 1) { \n return \"a month ago\"; \n } \n else { \n return \"$mnths months ago\"; \n } \n } \n \n // Check for years \n else { \n if($yrs == 1) { \n return \"one year ago\"; \n } \n else { \n return \"$yrs years ago\"; \n } \n } \n}", "function getHowLongAgo($date, $display = array('Year', 'Month', 'Day', 'Hour', 'Minute', 'Second'), $ago = 'Ago') {\n $date = getdate(strtotime($date));\n $current = getdate();\n $p = array('year', 'mon', 'mday', 'hours', 'minutes', 'seconds');\n $factor = array(0, 12, 30, 24, 60, 60);\n\n for ($i = 0; $i < 6; $i++) {\n if ($i > 0) {\n $current[$p[$i]] += $current[$p[$i - 1]] * $factor[$i];\n $date[$p[$i]] += $date[$p[$i - 1]] * $factor[$i];\n }\n if ($current[$p[$i]] - $date[$p[$i]] > 1) {\n $value = $current[$p[$i]] - $date[$p[$i]];\n return $value . ' ' . $display[$i] . (($value != 1) ? 's' : '') . ' ' . $ago;\n }\n }\n\n return '';\n }", "public function timeago($date) {\n $timestamp = strtotime($date); \n $strTime = array(\"sec\", \"min\", \"hr\", \"day\", \"month\", \"year\");\n $length = array(\"60\",\"60\",\"24\",\"30\",\"12\",\"10\");\n $currentnewTime = date('Y-m-d H:i:s');\n $currentTime = strtotime($currentnewTime);\n if($currentTime >= $timestamp) {\n $diff = $currentTime- $timestamp;\n for($i = 0; $diff >= $length[$i] && $i < count($length)-1; $i++) {\n $diff = $diff / $length[$i];\n }\n $diff = round($diff);\n return $diff . \" \" . $strTime[$i] . \"s \";\n }\n }", "function ago($datefrom,$dateto=-1)\n {\n // its an error rather than the epoch\n \n if($datefrom==0) { return \"A long time ago\"; }\n if($dateto==-1) { $dateto = time(); }\n \n // Make the entered date into Unix timestamp from MySQL datetime field\n\n $datefrom = strtotime($datefrom);\n \n // Calculate the difference in seconds betweeen\n // the two timestamps\n\n $difference = $dateto - $datefrom;\n\n // Based on the interval, determine the\n // number of units between the two dates\n // From this point on, you would be hard\n // pushed telling the difference between\n // this function and DateDiff. If the $datediff\n // returned is 1, be sure to return the singular\n // of the unit, e.g. 'day' rather 'days'\n \n switch(true)\n {\n // If difference is less than 60 seconds,\n // seconds is a good interval of choice\n case(strtotime('-1 min', $dateto) < $datefrom):\n $datediff = $difference;\n $res = ($datediff==1) ? $datediff.' second ago' : $datediff.' seconds ago';\n break;\n // If difference is between 60 seconds and\n // 60 minutes, minutes is a good interval\n case(strtotime('-1 hour', $dateto) < $datefrom):\n $datediff = floor($difference / 60);\n $res = ($datediff==1) ? $datediff.' minute ago' : $datediff.' minutes ago';\n break;\n // If difference is between 1 hour and 24 hours\n // hours is a good interval\n case(strtotime('-1 day', $dateto) < $datefrom):\n $datediff = floor($difference / 60 / 60);\n $res = ($datediff==1) ? $datediff.' hour ago' : $datediff.' hours ago';\n break;\n // If difference is between 1 day and 7 days\n // days is a good interval \n case(strtotime('-1 week', $dateto) < $datefrom):\n $day_difference = 1;\n while (strtotime('-'.$day_difference.' day', $dateto) >= $datefrom)\n {\n $day_difference++;\n }\n \n $datediff = $day_difference;\n $res = ($datediff==1) ? 'yesterday' : $datediff.' days ago';\n break;\n // If difference is between 1 week and 30 days\n // weeks is a good interval \n case(strtotime('-1 month', $dateto) < $datefrom):\n $week_difference = 1;\n while (strtotime('-'.$week_difference.' week', $dateto) >= $datefrom)\n {\n $week_difference++;\n }\n \n $datediff = $week_difference;\n $res = ($datediff==1) ? 'last week' : $datediff.' weeks ago';\n break; \n // If difference is between 30 days and 365 days\n // months is a good interval, again, the same thing\n // applies, if the 29th February happens to exist\n // between your 2 dates, the function will return\n // the 'incorrect' value for a day\n case(strtotime('-1 year', $dateto) < $datefrom):\n $months_difference = 1;\n while (strtotime('-'.$months_difference.' month', $dateto) >= $datefrom)\n {\n $months_difference++;\n }\n \n $datediff = $months_difference;\n $res = ($datediff==1) ? $datediff.' month ago' : $datediff.' months ago';\n\n break;\n // If difference is greater than or equal to 365\n // days, return year. This will be incorrect if\n // for example, you call the function on the 28th April\n // 2008 passing in 29th April 2007. It will return\n // 1 year ago when in actual fact (yawn!) not quite\n // a year has gone by\n case(strtotime('-1 year', $dateto) >= $datefrom):\n $year_difference = 1;\n while (strtotime('-'.$year_difference.' year', $dateto) >= $datefrom)\n {\n $year_difference++;\n }\n \n $datediff = $year_difference;\n $res = ($datediff==1) ? $datediff.' year ago' : $datediff.' years ago';\n break;\n \n }\n return $res;\n }", "function ago($time)\n {\n $periods = array(\"second\", \"minute\", \"hour\", \"day\", \"week\", \"month\", \"year\", \"decade\");\n $lengths = array(\"60\",\"60\",\"24\",\"7\",\"4.35\",\"12\",\"10\");\n\n $now = time();\n\n $difference = $now - $time;\n $tense = \"ago\";\n\n for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {\n $difference /= $lengths[$j];\n }\n\n $difference = round($difference);\n\n if($difference != 1) {\n $periods[$j].= \"s\";\n }\n\n return \"$difference $periods[$j] 'ago' \";\n }", "function ago_string($time_array) {\n\tif (@$time_array['days'] > 0) {\n\t\t$res = (int)$time_array['days'].(1 == (int)$time_array['days'] ? ' day' : ' days');\n\t} elseif ($time_array['hours'] > 0) {\n\t\t$res = (int)$time_array['hours'].(1 == (int)$time_array['hours'] ? ' hour' : ' hours');\n\t} else {\n\t\t$res = (int)$time_array['minutes'].(1 == (int)$time_array['minutes'] ? ' minute' : ' minutes');\n\t}\n\n\treturn '('.$res.' ago)';\n}", "public static function timespan($date = null, $old_dates_format = '\\o\\n F jS, Y')\n {\n if (empty($date))\n return 'just now';\n elseif (! is_int($date))\n $date = strtotime($date);\n \n // get the time difference...\n $time = time() - $date;\n \n // ...and seperate it in minutes, hours, etc.\n $minutes = floor($time / 60);\n $hours = floor($minutes / 60);\n $days = floor($hours / 24);\n $weeks = floor($days / 7);\n $months = floor($weeks / 4);\n \n $nice_time = '';\n \n if ($time < 60)\n {\n $nice_time = 'just now';\n }\n elseif ($minutes < 60)\n {\n $nice_time .= ($minutes == 1) ? 'a minute ago' : $minutes . ' minutes ago';\n }\n elseif ($hours < 24)\n {\n $nice_time .= ($hours == 1) ? 'an hour ago' : $hours . ' hours ago';\n }\n elseif ($days < 7)\n {\n $nice_time .= ($days) == 1 ? '1 day ago' : $days . ' days ago';\n }\n elseif ($weeks < 5)\n {\n $nice_time .= ($weeks == 1) ? '1 week ago' : $weeks . ' weeks ago';\n }\n elseif ($months < 12)\n {\n $nice_time .= ($months == 1) ? '1 month ago' : $months .' months ago';\n }\n else\n {\n $nice_time = date($old_dates_format, $date);\n }\n \n return $nice_time;\n }", "public static function timeAgo($time) {\n\t\t// Is this a unix timestamp or a MySQL datetime?\n\t\tif (strpos($time, ':') !== false) {\n\t\t\t// Seems to be a MySQL datetime\n\t\t\t// Convert to a unix timestamp\n\t\t\t$time = Core_Date::datetimeToTimestamp($time);\n\t\t}\n\n\t\t// Get the language\n\t\t$lang = Core_Language::getLanguage();\n\n\t\t// Work out the difference in seconds this happened\n\t\t$difference = $_SERVER['REQUEST_TIME'] - $time;\n\n\t\t// Less than one minute ago?\n\t\tif ($difference < 60) {\n\t\t\treturn 'Just now';\n\t\t}\n\n\t\t// Less than one hour ago?\n\t\telse if ($difference < 3600) {\n\t\t\treturn floor($difference / 60) . ' ' . $lang['date-minutes-ago'];\n\t\t}\n\n\t\t// Less than one day ago?\n\t\telse if ($difference < 86400) {\n\t\t\treturn floor($difference / 3600) . ' ' . $lang['date-hours-ago'];\n\t\t}\n\n\t\t// Less than one week?\n\t\telse if ($difference < 604800) {\n\t\t\treturn floor($difference / 86400) . ' ' . $lang['date-days-ago'];\n\t\t}\n\n\t\t// Less than one month ago?\n\t\telse if ($difference < 2419300) {\n\t\t\treturn floor($difference / 604800) . ' ' . $lang['date-weeks-ago'];\n\t\t}\n\n\t\t// Less than one year ago?\n\t\telse if ($difference < 31536000) {\n\t\t\treturn floor($difference / 2419300) . ' ' . $lang['date-months-ago'];\n\t\t}\n\n\t\t// Looks like it was years ago\n\t\telse {\n\t\t\treturn floor($difference / 31536000) . ' ' . $lang['date-years-ago'];\n\t\t}\n\t}", "public static function timeAgo($time_ago) {\n $time_ago = strtotime($time_ago);\n $cur_time = time();\n $time_elapsed = $cur_time - $time_ago;\n $seconds = $time_elapsed;\n $minutes = round($time_elapsed / 60);\n $hours = round($time_elapsed / 3600);\n $days = round($time_elapsed / 86400);\n $weeks = round($time_elapsed / 604800);\n $months = round($time_elapsed / 2600640);\n $years = round($time_elapsed / 31207680);\n // Seconds\n if ($seconds <= 60) {\n return \"just now\";\n }\n //Minutes\n else if ($minutes <= 60) {\n if ($minutes == 1) {\n return \"one minute ago\";\n } else {\n return \"$minutes minutes ago\";\n }\n }\n //Hours\n else if ($hours <= 24) {\n if ($hours == 1) {\n return \"an hour ago\";\n } else {\n return \"$hours hrs ago\";\n }\n }\n //Days\n else if ($days <= 7) {\n if ($days == 1) {\n return \"yesterday\";\n } else {\n return \"$days days ago\";\n }\n }\n //Weeks\n else if ($weeks <= 4.3) {\n if ($weeks == 1) {\n return \"a week ago\";\n } else {\n return \"$weeks weeks ago\";\n }\n }\n //Months\n else if ($months <= 12) {\n if ($months == 1) {\n return \"a month ago\";\n } else {\n return \"$months months ago\";\n }\n }\n //Years\n else {\n if ($years == 1) {\n return \"one year ago\";\n } else {\n return \"$years years ago\";\n }\n }\n }", "function _ftimeAgo($time, $format = 'M j Y'){\n\t\t$now = time();\n\t\tif(!is_numeric($time)) $time = strtotime($time);\n\n\t\t$secElapsed = $now - $time;\n\t\tif($secElapsed <= 60){\n\t\t\treturn _t('just now');\n\t\t}\n\t\telseif($secElapsed <= 3540){\n\t\t\t$min = $now - $time;\n\t\t\t$min = round($min/60);\n\t\t\treturn _t('%d minutes ago', $min);\n\t\t}\n\t\telseif($secElapsed <= 3660 ){\n\t\t\treturn _t('1 hour ago');\n\t\t}\n\t\telseif(date('j-n-y', $now) == date('j-n-y', $time)){\n\t\t\treturn date(\"g:i a\", $time);\n\t\t}\n\t\telseif(date('j-n-y', mktime(0, 0, 0, date('n', $now),date('j', $now)-1, date('Y', $now))) == date('j-n-y',$time)){\n\t\t\treturn _t('yesterday');\n\t\t}\n\t\telseif($secElapsed <= 345600 ){\n\t\t\treturn date('l', $time);\n\t\t}\n\t\telse{\n\t\t\treturn date($format, $time);\n\t\t}\n\t}", "function humanDate($date) {\n \n $time = time() - $date; // to get the time since that moment\n $time = ($time < 1) ? 1 : $time;\n $tokens = array (\n //31536000 => 'year',\n //2592000 => 'month',\n //604800 => 'week',\n 86400 => 'day',\n 3600 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n \n if ($time > (2592000*2)) { // over 2 months\n return date('M \\'y', $date);\n }\n elseif ($time > 2592000) { // over 1 month\n return date('M j', $date);\n }\n elseif ($time > (604800*2)) { // over 2 weeks\n return date('M j', $date);\n }\n elseif ($time < 60) { // under 60 seconds\n return 'just now';\n }\n else {\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits . ' ' . $text . (($numberOfUnits > 1) ? 's' : '') . ' ago';\n }\n }\n}", "public function timediff($date1) \n {\n\n\t\t$date2 = time();\n\t\t$diff = abs($date2 - $date1);\n\t\t$years = floor($diff / (365 * 60 * 60 * 24));\n\t\t$months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24));\n\t\t$days = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24));\n\t\t$hours = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24) / (60 * 60));\n\t\t$minuts = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24 - $hours * 60 * 60) / 60);\n\t\t$seconds = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24 - $hours * 60 * 60 - $minuts * 60));\n\n if ($diff < 60)\n return 'Just now';\n if ($diff < 3600)\n return $minuts . \" min ago\";\n if ($diff < 86400)\n return ($hours > 1) ? $hours .\" hrs ago\" : $hours .\" hr ago\";\n if ($diff < 604800)\n return ($days > 1) ? $days . \" days ago\" : $days . \" day ago\";\n if($diff< 2592000) \n return FLOOR($diff / 604800).\" week ago\";\n if ($diff < 31536000)\n return ($months > 1) ? $months . \" months ago\" : $months . \" month ago\";\n else\n return ($years > 1) ? $years . \" yrs ago\" : $years . \" yr ago\" ;\n }", "function time_ago($timestamp){\n\n $time_ago = strtotime($timestamp);\n $current_time = time();\n $time_difference = $current_time - $time_ago;\n $seconds = $time_difference;\n $minutes = round($seconds / 60 ); // Value 60 is seconds\n $hours = round($seconds / 3600); // Value 3600 is 60 minutes * 60 seconds\n $days = round($seconds / 86400); // Value 86400 is 24 hours * 60 minutes * 60 seconds\n $weeks = round($seconds / 604800); // Value 604800 is 7 days * 24 hours * 60 minutes * 60 seconds\n $month = round($seconds / 2629440); // Value 2629440 is ((365 + 365 + 365 + 365 + 266) / 5 / 12) * 24 hours * 60 minutes * 60 seconds\n $years = round($seconds / 31553280); // Value 31553280 is (365 + 365 + 365 + 365 + 266) / 5 * 24 hours * 60 minutes * 60 seconds\n\n if ($seconds <= 60){\n\n return 'Just Now';\n\n } elseif ($minutes <= 60){\n\n if ($minutes == 1){\n return 'one minute ago';\n } else{\n return $minutes . 'minutes ago';\n }\n\n } elseif ($hours <= 24){\n\n if ($hours == 1){\n return 'one hour ago';\n } else {\n return 'about ' . $hours . ' hours ago';\n }\n\n } elseif ($days <= 7){\n if ($days == 1){\n return 'one day ago';\n } else {\n return 'about ' . $days . ' days ago';\n }\n } elseif ($weeks <= 4.3) {\n if ($weeks == 1){\n return 'a week ago';\n } else {\n return 'about ' .$weeks . ' weeks ago';\n }\n } elseif ($month <= 12){\n if ($month == 1){\n return 'about month ago';\n } else{\n return 'about ' . $month . ' months ago';\n }\n } else {\n if ($years == 1){\n return 'one year ago';\n } else {\n return 'about ' . $years . ' years ago';\n }\n }\n }", "function timeAgo($date,$granularity=2) {\n \n $date = strtotime($date);\n $difference = time() - $date;\n \n $periods = array('decade' => 315360000,\n 'year' => 31536000,\n 'month' => 2628000,\n 'week' => 604800, \n 'day' => 86400,\n 'hour' => 3600,\n 'minute' => 60,\n 'second' => 1\n );\n\n $retval = \"\";\n foreach($periods as $key => $value) {\n \n if($difference >= $value) {\n $time = floor($difference/$value);\n $difference %= $value;\n \n $retval .= ($retval ? ' ' : '').$time.' ';\n $retval .= (($time > 1) ? $key.'s' : $key);\n $granularity--;\n }\n \n if($granularity == '0') { \n break; \n }\n }\n \n return ' posted '.$retval.' ago'; \n }", "public static function ago($time)\n {\n $periods = ['second', 'minute', 'hour', 'day', 'week', 'month', 'year', 'decade'];\n $lengths = ['60', '60', '24', '7', '4.35', '12', '10'];\n\n $now = time();\n\n $difference = $now - strtotime($time);\n $tense = 'ago';\n\n for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths) - 1; $j++) {\n $difference /= $lengths[$j];\n }\n\n $difference = round($difference);\n\n if ($difference != 1) {\n $periods[$j] .= 's';\n }\n\n return \"$difference $periods[$j] ago \";\n }", "function time_ago($time_in){\n\t\t$time_in = is_numeric($time_in) ? $time_in : strtotime($time_in) ; \n\t\t$m = time()-$time_in; $o='just now';\n\t\t$t = array('year'=>31556926,'month'=>2629744,'week'=>604800,'day'=>86400,'hour'=>3600,'minute'=>60,'second'=>1);\n\t\tforeach($t as $u=>$s){\n\t\t\tif($s<=$m){$v=floor($m/$s); $o=\"$v $u\".($v==1?'':'s').' ago'; break;}\n\t\t}\n\t\treturn $o;\n\t}", "static public function ago($timestamp){\n\t\t\n\t\t$difference = time() - $timestamp;\n\t\t$periods = array( 'second', 'minute', 'hour', 'day', 'week', 'month', 'year' );\n\t\t$lengths = array( '60', '60', '24', '7', '4.35', '12', '100' );\n\t\t\n\t\tfor( $j = 0; $difference >= $lengths[$j]; $j++ )\n\t\t\t$difference /= $lengths[$j];\n\t\t\n\t\t$difference = round($difference);\n\t\tif($difference != 1) $periods[$j].= \"s\";\n\t\t\t$text = $difference.' '.__($periods[$j]).' '.__('ago');\n\t\t\n\t\treturn $text;\n\t\t\n\t}", "function time_since($time, $showdate = TRUE) {\n\t$secs = array(\n\t\tarray(31536000, 'year'),\n\t\tarray(2592000, 'month'),\n\t\tarray(604800, 'week'),\n\t\tarray(86400, 'day'),\n\t\tarray(3600, 'hour'),\n\t\tarray(60, 'minute'),\n\t);\n\n\t$since = NOW-$time;\n\t$str = '';\n\n\tif ($showdate === TRUE && $since > 604800) {\n\t\t$str = date('F jS', $time);\n\t\tif ($since > 31536000) $str .= ', '.date('Y', $time);\n\n\t\treturn $str;\n\t}\n\n\tfor ($i = 3; $i < 6; ++$i) {\n\t\t$name = $secs[$i][1];\n\t\t$num = (int) floor($since/$secs[$i][0]);\n\n\t\tif ($num !== 0) break;\n\t}\n\n\treturn $num.' '.$name.($num === 1 ? '' : 's').' ago';\n}", "function ago($time) // dit is ene functie die na gaat hoeveel tijd het geleden is\n{\n $periods = array(\"seconden\", \"minuten\", \"uren\", \"dagen\", \"weken\", \"maanden\", \"jaren\", \"decenium\"); // dit zijn de verschillende tijdsoorten\n $lengths = array(\"60\",\"60\",\"24\",\"7\",\"4.35\",\"12\",\"10\"); // hiet mee wordt bepaald hoe lang iets duurt je moet het lezen als een minuut duurt 60 seconden, een uur duurt 60 minuten, enz.\n $now = time(); // hiet wordt gekeken hoelaat het nu is\n $difference = $now - $time; // hiet wordt gekeken hoeveel seconden het verschil\n $tense = \"geleden\"; // dit is de tag die er achter moet, dus bijvoorbeeld 10 minuten \"geleden\"\n // met deze loop wordt bepaald welke van de 8 tijdsoorten er moet staan.\n for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {\n $difference /= $lengths[$j];\n }\n $difference = round($difference);\n return \"$difference $periods[$j] geleden\";\n \n}", "function time_ago($time_ago)\r\n{\r\n $time_ago = strtotime($time_ago);\r\n $cur_time = time();\r\n $time_elapsed = $cur_time - $time_ago;\r\n $seconds = $time_elapsed;\r\n $minutes = round($time_elapsed / 60);\r\n $hours = round($time_elapsed / 3600);\r\n $days = round($time_elapsed / 86400);\r\n $weeks = round($time_elapsed / 604800);\r\n $months = round($time_elapsed / 2600640);\r\n $years = round($time_elapsed / 31207680);\r\n // Seconds\r\n if ($seconds <= 60) {\r\n return _l('time_ago_just_now');\r\n }\r\n //Minutes\r\n else if ($minutes <= 60) {\r\n if ($minutes == 1) {\r\n return _l('time_ago_minute');\r\n } else {\r\n return _l('time_ago_minutes', $minutes);\r\n }\r\n }\r\n //Hours\r\n else if ($hours <= 24) {\r\n if ($hours == 1) {\r\n return _l('time_ago_hour');\r\n } else {\r\n return _l('time_ago_hours', $hours);\r\n }\r\n }\r\n //Days\r\n else if ($days <= 7) {\r\n if ($days == 1) {\r\n return _l('time_ago_yesterday');\r\n } else {\r\n return _l('time_ago_days', $days);\r\n }\r\n }\r\n //Weeks\r\n else if ($weeks <= 4.3) {\r\n if ($weeks == 1) {\r\n return _l('time_ago_week');\r\n } else {\r\n return _l('time_ago_weeks', $weeks);\r\n }\r\n }\r\n //Months\r\n else if ($months <= 12) {\r\n if ($months == 1) {\r\n return _l('time_ago_month');\r\n } else {\r\n return _l('time_ago_months', $months);\r\n }\r\n }\r\n //Years\r\n else {\r\n if ($years == 1) {\r\n return _l('time_ago_year');\r\n } else {\r\n return _l('time_ago_years', $years);\r\n }\r\n }\r\n}", "function time_ago( $time )\n{\n\t//load assets\n\t$CI = &get_instance();\n\t$CI->lang->load('date');\n\t$CI->load->helper('language');\n\t// get time difference\n\t$ago = time() - $time;\n\t// if one minute ago\n\tif( $ago < 100 )\n\t{\n\t\treturn sprintf(lang('minute_ago'), time_convert($ago, 'minutes'));\n\t}\n\t// minutes ago\n\telseif( $ago > 100 && $ago < 3600)\n\t{\n\t\treturn sprintf(lang('minutes_ago'), time_convert($ago, 'minutes'));\n\t}\n\t// one hour ago\n\telseif( $ago > 3600 && $ago < 7200)\n\t{\n\t\treturn sprintf(lang('hour_ago'), time_convert($ago, 'hours'));\n\t}\n\t// hours ago\n\telseif( $ago > 7200 && $ago < 86000)\n\t{\n\t\treturn sprintf(lang('hours_ago'), time_convert($ago, 'hours'));\n\t}\n\t// one day ago\n\telseif( $ago > 86000 && $ago < 172000)\n\t{\n\t\treturn sprintf(lang('day_ago'), time_convert($ago, 'days'));\n\t}\n\t// days ago\n\telseif( $ago > 170000 && $ago < 2592000)\n\t{\n\t\treturn sprintf(lang('days_ago'), time_convert($ago, 'days'));\n\t}\n\t// one month ago\n\telseif( $ago > 2592000 && $ago < 5184000 )\n\t{\n\t\treturn sprintf(lang('one_month_ago'), time_convert($ago, 'month'));\n\t}\n\t// month ago\n\telseif( $ago > 5184000 && $ago < 31530000 )\n\t{\n\t\treturn sprintf(lang('month_ago'), time_convert($ago, 'month'));\n\t}\n\t// one year ago\n\telseif( $ago > 31530000 && $ago < 63060000 )\n\t{\n\t\treturn sprintf(lang('year_ago'), time_convert($ago, 'years'));\n\t}\n\t// years ago\n\telseif( $ago > 63060000 )\n\t{\n\t\treturn sprintf(lang('years_ago'), time_convert($ago, 'years'));\n\t}\n}", "function get_time_ago($time)\n{\n \n $time_difference = time() - strtotime($time);\n \n $condition = array(\n 60 * 60 => 'час',\n 60 => 'минута',\n 1 => 'секунда'\n );\n \n if ($time_difference < 1) {\n return 'меньше чем 1 секунду назад';\n }\n \n foreach ($condition as $secs => $str) {\n $time_unit = $time_difference / $secs;\n \n if ($time_unit >= 1) {\n $new_time = round($time_unit);\n \n if ($str === 'секунда') {\n $str = get_noun_plural_form($new_time, 'секунда', 'секунды', 'секунд');\n }\n if ($str === 'минута') {\n $str = get_noun_plural_form($new_time, 'минута', 'минуты', 'минут');\n }\n if ($str === 'час') {\n $str = get_noun_plural_form($new_time, 'час', 'часа', 'часов');\n }\n \n if ($time_difference > 60 * 60 * 24) {\n return date_format(date_create($time), \"d.m.y в H:i\");\n }\n \n return $new_time . ' ' . $str . ' назад';\n }\n }\n}", "function ago($tweet_time,$tweet_id,$tweet_name) {\n\t\t\n \t$m = time()-strtotime($tweet_time); $o='just now';\n \t$t = array('year'=>31556926,'month'=>2629744,'week'=>604800,'day'=>86400,'hour'=>3600,'minute'=>60,'second'=>1);\n \tforeach($t as $u=>$s){\n \tif($s<=$m){$v=floor($m/$s); $o='about '.$v.' '.$u.($v==1?'':'s').' ago'; break;}\n \t}\n\treturn '<a href=\"http://twitter.com/'.$tweet_name.'/statuses/'.$tweet_id.'\">('.$o.')</a>';\n\t\n}", "public function createdAgo(\\DateTime $dateTime)\r\n {\r\n $delta = time() - $dateTime->getTimestamp();\r\n if ($delta < 0)\r\n throw new \\InvalidArgumentException(\"createdAgo is unable to handle dates in the future\");\r\n\r\n $duration = \"\";\r\n if ($delta < 60)\r\n {\r\n // Seconds\r\n $time = $delta;\r\n $duration = $time . \" second\" . (($time === 0 || $time > 1) ? \"s\" : \"\") . \" ago\";\r\n }\r\n else if ($delta < 3600)\r\n {\r\n // Mins\r\n $time = floor($delta / 60);\r\n $duration = $time . \" minute\" . (($time > 1) ? \"s\" : \"\") . \" ago\";\r\n }\r\n else if ($delta < 86400)\r\n {\r\n // Hours\r\n $time = floor($delta / 3600);\r\n $duration = $time . \" hour\" . (($time > 1) ? \"s\" : \"\") . \" ago\";\r\n }\r\n else\r\n {\r\n // Days\r\n $time = floor($delta / 86400);\r\n if ($time==1) {\r\n return 'yesterday';\r\n }\r\n $duration = $time . \" day\" . (($time > 1) ? \"s\" : \"\") . \" ago\";\r\n }\r\n\r\n return $duration;\r\n }" ]
[ "0.78786355", "0.765708", "0.76445055", "0.7587637", "0.7577953", "0.7494284", "0.7371653", "0.73450387", "0.7275089", "0.72515357", "0.7232183", "0.7160862", "0.70566005", "0.70101917", "0.6992664", "0.6969654", "0.695453", "0.69330937", "0.6897617", "0.6888681", "0.6838521", "0.67932683", "0.6721034", "0.6715083", "0.6583714", "0.65518355", "0.65510654", "0.65501577", "0.65338385", "0.6484094" ]
0.7680155
1
/ Steps: A. Delete records, from area_time_slots table, with provided area_id B. Save all data
public function updateArea($data) { $this->getDataSource()->begin(); if(!empty($data['AreaTimeSlot'])) { $this->AreaTimeSlot->deleteAll(array('AreaTimeSlot.area_id' => $data['Area']['id'])); } $result = $this->saveAll($data); if($result) { $this->getDataSource()->commit(); return $result; } else { $this->getDataSource()->rollback(); return $result; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete()\n {\n parent::delete();\n\n // when no other times exist, delete the parent record\n $otherTimes = self::findByTrackingId($this->trackingId);\n if (!$otherTimes) {\n $tracking = TimeTrackingModel::findByPk($this->trackingId);\n echo \"<pre>\";\n print_r($tracking->id);\n exit;\n\n $tracking->delete();\n }\n }", "function bkap_remove_time_slot() {\n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif( isset( $_POST['details'] ) ) {\n\t\t\t\t\t$details = explode( \"&\", $_POST['details'] );\n\t\t\t\t\n\t\t\t\t\t$date_delete = $details[2];\n\t\t\t\t\t$date_db = date( 'Y-m-d', strtotime( $date_delete ) );\n\t\t\t\t\t$id_delete = $details[0];\n\t\t\t\t\t$book_details = get_post_meta( $details[1], 'woocommerce_booking_settings', true );\n\t\t\t\t\n\t\t\t\t\tif ( is_array( $book_details[ 'booking_time_settings' ] ) && count( $book_details[ 'booking_time_settings' ] > 0 ) ) {\n \t\t\t\t\tunset( $book_details[ 'booking_time_settings' ][ $date_delete ][ $id_delete ] );\n \t\t\t\t\t\n \t\t\t\t\tif ( count( $book_details[ 'booking_time_settings' ][ $date_delete ] ) == 0 ) {\n \t\t\t\t\t\t\n \t\t\t\t\t unset( $book_details[ 'booking_time_settings' ][ $date_delete ] );\n \t\t\t\t\t\t\n \t\t\t\t\t\tif ( substr( $date_delete, 0, 7 ) == \"booking\" ) {\n \t\t\t\t\t\t\t$book_details[ 'booking_recurring' ][ $date_delete ] = '';\n \t\t\t\t\t\t} elseif ( substr( $date_delete, 0, 7 ) != \"booking\" ) {\n \t\t\t\t\t\t\t$key_date = array_search( $date_delete, $book_details[ 'booking_specific_date' ] );\n \t\t\t\t\t\t\tunset( $book_details[ 'booking_specific_date' ][ $key_date ] );\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tupdate_post_meta( $details[1], 'woocommerce_booking_settings', $book_details );\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif ( substr( $date_delete, 0, 7 ) != \"booking\" ) {\n\t\t\t\t\t\tif ( $details[4] == \"0:00\" ) {\n\t\t\t\t\t\t\t$details[4] = \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t$update_status_query = \"UPDATE `\".$wpdb->prefix.\"booking_history`\n \t\t\t\t\t\t\t\t\t\tSET status = 'inactive'\n \t\t\t\t\t\t\t\t\t\tWHERE post_id = '\".$details[1].\"'\n \t\t\t\t\t\t\t\t\t \tAND start_date = '\".$date_db.\"'\n \t\t\t\t\t\t\t\t\t \tAND from_time = '\".$details[3].\"'\n \t\t\t\t\t\t\t\t\t \tAND to_time = '\".$details[4].\"' \";\n\t\t\t\t\t\n\t\t\t\t\t\t$wpdb->query( $update_status_query );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telseif ( substr( $date_delete, 0, 7 ) == \"booking\" ) {\n\t\t\t\t\t\tif ( $details[4] == \"0:00\" ) {\n\t\t\t\t\t\t\t$details[4] = \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t$update_status_query = \"UPDATE `\".$wpdb->prefix.\"booking_history`\n \t\t\t\t\t\t\t\t\t\tSET status = 'inactive'\n \t\t\t\t\t\t\t\t\t\tWHERE post_id = '\".$details[1].\"'\n \t\t\t\t\t\t\t\t\t\tAND weekday = '\".$date_delete.\"'\n \t\t\t\t\t\t\t\t\t\tAND from_time = '\".$details[3].\"'\n \t\t\t\t\t\t\t\t\t\tAND to_time = '\".$details[4].\"' \";\n\t\t\t\t\t\t$wpdb->query( $update_status_query );\n\t\t\t\t\t\t\n\t\t\t\t\t\t// delete the base record for the recurring weekday\n\t\t\t\t\t\t$delete_base_query = \"DELETE FROM `\".$wpdb->prefix.\"booking_history`\n \t\t\t\t\t\t\t\t\t\tWHERE post_id = '\".$details[1].\"'\n \t\t\t\t\t\t\t\t\t\tAND weekday = '\".$date_delete.\"'\n \t\t\t\t\t\t\t\t\t\t AND start_date = '0000-00-00'\n \t\t\t\t\t\t\t\t\t\tAND from_time = '\".$details[3].\"'\n \t\t\t\t\t\t\t\t\t\tAND to_time = '\".$details[4].\"' \";\n\t\t\t\t\t\t$wpdb->query( $delete_base_query );\n\t\t\t\t\t}\n \t}\t\n\t\t\t}", "public function delete_single_timeslot($id){\n $data= array(\n 'timeid' => $id ,\n );\n $query = $this->db->delete('facultyavailablity',$data);\n return $query; \n //delete from user where userid='$user_id'\n \n }", "function setTimesChangingRoomAfterByArea($diffTrainingStartChangingBeforeTraining, $viewAreaTimeslot, $area, &$changingRoomStartTime, &$changingRoomEndTime){\n foreach ($diffTrainingStartChangingBeforeTraining as $value){\n\n setTimeDiffAfterTraining($value,durationChangingBefore,$viewAreaTimeslot['endTime'] , $changingRoomStartTime, $changingRoomEndTime );\n \n $trainingEntrysByChangingRoom = getTrainingEntrysByChangingRoomAfter($viewAreaTimeslot, $area['labelling'], $changingRoomStartTime, $changingRoomEndTime);\n\n if(arePlacesAvailable($area['maxNumberOfPeople'],$viewAreaTimeslot, $changingRoomStartTime, $changingRoomEndTime, $trainingEntrysByChangingRoom)){\n return true;\n }\n }\n return false;\n array_push($errors, \"Kein Umkleideplatz verfügbar\");\n}", "public static function deleteOldPracticeAreaLocationData($id){\r\n $del = Doctrine_Query::create()\r\n ->delete()\r\n ->from('UserPracticeAreaLocation upal')\r\n ->where('upal.UserId = ?',$id)\r\n ->execute();\r\n }", "function timelinetest_delete_instance($id) {\n global $DB;\n\n $DB->delete_records('timelineoptions', array('timelinetestid'=>$id));\n $DB->delete_records('timelinephases', array('timelinetestid'=> $id));\n $DB->delete_records('timelineattemptlog', array('timelinetestid'=>$id));\n $DB->delete_records('timelinetotalmark', array('timelinetestid'=>$id));\n $DB->delete_records('timelinetest', array('id'=> $id));\n\n return true;\n}", "public function one_time_service_slots_delete() {\n $post_data = $this->input->post();\n $result = $this->Admin_vendor->one_time_service_slots_delete($post_data);\n echo json_encode('success');\n }", "public function eliminarTarea($tareaID){\n }", "public function usage_area_delete() {\n\t\tCheckAdminLoginSession();\n\t\t$id = $this->uri->segment(4);\n\t\t$this->admin_model->dataDelete($this->usage_area,$id);\n\t\t$this->session->set_flashdata('message','Your Vehicle usage area area has been deleted successfully');\n redirect('admin/vehicle/usage-area','refresh');\n\t}", "public function store()\n {\n $data = request()->except('_token');\n\n $seller = $this->sellerRepository->findOneWhere([\n 'customer_id' => auth()->guard('customer')->user()->id\n ]);\n\n $previousData = $this->timeSlotsRepository->findWhere([\n 'marketplace_seller_id' => $seller->id,\n 'is_seller' => 1\n ]);\n\n if (! isset($data['id'])) {\n foreach ($previousData as $previousValue) {\n $previousData->find($previousValue['id'])->update([\n 'status' => 0\n ]);\n }\n\n $insert = [\n 'minimum_time_required' => $data['minimum_time_required'],\n 'is_seller' => 1,\n 'marketplace_seller_id' => $seller->id\n ];\n\n $this->timeSlotsRepository->create($insert);\n\n return redirect()->route('marketplace.timeslot.seller.index');\n }\n\n // delete Value\n if ($previousData->count() > count($data['delivery_day'])) {\n $newId = array_map('intval', $data['id']);\n foreach ($previousData as $value) {\n if (! in_array($value->id, $newId)) {\n\n $value->find($value->id)->update([\n 'status' => 0\n ]);\n }\n }\n }\n\n foreach ($data['id'] as $exisitingValue => $id) {\n\n $result = $this->timeSlotsRepository->findOneWhere(\n ['id' => $id,\n 'marketplace_seller_id' => $seller->id\n ]);\n\n if ($result) {\n\n // conver 24H to 12H\n $startTime = date(\"g:i a\", strtotime(\"{$data['start_time'][$exisitingValue]}\"));\n $endTime = date(\"g:i a\", strtotime(\"{$data['end_time'][$exisitingValue]}\"));\n $result->update([\n 'delivery_day' => $data['delivery_day'][$exisitingValue],\n 'start_time' => strtoupper($startTime),\n 'end_time' => strtoupper($endTime),\n 'time_delivery_quota' => $data['time_delivery_quota'][$exisitingValue],\n 'is_seller' => 1,\n 'marketplace_seller_id' => $seller->id,\n 'minimum_time_required' => $data['minimum_time_required']\n ]);\n }\n }\n\n foreach ($data['delivery_day'] as $key => $value) {\n\n if ( ! in_array($data['id'][$key], array_filter($data['id']))) {\n\n // convert 24H to 12H\n $startTime = date(\"g:i a\", strtotime(\"{$data['start_time'][$key]}\"));\n $endTime = date(\"g:i a\", strtotime(\"{$data['end_time'][$key]}\"));\n $insert = [\n 'delivery_day' => $value,\n 'start_time' => strtoupper($startTime),\n 'end_time' => strtoupper($endTime),\n 'time_delivery_quota' => $data['time_delivery_quota'][$key],\n 'is_seller' => 1,\n 'minimum_time_required' => (int)$data['minimum_time_required'],\n 'marketplace_seller_id' => $seller->id\n ];\n\n $this->timeSlotsRepository->create($insert);\n }\n }\n\n session()->flash('success', trans('delivery-time-slot::app.admin.system.success-message', ['name' => 'TimeSlots']));\n\n return redirect()->route('marketplace.timeslot.seller.index');\n }", "public function delete()\n\t{\n\t\t\\App\\Db::getInstance('admin')->createCommand()\n\t\t\t->delete('s_#__business_hours', ['id' => $this->getId()])\n\t\t\t->execute();\n\t\t\\App\\Cache::clear();\n\t}", "public function delete($area_empresa);", "function afterDelete() {\n\t\t// $this->log($this->data, LOG_DEBUG);\n\t\t$this->Absence->updateAbsencePeriod($this->data[$this->alias]['absence_id']);\n\t}", "public function deleteEloquaSubmittedData();", "function deactivatesOldBudgetActivateNew(){\n global $new_time_line;\n global $budget_id;\n $conn = con();\n $sql=\"UPDATE time_line SET state='deactivated' WHERE state ='active' AND budget_Instance_ID =\".$budget_id;\n deactivateCategoryState();\n\n mysqli_query($conn,$sql);\n $sql = \"INSERT INTO time_line (\".createQueryStringKeys($new_time_line).\") VALUES (\".createQueryStringValues($new_time_line).\")\";\n mysqli_query($conn,$sql);\n //createBreak();\n //var_dump($new_time_line);\n}", "function deleteApartment($id){\r\n\t\tglobal $mysqli,$db_table_prefix; \r\n\t\t$stmt = $mysqli->prepare(\"DELETE FROM \".$db_table_prefix.\"apartments \r\n\t\t\tWHERE apartment_id = ?\");\r\n\r\n\t\t$stmt->bind_param(\"i\", $id);\r\n\t\t$stmt->execute();\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "public function run()\n {\n DB::table('stops')->truncate();\n\n DB::table('stops')->insert(\n [\n 'line_id' => 1,\n 'station_id' => 1,\n ]\n );\n\n DB::table('stops')->insert(\n [\n 'line_id' => 1,\n 'station_id' => 2,\n ]\n );\n DB::table('stops')->insert(\n [\n 'line_id' => 1,\n 'station_id' => 3,\n ]\n );\n DB::table('stops')->insert(\n [\n 'line_id' => 1,\n 'station_id' => 4,\n ]\n );\n\n }", "function hook_actions_delete($aid) {\n db_delete('actions_assignments')\n ->condition('aid', $aid)\n ->execute();\n}", "public function clear_zone_locks( $args='' ) {\n\t\t// normalize the input\n\t\t$args = wp_parse_args( $args, array(\n\t\t\t'event_id' => '',\n\t\t\t'customer_id' => '',\n\t\t) );\n\n\t\t// figure out a complete list of all temporary stati\n\t\t$stati = array();\n\t\tforeach ( $this->area_types as $slug => $type ) {\n\t\t\t$zoner = $type->get_zoner();\n\t\t\tif ( is_object( $zoner ) && ( $tmp = $zoner->get_temp_stati() ) ) {\n\t\t\t\tforeach ( $tmp as $key => $v )\n\t\t\t\t\tif ( $v[1] > 0 )\n\t\t\t\t\t\t$stati[ $v[0] ] = $v[1];\n\t\t\t}\n\t\t}\n\n\t\t// if there are no defined temp states, then bail\n\t\tif ( empty( $stati ) )\n\t\t\treturn;\n\n\t\t$wpdb='';\n // find all the rows to delete first\n // @NOTE - if a lock is associated to an order, never delete it\n $q = 'select * from ' . $wpdb->qsot_event_zone_to_order . ' where order_id = 0 and ';\n\n\t\t// construct the stati part of the query\n\t\t$stati_q = array();\n $queryF = '(state = %s and since < NOW() - INTERVAL %d SECOND)';\n foreach ( $stati as $slug => $interval )\n $stati_q = $this->addFastPrep($stati_q, $wpdb, $queryF, $slug, $interval);\n $q .= '(' . implode( ' or ', $stati_q ) . ')';\n\n\t\t// if the event_id was specified, then use it\n\t\tif ( '' !== $args['event_id'] && null !== $args['event_id'] )\n\t\t\t$q .= $wpdb->prepare( ' and event_id = %d', $args['event_id'] );\n\n\t\t// if the customer_id was specified, then use it\n\t\tif ( '' !== $args['customer_id'] && null !== $args['customer_id'] )\n\t\t\t$q .= $wpdb->prepare( ' and session_customer_id = %s', $args['customer_id'] );\n\n // get all the rows\n $locks = $wpdb->get_results( $q );\n\n // if there are no locks to remove, then skip this item\n if ( empty( $locks ) )\n return;\n\n // tell everyone that the locks are going away\n do_action( 'qsot-removing-zone-locks', $locks, 'deprecated', $args['event_id'], $args['customer_id'], $args );\n\n // delete the locks we said we would delete in the above action.\n // this is done in this manner, because we need to only delete the ones we told others about.\n // technically, if the above action call takes too long, other locks could have expired by the time we get to delete them.\n // thus we need to explicitly delete ONLY the ones we told everyone we were deleting, so that none are removed without the others being notified.\n $q = 'delete from ' . $wpdb->qsot_event_zone_to_order . ' where '; // base query\n $wheres = array(); // holder for queries defining each specific row to delete\n\n // cycle through all the locks we said we would delete\n foreach ( $locks as $lock ) {\n // aggregate a partial where statement, that specifically identifies this row, using all fields for positive id\n $fields = array();\n foreach ( $lock as $k => $v )\n $fields = $this->addFastPrep($fields, $wpdb, $k.' = %s', $v);\n if ( ! empty( $fields ) )\n $wheres[] = implode( ' and ', $fields );\n }\n\n // if we have where statements for at least one row to remove\n if ( ! empty( $wheres ) ) {\n // glue the query together, and run it to delete the rows\n $q .= '(' . implode( ') or (', $wheres ) . ')';\n $wpdb->query( $q );\n }\n\t}", "public function destroy($id)\n {\n //\n $area=area::findOrFail($id);\n $area->Activo='0';\n $area->update();\n return Redirect::to('/areas');\n }", "public function delete($areaid = null) {\n global $DB;\n if ($areaid) {\n $DB->delete_records('search_simpledb_index', array('areaid' => $areaid));\n } else {\n $DB->delete_records('search_simpledb_index');\n }\n }", "function em_gateway_worldpay_booking_timeout(){\n\tglobal $wpdb;\n\t//Get a time from when to delete\n\t$minutes_to_subtract = absint(get_option('em_worldpay_booking_timeout'));\n\tif( $minutes_to_subtract > 0 ){\n\t\t$cut_off_time = date('Y-m-d H:i:s', current_time('timestamp') - ($minutes_to_subtract * 60));\n\t\t//get booking IDs without pending transactions\n\t\t$booking_ids = $wpdb->get_col('SELECT b.booking_id FROM '.EM_BOOKINGS_TABLE.' b LEFT JOIN '.EM_TRANSACTIONS_TABLE.\" t ON t.booking_id=b.booking_id WHERE booking_date < '{$cut_off_time}' AND booking_status=4 AND transaction_id IS NULL\" );\n\t\tif( count($booking_ids) > 0 ){\n\t\t\t//first delete ticket_bookings with expired bookings\n\t\t\t$sql = \"DELETE FROM \".EM_TICKETS_BOOKINGS_TABLE.\" WHERE booking_id IN (\".implode(',',$booking_ids).\");\";\n\t\t\t$wpdb->query($sql);\n\t\t\t//then delete the bookings themselves\n\t\t\t$sql = \"DELETE FROM \".EM_BOOKINGS_TABLE.\" WHERE booking_id IN (\".implode(',',$booking_ids).\");\";\n\t\t\t$wpdb->query($sql);\n\t\t}\n\t}\n}", "function fun_delAreaById($area_id){\n\t\t$this->dbObj->deleteRow(TABLE_AREA, \"area_id\", $area_id);\n\t\treturn true;\n\t}", "function warquest_db_player_mission_delete_all($pid) {\r\n\r\n\t$query = 'delete from player_mission where pid='.$pid; \r\n\t\r\n\treturn warquest_db_query($query);\r\n}", "public function cleanExpiredMissionLocations()\n\t{\n\t\t$criteria=new CDbCriteria;\n\t\t$criteria->condition=\"expire < UNIX_TIMESTAMP()\";\n\t\t$count=MissionLocation::model()->deleteAll($criteria);\n\t}", "public function purgeData()\n {\n $maxIdVisit = $this->getDeleteIdVisitOffset();\n\n // break if no ID was found (nothing to delete for given period)\n if (empty($maxIdVisit)) {\n return;\n }\n\n $logTables = self::getDeleteTableLogTables();\n\n // delete data from log tables\n $where = \"WHERE idvisit <= ?\";\n foreach ($logTables as $logTable) {\n // deleting from log_action must be handled differently, so we do it later\n if ($logTable != Common::prefixTable('log_action')) {\n Db::deleteAllRows($logTable, $where, \"idvisit ASC\", $this->maxRowsToDeletePerQuery, array($maxIdVisit));\n }\n }\n\n // delete unused actions from the log_action table (but only if we can lock tables)\n if (Db::isLockPrivilegeGranted()) {\n $this->purgeUnusedLogActions();\n } else {\n $logMessage = get_class($this) . \": LOCK TABLES privilege not granted; skipping unused actions purge\";\n Log::warning($logMessage);\n }\n\n // optimize table overhead after deletion\n Db::optimizeTables($logTables);\n }", "function setTimesChangingRoomBeforeByArea($diffTrainingStartChangingBeforeTraining, $viewAreaTimeslot, $area, &$changingRoomStartTime, &$changingRoomEndTime){\n foreach ($diffTrainingStartChangingBeforeTraining as $value){\n\n setTimeDiffBeforeTraining($value,durationChangingBefore,$viewAreaTimeslot['startTime'] , $changingRoomStartTime, $changingRoomEndTime );\n \n $trainingEntrysByChangingRoom = getTrainingEntrysBychangingRoom($viewAreaTimeslot, $area['labelling'], $changingRoomStartTime, $changingRoomEndTime);\n \n if( arePlacesAvailable($area['maxNumberOfPeople'],$viewAreaTimeslot, $changingRoomStartTime, $changingRoomEndTime, $trainingEntrysByChangingRoom)){\n return true;\n }\n \n }\n return false;\n }", "public function destroy( $id_tarea)\n {\n\n $del=OrchardWorksM::find($id_tarea);\n $del->delete();\n return redirect(\"huertos\");\n }", "static function bkap_delete_booking( $booking_post_id ) {\n\t\t\t \n\t\t\t global $wpdb;\n\t\t\t \n\t\t\t $item_id = get_post_meta( $booking_post_id, '_bkap_order_item_id', true );\n\t\t\t $product_id = get_post_meta( $booking_post_id, '_bkap_product_id', true );\n\t\t\t $booking_start = get_post_meta( $booking_post_id, '_bkap_start', true );\n\t\t\t $booking_end = get_post_meta( $booking_post_id, '_bkap_end', true );\n\t\t\t \n\t\t\t $booking_type = get_post_meta( $product_id, '_bkap_booking_type', true );\n\t\t\t // get the order ID\n\t\t\t $order_query = \"SELECT order_id FROM `\" . $wpdb->prefix . \"woocommerce_order_items`\n \t\t WHERE order_item_id = %s\";\n\t\t\t $order_results = $wpdb->get_results( $wpdb->prepare( $order_query, $item_id ) );\n\t\t\t \t\n\t\t\t $order_id = $order_results[0]->order_id;\n\t\t\t \t\n\t\t\t if ( $order_id > 0 ) {\n\t\t\t \t\n\t\t\t $order_obj = new WC_Order( absint( $order_id ) );\n\t\t\t \t\n\t\t\t $order_items = $order_obj->get_items();\n\t\t\t foreach( $order_items as $oid => $o_value ) {\n\t\t\t if ( $oid == $item_id ) {\n\t\t\t $item_value = $o_value;\n\t\t\t break;\n\t\t\t }\n\t\t\t }\n\t\t\t \t\n\t\t\t if ( isset( $item_value ) ) {\n\t\t\t $get_booking_id = \"SELECT booking_id FROM `\" . $wpdb->prefix . \"booking_order_history`\n\t\t\t WHERE order_id = %d\";\n\t\t\t $results_booking = $wpdb->get_results( $wpdb->prepare( $get_booking_id, $order_id ) );\n\t\t\t \t\n\t\t\t foreach( $results_booking as $id ) {\n\t\t\t \t\n\t\t\t $get_booking_details = \"SELECT post_id, start_date, end_date, from_time, to_time FROM `\" . $wpdb->prefix . \"booking_history`\n WHERE id = %d\";\n\t\t\t $bkap_details = $wpdb->get_results( $wpdb->prepare( $get_booking_details, $id->booking_id ) );\n\t\t\t \n\t\t\t $matched = false;\n\t\t\t \t\n\t\t\t if ( $bkap_details[ 0 ]->post_id == $product_id ) {\n\t\t\t $start_date = substr( $booking_start, 0, 8 );\n\t\t\t $start_date = date( 'Y-m-d', strtotime( $start_date ) );\n\t\t\t switch( $booking_type ) {\n\t\t\t case 'only_day':\n\t\t\t if ( $start_date === $bkap_details[ 0 ]->start_date ) {\n\t\t\t $booking_id = $id->booking_id;\n\t\t\t $matched = true;\n\t\t\t }\n\t\t\t break;\n\t\t\t case 'multiple_days':\n\t\t\t $end_date = substr( $booking_end, 0, 8 );\n\t\t\t $end_date = date( 'Y-m-d', strtotime( $end_date ) );\n\t\t\t if ( $start_date === $bkap_details[ 0 ]->start_date && $end_date === $bkap_details[ 0 ]->end_date ) {\n\t\t\t $booking_id = $id->booking_id;\n\t\t\t $matched = true;\n\t\t\t }\n\t\t\t break;\n\t\t\t case 'date_time':\n\t\t\t $db_time_slot = $bkap_details[ 0 ]->from_time . '-' . $bkap_details[ 0 ]->end_time;\n\t\t\t $meta_time = substr( $booking_start, 8, 2 ) . ':' . substr( $booking_start, 10, 2 ) . '-' . substr( $booking_end, 8, 2 ) . ':' . substr( $booking_end, 10, 2 );\n\t\t\t if ( $start_date === $bkap_details[ 0 ]->start_date && $meta_time === $db_time_slot ) {\n\t\t\t $booking_id = $id->booking_id;\n\t\t\t $matched = true;\n\t\t\t }\n\t\t\t break;\n\t\t\t }\n\t\t\t \n\t\t\t if ( $matched ) {\n\t\t\t break;\n\t\t\t }\n\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t if ( isset( $booking_id ) && $booking_id > 0 ) {\n\t\t\t \t\n\t\t\t // cancel the booking\n\t\t\t bkap_cancel_order::bkap_reallot_item( $item_value, $booking_id, $order_id);\n\t\t\t \t\n\t\t\t // delete the order from booking order history\n\t\t\t if ( 'multiple_days' !== $booking_type ) {\n\t\t\t $delete_order_history = \"DELETE FROM `\" . $wpdb->prefix . \"booking_order_history`\n \t\t WHERE order_id = %d and booking_id = %d\";\n\t\t\t $wpdb->query( $wpdb->prepare( $delete_order_history, $order_id, $booking_id ) );\n\t\t\t }\n\t\t\t \t\n\t\t\t // update the booking post status\n\t\t $new_booking = bkap_checkout::get_bkap_booking( $booking_post_id );\n\t\t \n\t\t do_action('bkap_rental_delete', $new_booking, $booking_post_id);\n\t\t \n\t\t $new_booking->update_status( 'cancelled' );\n\t\t \n\t\t\t // remove the item from the order\n\t\t\t // wc_delete_order_item( $item_id );\n\t\t\t \t\n\t\t\t $_product = wc_get_product( $product_id );\n\t\t\t $product_title = $_product->get_name();\n\t\t\t \n\t\t\t // add note in the order\n\t\t\t $order_obj->add_order_note( __( \"The booking for $product_title has been trashed.\", 'woocommerce-booking' ) );\n\t\t\t \n\t\t\t }\n\t\t\t \n\t\t\t }\n\t\t\t }\n\t\t\t}", "public function delete_appointments(){\r $query=\"delete `ct_bookings`.*,`ct_payments`.*,`ct_order_client_info`.* from `ct_bookings` INNER JOIN `ct_payments`,`ct_order_client_info` where `ct_bookings`.`order_id`=`ct_payments`.`order_id` and `ct_bookings`.`order_id`=`ct_order_client_info`.`order_id` and `ct_bookings`.`order_id`='\".$this->order_id.\"' \";\r $result=mysqli_query($this->conn,$query);\r return $result;\r }" ]
[ "0.5797506", "0.5777573", "0.5323851", "0.5244844", "0.5214862", "0.51473767", "0.51188236", "0.5095128", "0.5084307", "0.508327", "0.5073572", "0.50585383", "0.50529456", "0.50482124", "0.5040681", "0.50359076", "0.5027152", "0.50023776", "0.49564236", "0.49303597", "0.4919879", "0.49133438", "0.48976615", "0.4876247", "0.4873976", "0.48561087", "0.48444802", "0.4794856", "0.47931212", "0.4789659" ]
0.58310974
0
Converts User ID into Community ID
public function convertToCommunityId($id) { switch (self::getTypeOfId($id)) { case USER_ID_TYPE_COMMUNITY: return $id; case USER_ID_TYPE_VANITY: $api_interface = new ISteamUser(); return $api_interface->ResolveVanityURL($id); case USER_ID_TYPE_STEAM: return self::steamIdToCommunityId($id); default: return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function communityId()\r\n {\r\n return gmp_strval(gmp_add(self::STEAM_COMMUNITY_ID_BASE, $this->userIdentifier));\r\n }", "protected function determine_user_id() {\n\t\treturn $this->coauthor_user_id;\n\t}", "public function transform($user)\n {\n if (null === $user) {\n return '';\n }\n\n return $user->getId();\n }", "public function communityIdToSteamId($community_id, $is_short = FALSE)\n {\n $temp = intval($community_id) - 76561197960265728;\n $odd_id = $temp % 2;\n $temp = floor($temp / 2);\n if ($is_short) {\n return $odd_id . ':' . $temp;\n } else {\n return 'STEAM_0:' . $odd_id . ':' . $temp;\n }\n }", "function getID($user){}", "function getUserId();", "private static function get_cid($user) {\n if (!$user) {\n return self::get_uuid_v4();\n }\n if ($user->analytics_cid) {\n return $user->analytics_cid;\n }\n $cid = self::get_uuid_v4();\n $user->analytics_cid = $cid;\n $user->save();\n\n return $cid;\n }", "private static function resolveUserId($user)\n\t{\n\t\tif ($user instanceof \\CUser)\n\t\t{\n\t\t\treturn (int)$user->getId();\n\t\t}\n\t\telseif(is_numeric($user) && (int)$user > 0)\n\t\t{\n\t\t\treturn (int)$user;\n\t\t}\n\n\t\treturn static::GUEST_USER_ID;\n\t}", "public function getCsUserId() : string\n {\n return $this->csUserId;\n }", "public function getToUid();", "public function getUserId() {\n $possibilities = array('cpr', 'userId', 'barcode', 'cardno', 'customId',);\n foreach ($possibilities as $pos) {\n if (isset($this->userData[$pos])) {\n return str_replace(\"-\",\"\",$this->userData[$pos]);\n }\n }\n return FALSE;\n }", "public function getUserIdentifier();", "public function getUserIdentifier();", "public function getUserId() : string;", "protected function sanitizeUser_id($user_id){\r\n// Return result...\r\n return filter_var($user_id, FILTER_SANITIZE_STRING);\r\n }", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function prepareStudentID($userid)\n {\n $settings = new GeneralSettings();\n\n $count = $this->getStudentCount();\n\n $length = $settings->getAdmissionNoLength();\n $user_id = $userid.$length;\n\n\n if(strlen($count) < $length)\n {\n $user_id = $userid. makeNumber($count, $length);\n }\n\n return $settings->getStudentIDPrefix().$userid;\n }", "private function getuserid() {\n\n\n $em = $this->getDoctrine()->getManager();\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n } else {\n $user_id = 0;\n \n }\n\n return ($user_id);\n \n }", "private function getuserid() {\n\n\n $em = $this->getDoctrine()->getManager();\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n /*$group = $user->getIdgroup();*/\n /*if (isset($group)) {\n $group_id = $group->getId();\n } else {\n $group_id = 0;\n }*/\n } else {\n $user_id = 0;\n // $group_id = 0;\n }\n return $user_id;\n }", "public function getUserID()\n {\n return (int)$this->_userid;\n }", "public function getUserID() {\r\n\t\treturn($this->sUserID);\r\n\t}", "private function get_user_id() {\n\t\t//Get user ID\n\t\t$user_id = isset( $_GET[ 'user_id' ] ) ? absint( $_GET[ 'user_id' ] ) : 0;\n\t\tif ( $user_id == 0 && IS_PROFILE_PAGE ) {\n\t\t\t$current_user = wp_get_current_user();\n\t\t\t$user_id = $current_user->ID;\n\t\t}\n\t\treturn $user_id;\n\t}", "function bbp_get_displayed_user_id()\n{\n}", "function my_id() {\n\n\treturn current_user_id();\n\n}" ]
[ "0.7418567", "0.6542993", "0.60624266", "0.60250777", "0.6015352", "0.6001127", "0.5999549", "0.59685165", "0.5752781", "0.5733537", "0.5689307", "0.5663947", "0.5663947", "0.5651877", "0.56328535", "0.560192", "0.560192", "0.560192", "0.560192", "0.560192", "0.560192", "0.560192", "0.55925727", "0.557599", "0.55740756", "0.55661523", "0.5542133", "0.55348295", "0.55083174", "0.54939985" ]
0.71315473
1
Converts Steam ID to Community ID Example input: STEAM_0:0:17336203 or 0:0:17336203
public function steamIdToCommunityId($steam_id) { $x = NULL; $y = NULL; if (preg_match('/(?i:STEAM)_0:[0-9]:[0-9]*/', $steam_id)) { $x = substr($steam_id, 8, 1); $y = substr($steam_id, 10); } elseif (preg_match('/0:[0-9]:[0-9]*/', $steam_id)) { $x = substr($steam_id, 2, 1); $y = substr($steam_id, 4); } else { throw new WrongIDException($steam_id); } return ($y * 2) + $x + 76561197960265728; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSteamID()\n {\n //See if the second number in the steamid (the auth server) is 0 or 1. Odd is 1, even is 0\n $authserver = bcsub($this->steamID64, '76561197960265728') & 1;\n //Get the third number of the steamid\n $authid = (bcsub($this->steamID64, '76561197960265728') - $authserver) / 2;\n\n //Concatenate the STEAM_ prefix and the first number, which is always 0, as well as colons with the other two numbers\n return \"STEAM_0:$authserver:$authid\";\n }", "public function communityIdToSteamId($community_id, $is_short = FALSE)\n {\n $temp = intval($community_id) - 76561197960265728;\n $odd_id = $temp % 2;\n $temp = floor($temp / 2);\n if ($is_short) {\n return $odd_id . ':' . $temp;\n } else {\n return 'STEAM_0:' . $odd_id . ':' . $temp;\n }\n }", "public function communityId()\r\n {\r\n return gmp_strval(gmp_add(self::STEAM_COMMUNITY_ID_BASE, $this->userIdentifier));\r\n }", "function _getSteamId32($id){\n $subid = substr($id, 4);\n $steamY = _parseInt($subid);\n $steamY = $steamY - 1197960265728; //76561197960265728\n if ($steamY%2 == 1){\n $steamX = 1;\n } else {\n $steamX = 0;\n }\n $steamY = (($steamY - $steamX) / 2);\n $steamID = \"STEAM_0:\" . (string)$steamX . \":\" . (string)$steamY;\n return $steamID;\n}", "public function parseSteamID()\n {\n preg_match(\n '#^https?://steamcommunity.com/openid/id/([0-9]{17,25})#',\n $this->request->get('openid_claimed_id'),\n $matches\n );\n\n $this->steamId = isset($matches[1]) && is_numeric($matches[1]) ? $matches[1] : 0;\n }", "function getSteamIDFromInput($steamInput) {\n\t\trequire_once('SteamAPI.php');\n\t\t\n\t\t$steamInput = trim($steamInput);\n\t\t$steamIDArray = array();\n\t\t\n\t\tif (empty($steamInput)) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Already in ID64 format?\n\t\tif (steamIDFormatIsValid($steamInput)) {\n\t\t\t$steamIDArray[] = $steamInput;\n\t\t}\n\t\t\n\t\t// Check for the steam ID anywhere in the input (URL or any form of garbage input)\n\t\tif (empty($steamIDArray)) {\n\t\t\tpreg_match_all('/7656[0-9]{13}/', $steamInput, $idArray);\n\t\t\tif (!empty($idArray)) {\n\t\t\t\tforeach($idArray[0] as $steamid) {\n\t\t\t\t\t$steamIDArray[] = $steamid;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$con = null;\n\t\t// Check for SteamID32 (Steam2 format) (STEAM_0:0:673866)\n\t\tif (preg_match_all('/steam_[0-9]:[0-9]:[0-9]*/i', $steamInput, $idArray)) {\n\t\t\tif (!empty($idArray)) {\n\t\t\t\tforeach($idArray[0] as $steamID32) {\n\t\t\t\t\t$stringFrags = explode(':', $steamID32);\n\t\t\t\t\tif (count($stringFrags) == 3) {\n\t\t\t\t\t\t$authServer = $stringFrags[1];\n\t\t\t\t\t\t$userid = $stringFrags[2];\n\t\t\t\t\t\tif (is_numeric($authServer) && is_numeric($userid)) {\n\t\t\t\t\t\t\tif ($con == null) {\n\t\t\t\t\t\t\t\trequire_once('MySQL.php');\n\t\t\t\t\t\t\t\t// PHP cannot reliably add 64 bit numbers but MySQL can\n\t\t\t\t\t\t\t\t// the magic number: 76561197960265728\n\t\t\t\t\t\t\t\t$con = new MySQL(MYSQL_DB, MYSQL_USERID, MYSQL_PW);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$result = $con->one('select (('.$userid.'*2)+'.$authServer.')+'.STEAM_ID_OFFSET.' as steam64id');\n\t\t\t\t\t\t\t$steamIDArray[] = $result['steam64id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check for Steam3 format (U:1:13477332)\n\t\tif (preg_match_all('/u:[0-9]:[0-9]*/i', $steamInput, $idArray)) {\n\t\t\tif (!empty($idArray)) {\n\t\t\t\tforeach($idArray[0] as $steam3ID) {\n\t\t\t\t\t$stringFrags = explode(':', $steam3ID);\n\t\t\t\t\tif (count($stringFrags) == 3) {\n\t\t\t\t\t\t$steam3IDFrag3 = $stringFrags[2];\n\t\t\t\t\t\tif (is_numeric($steam3IDFrag3)) {\n\t\t\t\t\t\t\tif ($con == null) {\n\t\t\t\t\t\t\trequire_once('MySQL.php');\n\t\t\t\t\t\t\t\t// PHP cannot reliably add 64 bit numbers but MySQL can\n\t\t\t\t\t\t\t\t// the magic number: 76561197960265728\n\t\t\t\t\t\t\t\t$con = new MySQL(MYSQL_DB, MYSQL_USERID, MYSQL_PW);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$result = $con->one('select '.$steam3IDFrag3.'+'.STEAM_ID_OFFSET.' as steam64id');\n\t\t\t\t\t\t\t$steamIDArray[] = $result['steam64id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If no valid ID found, look for a vanity URL and verify it\n\t\tif (empty($steamIDArray)) {\n\t\t\t$vanityURL = null;\n\t\t\t\n\t\t\t// Check for a valid steam ../id/<vanity_url> first\n\t\t\tif (strpos($steamInput, 'http') === 0) {\n\t\t\t\t$path = parse_url(urldecode($steamInput), PHP_URL_PATH);\n\t\t\t\t$pathFragments = explode('/', $path);\n\t\t\t\tforeach($pathFragments as $key=>$fragment) {\n\t\t\t\t\tif ($fragment=='id' && count($pathFragments)>($key+1)) {\n\t\t\t\t\t\t$vanityURL = $pathFragments[$key+1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Everything else failed, so try the raw input as a vanity url\n\t\t\tif ($vanityURL == null) {\n\t\t\t\t$vanityURL = $steamInput;\n\t\t\t}\n\t\t\t\n\t\t\t$steam64ID = SteamAPI::resolveVanityURL($vanityURL);\n\t\t\tif ($steam64ID) {\n\t\t\t\t$steamIDArray[] = $steam64ID;\t// found it!\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn array_unique($steamIDArray);\t\t// removes duplicate entries\n\t}", "private function convertId($id) {\n $idstr = (string)$id;\n $x = substr($idstr, 0, 1);\n $y = substr($idstr, 1, 1);\n $z = substr($idstr, 2);\n $steamid = 'STEAM_'.$x.':'.$y.':'.$z;\n return $steamid;\n }", "function _getSteamID64($id) {\n if (preg_match('/^STEAM_/', $id)) {\n $parts = explode(':', $id);\n return bcadd(bcadd(bcmul($parts[2], '2'), '76561197960265728'), $parts[1]);\n } elseif (is_numeric($id) && strlen($id) < 16) {\n return bcadd($id, '76561197960265728');\n } else {\n return $id; // We have no idea what this is, so just return it.\n }\n}", "function steamID_steam64($steamID)\n{\n \n\t//split the data into 3 types, 2 of them we actually need ($type, $id)\n list($e, $type, $id) = split(\":\", $steamID);\n\t\n\t//some math to figure out and return the 64 bit ID\n return ($id * 2) + 76561197960265728 + $type;\n \n}", "public function convertToCommunityId($id)\n {\n switch (self::getTypeOfId($id)) {\n case USER_ID_TYPE_COMMUNITY:\n return $id;\n case USER_ID_TYPE_VANITY:\n $api_interface = new ISteamUser();\n return $api_interface->ResolveVanityURL($id);\n case USER_ID_TYPE_STEAM:\n return self::steamIdToCommunityId($id);\n default:\n return FALSE;\n }\n }", "function convertLobby32IDToLobby64ID($lobby32ID) {\n\t\t// 0x186000000000000 | $accountId\n\t\t// Check for SteamID32 (Steam2 format) (STEAM_0:0:673866)\n\t\t$steam32ID = '';\n\t\tif (preg_match_all('/L:1:[0-9]*/', $lobby32ID, $idArray)) {\n\t\t\tif (!empty($idArray)) {\n\t\t\t\t$con = null;\n\t\t\t\tforeach($idArray[0] as $steamID32) {\n\t\t\t\t\t$stringFrags = explode(':', $steamID32);\n\t\t\t\t\tif (count($stringFrags) == 3) {\n\t\t\t\t\t\t$accountId = $stringFrags[2];\n\t\t\t\t\t\tif (is_numeric($accountId)) {\n\t\t\t\t\t\t\tif ($con == null) {\n\t\t\t\t\t\t\t\trequire_once('MySQL.php');\n\t\t\t\t\t\t\t\t// PHP cannot reliably add 64 bit numbers but MySQL can\n\t\t\t\t\t\t\t\t$con = new MySQL(MYSQL_DB, MYSQL_USERID, MYSQL_PW);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$result = $con->one('select 0x186000000000000 | '.$accountId.' as lobby64id');\n\t\t\t\t\t\t\t$steam32ID = $result['lobby64id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $steam32ID;\n\t}", "protected function resolveSteamId($steamId)\r\n {\r\n // Check is this SteamID v2.\r\n if (strncmp('STEAM_', $steamId, 6) == 0)\r\n {\r\n $parts = explode(':', $steamId);\r\n if (count($parts) != 3)\r\n {\r\n throw new InvalidSteamIdException(\"Invalid SteamIDv2\");\r\n }\r\n\r\n return intval($parts[2] * 2) + intval($parts[1]);\r\n }\r\n\r\n // Check is this SteamID v3.\r\n if (strncmp('[U:1:', $steamId, 4) == 0)\r\n {\r\n $parts = explode(':', $steamId);\r\n if (count($parts) != 3)\r\n {\r\n throw new InvalidSteamIdException(\"Invalid SteamIDv3\");\r\n }\r\n\r\n return intval(substr($parts[2], 0, -1));\r\n }\r\n\r\n // Check is this SteamID Community ID.\r\n if (strncmp('7656119', $steamId, 7) == 0 && strlen($steamId) == 17)\r\n {\r\n return gmp_intval(gmp_sub($steamId, self::STEAM_COMMUNITY_ID_BASE));\r\n }\r\n\r\n // And last try determine what is this.\r\n // If this fully integer - maybe this is Account ID already?\r\n if (preg_match('/^\\d{1,}$/', $steamId))\r\n {\r\n return intval($steamId);\r\n }\r\n\r\n // This is unknown SteamID type. Just throw exception.\r\n throw new InvalidSteamIdException(\"Unknown SteamID type\");\r\n }", "function buildUrlFromId($id){\n\t\t$url = 'http://steamcommunity.com/id/';\n\t\t$url = $url . $id;\n\t\t$url = $url . '/games?tab=all&xml=1';\n\t\treturn $url;\n\t}", "public static function steam64ToSTEAM($profileId) {\n $steamPieces = array(0 => '0', 1 => '', 2 => '');\n $steamPieces[1] = substr($profileId, -1) % 2;\n $steamPieces[2] = ((int) bcsub($profileId, '76561197960265728') - $steamPieces[1]) / 2;\n $steamId = implode(':', $steamPieces);\n return $steamId;\n }", "function aux_teamIDfromTeamName ($teamName) {\n return pathinfo(aux_searchAmongTeams(\"teamName\", $teamName), PATHINFO_FILENAME);\n}", "public function getId()\n {\n return TeamId::fromString($this->id);\n }", "protected function _siftReqId()\n\t{\n\t\t$requestID = array();\n\t\tswitch (true) {\n\t\t\tcase preg_match('/\\[\\s*#?scnzb@?efnet\\s*\\]\\[(\\d+)\\]/', $this->_release['name'], $requestID):\n\t\t\tcase preg_match('/\\[\\s*(\\d+)\\s*\\]/', $this->_release['name'], $requestID):\n\t\t\tcase preg_match('/^REQ\\s*(\\d{4,6})/i', $this->_release['name'], $requestID):\n\t\t\tcase preg_match('/^(\\d{4,6})-\\d{1}\\[/', $this->_release['name'], $requestID):\n\t\t\tcase preg_match('/(\\d{4,6}) -/',$this->_release['name'], $requestID):\n\t\t\t\tif ((int) $requestID[1] > 0) {\n\t\t\t\t\treturn (int) $requestID[1];\n\t\t\t\t}\n\t\t}\n\t\treturn self::REQID_ZERO;\n\t}", "public function createID()\n {\n $string = mapModel::newMapID();\n $idNum = preg_replace('#[^0-9]#', '', $string);\n $idNum++;\n $count = 5 - (strlen((string)$idNum));\n $finalmapid = \"map\";\n for ($x = 0; $x < $count; $x++) {\n $finalmapid .= \"0\";\n }\n $finalmapid .= $idNum;\n return $finalmapid;\n }", "function make_query_id ($award_id) {\n // important - leave dashes in\n $normalized = preg_replace(\"/[^A-Za-z0-9\\-]/\", '', $award_id);\n\n if (strlen($normalized) < 5) {\n return $award_id;\n } else {\n return strtoupper(substr($normalized, -5));\n }\n}", "function preprocess_award_id($raw_award_id) {\n /* super Kludge - Kuali will not valiate AGS-0856145,\n which is the cooperative agreement and is found in many\n records (and on the web). Kuali does recognize ATM0856145\n which is the same award.\n This KLudge allows kuali to recognize AGS-0856145\n */\n if (endswith($raw_award_id, '0856145')) {\n return '0856145';\n }\n return $raw_award_id;\n}", "protected function getFullSessID()\n {\n $sessID = $this->sessID;\n $sessType = $this->currentSessType;\n return (! empty($sessID) && ! empty($sessType)) ? $sessID . $sessType : '';\n }", "private function generateId(MessageInterface $message): string {\n $userId = $message->getAuthor()->getId();\n return $message->getChannel()->getId() . $userId;\n }", "protected static function createId() {\n if (!isset(self::$_idFormat)) {\n self::$_idFormat = sprintf('wmailer.id.%.5f.%d.%%05d', microtime(true), rand(1000, 9999));\n }\n return sprintf(self::$_idFormat, ++self::$_idIndex);\n }", "function get_ss_group_id($group){\n\tglobal $username;\n\tglobal $password;\n\tglobal $STATSEEKER_IP;\n\tglobal $DeviceId2Name;\n global $HTTP;\n\n\n\t$groupstr = str_replace(' ', '%20', $group);\n\n\t$context = stream_context_create(array(\n\t 'http' => array( 'header' => \"Authorization: Basic \" . base64_encode(\"$username:$password\"))\n\t));\n\n$url = <<<EOD\n$HTTP://$STATSEEKER_IP/api/group?indent=2&links=none&fields=name&where={\"name\":[\"=\",\"$groupstr\"]}\nEOD;\n\t$response = file_get_contents($url,false,$context);\n\t$res = json_decode_nice($response,true);\n#\tif(empty($res[\"result\"])) {\n# printf(\"BAD GROUP: %s\\n\",$groupstr);\n# exit;\n# }\n\n\tif(!isset($res[\"result\"][0][\"id\"])) {\n\t\t#printf(\"ERROR: Can't find group: $group\\n\");\n\t\tprintf(\"0\");\n\t\texit;\n\t}\n\treturn $res[\"result\"][0][\"id\"];\n}", "private function getMerchantID()\n\t{\n\t\t$sandbox = $this->params->get('sandbox', 0);\n\n\t\tif ($sandbox)\n\t\t{\n\t\t\treturn 'SCNet_Cert6';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn trim($this->params->get('merchant_id', ''));\n\t\t}\n\t}", "function cvve_id_safe($string) {\n\t// Replace with dashes anything that isn't A-Z, numbers, dashes, or\n\t// underscores.\n\t$string = strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '-', $string));\n\t// If the first character is not a-z, add 'n' in front.\n\t// Don't use ctype_alpha since its locale aware.\n\tif (!ctype_lower($string{0})) {\n\t\t$string = 'id' . $string;\n\t}\n\treturn $string;\n}", "function toBasicNumeralId($garyId){\n\t$s = substr($garyId, strlen($garyId) - 4, 4);\n\t$s = preg_replace(\"/^0+/\", \"\", $s);\n\treturn $s;\n}", "private function makeId()\n {\n $random = mt_rand();\n $random = md5($random);\n $random = substr($random,0,12);\n $name = $this->config['name'];\n $length = strlen($name);\n \n if($length > 22){\n $name = substr($name,0,22);\n }\n\n return $name.\"-\".$random;\n }", "function makeid($newid) {\n\t// the characters we will use\n\t$chars\t= \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t// splits $chars into an array of individual characters\n\t$tmp = preg_split(\"//u\", $chars, -1, PREG_SPLIT_NO_EMPTY);\n\n\t// shuffles/randomizes the $tmp array\n\tshuffle($tmp);\n\n\t// turns the randomized array into a string\n\t$tmp2 = join(\"\", $tmp);\n\n\t// returns the first 10 characters of the randomized string\n\treturn mb_substr($tmp2,0,20,\"UTF-8\");\n}", "function getSCID() {\n $svnid = '$Rev: 3857 $';\n $scid = substr($svnid, 6);\n return intval(substr($scid, 0, strlen($scid) - 2));\n}" ]
[ "0.7091504", "0.70906794", "0.6908884", "0.67429245", "0.66797256", "0.65915406", "0.6477439", "0.6360553", "0.62912244", "0.61542827", "0.5930508", "0.56617415", "0.55804706", "0.5395524", "0.5291824", "0.5210673", "0.5205896", "0.5204226", "0.51692593", "0.5158094", "0.5141768", "0.51152664", "0.5107975", "0.5098802", "0.5083313", "0.5062842", "0.5057853", "0.5048156", "0.504274", "0.50278646" ]
0.7204236
0
Converts Community ID to Steam ID
public function communityIdToSteamId($community_id, $is_short = FALSE) { $temp = intval($community_id) - 76561197960265728; $odd_id = $temp % 2; $temp = floor($temp / 2); if ($is_short) { return $odd_id . ':' . $temp; } else { return 'STEAM_0:' . $odd_id . ':' . $temp; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function communityId()\r\n {\r\n return gmp_strval(gmp_add(self::STEAM_COMMUNITY_ID_BASE, $this->userIdentifier));\r\n }", "public function steamIdToCommunityId($steam_id)\n {\n $x = NULL;\n $y = NULL;\n if (preg_match('/(?i:STEAM)_0:[0-9]:[0-9]*/', $steam_id)) {\n $x = substr($steam_id, 8, 1);\n $y = substr($steam_id, 10);\n } elseif (preg_match('/0:[0-9]:[0-9]*/', $steam_id)) {\n $x = substr($steam_id, 2, 1);\n $y = substr($steam_id, 4);\n } else {\n throw new WrongIDException($steam_id);\n }\n return ($y * 2) + $x + 76561197960265728;\n }", "function _getSteamId32($id){\n $subid = substr($id, 4);\n $steamY = _parseInt($subid);\n $steamY = $steamY - 1197960265728; //76561197960265728\n if ($steamY%2 == 1){\n $steamX = 1;\n } else {\n $steamX = 0;\n }\n $steamY = (($steamY - $steamX) / 2);\n $steamID = \"STEAM_0:\" . (string)$steamX . \":\" . (string)$steamY;\n return $steamID;\n}", "private function convertId($id) {\n $idstr = (string)$id;\n $x = substr($idstr, 0, 1);\n $y = substr($idstr, 1, 1);\n $z = substr($idstr, 2);\n $steamid = 'STEAM_'.$x.':'.$y.':'.$z;\n return $steamid;\n }", "public function parseSteamID()\n {\n preg_match(\n '#^https?://steamcommunity.com/openid/id/([0-9]{17,25})#',\n $this->request->get('openid_claimed_id'),\n $matches\n );\n\n $this->steamId = isset($matches[1]) && is_numeric($matches[1]) ? $matches[1] : 0;\n }", "function _getSteamID64($id) {\n if (preg_match('/^STEAM_/', $id)) {\n $parts = explode(':', $id);\n return bcadd(bcadd(bcmul($parts[2], '2'), '76561197960265728'), $parts[1]);\n } elseif (is_numeric($id) && strlen($id) < 16) {\n return bcadd($id, '76561197960265728');\n } else {\n return $id; // We have no idea what this is, so just return it.\n }\n}", "public function getSteamID()\n {\n //See if the second number in the steamid (the auth server) is 0 or 1. Odd is 1, even is 0\n $authserver = bcsub($this->steamID64, '76561197960265728') & 1;\n //Get the third number of the steamid\n $authid = (bcsub($this->steamID64, '76561197960265728') - $authserver) / 2;\n\n //Concatenate the STEAM_ prefix and the first number, which is always 0, as well as colons with the other two numbers\n return \"STEAM_0:$authserver:$authid\";\n }", "public function convertToCommunityId($id)\n {\n switch (self::getTypeOfId($id)) {\n case USER_ID_TYPE_COMMUNITY:\n return $id;\n case USER_ID_TYPE_VANITY:\n $api_interface = new ISteamUser();\n return $api_interface->ResolveVanityURL($id);\n case USER_ID_TYPE_STEAM:\n return self::steamIdToCommunityId($id);\n default:\n return FALSE;\n }\n }", "function steamID_steam64($steamID)\n{\n \n\t//split the data into 3 types, 2 of them we actually need ($type, $id)\n list($e, $type, $id) = split(\":\", $steamID);\n\t\n\t//some math to figure out and return the 64 bit ID\n return ($id * 2) + 76561197960265728 + $type;\n \n}", "function getSteamIDFromInput($steamInput) {\n\t\trequire_once('SteamAPI.php');\n\t\t\n\t\t$steamInput = trim($steamInput);\n\t\t$steamIDArray = array();\n\t\t\n\t\tif (empty($steamInput)) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Already in ID64 format?\n\t\tif (steamIDFormatIsValid($steamInput)) {\n\t\t\t$steamIDArray[] = $steamInput;\n\t\t}\n\t\t\n\t\t// Check for the steam ID anywhere in the input (URL or any form of garbage input)\n\t\tif (empty($steamIDArray)) {\n\t\t\tpreg_match_all('/7656[0-9]{13}/', $steamInput, $idArray);\n\t\t\tif (!empty($idArray)) {\n\t\t\t\tforeach($idArray[0] as $steamid) {\n\t\t\t\t\t$steamIDArray[] = $steamid;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$con = null;\n\t\t// Check for SteamID32 (Steam2 format) (STEAM_0:0:673866)\n\t\tif (preg_match_all('/steam_[0-9]:[0-9]:[0-9]*/i', $steamInput, $idArray)) {\n\t\t\tif (!empty($idArray)) {\n\t\t\t\tforeach($idArray[0] as $steamID32) {\n\t\t\t\t\t$stringFrags = explode(':', $steamID32);\n\t\t\t\t\tif (count($stringFrags) == 3) {\n\t\t\t\t\t\t$authServer = $stringFrags[1];\n\t\t\t\t\t\t$userid = $stringFrags[2];\n\t\t\t\t\t\tif (is_numeric($authServer) && is_numeric($userid)) {\n\t\t\t\t\t\t\tif ($con == null) {\n\t\t\t\t\t\t\t\trequire_once('MySQL.php');\n\t\t\t\t\t\t\t\t// PHP cannot reliably add 64 bit numbers but MySQL can\n\t\t\t\t\t\t\t\t// the magic number: 76561197960265728\n\t\t\t\t\t\t\t\t$con = new MySQL(MYSQL_DB, MYSQL_USERID, MYSQL_PW);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$result = $con->one('select (('.$userid.'*2)+'.$authServer.')+'.STEAM_ID_OFFSET.' as steam64id');\n\t\t\t\t\t\t\t$steamIDArray[] = $result['steam64id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check for Steam3 format (U:1:13477332)\n\t\tif (preg_match_all('/u:[0-9]:[0-9]*/i', $steamInput, $idArray)) {\n\t\t\tif (!empty($idArray)) {\n\t\t\t\tforeach($idArray[0] as $steam3ID) {\n\t\t\t\t\t$stringFrags = explode(':', $steam3ID);\n\t\t\t\t\tif (count($stringFrags) == 3) {\n\t\t\t\t\t\t$steam3IDFrag3 = $stringFrags[2];\n\t\t\t\t\t\tif (is_numeric($steam3IDFrag3)) {\n\t\t\t\t\t\t\tif ($con == null) {\n\t\t\t\t\t\t\trequire_once('MySQL.php');\n\t\t\t\t\t\t\t\t// PHP cannot reliably add 64 bit numbers but MySQL can\n\t\t\t\t\t\t\t\t// the magic number: 76561197960265728\n\t\t\t\t\t\t\t\t$con = new MySQL(MYSQL_DB, MYSQL_USERID, MYSQL_PW);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$result = $con->one('select '.$steam3IDFrag3.'+'.STEAM_ID_OFFSET.' as steam64id');\n\t\t\t\t\t\t\t$steamIDArray[] = $result['steam64id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If no valid ID found, look for a vanity URL and verify it\n\t\tif (empty($steamIDArray)) {\n\t\t\t$vanityURL = null;\n\t\t\t\n\t\t\t// Check for a valid steam ../id/<vanity_url> first\n\t\t\tif (strpos($steamInput, 'http') === 0) {\n\t\t\t\t$path = parse_url(urldecode($steamInput), PHP_URL_PATH);\n\t\t\t\t$pathFragments = explode('/', $path);\n\t\t\t\tforeach($pathFragments as $key=>$fragment) {\n\t\t\t\t\tif ($fragment=='id' && count($pathFragments)>($key+1)) {\n\t\t\t\t\t\t$vanityURL = $pathFragments[$key+1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Everything else failed, so try the raw input as a vanity url\n\t\t\tif ($vanityURL == null) {\n\t\t\t\t$vanityURL = $steamInput;\n\t\t\t}\n\t\t\t\n\t\t\t$steam64ID = SteamAPI::resolveVanityURL($vanityURL);\n\t\t\tif ($steam64ID) {\n\t\t\t\t$steamIDArray[] = $steam64ID;\t// found it!\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn array_unique($steamIDArray);\t\t// removes duplicate entries\n\t}", "function convertLobby32IDToLobby64ID($lobby32ID) {\n\t\t// 0x186000000000000 | $accountId\n\t\t// Check for SteamID32 (Steam2 format) (STEAM_0:0:673866)\n\t\t$steam32ID = '';\n\t\tif (preg_match_all('/L:1:[0-9]*/', $lobby32ID, $idArray)) {\n\t\t\tif (!empty($idArray)) {\n\t\t\t\t$con = null;\n\t\t\t\tforeach($idArray[0] as $steamID32) {\n\t\t\t\t\t$stringFrags = explode(':', $steamID32);\n\t\t\t\t\tif (count($stringFrags) == 3) {\n\t\t\t\t\t\t$accountId = $stringFrags[2];\n\t\t\t\t\t\tif (is_numeric($accountId)) {\n\t\t\t\t\t\t\tif ($con == null) {\n\t\t\t\t\t\t\t\trequire_once('MySQL.php');\n\t\t\t\t\t\t\t\t// PHP cannot reliably add 64 bit numbers but MySQL can\n\t\t\t\t\t\t\t\t$con = new MySQL(MYSQL_DB, MYSQL_USERID, MYSQL_PW);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$result = $con->one('select 0x186000000000000 | '.$accountId.' as lobby64id');\n\t\t\t\t\t\t\t$steam32ID = $result['lobby64id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $steam32ID;\n\t}", "public static function steam64ToSTEAM($profileId) {\n $steamPieces = array(0 => '0', 1 => '', 2 => '');\n $steamPieces[1] = substr($profileId, -1) % 2;\n $steamPieces[2] = ((int) bcsub($profileId, '76561197960265728') - $steamPieces[1]) / 2;\n $steamId = implode(':', $steamPieces);\n return $steamId;\n }", "function getSteamID64() {\n\t\treturn $this->steamID64;\n\t}", "function buildUrlFromId($id){\n\t\t$url = 'http://steamcommunity.com/id/';\n\t\t$url = $url . $id;\n\t\t$url = $url . '/games?tab=all&xml=1';\n\t\treturn $url;\n\t}", "public function getSteamId64() {\n return $this->steamId64;\n }", "public function getSteamId64() {\n return $this->steamId64;\n }", "public function getSteamId64() {\n return $this->steamId64;\n }", "public function getSteamId(){\n return $this->SteamID;\n }", "protected function resolveSteamId($steamId)\r\n {\r\n // Check is this SteamID v2.\r\n if (strncmp('STEAM_', $steamId, 6) == 0)\r\n {\r\n $parts = explode(':', $steamId);\r\n if (count($parts) != 3)\r\n {\r\n throw new InvalidSteamIdException(\"Invalid SteamIDv2\");\r\n }\r\n\r\n return intval($parts[2] * 2) + intval($parts[1]);\r\n }\r\n\r\n // Check is this SteamID v3.\r\n if (strncmp('[U:1:', $steamId, 4) == 0)\r\n {\r\n $parts = explode(':', $steamId);\r\n if (count($parts) != 3)\r\n {\r\n throw new InvalidSteamIdException(\"Invalid SteamIDv3\");\r\n }\r\n\r\n return intval(substr($parts[2], 0, -1));\r\n }\r\n\r\n // Check is this SteamID Community ID.\r\n if (strncmp('7656119', $steamId, 7) == 0 && strlen($steamId) == 17)\r\n {\r\n return gmp_intval(gmp_sub($steamId, self::STEAM_COMMUNITY_ID_BASE));\r\n }\r\n\r\n // And last try determine what is this.\r\n // If this fully integer - maybe this is Account ID already?\r\n if (preg_match('/^\\d{1,}$/', $steamId))\r\n {\r\n return intval($steamId);\r\n }\r\n\r\n // This is unknown SteamID type. Just throw exception.\r\n throw new InvalidSteamIdException(\"Unknown SteamID type\");\r\n }", "private function getMerchantID()\n\t{\n\t\t$sandbox = $this->params->get('sandbox', 0);\n\n\t\tif ($sandbox)\n\t\t{\n\t\t\treturn 'SCNet_Cert6';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn trim($this->params->get('merchant_id', ''));\n\t\t}\n\t}", "public function getOrganizationId() :string\n {\n return $this->mollie->organizations->current()->id;\n }", "function encodeId($argId)\n{\n $seaSalt = mt_rand(1,98);\n $salt = ($seaSalt & 1)? $seaSalt + 1 : $seaSalt;\n $id = $argId * ($salt / 2) + $seaSalt;\n $seaSalt = (string) ($seaSalt < 10)? '0' . $seaSalt : $seaSalt;\n $id .= $seaSalt;\n return (int) $id;\n}", "function GET_32_BIT ($ID_64) {\n $upper = gmp_mul( bindec(STEAM_ID_UPPER_32_BITS) , \"4294967296\" );\n return gmp_strval(gmp_sub($ID_64,$upper));\n }", "function makeid($newid) {\n\t// the characters we will use\n\t$chars\t= \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t// splits $chars into an array of individual characters\n\t$tmp = preg_split(\"//u\", $chars, -1, PREG_SPLIT_NO_EMPTY);\n\n\t// shuffles/randomizes the $tmp array\n\tshuffle($tmp);\n\n\t// turns the randomized array into a string\n\t$tmp2 = join(\"\", $tmp);\n\n\t// returns the first 10 characters of the randomized string\n\treturn mb_substr($tmp2,0,20,\"UTF-8\");\n}", "protected function getFullSessID()\n {\n $sessID = $this->sessID;\n $sessType = $this->currentSessType;\n return (! empty($sessID) && ! empty($sessType)) ? $sessID . $sessType : '';\n }", "public function getId()\n {\n return TeamId::fromString($this->id);\n }", "function toBasicNumeralId($garyId){\n\t$s = substr($garyId, strlen($garyId) - 4, 4);\n\t$s = preg_replace(\"/^0+/\", \"\", $s);\n\treturn $s;\n}", "public function ClientFormattedID() {\n return self::integerToBase64($this->ID);\n }", "function decodeId($argId)\n{\n $seaSalt = substr($argId, strlen($argId)-2,2);\n $id = substr($argId, 0, strlen($argId)-2);\n $seaSalt = (int) ($seaSalt{0} == 0)? $seaSalt{1} : $seaSalt;\n $salt = ($seaSalt & 1)? $seaSalt + 1 : $seaSalt;\n $id = ($id - $seaSalt) / ($salt / 2);\n return (int) $id;\n}", "function getSCID() {\n $svnid = '$Rev: 3857 $';\n $scid = substr($svnid, 6);\n return intval(substr($scid, 0, strlen($scid) - 2));\n}" ]
[ "0.717476", "0.715563", "0.67623484", "0.6741276", "0.6696082", "0.65800774", "0.65795267", "0.6526919", "0.6502289", "0.6208128", "0.60830927", "0.5929763", "0.5633275", "0.56047946", "0.5533774", "0.5533774", "0.5533774", "0.5518775", "0.5399535", "0.5334884", "0.52178425", "0.5211952", "0.5197249", "0.5114229", "0.51081467", "0.51054764", "0.50897676", "0.50894535", "0.5082504", "0.50691617" ]
0.7554813
0
Instantiates and loads address defined in the $address property.
private function loadAddress(): void { $address = is_subclass_of($this->address, Address::class) ? new $this->address($this->parameters) : AddressFactory::from($this->address, $this->parameters); $this->addressInstance = $address; $this->bootAddress($this->addressInstance); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(Address $address)\n {\n $this->address = $address;\n }", "public function __construct($address) {\n if (is_int($address)) {\n $this->addr= $address;\n } else {\n $this->addr= self::parse($address);\n }\n }", "public function setAddress($address)\n {\n }", "public function setAddress($var)\n {\n GPBUtil::checkString($var, True);\n $this->address = $var;\n\n return $this;\n }", "public function setAddress($var)\n {\n GPBUtil::checkString($var, False);\n $this->address = $var;\n\n return $this;\n }", "public function setAddress($var)\n {\n GPBUtil::checkString($var, False);\n $this->address = $var;\n\n return $this;\n }", "public function getAddressObject();", "public function setAddress($var)\n\t{\n\t\tGPBUtil::checkString($var, True);\n\t\t$this->address = $var;\n\n\t\treturn $this;\n\t}", "public function setAddress($var)\n {\n GPBUtil::checkString($var, True);\n $this->Address = $var;\n\n return $this;\n }", "public function setAddress($address) {\n\t\t$this->address = $address;\n\t}", "public function setAddress($address) {\n $this->address = $address;\n }", "public function getAddress(): Address;", "public function getFromAddress();", "abstract protected function getAddress();", "public function __construct($addressType) \n {\n $this->_addressType = $addressType;\n }", "public function address(Address $address) {\n $this->_address = $address;\n return $this;\n }", "public abstract function getAddress();", "public function __construct($inputAddress= '')\r\n\t{\r\n\t\t$this->setInputAddress($inputAddress);\r\n\t}", "protected function setAddress(Address $address) {\n\t\t\t$this->_Address = $address;\n\t\t}", "public function __construct()\n {\n $this->addressRepository = new AddressRepository();\n }", "public static function getObject()\r\n {\r\n return new HDAddress(self::getJson());\r\n }", "protected function bootAddress(Address $address): void {}", "public function getAddress();", "public function getAddress();", "public function getAddress();", "public function getAddress();", "public function getAddress();", "public function __construct()\n {\n $this->model = new Address();\n }", "function setAddress($value);", "public function setAddress($value)\n\t{\n\t\t$this->address = $value;\n\t}" ]
[ "0.7209233", "0.68882716", "0.66129583", "0.6607307", "0.6578932", "0.6578932", "0.6573163", "0.65213263", "0.6485834", "0.6449731", "0.6441786", "0.6398787", "0.63130283", "0.62596124", "0.6256127", "0.6221129", "0.6220939", "0.6207124", "0.6203491", "0.61991173", "0.61649907", "0.6143611", "0.61186796", "0.61186796", "0.61186796", "0.61186796", "0.61186796", "0.6117812", "0.6113007", "0.6112392" ]
0.8186267
0
Instantiates and loads engine defined in the $endine property.
private function loadEngine(): void { $engine = is_subclass_of($this->engine, Engine::class) ? new $this->engine() : EngineFactory::from($this->getAddress()->getScheme()); $engine->setAddress($this->getAddress()); $this->engineInstance = $engine; $this->bootEngine($this->engineInstance); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function get_engine();", "public abstract function getEngine();", "public function getEngine();", "public function getEngine();", "public function getEngine();", "public function addEngine()\n {\n $this->bike->setPart('engine', new Parts\\Engine);\n }", "public function addEngine()\n {\n $this->car->setPart('carEngin',new Engine());\n }", "public function build_engine();", "function _init_engine($e) {\r\n if (isset($this->engines[$e])) return; \r\n \r\n require_once (dirname(__FILE__) . '/drivers/' . $e . '.php');\r\n \r\n $method = '_init_' . $e;\r\n if (is_callable(array($this, $method))) {\r\n call_user_func(array($this, $method));\r\n }\r\n else {\r\n $this->engines[$e] = false;\r\n }\r\n }", "public function engine($engine){\n\t\t$this->engine = $engine;\n\t}", "function loadEngine() {\n $engine = strtolower($this->types[$this->getRepositoryType()]);\n \n if (is_file(SOURCE_MODULE_PATH.'/engines/'.$engine.'.class.php')) {\n require_once(SOURCE_MODULE_PATH.'/engines/'.$engine.'.class.php');\n return true;\n }\n \n return false;\n }", "function startEngine() {\n }", "function startEngine() {\n }", "public function startEngine(){\n }", "public function getEngine()\n {\n return $this->engine;\n }", "public function getEngine()\n {\n return $this->engine;\n }", "public function getEngine()\n {\n return $this->engine;\n }", "public function startEngine()\n {\n }", "public function getEngine()\n {\n return $this;\n }", "public function getEngine()\n\t{\n\t\treturn $this;\n\t}", "public function getEngine() {\r\n\t\treturn $this;\r\n\t}", "function getEngine() {\n return $this->getApplication()->getEngine();\n }", "public function getInstance()\n {\n if (! $this->engineInstance) {\n $this->engineInstance = new Engine($this->templatesPath ?: $this->getTemplatesDirectory());\n\n if ($this->fileExtension) {\n $this->engineInstance->setFileExtension($this->fileExtension); \n }\n\n if (count($this->templatesFolders) > 0) {\n foreach ($this->templatesFolders as $name => $path) {\n $this->engineInstance->addFolder($name, $path);\n }\n }\n\n if (count($this->parserExtensions) > 0) {\n foreach ($this->parserExtensions as $extension) {\n $this->engineInstance->loadExtension($extension);\n }\n }\n }\n\n return $this->engineInstance;\n }", "public function engines()\n {\n static::$spec = 'engines';\n return $this;\n }", "static function setEngine(Angie_Engine $engine, $engine_name = null) {\n $name = trim($engine_name);\n if(trim($name) == '') {\n self::$default_engine = $engine;\n } else {\n self::$additional_engines[$name] = $engine;\n } // if\n }", "public function getEngineResolver ()\n {\n return $this->engines;\n }", "public function setEngine(string $engine): self\n {\n $this->engine = $engine;\n return $this;\n }", "private function setEngine()\n {\n $this->engine = null;\n\n $engine = self::ENGINE_OPENSSL;\n\n if ($this->isValidEngine($engine)) {\n $this->engine = $engine;\n }\n\n $this->changed = true;\n }", "private function __construct(){\n\t\t$engine = CODE_GENERATOR_NAME_RESOLVER_ENGINE;\n\t\t$this->engine = new $engine();\n\t}", "public function setEngine($loc)\r\n\t{\r\n\t\tif($this->_location == $loc && $this->_engineIsSet)\r\n\t\t\treturn;\r\n\r\n\t\tswitch($this->isSupported($loc))\r\n\t\t{\r\n\t\t\tcase true:\r\n\t\t\tswitch($loc)\r\n\t\t\t{\r\n\t\t\t\tcase 'db':\r\n\t\t\t\t$this->_location = 'db';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'file':\r\n\t\t\t\t$this->_objects['file'] = new File();\r\n\t\t\t\t$this->_location = 'file';\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tswitch(!empty($this->_location))\r\n\t\t{\r\n\t\t\tcase true:\r\n\t\t\t//clear any other unused engine data\r\n\t\t\tforeach(array_diff_key($this->_supported, [$this->_location => ucfirst($this->_location)]) as $clear=>$key)\r\n\t\t\t{\r\n\t\t\t\t$this->remove(''.$clear);\r\n\t\t\t}\r\n\t\t\t$this->set('current.engine', $this->_location);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t$this->getContainers(null);\r\n\t\t$this->_engineIsSet = true;\r\n\t}" ]
[ "0.69720995", "0.68597734", "0.68066996", "0.68066996", "0.68066996", "0.66889334", "0.6367825", "0.6281838", "0.6222222", "0.6213419", "0.6207141", "0.6147567", "0.6147567", "0.60918957", "0.6054961", "0.6054961", "0.6054961", "0.6051121", "0.5910262", "0.5882283", "0.5834715", "0.5714443", "0.5644231", "0.5621509", "0.55573994", "0.55165046", "0.54510206", "0.5449712", "0.5443847", "0.5342189" ]
0.74071217
0
Instantiates and loads the reader based on the $format.
private function loadReader(): void { $this->readerInstance = ReaderFactory::from($this->format); $this->bootReader($this->readerInstance); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReader() {}", "public function getReader(): Reader\n {\n return new Reader($this->settings);\n }", "private function readFormat() {\n $length = Format::getUInt2d($this->data, $this->pos + 2);\n $recordData = substr($this->data, $this->pos + 4, $length);\n\n // move stream pointer to next record\n $this->pos += 4 + $length;\n\n $indexCode = Format::getUInt2d($recordData, 0);\n if ($this->version == self::XLS_BIFF8) {\n $string = self::readUnicodeStringLong(substr($recordData, 2));\n } else {\n // BIFF7\n $string = $this->readByteStringShort(substr($recordData, 2));\n }\n\n $formatString = $string['value'];\n $this->formats[$indexCode] = $formatString;\n }", "public function read($importer_conf);", "protected function registerReader($format, \\Closure $reader) {\n\t\t$this->readers[$format] = $reader;\n\t}", "public function createReaderFromStream(UploadedFile $filestream, $formatDates = true);", "private function createReader()\n {\n $reader = phpiredis_reader_create();\n\n phpiredis_reader_set_status_handler($reader, $this->getStatusHandler());\n phpiredis_reader_set_error_handler($reader, $this->getErrorHandler());\n\n return $reader;\n }", "private function createReader()\n {\n $reader = phpiredis_reader_create();\n\n phpiredis_reader_set_status_handler($reader, $this->getStatusHandler());\n phpiredis_reader_set_error_handler($reader, $this->getErrorHandler());\n\n return $reader;\n }", "private function createReader()\n {\n $reader = phpiredis_reader_create();\n\n phpiredis_reader_set_status_handler($reader, $this->getStatusHandler());\n phpiredis_reader_set_error_handler($reader, $this->getErrorHandler());\n\n return $reader;\n }", "function parse($format)\n {\n $filename = 'File/IMC/Parse/'. $format . '.php';\n $classname = 'File_IMC_Parse_'. $format;\n\n if (!file_exists($filename)) {\n return File_IMC::raiseError(\n 'No builder driver exists for format: ' . $format,\n FILE_IMC_ERROR_INVALID_DRIVER);\n }\n\n include_once $filename;\n \n if (!class_exists($classname)) {\n return File_IMC::raiseError(\n 'No parser driver exists for format: ' . $format, \n FILE_IMC_ERROR_INVALID_DRIVER);\n }\n \n $class = new $classname;\n \n return $class;\n }", "public function getReader(): ReaderInterface;", "protected function init()\n {\n $this->checkDatabaseFile();\n\n $this->reader = new Reader(\n $this->getDatabasePath(),\n $this->getLocales()\n );\n }", "function __construct($parentClassName){\n $this->reader = new $parentClassName();\n }", "public function from(string $format): self\n {\n if (! isset($this->inputRaw)) {\n throw new RawInputNotProvidedException;\n }\n\n $inputConverter = $this->factory->getConverter($format);\n\n $this->inputArray = $inputConverter->split($this->inputRaw);\n\n return $this;\n }", "protected function initializeRead()\n {\n // TODO mime_content_type is deprecated, use Symfony\\Component\\HttpFoundation\\File\\MimeTypeMimeTypeGuesser?\n if ('application/zip' === mime_content_type($this->filePath)) {\n $this->extractZipArchive();\n }\n\n $this->csv = new \\SplFileObject($this->filePath);\n $this->csv->setFlags(\n \\SplFileObject::READ_CSV |\n \\SplFileObject::READ_AHEAD |\n \\SplFileObject::SKIP_EMPTY\n );\n $this->csv->setCsvControl($this->delimiter, $this->enclosure, $this->escape);\n }", "public function setReadFormatToCustom ()\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!$this->isReading())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->resetReadFormat();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->readVariables['format'] = 'custom';\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "public function setReader(ReaderInterface $reader) {}", "public function __construct($format = 'object')\n {\n $this->setFormat($format);\n }", "public function __construct($format) {\n\t\t\t$this->setFormat($format);\n\t\t}", "function wow_armory_reader(){$this->__construct();}", "public static function get($format, $data = array()) {\n\t\tswitch(strtoupper($format)) {\n\t\t\tcase 'XML':\n\t\t\tcase \\Bedrock\\Common\\DataFormat::TYPE_XML:\n\t\t\t\treturn new \\Bedrock\\Common\\DataFormat\\XML($data);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'YAML':\n\t\t\tcase \\Bedrock\\Common\\DataFormat::TYPE_YAML:\n\t\t\t\treturn new \\Bedrock\\Common\\DataFormat\\YAML($data);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'JSON':\n\t\t\tcase \\Bedrock\\Common\\DataFormat::TYPE_JSON:\n\t\t\t\treturn new \\Bedrock\\Common\\DataFormat\\JSON($data);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'CSV':\n\t\t\tcase \\Bedrock\\Common\\DataFormat::TYPE_CSV:\n\t\t\t\treturn new \\Bedrock\\Common\\DataFormat\\CSV($data);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\treturn NULL;\n\t\t}\n\t}", "public function parse(string $path): Reader;", "protected function getReader()\n {\n return $this->reader;\n }", "protected function getReader()\n {\n return $this->reader;\n }", "public function __construct() {\n\t\tif ($this->format == 'json') {\n\t\t\tif (!function_exists('json_decode')) {\n\t\t\t\tthrow new Exception('The JSON library could not be loaded, and is needed for the JSON format.');\n\t\t\t}\n\t\t} else if ($this->format == 'xml') {\n\t\t\tif (!function_exists('simplexml_load_string')) {\n\t\t\t\tthrow new Exception('The SimpleXML library could not be loaded, and is needed for the XML format.');\n\t\t\t}\n\t\t} else if ($this->format == 'php') {\n\t\t\tif (!function_exists('unserialize')) {\n\t\t\t\tthrow new Exception('Could not unserialize data.');\n\t\t\t}\n\t\t}\n\t}", "public function read(bool $parse = true);", "public function initImporter()\n {\n $input_format = Config::get('input_format');\n $impData = array (\n 'sheet' => $this->sheet,\n 'delimiter' => $this->delimiter ? : $input_format['delimiter'],\n 'file_type' => $this->file_type,\n 'record' => $this->record,\n );\n $file = array('tmp_name' => $this->dataFileName);\n $this->setCurrentProject();\n \n $this->parser = $this->configureImport($impData, $file);\n }", "public static function createReaderFromFile(string $path)\n {\n return ReaderFactory::createFromFile($path);\n }", "public function __construct(ReaderInterface $reader)\n {\n parent::__construct();\n $this->reader = $reader;\n }", "public function createStandardReader(): ReaderInterface\n {\n if ($this->allowReading === true) {\n if ($this->standardReader === null) {\n $this->standardReader = new Reader();\n }\n\n return $this->standardReader;\n }\n\n return $this->createErrorReader();\n }" ]
[ "0.65210086", "0.6113636", "0.6057775", "0.60538185", "0.6043584", "0.59441847", "0.58697236", "0.58697236", "0.58697236", "0.58610594", "0.5813276", "0.57819355", "0.57449716", "0.57000875", "0.56711876", "0.5641587", "0.56058633", "0.558472", "0.55707633", "0.5569937", "0.5550715", "0.5546117", "0.5540103", "0.5540103", "0.5420435", "0.5406854", "0.54013366", "0.540015", "0.539741", "0.5394886" ]
0.756526
0
Instantiates and loads the writer based on the $format.
private function loadWriter(): void { $this->writerInstance = WriterFactory::from($this->format); $this->bootWriter($this->writerInstance); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getFileWriter($format)\n {\n switch ($format) {\n case self::FORMAT_CSV:\n $writer = new CsvFileWriter();\n break;\n case self::FORMAT_EXCEL:\n $writer = new ExcelFileWriter();\n break;\n default:\n throw new \\InvalidArgumentException(sprintf('Invalid export format: %s', $format));\n }\n\n $writer->enableHeaderFields();\n\n return $writer;\n }", "public static function OutputFactory($format = 'json')\n {\n if (!is_string($format) || ($format == ''))\n $format = 'json';\n $format = ucfirst(strtolower($format));\n $classname = \"WSOutput_$format\";\n\n if (!class_exists($classname, false)) {\n if (file_exists(dirname(__FILE__).\"/WSOutput/$format.php\"))\n include_once(\"ws/classes/WSOutput/$format.php\");\n }\n if (!class_exists($classname, false)) {\n throw new WSException(\"Output type $format not supported\"); \t\n }\n \n return (new $classname());\n }", "public function newWriter($format, \\PHPExcel $PHPExcel)\n {\n switch (true) {\n case $format === Adapter::XLSX:\n $writer = new \\PHPExcel_Writer_Excel2007($PHPExcel);\n break;\n case $format === Adapter::XLS:\n $writer = new \\PHPExcel_Writer_Excel5($PHPExcel);\n break;\n case $format === Adapter::CSV:\n $writer = new \\PHPExcel_Writer_CSV($PHPExcel);\n break;\n default:\n throw new \\InvalidArgumentException('the given format is not supported');\n }\n return $writer;\n }", "public function package($format);", "public function setFormat ($format) {}", "function parse($format)\n {\n $filename = 'File/IMC/Parse/'. $format . '.php';\n $classname = 'File_IMC_Parse_'. $format;\n\n if (!file_exists($filename)) {\n return File_IMC::raiseError(\n 'No builder driver exists for format: ' . $format,\n FILE_IMC_ERROR_INVALID_DRIVER);\n }\n\n include_once $filename;\n \n if (!class_exists($classname)) {\n return File_IMC::raiseError(\n 'No parser driver exists for format: ' . $format, \n FILE_IMC_ERROR_INVALID_DRIVER);\n }\n \n $class = new $classname;\n \n return $class;\n }", "public function __construct($format) {\n\t\t\t$this->setFormat($format);\n\t\t}", "protected function initNewWriterWhenNeeded()\n {\n if (!$this->writer) {\n $this->writer = app('excel.writer');\n $this->writer->injectExcel($this->excel, false);\n $this->writer->setFileName($this->getFileName());\n $this->writer->setTitle($this->getTitle());\n }\n }", "private function scriptFactory($format)\n {\n $class = self::scriptFormats[$format];\n return new $class;\n }", "public function __construct($format = 'object')\n {\n $this->setFormat($format);\n }", "public function __construct(Writer $writer)\n {\n $this->writer = $writer;\n }", "public static function getInstance($format) {\n\t\t\tif (null === static::$instance) {\n \tstatic::$instance = new Format($format);\n \t}\n \treturn static::$instance;\n\t\t}", "public function setFormat($format);", "public function setFormat($format);", "private function loadReader(): void\r\n {\r\n $this->readerInstance = ReaderFactory::from($this->format);\r\n $this->bootReader($this->readerInstance);\r\n }", "public function setFormat($format) {\n\t}", "public function onGenerate($format)\n {\n try\n {\n $filters = $this->getFilters();\n \n // open a transaction with database 'microerp'\n TTransaction::open('microerp');\n \n // creates a repository for Pessoa\n $repository = new TRepository('Pessoa');\n \n // creates a criteria\n $criteria = new TCriteria;\n\n if ($filters)\n {\n foreach ($filters as $filter) \n {\n $criteria->add($filter); \n }\n }\n\n // load the objects according to criteria\n $objects = $repository->load($criteria, FALSE);\n\n if ($objects)\n {\n $widths = array(100,200,200,200,200,200);\n\n switch ($format)\n {\n case 'html':\n $tr = new TTableWriterHTML($widths);\n break;\n case 'pdf':\n $tr = new TTableWriterPDF($widths, 'L');\n break;\n case 'rtf':\n if (!class_exists('PHPRtfLite_Autoloader'))\n {\n PHPRtfLite::registerAutoloader();\n }\n $tr = new TTableWriterRTF($widths);\n break;\n }\n\n if (!empty($tr))\n {\n // create the document styles\n $tr->addStyle('title', 'Helvetica', '10', 'B', '#000000', '#dbdbdb');\n $tr->addStyle('datap', 'Arial', '10', '', '#333333', '#f0f0f0');\n $tr->addStyle('datai', 'Arial', '10', '', '#333333', '#ffffff');\n $tr->addStyle('header', 'Helvetica', '16', 'B', '#5a5a5a', '#6B6B6B');\n $tr->addStyle('footer', 'Helvetica', '10', 'B', '#5a5a5a', '#A3A3A3');\n $tr->addStyle('break', 'Helvetica', '10', 'B', '#ffffff', '#9a9a9a');\n $tr->addStyle('total', 'Helvetica', '10', 'I', '#000000', '#c7c7c7');\n\n // add titles row\n $tr->addRow();\n $tr->addCell('Id', 'left', 'title');\n $tr->addCell('Nome', 'left', 'title');\n $tr->addCell('Fone', 'left', 'title');\n $tr->addCell('Email', 'left', 'title');\n $tr->addCell('Cep', 'left', 'title');\n $tr->addCell('Cidade', 'left', 'title');\n\n $grandTotal = [];\n\n // controls the background filling\n $colour = false; \n foreach ($objects as $object)\n {\n $style = $colour ? 'datap' : 'datai';\n \n $grandTotal['cidade_id'][] = $object->cidade_id;\n \n $tr->addRow();\n $tr->addCell($object->id, 'left', $style);\n $tr->addCell($object->nome, 'left', $style);\n $tr->addCell($object->fone, 'left', $style);\n $tr->addCell($object->email, 'left', $style);\n $tr->addCell($object->cep, 'left', $style);\n $tr->addCell($object->cidade->nome, 'left', $style);\n\n $colour = !$colour;\n }\n\n $tr->addRow();\n\n $total_cidade_id = count($grandTotal['cidade_id']);\n \n $tr->addCell('', '', 'total');\n $tr->addCell('', '', 'total');\n $tr->addCell('', '', 'total');\n $tr->addCell('', '', 'total');\n $tr->addCell('', '', 'total');\n $tr->addCell('Qtde: '.$total_cidade_id, 'left', 'total');\n\n $file = 'report_'.uniqid().\".{$format}\";\n \n // stores the file\n if (!file_exists(\"app/output/{$file}\") || is_writable(\"app/output/{$file}\"))\n {\n $tr->save(\"app/output/{$file}\");\n }\n else\n {\n throw new Exception(_t('Permission denied') . ': ' . \"app/output/{$file}\");\n }\n\n parent::openFile(\"app/output/{$file}\");\n\n // shows the success message\n new TMessage('info', 'Report generated. Please, enable popups.');\n }\n }\n else\n {\n new TMessage('error', _t('No records found'));\n }\n\n // close the transaction\n TTransaction::close();\n }\n catch (Exception $e)\n {\n new TMessage('error', $e->getMessage());\n TTransaction::rollback();\n }\n }", "public function support($format);", "abstract protected function openWriter();", "public function createPrinterByName($format) {\r\n\t\treturn new $this->mFormats[$format] ($this, $format);\r\n\t}", "protected function registerReader($format, \\Closure $reader) {\n\t\t$this->readers[$format] = $reader;\n\t}", "public function __construct( StreamWriter $writer ) {\n\t\t$this->writer = $writer;\n\t}", "protected function _setFormat()\n {\n $this->format = $this->identifier->getFormatByFile($this->file);\n\n return $this;\n }", "public function getWriter(): Writer\n {\n return new Writer($this->settings);\n }", "public function __construct(string $format = 'P%yY%mM%dDT%hH%iM%sS')\n {\n $this->format = $format;\n }", "protected function getTranslation_WriterService()\n {\n $this->services['translation.writer'] = $instance = new \\Symfony\\Component\\Translation\\Writer\\TranslationWriter();\n\n $instance->addDumper('php', ${($_ = isset($this->services['translation.dumper.php']) ? $this->services['translation.dumper.php'] : $this->get('translation.dumper.php')) && false ?: '_'});\n $instance->addDumper('xlf', ${($_ = isset($this->services['translation.dumper.xliff']) ? $this->services['translation.dumper.xliff'] : $this->get('translation.dumper.xliff')) && false ?: '_'});\n $instance->addDumper('po', ${($_ = isset($this->services['translation.dumper.po']) ? $this->services['translation.dumper.po'] : $this->get('translation.dumper.po')) && false ?: '_'});\n $instance->addDumper('mo', ${($_ = isset($this->services['translation.dumper.mo']) ? $this->services['translation.dumper.mo'] : $this->get('translation.dumper.mo')) && false ?: '_'});\n $instance->addDumper('yml', ${($_ = isset($this->services['translation.dumper.yml']) ? $this->services['translation.dumper.yml'] : $this->get('translation.dumper.yml')) && false ?: '_'});\n $instance->addDumper('ts', ${($_ = isset($this->services['translation.dumper.qt']) ? $this->services['translation.dumper.qt'] : $this->get('translation.dumper.qt')) && false ?: '_'});\n $instance->addDumper('csv', ${($_ = isset($this->services['translation.dumper.csv']) ? $this->services['translation.dumper.csv'] : $this->get('translation.dumper.csv')) && false ?: '_'});\n $instance->addDumper('ini', ${($_ = isset($this->services['translation.dumper.ini']) ? $this->services['translation.dumper.ini'] : $this->get('translation.dumper.ini')) && false ?: '_'});\n $instance->addDumper('json', ${($_ = isset($this->services['translation.dumper.json']) ? $this->services['translation.dumper.json'] : $this->get('translation.dumper.json')) && false ?: '_'});\n $instance->addDumper('res', ${($_ = isset($this->services['translation.dumper.res']) ? $this->services['translation.dumper.res'] : $this->get('translation.dumper.res')) && false ?: '_'});\n\n return $instance;\n }", "public function setFormat($format)\r\n {\r\n $this->_format = $format;\r\n return $this;\r\n }", "public static function getInstance($format)\n\t{\n\t\tstatic $instances;\n\n\t\t// Only create one parser for each format.\n\t\tif (isset($instances[$format]))\n\t\t{\n\t\t\treturn $instances[$format];\n\t\t}\n\n\t\t// Create an array of instances if necessary.\n\t\tif (!is_array($instances))\n\t\t{\n\t\t\t$instances = array();\n\t\t}\n\n\t\t// Setup the adapter for the parser.\n\t\t$format = JFilterInput::getInstance()->clean($format, 'cmd');\n\t\t$path = __DIR__ . '/parser/' . $format . '.php';\n\t\t$class = 'FinderIndexerParser' . ucfirst($format);\n\n\t\t// Check if a parser exists for the format.\n\t\tif (file_exists($path))\n\t\t{\n\t\t\t// Instantiate the parser.\n\t\t\tinclude_once $path;\n\t\t\t$instances[$format] = new $class;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Throw invalid format exception.\n\t\t\tthrow new Exception(JText::sprintf('COM_FINDER_INDEXER_INVALID_PARSER', $format));\n\t\t}\n\n\t\treturn $instances[$format];\n\t}", "public function format($format) {\n\t\t$this->format = $format;\n\n\t\treturn $this;\n\t}", "public static function setFormat($format)\n {\n self::getInstance()->format = $format;\n }" ]
[ "0.6995415", "0.63508326", "0.5862333", "0.5735663", "0.5730463", "0.57247144", "0.5711373", "0.57007617", "0.5647117", "0.5632293", "0.5630239", "0.5593019", "0.55646855", "0.55646855", "0.55171925", "0.54579055", "0.54474026", "0.54201794", "0.5412445", "0.5407713", "0.54023755", "0.53945786", "0.5363991", "0.5356156", "0.53462476", "0.5320478", "0.5221848", "0.5180741", "0.5160832", "0.5133689" ]
0.7548069
0
Trigger the entity.remove.pre event.
public function preRemove(LifecycleEventArgs $args) { $this->trigger('entity.remove.pre', $args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function preRemove(LifecycleEventArgs $args)\n {\n $em = $args->getEntityManager();\n $this->sync_service->logEntityToCrmUpdateTable($em, $args,'delete');\n }", "public function preDelete(Doctrine_Event $event)\n {\n $event->getInvoker()->removeImages();\n }", "public function preRemove(LifecycleEventArgs $event)\n {\n $this->manager->delete($event->getEntity());\n }", "public function preRemove(LifecycleEventArgs $args) : void\n {\n $entity = $args->getEntity();\n \n if ($entity instanceof Document)\n {\n $attachment = $entity->getAttachment();\n $this->removeFile($attachment);\n \n $images = $attachment->getImages();\n $this->removeImages($images);\n }\n }", "private function afterRemove(): void\n {\n $this->trigger(self::EVENT_AFTER_REMOVING);\n }", "public function preRemove(LifecycleEventArgs $args) : void {\n $this->saveHistory($args, 'delete');\n }", "public function postRemove(LifecycleEventArgs $args)\n {\n $this->trigger('entity.remove.post', $args);\n }", "public function firePreDeleteEvents()\n {\n $parsedClassName = explode('\\\\',get_class($this));\n $className = end($parsedClassName);\n\n $extensionsClass = \\Config::get('photon.dynamic_module_extensions_namespace').'\\\\'.$className.\"ModuleExtensions\";\n\n if (\n class_exists($extensionsClass) &&\n in_array('Photon\\PhotonCms\\Core\\Entities\\DynamicModuleExtension\\Contracts\\ModuleExtensionHandlesPreDelete', class_implements($extensionsClass))\n ) {\n $extensionsInstance = \\App::make($extensionsClass);\n $extensionsInstance->preDelete($this, $this->cloneBefore);\n }\n }", "public function preRemove(EventArgs $args)\n {\n $ea = $this->getEventAdapter($args);\n $om = $ea->getObjectManager();\n $object = $ea->getObject();\n $meta = $om->getClassMetadata(get_class($object));\n\n if ($this->getConfiguration($om, $meta->getName())) {\n $this->getStrategy($om, $meta->getName())->processPreRemove($om, $object);\n }\n }", "public function onRemove();", "public function preDelete($event) {\n\t\tself::fireCategoryDeleted($this);\n\t}", "public function preRemove(LifecycleEventArgs $args)\n {\n $entity = $args->getObject();\n if (!$this->isEntityManagedByThisBundle($entity) || !method_exists($entity, 'get_objectType')) {\n return;\n }\n \n // create the filter event and dispatch it\n $event = $this->createFilterEvent($entity);\n $this->eventDispatcher->dispatch(constant('\\\\MU\\\\YourCityModule\\\\YourCityEvents::' . strtoupper($entity->get_objectType()) . '_PRE_REMOVE'), $event);\n if ($event->isPropagationStopped()) {\n return false;\n }\n \n // delete workflow for this entity\n $workflowHelper = $this->container->get('mu_yourcity_module.workflow_helper');\n $workflowHelper->normaliseWorkflowData($entity);\n $workflow = $entity['__WORKFLOW__'];\n if ($workflow['id'] > 0) {\n $result = true;\n try {\n $entityManager = $args->getEntityManager();\n $workflow = $entityManager->find('Zikula\\Core\\Doctrine\\Entity\\WorkflowEntity', $workflow['id']);\n $entityManager->remove($workflow);\n $entityManager->flush();\n } catch (\\Exception $e) {\n $result = false;\n }\n if (false === $result) {\n $session = $this->container->get('session');\n $session->getFlashBag()->add('error', $this->translator->__('Error! Could not remove stored workflow. Deletion has been aborted.'));\n \n return false;\n }\n }\n }", "public function preDelete(Doctrine_Event $event)\n {\n Doctrine::getTable('rtIndex')->clearIndexForObject($event->getInvoker());\n }", "public function beforeDelete(): void\n {\n }", "protected function _beforeDelete()\r\n\t{}", "function hook_entity_predelete(\\Drupal\\Core\\Entity\\EntityInterface $entity) {\n $connection = \\Drupal::database();\n // Count references to this entity in a custom table before they are removed\n // upon entity deletion.\n $id = $entity->id();\n $type = $entity->getEntityTypeId();\n $count = \\Drupal::database()->select('example_entity_data')\n ->condition('type', $type)\n ->condition('id', $id)\n ->countQuery()\n ->execute()\n ->fetchField();\n\n // Log the count in a table that records this statistic for deleted entities.\n $connection->merge('example_deleted_entity_statistics')\n ->key(['type' => $type, 'id' => $id])\n ->fields(['count' => $count])\n ->execute();\n}", "public function onRemove()\n {\n // Change the associated media to the unsorted album.\n Shopware()->Db()->query('UPDATE s_media SET albumID = ? WHERE albumID = ?', [-10, $this->id]);\n }", "public function onAfterDelete() {\n if (\\Config::inst()->get('ElasticSearch', 'disabled')) {\n return;\n }\n \n $stage = \\Versioned::current_stage();\n\t\t$this->service->remove($this->owner, $stage);\n\t}", "protected function onBeforeDelete()\n\t{\n\t\t$event = $this->table->getEvent();\n\t\tif ($this->string()->length($event) > 0){\n\t\t\t$event = 'OnBefore'.$this->string()->ucwords($event).'Delete';\n\t\t\tif ($this->fire($event,[$this->id]) === false){\n\t\t\t\tif (!$this->entity->hasErrors()){\n\t\t\t\t\t$trans = 'db.unitofwork.delete_unknow_error';\n\t\t\t\t\t$this->entity->addError(false,$this->trans($trans));\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "protected function onPreDelete($object)\n {\n // Implements logic for pre-delete actions here\n }", "public function onBeforeDeleteUser(KEvent $event)\n {\n\n $person = KService::get('repos:people.person')->find(array(\n 'id' => $event->person->id\n ));\n\n if ($person) {\n\n KService::get('repos:components')\n ->fetchSet()\n ->registerEventDispatcher(KService::get('anahita:event.dispatcher'));\n\n KService::get('anahita:event.dispatcher')\n ->dispatchEvent('onDeleteActor', array(\n 'actor_id' => $person->id\n ));\n\n $person->delete()->save();\n }\n }", "public function beforeDelete() {\n }", "public function onPreRemove(OrderItemEvent $event)\n {\n if ($this->isOrderLocked($event)) {\n return;\n }\n\n $this->prepareEvent($event);\n }", "public function postRemove(LifecycleEventArgs $args)\n {\n $entity = $args->getObject();\n if (!$this->isEntityManagedByThisBundle($entity) || !method_exists($entity, 'get_objectType')) {\n return;\n }\n \n $objectType = $entity->get_objectType();\n \n $uploadFields = $this->getUploadFields($objectType);\n if (count($uploadFields) > 0) {\n $uploadHelper = $this->container->get('mu_yourcity_module.upload_helper');\n foreach ($uploadFields as $uploadField) {\n if (empty($entity[$uploadField])) {\n continue;\n }\n \n // remove upload file\n $uploadHelper->deleteUploadFile($entity, $uploadField);\n }\n }\n \n $currentUserApi = $this->container->get('zikula_users_module.current_user');\n $logArgs = ['app' => 'MUYourCityModule', 'user' => $currentUserApi->get('uname'), 'entity' => $objectType, 'id' => $entity->getKey()];\n $this->logger->debug('{app}: User {user} removed the {entity} with id {id}.', $logArgs);\n \n // create the filter event and dispatch it\n $event = $this->createFilterEvent($entity);\n $this->eventDispatcher->dispatch(constant('\\\\MU\\\\YourCityModule\\\\YourCityEvents::' . strtoupper($objectType) . '_POST_REMOVE'), $event);\n }", "public function preDelete($event)\n {\n // Remove the thumbnail\n @unlink($this->getThumbnailPath());\n }", "function hook_ENTITY_TYPE_predelete(\\Drupal\\Core\\Entity\\EntityInterface $entity) {\n $connection = \\Drupal::database();\n // Count references to this entity in a custom table before they are removed\n // upon entity deletion.\n $id = $entity->id();\n $type = $entity->getEntityTypeId();\n $count = \\Drupal::database()->select('example_entity_data')\n ->condition('type', $type)\n ->condition('id', $id)\n ->countQuery()\n ->execute()\n ->fetchField();\n\n // Log the count in a table that records this statistic for deleted entities.\n $connection->merge('example_deleted_entity_statistics')\n ->key(['type' => $type, 'id' => $id])\n ->fields(['count' => $count])\n ->execute();\n}", "public function postRemoveEntity(LifecycleEventArgs $eventArgs)\n {\n $file = $eventArgs->getDocument();\n if (!$file instanceof Attachment) {\n return;\n }\n\n $dm = $eventArgs->getDocumentManager();\n //$repo = $dm->getRepository('Applications\\Entity\\Application');\n\n $fileId = new \\MongoId($file->id);\n\n $dm->createQueryBuilder('Applications\\Entity\\Application')\n ->update()->multiple(true)\n ->field('attachments')->equals($fileId)->pull($fileId)\n ->getQuery()->execute();\n\n\n $dm->createQueryBuilder('Applications\\Entity\\Application')\n ->update()->multiple(true)\n ->field('contact.image')->equals($fileId)->set(null)\n ->getQuery()->execute();\n }", "protected function beforeDelete()\n {\n }", "public function beforeDelete($event)\n {\n\t\tEntityGallery::model()->deleteAll(array(\n\t\t\t'condition' => 'entity_id=:e_id AND entity_type=:e_type',\n\t\t\t'params'=>array(':e_id'=>$this->getOwner()->id, ':e_type'=>$this->_entityName),\n\t\t));\n parent::beforeDelete($event);\n }", "protected function _before_delete(): void\n {\n //object the transaction and add a on commit event\n //it is better to do it this way insted of deleting the images in _after_delete but without taking into account the transaction.\n //there is no way to obtain the current transaction (this is intentional)\n //instead a nested one is started\n $Transaction = self::new_transaction($TR);\n $Transaction->begin();\n $Transaction->add_callback('_after_commit', function(): void\n {\n //if there is an exception here will hit a bug in CompositeTransaction nesting\n if (file_exists($this->image_path) && is_writable($this->image_path)) {\n unlink($this->image_path);\n }\n });\n $Transaction->commit();\n }" ]
[ "0.7315945", "0.68203515", "0.67993945", "0.6637306", "0.6586675", "0.6585903", "0.65081334", "0.63647044", "0.63552743", "0.6247604", "0.62232125", "0.61726344", "0.61484975", "0.6071808", "0.6055109", "0.6014714", "0.6000112", "0.5994701", "0.59807193", "0.59589106", "0.5958523", "0.5950256", "0.59294593", "0.59033453", "0.58969545", "0.588862", "0.5883051", "0.5832017", "0.58118767", "0.579074" ]
0.7251124
1
Trigger the entity.persist.post event.
public function postPersist(LifecycleEventArgs $args) { $this->trigger('entity.persist.post', $args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function postPersist()\n {\n }", "public function onUpload(PostPersistEvent $event)\n {\n\n\n\n if ($event->getType() == \"videos\") {\n $this->persistVideo($event);\n } elseif ($event->getType() == \"tutos\") {\n $this->persistTutos($event);\n } elseif ($event->getType() == \"images\") {\n $this->persistImage($event);\n } elseif ($event->getType() == \"annonces\") {\n $this->persistAdvertisement($event);\n }\n\t\t\n\n }", "public function postPersist (LifecycleEventArgs $args)\n {\n $this->handleDoctrineEvent($args);\n }", "public function doPersist(): void;", "public function postPersist(LifecycleEventArgs $args)\n {\n $em = $args->getEntityManager();\n $entity = $args->getEntity();\n $entityType = $em->getClassMetadata(get_class($entity))->getTableName();\n\n $this->sync_service->logEntityToCrmUpdateTable($em, $args,'create');\n $this->sync_service->updateLastContactedField($em, $args);\n $this->sync_service->updateLastMetField($em, $entity, $entityType);\n }", "protected function _postSave()\n {}", "public function postPersist(EventArgs $args)\n {\n $ea = $this->getEventAdapter($args);\n $om = $ea->getObjectManager();\n $object = $ea->getObject();\n $meta = $om->getClassMetadata(get_class($object));\n\n if ($this->getConfiguration($om, $meta->getName())) {\n $this->getStrategy($om, $meta->getName())->processPostPersist($om, $object, $ea);\n }\n }", "public function postPersist(LifecycleEventArgs $eventArgs)\n {\n $entity = $eventArgs->getEntity();\n\n $class = $this->em->getClassMetadata(get_class($entity));\n if (!$this->metadataFactory->isAudited($class->name)) {\n return;\n }\n\n $this->saveRevisionEntityData($class, $this->getOriginalEntityData($entity), 'INS');\n }", "public function postPersist(LifecycleEventArgs $args) : void {\n $this->saveHistory($args, 'create');\n }", "protected function _postSave()\n {\n }", "protected function _postSave()\n {\n }", "protected function _postSave()\n {\n // Create logic that precedes saving of data into the database.\n }", "protected function postSave()\n {\n }", "public function postPersist(LifecycleEventArgs $event)\n {\n $this->callUpdate($event);\n }", "public function postPersist(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n // check if entity is tracked by loggable and without foreign key\n if (array_key_exists($meta->name, $this->configurations) && count($this->pendingLogInserts)) {\n $oid = spl_object_hash($object);\n\n // there should be single identifier\n $identifierField = $this->getSingleIdentifierFieldName($meta);\n $logMeta = $om->getClassMetadata($this->getLogClass($meta->name));\n if (array_key_exists($oid, $this->pendingLogInserts)) {\n // load the pending logs without key\n $log = $this->pendingLogInserts[$oid];\n $logMeta->getReflectionProperty('foreignKey')->setValue(\n $log,\n $meta->getReflectionProperty($identifierField)->getValue($object)\n );\n $this->insertLogRecord($om, $log);\n }\n }\n }", "public function postPersist(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n\n if ($entity instanceof Taggable) {\n $this->getTagManager()->saveTagging($entity);\n }\n }", "public function prePersist()\n {\n }", "function persist($entity);", "public function save(\\WTGear\\Repositories\\Interfaces\\EntityInterface $post): bool\n {\n// $id = $this->persistence->persist([\n// 'text' => $post->getText(),\n// 'title' => $post->getTitle(),\n// ]);\n//\n// $post->setId($id);\n }", "public function persist()\n\t{\n\t}", "public function persist($blogId, $post);", "public function postFlush(PostFlushEventArgs $args)\n {\n $change = false;\n\n $em = $args->getEntityManager();\n $uow = $args->getEntityManager()->getUnitOfWork();\n $result = $uow->getIdentityMap();\n if(isset($result[$this->targetClass])) {\n foreach ($result[$this->targetClass] as $entity) {\n $updated = $this->updateEntity($entity);\n if($updated) {\n $change = true;\n }\n\n $propertyAccessor = PropertyAccess::createPropertyAccessor();\n $targetProperty = $propertyAccessor->getValue($entity, $this->targetProperty);\n\n if($targetProperty && $uow->getEntityState($targetProperty) !== UnitOfWork::STATE_MANAGED) {\n $em->persist($targetProperty);\n $change = true;\n }\n }\n }\n\n if($change) {\n $em->flush();\n }\n }", "public function persist();", "public function save() {\n\t\tself::getEntityManager()->persist($this);\n\t}", "public function savePost()\n {\n $contentContainer = ContentContainer::findRecord($this->guid);\n\n $post = new Post($contentContainer);\n $post->message = $this->message;\n\n if($post->save())\n {\n if(!empty($this->fileList) && is_array($this->fileList))\n {\n foreach($this->fileList as $fileGuid)\n {\n $file = File::findOne(['guid' => $fileGuid]);\n\n if($file)\n {\n $post->fileManager->attach($file);\n }\n }\n }\n }\n }", "public function planner_save_post() {\n \n // Save a post\n (new MidrubBaseUserAppsCollectionPlannerHelpers\\Posts)->planner_save_post();\n \n }", "public function PostPersist(LifecycleEventArgs $args){\n\t\t$entity = $args->getObject(); \n\n\t\tif(!$entity instanceof Application && !$entity instanceof Advert) return ; \n\n\t\tif($entity instanceof Application) $this->serviceEmail->envoiEmail(\"Une nouvelle candidature\", \"[email protected]\", \"[email protected]\", \"Bonjour, \\nJe m'appelle \".$entity->getAuthor().\" \\n\".$entity->getContent()); \n\n\t\tif($entity instanceof Advert) $this->serviceEmail->envoiEmail(\"Ajout de candidature\", \"[email protected]\", \"[email protected]\", \"Bonjour monsieur \".$entity->getAuthor().\"\\nNous vous informons que vous venez à l'instant de rajouter une nouvelle annonce sur notre site.\\nTitre de l'annonce: \".$entity->getTitle().\" \\ncontenu de l'annonce: \".$entity->getContent()); \n\n\t}", "public function postUpdate(LifecycleEventArgs $args)\n {\n $this->postPersist($args);\n }", "public function postSave($event)\n {\n $dispatcher = sfProjectConfiguration::getActive()->getEventDispatcher();\n \n $dispatcher->notify(new sfEvent($this, 'ull_mail_logged_message.post_save'));\n }", "public function postPersist(LifecycleEventArgs $args)\n {\n $entity = $args->getObject();\n if (!$this->isEntityManagedByThisBundle($entity) || !method_exists($entity, 'get_objectType')) {\n return;\n }\n \n $currentUserApi = $this->container->get('zikula_users_module.current_user');\n $logArgs = ['app' => 'MUYourCityModule', 'user' => $currentUserApi->get('uname'), 'entity' => $entity->get_objectType(), 'id' => $entity->getKey()];\n $this->logger->debug('{app}: User {user} created the {entity} with id {id}.', $logArgs);\n \n // create the filter event and dispatch it\n $event = $this->createFilterEvent($entity);\n $this->eventDispatcher->dispatch(constant('\\\\MU\\\\YourCityModule\\\\YourCityEvents::' . strtoupper($entity->get_objectType()) . '_POST_PERSIST'), $event);\n }" ]
[ "0.7640106", "0.69088376", "0.6860466", "0.6709392", "0.6703872", "0.66582304", "0.66183686", "0.6605669", "0.6541424", "0.65327233", "0.65327233", "0.6510691", "0.64862376", "0.6398447", "0.6372683", "0.63570374", "0.6356852", "0.633794", "0.63350177", "0.6334432", "0.6225747", "0.6205409", "0.61642605", "0.6137266", "0.6132302", "0.612903", "0.6121917", "0.61096895", "0.6101264", "0.6087608" ]
0.74116653
1
Trigger the entity.update.pre event.
public function preUpdate(LifecycleEventArgs $args) { $this->trigger('entity.update.pre', $args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function preUpdate(PreUpdateEventArgs $event)\n {\n }", "public function onPreUpdate()\n {\n parent::onPreUpdate();\n $this->upsertOperationData(true);\n }", "public function preUpdate(PreUpdateEventArgs $args) {\n $entity = $args->getEntity();\n $this->processFields($entity);\n }", "public function preUpdate()\n {\n }", "public function preUpdate(PreUpdateEventArgs $args)\n {\n $entity = $args->getEntity();\n $this->uploadFile($entity);\n }", "public function onPreUpdate()\n {\n $this->updateAt = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function testPreUpdate(): void\n {\n $this->mockMethods();\n $args = new LifecycleEventArgs(\n $this->object,\n $this->entityManager\n );\n\n $this->listener->prePersist($args);\n }", "public function onPreUpdate()\n {\n $this->date_updated = new \\DateTime(\"now\");\n }", "public function preUpdate(PreUpdateEventArgs $args)\n {\n $this->em = $args->getEntityManager();\n\n /** @var $entity Invoice */\n $entity = $args->getEntity();\n\n $this->setUpdatedAt($entity);\n $this->setDueDate($entity);\n $this->generateReference($entity);\n }", "protected function onPreUpdate($object)\n {\n // Implements logic for pre-update actions here\n }", "public function preUpdate($object);", "public function onPrePersist()\n {\n parent::onPrePersist();\n $this->upsertOperationData();\n }", "public function beforeUpdate()\n {\n }", "public function beforeUpdate() {\n }", "public function onPreUpdate()\n {\n $this->setUpdatedAt(new \\DateTime(\"now\"));\n }", "public function preUpdate(LifecycleEventArgs $event)\n {\n $this->callUpdate($event);\n }", "public function preUpdate(EventArgs $args)\n {\n $ea = $this->getEventAdapter($args);\n $om = $ea->getObjectManager();\n $object = $ea->getObject();\n $meta = $om->getClassMetadata(get_class($object));\n\n if ($this->getConfiguration($om, $meta->getName())) {\n $this->getStrategy($om, $meta->getName())->processPreUpdate($om, $object);\n }\n }", "public function doPreUpdate()\n {\n $this->updatedAt = new \\DateTime('now', new \\DateTimeZone('UTC'));\n }", "public function preSave($event)\n\t{\n\t\tparent::preSave($event);\n\n\t\tif ($this->isModified())\n\t\t{\n\t\t\t$this->notify($this->isNew() ? 'create' : 'update');\n\t\t}\n\t\telseif($this->getTable()->hasI18n() && $this->hasCurrentTranslation() && $this->getCurrentTranslation()->isModified())\n\t\t{\n\t\t\t$this->notify($this->isNew() ? 'create' : 'update');\n\t\t}\n\t}", "public function prePersist(LifecycleEventArgs $eventArgs)\n {\n $this->preUpdate($eventArgs);\n }", "public function preUpdate(EntityEvent $event): void\n\t{\n\t\t$this->setLocales($event);\n\t}", "public function onPreUpdate(): void\n {\n $this->setUpdatedAt(new \\DateTime());\n }", "public function preUpdate()\n {\n \t$this->updated_at = new \\DateTime;\n }", "function hook_entity_presave($entity, $type) {\n $entity->changed = REQUEST_TIME;\n}", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }" ]
[ "0.7188351", "0.71852756", "0.7076147", "0.69430894", "0.68671525", "0.6850505", "0.6794337", "0.6794337", "0.6794337", "0.6794337", "0.67459196", "0.6676426", "0.6669112", "0.66654414", "0.664055", "0.6542082", "0.6523976", "0.6504578", "0.6480114", "0.6477806", "0.64757735", "0.64714944", "0.6433205", "0.6430281", "0.63943267", "0.6393755", "0.63848454", "0.63802505", "0.6371822", "0.6371822" ]
0.7232263
0
Prepares the collection tokens
protected function prepareCollectionTokens(IsotopeProductCollection $objCollection) { $arrTokens = array(); foreach ($objCollection->row() as $k => $v) { $arrTokens['collection_' . $k] = $v; } return $arrTokens; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createTokensCollection()\n {\n $this->tokens = (new Tokens($this->connection))->setEventDispatcher($this->dispatcher);\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('emvemt/emt_collection');\n $collection->prepareQueryToGetMagentoName();\n $collection->prepareQueryToGetAccountName();\n $collection->unselectEmvSendingTemplate();\n $this->setCollection($collection);\n\n parent::_prepareCollection();\n }", "private function reset_tokens() {\r\n reset( $this->tokens );\r\n $this->last_token = null;\r\n $this->token = null;\r\n $this->index = 0;\r\n }", "public function prepare(){\n\t\tif ( !$this->id )\n\t\t\t$this->label->setRef();\t\n\t\t$bson['permissions'] = $this->permissions;\n\t\treturn parent::prepare() + $bson + $this->label->prepare();\t\t\n\t}", "protected function resetTokens()\n {\n $this->tokens = [];\n }", "protected function _prepareCollection()\n {\n return parent::_prepareCollection();\n }", "public function clean()\n\t{\n // Loop through the tokens array\n $ntokens = count($this->tokens);\n \n for ($i = 0; $i < $ntokens; $i++) {\n \n // Transform every token into an array\n if( !is_array($this->tokens[$i]) ) {\n $this->uniform($i);\n }\n \n // Mark for removal not needed token types received from the configuration class\n if ( in_array($this->tokens[$i][0], $this->conf->ignore_tokens) ) {\n unset($this->tokens[$i]);\n }\n \n // Launch additional cleaning from the securitylibs classes\n $this->conf->additionalCleaning();\n }\n \n // Rearrange the array as some indexes have been removed\n $this->tokens = array_values($this->tokens);\n }", "private function prepareTokens($body)\n {\n $this->tokens = token_get_all($body);\n $this->ptokens = [];\n\n $list_tokens = preg_grep('/^T_/', array_keys(get_defined_constants()));\n $idx_tokens = [];\n foreach ($list_tokens as $i_token) {\n $idx_tokens[constant($i_token)] = $i_token;\n }\n\n $in_nowdoc = $in_heredoc = $in_string = false;\n $heredoc_value = $string_value = '';\n // iterate array manually so that we can read several tokens in hooks and auto-advance position\n reset($this->tokens);\n while ($i_value = current($this->tokens)) {\n next($this->tokens);\n $tok = is_array($i_value) ? $i_value[0] : $i_value;\n if (isset($this->token_hook_callbacks[$tok])) {\n $method_name = $this->token_hook_callbacks[$tok];\n $result = $this->$method_name($idx_tokens, $i_value);\n foreach ($result as $parsed_token) {\n $this->ptokens[] = $parsed_token;\n }\n continue;\n }\n\n if (is_array($i_value)) {\n $this->current_line = $i_value[2];\n $this->ptokens[] = [\n PHPCF_KEY_CODE => $idx_tokens[$i_value[0]],\n PHPCF_KEY_TEXT => $i_value[1],\n PHPCF_KEY_LINE => $this->current_line,\n ];\n $this->current_line += substr_count($i_value[1], \"\\n\");\n } else {\n $this->ptokens[] = [\n PHPCF_KEY_CODE => $i_value,\n PHPCF_KEY_TEXT => $i_value,\n PHPCF_KEY_LINE => $this->current_line,\n ];\n }\n }\n }", "public function startPrependToCollection(string $collection): void\n {\n if (ob_start()) {\n $this->collectionStack[] = $collection;\n }\n }", "protected function prepare()\r\n {\r\n $this->query = new Query();\r\n $this->queryString = null;\r\n $this->tokens = array();\r\n $this->tmp = null;\r\n // add the default prefixes defined in constants.php\r\n global $default_prefixes;\r\n $this->query->prefixes = $default_prefixes;\r\n }", "public function build() {\n \n $this->conf = HttpParameterPollution::getInstance();\n \n $this->source = file_get_contents($this->filename);\n \n $this->tokens = token_get_all($this->source);\n \n // For the strange token_get_all behaviour that leave empty array \n // elements i need to use array_values to reorder indexes\n $this->tokens = array_values($this->tokens);\n \n // Clean tokens\n $this->clean();\n \n //$this->pt();\n \n // Reconstruct arrays into one single token\n $this->manageArrays();\n \n //$this->pt();\n \n //$this->pat();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getSingleton('languagecsv/file_collection');\n// Mage::log($collection->load(), null, 'debug.log', true);\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function prepare()\n {\n $this->scope = new ScopeNode;\n }", "function WStokenizer(){\n\t\t$tokens= explode(\" \",$this->text);\n\t\tforeach($tokens as $k=>$tok)\n\t\t\t$this->tokens[]=$tok;\t\t\t\t\n\t}", "public function startCollection(string $collection): void\n {\n if (ob_start()) {\n $this->collectionStack[] = $collection;\n }\n }", "protected function setUp()\n {\n parent::setUp();\n $this->_object = new TokenizerCollection();\n }", "function prepare($args)\n {\n parent::prepare($args);\n\n $this->verify_token = $this->trim('verify_token');\n }", "private function reset()\n\t{\n\t\t$this->tokens = array();\n\t\t$this->chunk = '';\n\t\t$this->idx = 0;\n\t}", "protected function _prepareCollection()\n {\n $collection = $this->_collectionFactory->create();\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function prepareForValidation(): void\n {\n $this->merge([\n 'cpf' => Helper::removePunctuation($this->cpf),\n 'phone' => Helper::removePunctuation($this->phone)\n ]);\n }", "private function setup()\n {\n //get user words;\n $this->_words = '';\n \n //get user stats;\n $this->_stats = '';\n }", "protected function _prepareCollection() {\n\t\t$wizard_collection = Mage::getModel('wizard/wizard')->getCollection()\n\t\t\t->addGroupIdFilter($this->getGroupId());\n\n\t\t$this->setCollection($wizard_collection);\n\t\n\t\treturn parent::_prepareCollection();\n\t}", "protected function postprocessTokens() {\n // we need to manually iterate and manage a count because we'll change\n // the tokens array on the way\n for ($i = 0, $c = count($this->tokens); $i < $c; ++$i) {\n // first check that the following tokens are of form ~LABEL~,\n // then match the __EMU__... sequence.\n if ('~' === $this->tokens[$i]\n && isset($this->tokens[$i + 2])\n && '~' === $this->tokens[$i + 2]\n && T_STRING === $this->tokens[$i + 1][0]\n && preg_match('(^__EMU__([A-Z]++)__(?:([A-Za-z0-9]++)__)?$)', $this->tokens[$i + 1][1], $matches)\n ) {\n if ('BINARY' === $matches[1]) {\n // the binary number can either be an integer or a double, so return a LNUMBER\n // or DNUMBER respectively\n $replace = array(\n array(is_int(bindec($matches[2])) ? T_LNUMBER : T_DNUMBER, $matches[2], $this->tokens[$i + 1][2])\n );\n } else if ('ELLIPSIS' === $matches[1]) {\n $replace = array(\n array(self::T_ELLIPSIS, '...', $this->tokens[$i + 1][2])\n );\n } else if ('POW' === $matches[1]) {\n $replace = array(\n array(self::T_POW, '**', $this->tokens[$i + 1][2])\n );\n } else if ('POWEQUAL' === $matches[1]) {\n $replace = array(\n array(self::T_POW_EQUAL, '**=', $this->tokens[$i + 1][2])\n );\n } else {\n // just ignore all other __EMU__ sequences\n continue;\n }\n\n array_splice($this->tokens, $i, 3, $replace);\n $c -= 3 - count($replace);\n // for multichar tokens (e.g. strings) replace any ~__EMU__...~ sequences\n // in their content with the original character sequence\n } elseif (is_array($this->tokens[$i])\n && 0 !== strpos($this->tokens[$i][1], '__EMU__')\n ) {\n $this->tokens[$i][1] = preg_replace_callback(\n '(~__EMU__([A-Z]++)__(?:([A-Za-z0-9]++)__)?~)',\n array($this, 'restoreContentCallback'),\n $this->tokens[$i][1]\n );\n }\n }\n }", "protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getModel(\"googleauthorship/author\")->getCollection();\n\t\t$this->setCollection($collection);\n\t\treturn parent::_prepareCollection();\n\t}", "public function prependCollection(string $collection, string $content): void\n {\n if (! isset($this->collections[$collection])) {\n $this->collections[$collection] = $content;\n } else {\n $this->collections[$collection] = $content.$this->collections[$collection];\n }\n }", "protected function _prepareCollection()\n {\n /* var $collection Gri_Cms_Model_Mysql4_Revision_Collection */\n $collection = Mage::getModel('gri_cms/page_revision')->getCollection()\n ->addPageFilter($this->getPage())\n ->addVersionFilter($this->getVersion())\n ->addUserColumn()\n ->addUserNameColumn();\n\n // Commented this bc now revision are shown in scope of version and not page.\n // So if user has permission to load this version he\n // has permission to see all its versions\n //->addVisibilityFilter(Mage::getSingleton('admin/session')->getUser()->getId(),\n // Mage::getSingleton('gri_cms/config')->getAllowedAccessLevel());\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "private function _prepareFeatures()\n {\n if(!empty($this->request->data['AccountFeature']['feature_id'])){\n $accountFeatures = array();\n foreach ($this->request->data['AccountFeature']['feature_id'] as $feature_id) {\n $accountFeature = array(\n 'feature_id' => $feature_id\n );\n array_push($accountFeatures, $accountFeature);\n }\n $this->request->data['AccountFeature'] = $accountFeatures;\n }\n\n }", "protected function prepare()\n {\n /** @var CollectionView $collection */\n $collection = $this->getComponent('collection_view');\n $collection->setData($this->getDataProvider());\n if ($collection->getDataInjector() === null) {\n $collection->setDataInjector($this->makeDataInjector());\n }\n $this->applyOperations();\n $this->hideSubmitButtonIfNotUsed();\n }", "protected function prepareVars()\n {\n $query = $this->hasForcedQuery ? $this->forcedQuery : Request::get('q', '');\n\n $this->setVar('pageNumber', (int)Request::get('page', 1));\n $this->setVar('query', $query);\n $this->setVar('noResultsMessage');\n $this->setVar('visitPageMessage');\n $this->setVar('showProviderBadge');\n $this->setVar('resultsPerPage');\n $this->setVar('minQueryLength');\n\n $this->resultCollection = new ResultCollection();\n }", "public function createCollection() {\n $collection = new Collection ();\n $this->setRules ( [ StringLiterals::TITLE => 'required|unique:collections,title' ] );\n $this->setMessage ( 'title', 'The Genre filed is required.' );\n $this->_validate ();\n if ($this->request->title != null) {\n $collection->fill ( $this->request->except ( StringLiterals::TOKEN ) );\n $collection->save ();\n return true;\n }\n }" ]
[ "0.68677515", "0.53662723", "0.53254753", "0.5238742", "0.52213514", "0.5217555", "0.5214806", "0.51787275", "0.51777184", "0.514239", "0.5091362", "0.50831074", "0.50560385", "0.50317943", "0.5023702", "0.49733257", "0.49708188", "0.49593142", "0.4951167", "0.494579", "0.49386454", "0.49349287", "0.49219537", "0.492019", "0.48968098", "0.48476002", "0.48475125", "0.48155877", "0.48064867", "0.47935554" ]
0.59568226
1
Chain multiple conditions with OR. The whole statement will evaluate to true if at least one of provided conditions is true.
public function do_or() { return $this->condition_factory->do_or( func_get_args() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function or( ...$conditions ) {\n\n // Extract options.\n $options = array_last($conditions);\n $conditions = array_head($conditions);\n $result = false;\n\n // Ensure that at least one conditions is truthy.\n foreach( $conditions as $condition ) {\n\n if( $condition ) {\n\n $result = true;\n\n break;\n\n }\n\n }\n\n // Return truthy.\n if( $result ) return (isset($options['fn']) ? $options['fn'] : true);\n\n // Return falsey.\n return (isset($options['inverse']) ? $options['inverse']() : false);\n\n }", "public function or(...$args): Query\n {\n return $this->setConditionOrClosure(Condition\\ConditionOr::class, $args);\n }", "public function orWhere()\n {\n $args = array_merge(array('OR'), func_get_args());\n return call_user_func_array(array($this, '_where'), $args);\n }", "public static function sqlor() {\n\t\t$args = func_get_args();\n\t\t$function = 'or';\n\t\t$res = false;\n\t\tforeach ($args as $arg) {\n\t\t\tif (!empty($arg))\n\t\t\t\t$res[] = $arg;\n\t\t}\n\t\tif (!empty($res))\n\t\t\t$res = '(' . implode(') '.$function.' (', $res) . ')';\n\t\telse\n\t\t\t$res = '1=0';\n\t\treturn $res;\n\t}", "public function orWhere($cond, array $bind = []);", "public function whereOr($conditions)\n {\n $this->_sql['where'][] = $this->_where($conditions, FALSE);\n return $this;\n }", "public function orWhere(array $where);", "public function orWhere($where, $arguments = null)\n {\n return $this->where($where, $arguments, 'OR');\n }", "public function orWhere(...$whereStatements)\n {\n $this->addBaseOrIfNotExists();\n\n if (1 == count($whereStatements) && is_array($whereStatements[0])) {\n foreach ($whereStatements[0] as $attribute => $value) {\n $this->baseOr->add($this->filterBuilder->eq($attribute, $value));\n }\n } else {\n $this->baseOr->add(...$whereStatements);\n }\n\n return $this;\n }", "abstract protected function perform_or($first, $second);", "public function orConditions($data = array()) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t$filter = trim($data['filter']);\r\n\t\t$condition = array(\r\n\t\t\t\t'OR' => array(\r\n\t\t\t\t\t\t$this->alias . '.description LIKE' => '%' . $filter . '%',\r\n\t\t\t\t\t\t$this->alias . '.name LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.upc LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.manufacturer LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.category_1 LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.model LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.sku LIKE' => '%' . $filter . '%',\n\t\t\t\t\t\t$this->alias . '.asin LIKE' => '%' . $filter . '%',\r\n\t\t\t\t)\r\n\t\t);\r\n\t\treturn $condition;\r\n\t}", "public function orWhere($conditions, $params = array(), $types = array())\n {\n $conditions = $this->processCondition($conditions, $params, $types);\n return $this->add('where', $conditions, true, 'OR');\n }", "public function any(...$values)\n {\n if ( ! count($values))\n return $this;\n\n $this->exact(array_shift($values));\n\n foreach ($values as $value) {\n $this->or($value);\n }\n\n return $this;\n }", "public static function func_or( $args ) {\n\t\t$args = func_get_args();\n\t\tforeach ( $args as $value ) {\n\t\t\tif ( $value ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public function orWhere()\r\n {\r\n $args = func_get_args();\r\n call_user_func_array(array($this->adapter, 'orWhere'), $args);\r\n \r\n return $this;\r\n }", "public function conditions($operand=null);", "public function sc_or($values) {\n\t\tif (!is_array($values)) {\n\t\t\tthrow new Exception('The values to query must come on an array format.');\n\t\t}\n\n\t\tif (is_array($values[0])) {\n\t\t\t$t_value = '';\n\t\t\tforeach ($values as $value) {\n\t\t\t\tif (count($value) > 4 || count($value) < 3) {\n\t\t\t\t\tthrow new Exception('Please verify the correct format for the AND function.');\n\t\t\t\t}\n\n\t\t\t\t$valKey = $value[0];\n\t\t\t\tif (strpos($valKey, '.') !== false) {\n\t\t\t\t\t$valKey = str_replace(substr($valKey, 0, strpos($valKey, '.')+1), '', $valKey);\n\t\t\t\t}\n\t\t\t\tif (is_null($value[2]) || $value[2] === 'NULL' || $value[2] === 'null') {\n\t\t\t\t\t$t_value .= ' '.$value[0].' '.$value[1].\" NULL \";\n\t\t\t\t}else{\n\t\t\t\t\t$t_value .= ' '.$value[0].' '.$value[1].' :'.$valKey.'_'.$this->t_count;\n\t\t\t\t\t$temp_key = \":\".$valKey.\"_\".$this->t_count;\n\t\t\t\t\t$temp_array = array($temp_key=>$value[2]);\n\t\t\t\t\tarray_push($this->query_values, $temp_array);\n\t\t\t\t\t$this->t_count ++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (count($value) == 4) {\n\t\t\t\t\t$t_value .= ' '.$value[3];\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->t_value .= ' OR ('.$t_value.') ';\n\n\t\t}else{\n\t\t\tif (count($values) > 3 || count($values) < 2) {\n\t\t\t\tthrow new Exception('Please verify the correct format for the AND function.');\n\t\t\t}\n\n\t\t\t$valKey = $values[0];\n\t\t\tif (strpos($valKey, '.') !== false) {\n\t\t\t\t$valKey = str_replace(substr($valKey, 0, strpos($valKey, '.')+1), '', $valKey);\n\t\t\t}\n\t\t\t$temp_string = '';\n\t\t\tif (count($values) == 3 && (is_null($values[2]) || $values[2] === 'NULL' || $values[2] === 'null')) {\n\t\t\t\t$temp_string = $values[0].' '.$values[1].\" NULL \";\n\t\t\t}else{\n\t\t\t\t$temp_string = $values[0].' '.$values[1].\" :\".$valKey.\"_\".$this->t_count;\n\n\t\t\t\t$temp_key = \":\".$valKey.\"_\".$this->t_count;\n\t\t\t\tif (count($values) == 3) {\n\t\t\t\t\t$temp_array = array($temp_key=>$values[2]);\n\t\t\t\t}else{\n\t\t\t\t\t$temp_array = array($temp_key=>\"''\");\n\t\t\t\t}\n\t\t\t\tarray_push($this->query_values, $temp_array);\n\t\t\t\t$this->t_count ++;\n\t\t\t}\n\t\t\t\n\t\t\t$this->t_value .= ' OR '.$temp_string;\n\t\t}\n\t\treturn $this;\n\t}", "public static function and( ...$conditions ) {\n\n // Extract options.\n $options = array_last($conditions);\n $conditions = array_head($conditions);\n $result = true;\n\n // Ensure that all conditions are truthy.\n foreach( $conditions as $condition ) {\n\n if( !$condition ) {\n\n $result = false;\n\n break;\n\n }\n\n }\n\n // Return truthy.\n if( $result ) return (isset($options['fn']) ? $options['fn'] : true);\n\n // Return falsey.\n return (isset($options['inverse']) ? $options['inverse']() : false);\n\n }", "public function or()\n {\n $this->_whereConnector = 'OR';\n return $this;\n }", "public function where($conditions = null) {\n $whereString = null;\n $counter = 0;\n if (!empty($conditions)) {\n if (is_array($conditions)) {\n foreach ($conditions as $key => $value) {\n if (strtoupper($key) == \"OR\") {\n $innerCounter = 0;\n foreach ($value as $orKey => $orValue) {\n if (($counter == 0) and (($innerCounter == 0) or ($innerCounter == sizeof($value))))\n $whereString .= \"\";\n else\n $whereString .= \" OR \";\n\n $whereString .= $this->handleArithmeticConditions($orKey, $orValue);\n $innerCounter++;\n\n }\n } else {\n if (($counter == 0) or ($counter == sizeof($conditions)))\n $whereString .= \"\";\n else\n $whereString .= \" AND \";\n $whereString .= $this->handleArithmeticConditions($key, $value);\n }\n $counter++;\n }\n } else {\n $whereString = $conditions;\n }\n $whereString = \"where \" . $whereString;\n $this->query .= $whereString . \" \";\n }\n return $this;\n }", "public function orNest()\n {\n return $this->nest('OR');\n }", "public function _or(): bool;", "public function do_and() {\n\t\treturn $this->condition_factory->do_and( func_get_args() );\n\t}", "public function orWhere(array $conditions = [], $type = 'AND')\n {\n return $this->where($conditions, $type, 'OR');\n }", "public function whereOr($where=\"\")\r\n\t{\r\n\t\treturn $this->add('where',$this->_parts['where'].' OR '.$where, true);\r\n\t}", "public function where_or( $where_clause_arr=array() ){\r\n if( sizeof( $this->where_clause_arr['and'] ) > 0 ){\r\n //$this->where_clause_arr['and'] = array_merge( $this->where_clause_arr['and'], array( 'or' => $where_clause_arr ) );\r\n $this->where_clause_arr['or'] = array_merge( $this->where_clause_arr['or'], $where_clause_arr );\r\n }else{\r\n $this->where_clause_arr['or'] = array_merge( $this->where_clause_arr['or'], $where_clause_arr );\r\n }\r\n \r\n return $this;\r\n }", "public function orFilterMatch(array $condition)\n {\n $condition = $this->filterCondition($condition);\n if ($condition !== []) {\n $this->orMatch($condition);\n }\n return $this;\n }", "public function or() {\n\t\t$this->comandoString .= \"OR \";\n\n\t\treturn $this;\n\t}", "public function whereOr($expressions = null)\n {\n if($expressions instanceof Expression) {\n $expressions = func_get_args();\n }\n \n return $this->where('$or', array_map(function(Expression $expression) {\n return $expression->toArray();\n }, $expressions));\n }", "public function logicalOr($constraint1)\n {\n if (is_array($constraint1)) {\n $constraints = $constraint1;\n } else {\n $constraints = func_get_args();\n }\n return $this->queryBuilder->expr()->orX(...$constraints);\n }" ]
[ "0.7590765", "0.7094827", "0.70594597", "0.69203305", "0.6889269", "0.6882338", "0.6856723", "0.67467076", "0.67161953", "0.6531156", "0.65051246", "0.64218193", "0.6395366", "0.62695384", "0.6255822", "0.62080073", "0.6205144", "0.61944985", "0.6173354", "0.61644924", "0.6113242", "0.61007994", "0.6084701", "0.60813683", "0.60543483", "0.60387564", "0.6036476", "0.5978841", "0.5978719", "0.5964959" ]
0.7976301
0
Chain multiple conditions with AND. The whole statement will evaluate to true if all provided conditions are true.
public function do_and() { return $this->condition_factory->do_and( func_get_args() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function and( ...$conditions ) {\n\n // Extract options.\n $options = array_last($conditions);\n $conditions = array_head($conditions);\n $result = true;\n\n // Ensure that all conditions are truthy.\n foreach( $conditions as $condition ) {\n\n if( !$condition ) {\n\n $result = false;\n\n break;\n\n }\n\n }\n\n // Return truthy.\n if( $result ) return (isset($options['fn']) ? $options['fn'] : true);\n\n // Return falsey.\n return (isset($options['inverse']) ? $options['inverse']() : false);\n\n }", "public function and(...$args): Query\n {\n return $this->setConditionOrClosure(Condition\\ConditionAnd::class, $args);\n }", "public function andWhere(...$whereStatements)\n {\n return $this->where(...$whereStatements);\n }", "public function where()\n {\n $args = array_merge(array('AND'), func_get_args());\n return call_user_func_array(array($this, '_where'), $args);\n }", "public function andWhere($where, $arguments = null)\n {\n return $this->where($where, $arguments, 'AND');\n }", "public static function sqland() {\n\t\t$args = func_get_args();\n\t\t$function = 'and';\n\t\t$res = false;\n\t\tforeach ($args as $arg) {\n\t\t\tif (!empty($arg))\n\t\t\t\t$res[] = $arg;\n\t\t}\n\t\tif (!empty($res))\n\t\t\t$res = '(' . implode(') '.$function.' (', $res) . ')';\n\t\treturn $res;\n\t}", "public function andWhere($conditions, $params = array(), $types = array())\n {\n if ($conditions === false) {\n return $this;\n } else {\n $conditions = $this->processCondition($conditions, $params, $types);\n return $this->add('where', $conditions, true, 'AND');\n }\n }", "public function sc_and($values) {\n\t\t\n\t\tif (!is_array($values)) {\n\t\t\tthrow new Exception('The values to query must come on an array format.');\n\t\t}\n\n\t\tif (is_array($values[0])) {\n\t\t\t$t_value = '';\n\t\t\tforeach ($values as $value) {\n\t\t\t\tif (count($value) > 4 || count($value) < 3) {\n\t\t\t\t\tthrow new Exception('Please verify the correct format for the AND function.');\n\t\t\t\t}\n\n\t\t\t\t$valKey = $value[0];\n\t\t\t\tif (strpos($valKey, '.') !== false) {\n\t\t\t\t\t$valKey = str_replace(substr($valKey, 0, strpos($valKey, '.')+1), '', $valKey);\n\t\t\t\t}\n\t\t\t\tif (is_null($value[2]) || $value[2] === 'NULL' || $value[2] === 'null') {\n\t\t\t\t\t$t_value .= ' '.$value[0].' '.$value[1].\" NULL \";\n\t\t\t\t}else{\n\t\t\t\t\t$t_value .= ' '.$value[0].' '.$value[1].' :'.$valKey.'_'.$this->t_count;\n\t\t\t\t\t$temp_key = \":\".$valKey.\"_\".$this->t_count;\n\t\t\t\t\t$temp_array = array($temp_key=>$value[2]);\n\t\t\t\t\tarray_push($this->query_values, $temp_array);\n\t\t\t\t\t$this->t_count ++;\n\t\t\t\t}\n\n\t\t\t\tif (count($value) == 4) {\n\t\t\t\t\t$t_value .= ' '.$value[3];\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->t_value .= ' AND ('.$t_value.') ';\n\n\t\t}else{\n\t\t\tif (count($values) > 3 || count($values) < 2) {\n\t\t\t\tthrow new Exception('Please verify the correct format for the AND function.');\n\t\t\t}\n\n\t\t\t$valKey = $values[0];\n\t\t\tif (strpos($valKey, '.') !== false) {\n\t\t\t\t$valKey = str_replace(substr($valKey, 0, strpos($valKey, '.')+1), '', $valKey);\n\t\t\t}\n\t\t\t$temp_string = '';\n\t\t\tif (count($values) == 3 && (is_null($values[2]) || $values[2] === 'NULL' || $values[2] === 'null')) {\n\t\t\t\t$temp_string = $values[0].' '.$values[1].\" NULL \";\n\t\t\t}else{\n\t\t\t\t$temp_string = $values[0].' '.$values[1].' :'.$valKey.'_'.$this->t_count;\n\t\t\t\t$temp_key = \":\".$valKey.\"_\".$this->t_count;\n\t\t\t\tif (count($values) == 3) {\n\t\t\t\t\t$temp_array = array($temp_key=>$values[2]);\n\t\t\t\t}else{\n\t\t\t\t\t$temp_array = array($temp_key=>\"''\");\n\t\t\t\t}\n\t\t\t\tarray_push($this->query_values, $temp_array);\n\t\t\t\t$this->t_count ++;\n\t\t\t}\n\t\t\t\n\t\t\t$this->t_value .= ' AND '.$temp_string;\n\t\t}\n\t\treturn $this;\n\t}", "function also(...$args) {\n $and = curry(function($f1, $f2, $x) {\n return $f1($x) && $f2($x);\n });\n\n return call_user_func_array($and, $args);\n}", "abstract protected function perform_and($first, $second);", "public function and_()\n {\n $this->addRules( AndRule::operator, func_get_args());\n return $this;\n }", "public static function func_and( $args ) {\n\t\t$args = func_get_args();\n\t\tforeach ( $args as $value ) {\n\t\t\tif ( ! $value ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}", "public function andNest()\n {\n return $this->nest('AND');\n }", "public function And_($ignoreLo=false){\n\t\t\n\t\t$cond = new self($this,$this->table);\n\t\t$this->addStatement('and',array('and',$cond,$ignoreLo));\n\t\treturn $cond;\n\t}", "public function _and(): bool;", "public function and() {\n\t\t$this->comandoString .= \"AND \";\n\n\t\treturn $this;\n\t}", "public function where(...$whereStatements)\n {\n $this->addBaseAndIfNotExists();\n\n if (1 == count($whereStatements) && is_array($whereStatements[0])) {\n foreach ($whereStatements[0] as $attribute => $value) {\n $this->baseAnd->add($this->filterBuilder->eq($attribute, $value));\n }\n } else {\n $this->baseAnd->add(...$whereStatements);\n }\n\n return $this;\n }", "public function conditions($operand=null);", "public function do_or() {\n\t\treturn $this->condition_factory->do_or( func_get_args() );\n\t}", "public function File_Archive_Predicate_And() {\n\t\t$this->preds = func_get_args();\n\t}", "public function or(...$args): Query\n {\n return $this->setConditionOrClosure(Condition\\ConditionOr::class, $args);\n }", "protected function explodeConditions() {\n if (!empty($this->conditions)) {\n $value = implode(' ', $this->conditions);\n $this->addQuery('where', $value);\n }\n }", "public function andWhere(array $conditions = [], $type = 'AND')\n {\n return $this->where($conditions, $type, 'AND');\n }", "public function andWhere($restriction)\n {\n $sql = clone $this;\n if ($sql->where === '') {\n $sql->where = array('AND', $restriction);\n } elseif (\\Sledgehammer\\extract_logical_operator($sql->where) === 'AND') {\n $sql->where[] = $restriction;\n } else {\n $sql->where = array('AND', $sql->where, $restriction);\n }\n\n return $sql;\n }", "public function whereAnd($where=\"\")\r\n\t{\r\n\t\treturn $this->add('where',$this->_parts['where'].' AND '.$where, true);\r\n\t}", "public function logicalAnd($constraint1)\n {\n if (is_array($constraint1)) {\n $constraints = $constraint1;\n } else {\n $constraints = func_get_args();\n }\n return $this->queryBuilder->expr()->andX(...$constraints);\n }", "public function any(...$values)\n {\n if ( ! count($values))\n return $this;\n\n $this->exact(array_shift($values));\n\n foreach ($values as $value) {\n $this->or($value);\n }\n\n return $this;\n }", "public function where($conditions = null) {\n $whereString = null;\n $counter = 0;\n if (!empty($conditions)) {\n if (is_array($conditions)) {\n foreach ($conditions as $key => $value) {\n if (strtoupper($key) == \"OR\") {\n $innerCounter = 0;\n foreach ($value as $orKey => $orValue) {\n if (($counter == 0) and (($innerCounter == 0) or ($innerCounter == sizeof($value))))\n $whereString .= \"\";\n else\n $whereString .= \" OR \";\n\n $whereString .= $this->handleArithmeticConditions($orKey, $orValue);\n $innerCounter++;\n\n }\n } else {\n if (($counter == 0) or ($counter == sizeof($conditions)))\n $whereString .= \"\";\n else\n $whereString .= \" AND \";\n $whereString .= $this->handleArithmeticConditions($key, $value);\n }\n $counter++;\n }\n } else {\n $whereString = $conditions;\n }\n $whereString = \"where \" . $whereString;\n $this->query .= $whereString . \" \";\n }\n return $this;\n }", "public function sc_or($values) {\n\t\tif (!is_array($values)) {\n\t\t\tthrow new Exception('The values to query must come on an array format.');\n\t\t}\n\n\t\tif (is_array($values[0])) {\n\t\t\t$t_value = '';\n\t\t\tforeach ($values as $value) {\n\t\t\t\tif (count($value) > 4 || count($value) < 3) {\n\t\t\t\t\tthrow new Exception('Please verify the correct format for the AND function.');\n\t\t\t\t}\n\n\t\t\t\t$valKey = $value[0];\n\t\t\t\tif (strpos($valKey, '.') !== false) {\n\t\t\t\t\t$valKey = str_replace(substr($valKey, 0, strpos($valKey, '.')+1), '', $valKey);\n\t\t\t\t}\n\t\t\t\tif (is_null($value[2]) || $value[2] === 'NULL' || $value[2] === 'null') {\n\t\t\t\t\t$t_value .= ' '.$value[0].' '.$value[1].\" NULL \";\n\t\t\t\t}else{\n\t\t\t\t\t$t_value .= ' '.$value[0].' '.$value[1].' :'.$valKey.'_'.$this->t_count;\n\t\t\t\t\t$temp_key = \":\".$valKey.\"_\".$this->t_count;\n\t\t\t\t\t$temp_array = array($temp_key=>$value[2]);\n\t\t\t\t\tarray_push($this->query_values, $temp_array);\n\t\t\t\t\t$this->t_count ++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (count($value) == 4) {\n\t\t\t\t\t$t_value .= ' '.$value[3];\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->t_value .= ' OR ('.$t_value.') ';\n\n\t\t}else{\n\t\t\tif (count($values) > 3 || count($values) < 2) {\n\t\t\t\tthrow new Exception('Please verify the correct format for the AND function.');\n\t\t\t}\n\n\t\t\t$valKey = $values[0];\n\t\t\tif (strpos($valKey, '.') !== false) {\n\t\t\t\t$valKey = str_replace(substr($valKey, 0, strpos($valKey, '.')+1), '', $valKey);\n\t\t\t}\n\t\t\t$temp_string = '';\n\t\t\tif (count($values) == 3 && (is_null($values[2]) || $values[2] === 'NULL' || $values[2] === 'null')) {\n\t\t\t\t$temp_string = $values[0].' '.$values[1].\" NULL \";\n\t\t\t}else{\n\t\t\t\t$temp_string = $values[0].' '.$values[1].\" :\".$valKey.\"_\".$this->t_count;\n\n\t\t\t\t$temp_key = \":\".$valKey.\"_\".$this->t_count;\n\t\t\t\tif (count($values) == 3) {\n\t\t\t\t\t$temp_array = array($temp_key=>$values[2]);\n\t\t\t\t}else{\n\t\t\t\t\t$temp_array = array($temp_key=>\"''\");\n\t\t\t\t}\n\t\t\t\tarray_push($this->query_values, $temp_array);\n\t\t\t\t$this->t_count ++;\n\t\t\t}\n\t\t\t\n\t\t\t$this->t_value .= ' OR '.$temp_string;\n\t\t}\n\t\treturn $this;\n\t}", "public function lAnd()\n {\n $args = func_get_args();\n if ( count( $args ) < 1 )\n {\n throw new ezcSearchQueryVariableParameterException( 'lAnd', count( $args ), 1 );\n }\n\n $elements = ezcSearchQueryTools::arrayFlatten( $args );\n if ( count( $elements ) == 1 )\n {\n return $elements[0];\n }\n else\n {\n return '( ' . join( ' AND ', $elements ) . ' )';\n }\n }" ]
[ "0.75524926", "0.7309431", "0.73076963", "0.7109984", "0.68594855", "0.68270636", "0.6662253", "0.66165584", "0.6573256", "0.6444296", "0.6393527", "0.63887435", "0.63213074", "0.6284343", "0.6202265", "0.6165637", "0.6146775", "0.6128809", "0.608191", "0.60618675", "0.6048471", "0.60431594", "0.60108", "0.60083944", "0.59917635", "0.59722006", "0.5962968", "0.5904031", "0.5894706", "0.58933693" ]
0.7744523
0
Query by a row intermediary_id of a relationship definition.
public function intermediary_id( $relationship_id ) { return $this->condition_factory->intermediary_id( $relationship_id ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function relationship( IToolset_Relationship_Definition $relationship_definition ) {\n\t\treturn $this->relationship_id( $relationship_definition->get_row_id() );\n\t}", "public function getRelationshipQuery($relationshipNames,$query);", "public function getByIdWithRelations($attachmentId);", "public function findOne($id, $relation);", "public function filterByHasOne($query, HasOne $relationship, array $ids): void;", "public function find($id,$relationshipNames=[],$trashed = false);", "public function processIntersectionTableQueryResultArray(array $arr): int\n\t{\n\t\t$f = __METHOD__;\n\t\t$print = false;\n\t\tif($this->getReceptivity() === DATA_MODE_RECEPTIVE){\n\t\t\tDebug::error(\"{$f} this shouldn't be getting called on receptive objects\");\n\t\t}\n\t\tif($print){\n\t\t\tDebug::printStackTraceNoExit(\"{$f} entered\");\n\t\t}\n\t\t\n\t\tif (! array_key_exists(\"relationship\", $arr)) {\n\t\t\tDebug::warning(\"{$f} array does not have a foreign key name\");\n\t\t\tDebug::printArray($arr);\n\t\t\tDebug::printStackTrace();\n\t\t} elseif ($print) {\n\t\t\tDebug::print(\"{$f} entered with the following array\");\n\t\t\tDebug::printArray($arr);\n\t\t}\n\t\t$fkn = $arr['relationship'];\n\t\tif (! $this->hasColumn($fkn)) {\n\t\t\tDebug::error(\"{$f} this object does not have a datum at column \\\"{$fkn}\\\"\");\n\t\t}\n\t\t$column = $this->getColumn($fkn);\n\t\tif ($column instanceof ForeignKeyDatum) {\n\t\t\t$column->setValueFromQueryResult($arr[\"foreignKey\"]);\n\t\t} elseif ($column instanceof KeyListDatum) {\n\t\t\tif ($print) {\n\t\t\t\tDebug::print(\"{$f} column is a key list\");\n\t\t\t}\n\t\t\t$fk = $arr['foreignKey'];\n\t\t\t$column->pushValueFromQueryResult($fk);\n\t\t\tif (registry()->has($fk)) {\n\t\t\t\tif ($print) {\n\t\t\t\t\tDebug::print(\"{$f} registry has an object with key \\\"{$fk}\\\"\");\n\t\t\t\t}\n\t\t\t\t$fds = registry()->get($fk);\n\t\t\t\tif ($fds->getLoadedFlag()) {\n\t\t\t\t\t$this->setForeignDataStructureListMember($fkn, $fds);\n\t\t\t\t} elseif ($print) {\n\t\t\t\t\tDebug::print(\"{$f} ... but it wasn't loaded yet\");\n\t\t\t\t}\n\t\t\t} elseif ($print) {\n\t\t\t\tDebug::print(\"{$f} the registry does not know anything about an object with key \\\"{$fk}\\\"\");\n\t\t\t}\n\t\t} else {\n\t\t\t$cc = $column->getClass();\n\t\t\tDebug::error(\"{$f} illegal column class \\\"{$cc}\\\"\");\n\t\t}\n\t\tif (cache()->enabled()) {\n\t\t\t$column->setDirtyCacheFlag(true);\n\t\t}\n\t\treturn SUCCESS;\n\t}", "public abstract function query($id);", "public function findOneBy(array $criteria, $relation);", "public function getUserRelationship($id);", "public function relationship_id( $relationship_id ) {\n\t\treturn $this->condition_factory->relationship_id( $relationship_id );\n\t}", "protected function findRelation($relation, $one = true)\n {\n if ($one)\n {\n $config = $this->getTable()->getOneRelation($relation);\n } else\n {\n $config = $this->getTable()->getManyRelation($relation);\n }\n\n $local = $config['local'];\n $foreign = $config['foreign'];\n $class = $config['class'];\n\n //Logger::getRootLogger()->trace(\"$class::findBy\" . ucfirst($foreign) . \"(\\$object->$getter()) one?\" . ($one ? 'true' : 'false'));\n\n if ($this->get($local) != null)\n {\n $fct = 'findBy' . ucfirst($foreign);\n //$objs = \\Quartz\\Quartz::getInstance()->getTable($class)->$fct($this->get($local));\n $objs = \\Quartz\\Quartz::getInstance()->getTable($class)->find(array($foreign => $this->get($local)), $config['orderBy'], $config['limit'], $config['offset']);\n\n if ($one)\n {\n $obj = array_shift($objs);\n if ($obj)\n {\n return $obj;\n }\n //Logger::getRootLogger()->trace(\"no association found\");\n } else\n {\n return $objs;\n }\n } else\n {\n //Logger::getRootLogger()->trace(\"link is null\");\n }\n return null;\n }", "function object_foreign_id($obj_type, $obj_or_id, $key, $field='fids') {\n $fids = object_foreign_key('property', $obj_or_id, $field);\n return json_get_value($fids, $key);\n}", "public function GetAssocRow( $sql, $bindings = array() );", "public function getRelationship($relationship)\n {\n return $this->addOperation('GET','relationship/'.$relationship);\n }", "public function getRelation($key);", "abstract public function queryRow($query, $attributes = false);", "public function findById($id)\n {\n Yii::trace(get_class($this).'.findById()','ext.Neo4Yii.ENeo4jRelationship');\n $gremlinQuery=new EGremlinScript;\n $gremlinQuery->setQuery('g.e('.$id.')._().filter{it.'.$this->getModelClassField().'==\"'.get_class($this).'\"}');\n $response=$this->getConnection()->queryByGremlin($gremlinQuery);\n $responseData=$response->getData();\n if(isset($responseData[0]))\n {\n $model=$this->populateRecords($responseData);\n return $model[0];\n }\n else\n return null;\n }", "public function getRowById($id);", "abstract protected function fetchOneAssoc();", "protected function query($entity, $relation)\r\n\t{\r\n\t\t$entityMap = $this->getMapper($entity)->getEntityMap();\r\n\r\n\t\treturn $entityMap->$relation($entity);\r\n\t}", "protected function loadRelationship() {\n $field_parameters = $this->getFieldParameters();\n\n $query = $this->buildRelationshipQuery($field_parameters);\n\n if(!$query) {\n throw new Exception('Could not build query from field parameters');\n }\n\n if(method_exists($this, 'amendRelationshipQuery')) {\n $query = $this->amendRelationshipQuery($query);\n }\n\n return $this->getRelationshipArray($query, $field_parameters);\n }", "abstract static public function find(...$fk_criteria);", "public function related($relationshipName);", "protected function getRelationship($sermonId, $taxonomy)\n {\n $sermonId = $this->mysqli->real_escape_string($sermonId);\n $taxonomy = $this->mysqli->real_escape_string($taxonomy);\n $query = <<<SQL\n SELECT\n TER.name,\n TER.slug\n FROM wp_posts P\n INNER JOIN wp_term_relationships REL\n ON REL.`object_id` = P.`ID`\n INNER JOIN wp_term_taxonomy TT\n ON TT.`term_taxonomy_id` = REL.`term_taxonomy_id` AND TT.`taxonomy` = \"$taxonomy\"\n INNER JOIN wp_terms TER\n ON TER.`term_id` = TT.`term_id`\n WHERE P.`ID` = \"$sermonId\";\nSQL;\n $result = $this->mysqli->query($query);\n if (!$result) {\n throw new \\Exception(\"Relation could not be queried\");\n }\n $rows = array();\n while ($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n return $rows;\n }", "abstract public function find(array $relatedKeys): mixed;", "public function association_id( $association_id ) {\n\t\t$this->limit( 1 );\n\t\treturn $this->condition_factory->association_id( $association_id );\n\t}", "public function getByIdWith($id, string $relations, array $columns = ['*']);", "private function _getRow($sSql, $bAssoc, &$hLink)\n { \t\n \t// Run the query\n $hRes = $this->query($sSql, $hLink);\n\n // Get the array\n \t$aRes = pg_fetch_array($hRes, null, ($bAssoc ? PGSQL_ASSOC : PGSQL_NUM));\n\n return $aRes ? $aRes : array();\n }", "function get_by_id($id, $conn){\n\t//Give it the query, an array of bindings and the connection\n\t//Presto! we have an array of posts.\n\t$query = query(\n\t\t'SELECT * FROM posts WHERE id = :id LIMIT 1', \n\t\tarray('id' => $id), \n\t\t$conn);\n\n\treturn $query->fetchAll();\n\n}" ]
[ "0.60012585", "0.54022396", "0.5320726", "0.5274212", "0.5178714", "0.5086926", "0.5072892", "0.5071581", "0.50298977", "0.50059456", "0.500512", "0.499205", "0.49722034", "0.49382818", "0.49095556", "0.49027252", "0.48610234", "0.48331043", "0.4821578", "0.48050538", "0.4791432", "0.47912684", "0.47866264", "0.47785103", "0.47636572", "0.47313783", "0.4719103", "0.47045276", "0.46869454", "0.46751213" ]
0.57003677
1
Query by a relationship definition slug.
public function relationship_slug( $slug ) { $definition = $this->get_definition_repository()->get_definition( $slug ); if( null === $definition ) { return $this->condition_factory->contradiction(); } return $this->relationship( $definition ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function find($slug);", "public function findBySlug(string $slug): Model;", "public function bySlug($slug);", "public function getRelationshipQuery($relationshipNames,$query);", "public function getBySlug($slug);", "public function getBySlug($slug);", "public function scopeSlug($query, $slug)\n {\n \treturn $query->where(\"id\", $slug)->first();\n }", "public function related($relationshipName);", "public function query(ReferralRelationship $model)\n {\n $referral_program = $this->request->route('referral_program');\n if (!$referral_program) {\n abort('404');\n }\n\n return $model->newQuery()->whereHas('link', function ($query) use ($referral_program) {\n return $query->where('referral_program_id', $referral_program->id);\n });\n }", "public function bySlug($slug)\n {\n return $this->findModel(function ($q) use($slug)\n {\n $q->where($this->slugAttribute, '=', $slug);\n });\n }", "public function queryBySlug($slug)\n\t{\n\t\t$posts = get_posts([\n\t\t\t'name' => $slug,\n\t\t\t'post_type' => $this->postType,\n\t\t\t'post_status' => 'publish',\n\t\t\t'numberposts' => 1\n\t\t]);\n\n\t\tif(is_array($posts) && isset($posts[0])) {\n\t\t\t$restRequest = new \\WP_REST_Request();\n\t\t\t$restController = new \\WP_REST_Posts_Controller($posts[0]->post_type);\n\n\t\t\t$post = new \\stdClass;\n\t\t\t$post->page = $restController->prepare_item_for_response($posts[0], $restRequest);\n\t\t\t$post->meta = get_post_meta($posts[0]->ID, '', true);\n\t\t\t$post->seo = new \\stdClass;\n\t\t\t$post->seo->title = get_post_meta($posts[0]->ID, 'rank_math_title', true);\n\t\t\t$post->seo->description = get_post_meta($posts[0]->ID, 'rank_math_description', true);\n\t\t\t$post->seo->canonical_url = get_post_meta($posts[0]->ID, 'rank_math_canonical_url', true);\n\t\t\t$post->seo->robots = get_post_meta($posts[0]->ID, 'rank_math_robots', true);\n\t\t\t$post->seo->schema = get_post_meta($posts[0]->ID, 'rm_rank_math_schema', true);\n $post->sidebar = new \\stdClass;\n $post->sidebar->items = $this->sidebarItems();\n $post->sidebar->title = $this->pluralName;\n\n\t\t\treturn $post;\n\t\t}\n\n\t\treturn new \\WP_Error( 'not_found', __('A '.$this->singularName.' was not found matching the supplied slug'), array( 'status' => 404 ) );\n\t}", "function find( $relationName, Filter $filter_1 );", "abstract public function getRelatedName();", "public function findRecipeBySlug($slug)\n {\n }", "public function scopeFromSlugidable($query, $slug)\n {\n $this->configureSlugidableSettings();\n\n if ($this->slugidableSettings['using_separator'] === 'prefix') {\n $slug_id = Str::before($slug, $this->slugidableSettings['using_separator']);\n } else {\n $slug_id = Str::afterLast($slug, $this->slugidableSettings['using_separator']);\n }\n\n $query->where($this->slugidableSettings['using_key_name'], $slug_id);\n }", "public function scopeBySlug(Builder $query, string $slug, string $locale = null): Builder;", "public function scopeFromSlug( $query, $slug ){\n\t\t\n\t\t$pieces = explode('-', $slug);\n\t\t$slug = substr_replace($slug, '', strrpos($slug, '-'.end($pieces)), strlen('-'.end($pieces)));\n\t\t$query->where([\n\t\t\t\t['id', '=', end($pieces)], \n\t\t\t\t['slug', '=', $slug],\n\t\t\t]);\n\t}", "public function testFilterByAttributeInRelationship()\n {\n parse_str('filter[post.text][like]=%repudiandae%&filter[text][like]=%veniam%&sorting=id', $parameters);\n $response = $this->get(self::API_URI, $parameters);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertNotNull($resource = json_decode((string)$response->getBody()));\n\n // manually checked with\n // SELECT comments.*\n // FROM comments\n // JOIN posts ON comments.id_post = posts.id_post\n // WHERE comments.text LIKE '%veniam%' AND posts.text LIKE '%repudiandae%'\n // ORDER BY comments.id_comment;\n $this->assertCount(4, $resource->data);\n $this->assertEquals(104, $resource->data[0]->id);\n $this->assertEquals(173, $resource->data[1]->id);\n $this->assertEquals(207, $resource->data[2]->id);\n $this->assertEquals(253, $resource->data[3]->id);\n }", "public function findBySlug($slug)\n {\n return $this->findOneBy(['slug' => $slug]);\n\n }", "public function getSlugColumn(): string;", "abstract public function getReverseRelatedName();", "function findOne( $relationName, Filter $filter_1 );", "public function findWhere($parameters,$relationshipNames=[],$trashed = false);", "public function relation($relationName);", "public function findOneByShortName($slug)\n {\n $results = $this->getEntityManager()\n ->createQuery('SELECT s FROM ActsCamdramBundle:Society s')\n ->getResult();\n $slug = strtolower($slug);\n /* Allow for hyphen-delimeted words */\n $slug = preg_replace (\"/-/\", \"_\", $slug);\n foreach ($results as $result) {\n if ($slug == $this->string_to_url($this->noslashes($result->getShortName()))) {\n return $result;\n }\n }\n return null;\n }" ]
[ "0.5753716", "0.5753716", "0.5753716", "0.5753716", "0.5753716", "0.5731607", "0.5565214", "0.5500224", "0.5451761", "0.531696", "0.531696", "0.52641773", "0.51916105", "0.5166633", "0.5071416", "0.5064767", "0.5027508", "0.50134456", "0.5003557", "0.4996927", "0.49968517", "0.4993018", "0.49880406", "0.4983982", "0.4959087", "0.4941773", "0.48920888", "0.48882014", "0.48771122", "0.4871692" ]
0.6308178
0
Query by an ID of an element in the selected role. Warning: This is an WPMLunaware query.
public function element_id( $element_id, IToolset_Relationship_Role_Parent_Child $for_role, $need_wpml_unaware_query = true ) { if( ! $need_wpml_unaware_query ) { // This is to ensure a smooth transition from using element_id() everywhere to doing it only // in cases where it's explicitly needed. We can remove this after the final release. trigger_error( 'You are using the element_id() condition in the association query. ' . 'However, this condition is WPML-unaware. Consider using element_id_and_domain() instead ' .'or, if you really need to ignore element translations, set the new $need_wpml_unaware_query to true.', E_NOTICE ); } return $this->condition_factory->element_id( $element_id, $for_role, $this->element_selector_provider ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getRolesUiElement($element_id){\n $element = App\\Uielement::find($element_id);\n if($element == null){\n return App\\Role::where('name', 'admin_global')->get();\n }\n $roles = $element->roles;\n //$roles = array_prepend($roles, 'admin_global');\n return $roles;\n }", "function get_role($id) {\n $id = mysqli_real_escape_string($this->connection, $id); \n return $this->query(\n \"SELECT username, job.name as JobName, kwds.id as kwdsID, job.id as JobID, user_id AS UserID\n FROM kwds, role, job, user\n WHERE user_id=user.id AND job.id=job_id AND kwds.id=kwds_id AND role_id='$id'\"\n );\n }", "function findRole($objectId, $contactId, $roleId) {\n global $db;\n $id = $db->getOne(\"SELECT id FROM sotf_object_roles WHERE object_id='$objectId' AND contact_id='$contactId' AND role_id='$roleId' \");\n return $id;\n }", "function a_role()\n\t{\n\t\tif ($this->params->event == 'pre_get'){\n\t\t\t$this->_get_filtered(TRUE, FALSE);\n\t\t\t\n\t\t\tif (isset($this->params->for_user) && !empty($this->params->for_user)) {\n\t\t\t\t$this->params->where_in['id'] = $this->_get_role($this->params->for_user);\n\t\t\t}\n\t\t}\n\t}", "public function find($id = null)\n {\n if (empty($id) || ! is_integer($id)) {\n return false;\n }\n\n $role = parent::find($id);\n if ($role == false) {\n return false;\n }\n\n $this->get_role_permissions($role);\n\n return $role;\n }", "function get_single_role($id) {\n\t\t\n\t\t$this->db->where('id', $id);\n\t\t$query = $this->db->get('roles');\n\t\t$result = $query->row();\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "static function get($id)\n {\n global $user;\n\n $mdb2 = getConnection();\n\n $sql = \"select id, name, description, rank, rights, status from tt_roles\n where id = $id and group_id = \".$user->getGroup().\" and (status = 0 or status = 1)\";\n $res = $mdb2->query($sql);\n\n if (!is_a($res, 'PEAR_Error')) {\n $val = $res->fetchRow();\n\t if ($val['id'] != '') {\n return $val;\n } else\n return false;\n }\n return false;\n }", "public abstract function query($id);", "public function getWithRoles($id);", "public function getListAccountWithIDRole($id);", "public function selectById($id);", "public function searchId(int $id);", "function get_user_role($id)\n\t{\n\t\t$user = new WP_User($id);\n\t\treturn array_shift($user->roles);\n\t}", "function wp_admin_search_by_id( $search, $wp_query ) {\n if ( ! is_admin() ) {\n return $search;\n }\n\n if ( ! $wp_query->is_main_query() && ! $wp_query->is_search() ) {\n return $search;\n } \n\n $search_string = get_query_var( 's' );\n\n if ( ! filter_var( $search_string, FILTER_VALIDATE_INT ) ) {\n return $search;\n }\n \n return \"AND wp_posts.ID = '\" . intval( $search_string ) . \"'\";\n}", "public function find($id)\n {\n if (!isset(self::$list[$id])) {\n throw new NotFound('No role found for '.$id);\n }\n\n return self::$list[$id];\n }", "function get_role($role_id){\n $result = $this->cosi_db->get_where(\"roles\",\n array(\n \"role_id\"=>$role_id\n ));\n foreach($result->result() as $r){\n return $r;\n }\n }", "function get_permission_by_role_id($roleId = 0, $field = '') {\n\n\t\t$sintax = \"SELECT \" . $field . \"\n\t\t\t\tFROM \" . $this->table . \"\n\t\t\t\tWHERE \" . $this->foreignKey . \" = '$roleId'\";\n\n\t\t$query = $this->db->query($sintax);\n\n\t\t$result = $query->row_array();\n\n\t\treturn $result;\n\n\t}", "public function element(\n\t\tIToolset_Element $element,\n\t\tIToolset_Relationship_Role $for_role = null,\n\t\t$query_original_element = false,\n\t\t$translate_provided_id = true,\n\t\t$set_its_translation_language = true\n\t) {\n\t\tif( $set_its_translation_language ) {\n\t\t\t$this->set_translation_language_by_element_id_and_domain( $element->get_id(), $element->get_domain() );\n\t\t}\n\n\t\tif( null === $for_role ) {\n\t\t\t$conditions = array();\n\t\t\tforeach( Toolset_Relationship_Role::all() as $role ) {\n\t\t\t\t$conditions[] = $this->element(\n\t\t\t\t\t$element, $role, $query_original_element, $translate_provided_id, false\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn $this->do_or( $conditions );\n\t\t}\n\n\t\treturn $this->element_id_and_domain(\n\t\t\t$element->get_id(), $element->get_domain(), $for_role,\n\t\t\t$query_original_element, $translate_provided_id\n\t\t);\n\t}", "function get_user_role_id($id)\n {\n $role = \\App\\User::query()->where('id',$id)->first();\n\n return $role->role_id;\n }", "public function request_element_selection( IToolset_Association_Query_Element_Selector $element_selector ) {\n\t\t// We need only one element here. Also, we explicitly *don't* want to include association ID\n\t\t// so that we can filter out duplicate IDs by the DISTINCT query.\n\t\t$element_selector->request_element_in_results( $this->role );\n\t\t$element_selector->request_distinct_query();\n\t}", "function get_by_id() {\n $id = (isset($_REQUEST['ro_idroles'])) ? $_REQUEST['ro_idroles'] : '';\n $result = $this->app_roles_model->get_by_id($id);\n echo json_encode($result);\n }", "function get_user_by_id($id) {\n\tglobal $wpdb;\n\tglobal $webgrain;\n\t$sql = \"SELECT * FROM \" . $webgrain->usertable . \" WHERE id = $id\";\n\t$result = $wpdb->get_results($wpdb->prepare($sql, 0));\n\tif(!empty($result)) { foreach($result as $r) { return $r; } }\n}", "public function getById($id)\n {\n // Getting all the items\n $feed = $this->getAdvancedFeed('*', 0, 999999, false, false, array(), false);\n\n // Getting id field name\n $id_field_name = $this->getIdFieldName();\n\n // Walking trough the items until object of specified ID is found\n foreach ($feed[0] as $line) {\n if ($line->$id_field_name == $id) {\n return $line;\n }\n }\n\n return false;\n }", "public function element_id_and_domain(\n\t\t$element_id,\n\t\t$domain,\n\t\tIToolset_Relationship_Role $for_role,\n\t\t$query_original_element = false,\n\t\t$translate_provided_id = true,\n\t\t$set_its_translation_language = true\n\t) {\n\t\tif( $set_its_translation_language ) {\n\t\t\t$this->set_translation_language_by_element_id_and_domain( $element_id, $domain );\n\t\t}\n\n\t\treturn $this->condition_factory->element_id_and_domain(\n\t\t\t$element_id,\n\t\t\t$domain,\n\t\t\t$for_role,\n\t\t\t$this->element_selector_provider,\n\t\t\t$query_original_element,\n\t\t\t$translate_provided_id\n\t\t);\n\t}", "public function find($id)\n {\n return Role::findById($id);\n }", "public function query($id) {\n }", "function get_by_id($id)\n {\n $this->db3->where($this->id, $id);\n return $this->db3->get($this->table)->row();\n }", "function getMediaQueryForId($a_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$set = $ilDB->query(\"SELECT * FROM sty_media_query \".\n\t\t\t\" WHERE id = \".$ilDB->quote($a_id, \"integer\")\n\t\t\t);\n\t\treturn $ilDB->fetchAssoc($set);\n\t}", "public function testFindByRoleIdWhichExists()\r\n {\r\n $mockObj = $this->_createMockDataObject();\r\n\r\n $mock = $this->_getInstanceManagerWithMockSoapClient();\r\n\r\n // SOAP client should return a single Role object when\r\n // the specified Role ID exists in D2L\r\n $mock->getSoapClient()->addCallback(\"UserManagement\", \"GetRole\",\r\n function($args) use (&$mockObj) {\r\n $mockObj->RoleId->Id = $args['RoleId']['Id'];\r\n $mockObj->RoleId->Source = $args['RoleId']['Source'];\r\n\r\n $result = new stdClass();\r\n $result->Role = $mockObj;\r\n return $result;\r\n }\r\n );\r\n\r\n $apiRole = new D2LWS_Role_API($mock);\r\n $roleObj = $apiRole->findByID(9999);\r\n\r\n $this->assertEquals(9999, $roleObj->getRoleID());\r\n }", "function GetByID($id){\r\n\t\t$db = Database::getInstance ();\r\n\t\t$sql = $db->getConnection ();\r\n\t\t$query = \"select n.nieuwsitemid,n.titel,n.tekst,n.thumbnail,n.isvideo,n.bannerfoto,n.datum,n.auteur, CONCAT(a.voornaam , ' ' , a.tussenvoegsel , ' ' , a.achternaam) as volledignaam from nieuwsitems n\r\n\t\t\t\t left join account a on n.auteur = a.accountid where n.nieuwsitemid =\".$id;\r\n\t\t$result = $sql->query ($query);\r\n\t\t$row = $result->fetch_object('nieuwsItem');\t\t\r\n\t\t$result->close();\r\n\t\treturn $row;\r\n\t}" ]
[ "0.6014816", "0.5833588", "0.58159685", "0.5740505", "0.57098526", "0.5698372", "0.5695448", "0.5585781", "0.5575507", "0.55660087", "0.5528583", "0.5528576", "0.5501421", "0.549169", "0.54191285", "0.5415988", "0.54011446", "0.53750956", "0.5328264", "0.5326174", "0.5297365", "0.52830595", "0.5282165", "0.52801335", "0.52756244", "0.52677184", "0.5254734", "0.52484727", "0.5241989", "0.52410585" ]
0.5952567
1
Exclude associations with a particular element in the selected role.
public function exclude_element( IToolset_Element $element, IToolset_Relationship_Role $for_role, $query_original_element = false, $translate_provided_id = true ) { return $this->condition_factory->exclude_element( $element->get_id(), $element->get_domain(), $for_role, $this->element_selector_provider, $query_original_element, $translate_provided_id ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_excluded_roles() {\n\t\t$roles = WordPress::get_roles();\n\t\tunset( $roles['administrator'], $roles['editor'], $roles['author'] );\n\n\t\treturn $roles;\n\t}", "public function getExcludes();", "public function addExclude($element) {\n\t\tif ($element instanceof $this->_setInterface || $element instanceof Celsus_Set_Operation_Abstract) {\n\t\t\t$this->_excludes[] = $element;\n\t\t} else {\n\t\t\tthrow new Celsus_Exception(\"Element must implement $this->_setInterface or Set\");\n\t\t}\n\t}", "public function getExclude(): array;", "function exclude_this_page($query)\n{\n global $current_user;\n $user_roles = $current_user->roles;\n\n //Ids of pages to be excluded\n $excluded_pages = [];\n\n global $pagenow;\n\n if ('edit.php' == $pagenow && (get_query_var('post_type') && 'page' == get_query_var('post_type'))) {\n if (in_array('webmaster', $user_roles)) {\n $query->set('post__not_in', $excluded_pages);\n }\n }\n return $query;\n}", "public function exclusions()\n {\n return $this->hasMany('App\\ProjectRequirement')->whereIn('exclusion', [ 1, true ])->orderBy('id', 'asc');\n }", "function bbp_remove_roles()\n{\n}", "function get_not_my_courses_by_role($userid, $roleid, $sortorder='c.sortorder',\n $fields='c.id, c.fullname, x.id AS contextid', $contextlevel='50') {\n \n global $CFG, $DB;\n $notmyrolecourses = array();\n \n $rs = $DB->get_recordset_sql(\"\n SELECT $fields\n FROM {$CFG->prefix}context x\n INNER JOIN {$CFG->prefix}course c ON x.instanceid = c.id AND x.contextlevel = $contextlevel\n WHERE x.instanceid NOT IN \n (SELECT x.instanceid\n FROM {$CFG->prefix}role_assignments ra\n INNER JOIN {$CFG->prefix}context x ON x.id = ra.contextid AND x.contextlevel = $contextlevel\n WHERE ra.roleid = $roleid AND ra.userid = $userid)\n ORDER BY $sortorder\");\n \n if ($rs && count($rs) > 0) {\n foreach ($rs as $course) {\n if ($course->id != SITEID) {\n $notmyrolecourses[$course->id] = $course;\n }\n }\n }\n \n $rs->close();\n \n return $notmyrolecourses;\n}", "public function isNotA($role)\n {\n return call_user_func_array([$this, 'isNotAn'], func_get_args());\n }", "public function deny($roleName, $resourceName);", "public function findAllWhereNotIn($columnName,$array,$relationshipNames=[],$trashed = false);", "public function detachRole($role);", "public function detachRole($role);", "function filter_exclude_authors( $where = '' ) {\n\n\t\t\t\t$author_ids = isset( $_GET['group'] ) ? postmedia_get_voices_usergroup( sanitize_text_field( $_GET['group'] ) ) : '';\n\n\t\t\t\tif ( is_array( $author_ids ) ){\n\n\t\t\t\t\tforeach ( $author_ids as $exclude_author ){\n\n\t\t\t\t\t//loop through our voices group and exclude each\n\t\t\t\t\t$where .= \" AND post_author != '\" . $exclude_author . \"'\";\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn $where;\n\n\t\t\t}", "public function testExcluedElements() {\n $this->drupalGet('/webform/test_element_excluded_columns');\n\n $this->assertFieldByName('webform_excluded_columns[tableselect][textfield]');\n $this->assertNoFieldByName('webform_excluded_columns[tableselect][markup]');\n $this->assertNoFieldByName('webform_excluded_columns[tableselect][details]');\n }", "public function getModelToExcludedPermissions()\n {\n return array();\n }", "public function ignore_delete_role() : Database_model\n\t{\n\t\t$this->ignore_delete_role = true;\n\n\t\treturn $this;\n\t}", "function quizbook_examen_remover_capabilities() {\n\n $manager_roles = array( 'administrator', 'editor' );\n\n foreach( $manager_roles as $the_role ) {\n $role = get_role( $the_role );\n $role->remove_cap( 'read' );\n $role->remove_cap( 'edit_examenes' );\n $role->remove_cap( 'publish_examenes' );\n $role->remove_cap( 'edit_published_examenes' );\n $role->remove_cap( 'read_private_examenes' );\n $role->remove_cap( 'edit_others_examenes' );\n $role->remove_cap( 'edit_private_examenes' );\n $role->remove_cap( 'delete_examenes' );\n $role->remove_cap( 'delete_published_examenes' );\n $role->remove_cap( 'delete_private_examenes' );\n $role->remove_cap( 'delete_others_examenes' );\n }\n\n}", "public function deny(Role $role)\n {\n return $role->deny($this);\n }", "public function setExcludes(array $excludes);", "function my_relationship_query( $args, $field, $post_id ) {\n\t\n // exclude current post from being selected\n $args['exclude'] = $post_id;\n\t\n\t\n\t// return\n return $args;\n \n}", "public function testDenyRole()\n {\n $this->assertEmpty($this->Authorizer->getData());\n\n $this->Authorizer->action('index', function($auth) {\n $auth->denyRole(2);\n });\n\n $this->assertNotEmpty($this->Authorizer->getData());\n\n $data = $this->Authorizer->getData();\n\n $this->assertFalse(Hash::get($data, \"users.index.roles.2\"));\n $this->assertArrayHasKey(2, Hash::get($data, \"users.index.roles\"));\n $this->assertArrayNotHasKey(1, Hash::get($data, \"users.index.roles\"));\n $this->assertArrayNotHasKey(3, Hash::get($data, \"users.index.roles\"));\n }", "function hide_adminstrator_editable_roles( $roles ){\n if ( isset( $roles['administrator'] ) && !current_user_can('level_10') ){\n unset( $roles['administrator'] );\n }\n return $roles;\n}", "public static function getFeaturesNotAssignedToCurrentRole($rid)\n {\n $features = []; $array = [0];\n\n $features = Role::find($rid)->features()->wherePivot('deleted_at', Null)->get();\n foreach ($features as $f){\n $array [] = $f->id;\n }\n\n //if(!isset($array)) return [];\n $feature_result = Feature::whereNotIn('id', $array)->get();\n\n return $feature_result;\n }", "public function getExclusionCriteria()\n {\n return $this->exclusionCriteria;\n }", "public function getExclusions();", "public function deny($role, $actions) {\n\n // create array of actions (in any case: if $actions is string or array)\n $acts = [];\n if(is_string($actions)) {\n $acts[] = $actions;\n } else if(is_array($actions)) {\n $acts = $actions;\n }\n\n // check if actions for selected role are already set or create new key\n if(isset($this->actions[$role])) {\n foreach($acts as $act) {\n $this->actions[$role][$act] = Acl::DENIED;\n }\n } else {\n foreach($acts as $act) {\n $this->actions[$role] = [$act => Acl::DENIED];\n }\n }\n }", "public function removeRole($role);", "public function removeRole($role);", "public function setExclude(array $exclude): void;" ]
[ "0.5898692", "0.5691484", "0.56856364", "0.5647777", "0.54945487", "0.5423962", "0.5314829", "0.53096724", "0.5266669", "0.5246108", "0.52045137", "0.51865196", "0.51865196", "0.51745766", "0.5173389", "0.51579666", "0.515732", "0.51479614", "0.5144549", "0.5142641", "0.5110387", "0.5090777", "0.5084725", "0.50796723", "0.50675654", "0.5026802", "0.5023666", "0.50135005", "0.50135005", "0.49973544" ]
0.66481155
0
Query associations by the fact whether the relationship was migrated from the legacy implementation.
public function has_legacy_relationship( $needs_legacy_support = true ) { return $this->condition_factory->has_legacy_relationship( $needs_legacy_support, $this->join_manager ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requestedRelationships(): bool;", "public function requestsRelationships(): bool;", "public function toMany(): bool;", "public function hasRelations();", "public function eagerLoadableRelations(): array;", "function getAvailableRelations()\n\t{\n\t\t// overwrite in inherited classes\n\t\treturn array();\n\t}", "public function getAssociations();", "public function getRelationships(): array;", "public function getRelationships();", "public function getAssociations(): array;", "public function getAssoc_relateds() {\n $relateds = array();\n \n $bizRelations = wcmBizrelation::getBizobjectRelations($this);\n foreach ($bizRelations as $bizRelation) {\n $related = array(\"relation\"=>$bizRelation, \"object\"=> new $bizRelation[\"destinationClass\"]($this->getProject(), $bizRelation[\"destinationId\"]));\n $relateds[] = $related;\n }\n return $relateds;\n }", "private function set_relationships()\n {\n if (empty($this->relationships)) {\n $options = ['has_one', 'has_many', 'has_many_pivot'];\n foreach ($options as $option) {\n if (isset($this->{$option}) && !empty($this->{$option})) {\n foreach ($this->{$option} as $key => $relation) {\n $single_query = false;\n if (!is_array($relation)) {\n $foreign_model = $relation;\n $model = $this->parse_model_dir($foreign_model);\n $foreign_model = $model['foreign_model'];\n $foreign_model_name = $model['foreign_model_name'];\n\n $this->load->model($foreign_model, $foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n $foreign_key = $this->{$foreign_model_name}->primary_key;\n $local_key = $this->primary_key;\n $pivot_local_key = $this->table.'_'.$local_key;\n $pivot_foreign_key = $foreign_table.'_'.$foreign_key;\n $get_relate = false;\n } else {\n if ($this->is_assoc($relation)) {\n $foreign_model = $relation['foreign_model'];\n $model = $this->parse_model_dir($foreign_model);\n $foreign_model = $model['model_dir'].$model['foreign_model'];\n $foreign_model_name = $model['foreign_model_name'];\n\n if (array_key_exists('foreign_table', $relation)) {\n $foreign_table = $relation['foreign_table'];\n } else {\n $this->load->model($foreign_model, $foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n }\n\n $foreign_key = $relation['foreign_key'];\n $local_key = $relation['local_key'];\n if ($option == 'has_many_pivot') {\n $pivot_table = $relation['pivot_table'];\n $pivot_local_key = (array_key_exists('pivot_local_key', $relation)) ? $relation['pivot_local_key'] : $this->table.'_'.$this->primary_key;\n $pivot_foreign_key = (array_key_exists('pivot_foreign_key', $relation)) ? $relation['pivot_foreign_key'] : $foreign_table.'_'.$foreign_key;\n $get_relate = (array_key_exists('get_relate', $relation) && ($relation['get_relate'] === true)) ? true : false;\n }\n if ($option=='has_one' && isset($relation['join']) && $relation['join'] === true) {\n $single_query = true;\n }\n } else {\n $foreign_model = $relation[0];\n $model = $this->parse_model_dir($foreign_model);\n $foreign_model = $model['model_dir'].$model['foreign_model'];\n $foreign_model_name = $model['foreign_model_name'];\n $this->load->model($foreign_model);\n $foreign_table = $this->{$foreign_model}->table;\n $foreign_key = $relation[1];\n $local_key = $relation[2];\n if ($option=='has_many_pivot') {\n $pivot_local_key = $this->table.'_'.$this->primary_key;\n $pivot_foreign_key = $foreign_table.'_'.$foreign_key;\n $get_relate = (isset($relation[3]) && ($relation[3] === true)) ? true : false;\n }\n }\n }\n\n if ($option=='has_many_pivot' && !isset($pivot_table)) {\n $tables = [$this->table, $foreign_table];\n sort($tables);\n $pivot_table = $tables[0].'_'.$tables[1];\n }\n\n $this->relationships[$key] = [\n 'relation' => $option,\n 'relation_key' => $key,\n 'foreign_model' => strtolower($foreign_model),\n 'foreign_model_name' => strtolower($foreign_model_name),\n 'foreign_table' => $foreign_table,\n 'foreign_key' => $foreign_key,\n 'local_key' => $local_key\n ];\n\n if ($option == 'has_many_pivot') {\n $this->relationships[$key]['pivot_table'] = $pivot_table;\n $this->relationships[$key]['pivot_local_key'] = $pivot_local_key;\n $this->relationships[$key]['pivot_foreign_key'] = $pivot_foreign_key;\n $this->relationships[$key]['get_relate'] = $get_relate;\n }\n\n if ($single_query === true) {\n $this->relationships[$key]['joined'] = true;\n }\n }\n }\n }\n }\n }", "abstract protected function getRelations();", "public function hasRelationResolver(): bool\n {\n return isset($this->relationResolver);\n }", "public function findAllWithRelationship($relationshipNames,$trashed = false);", "protected function getRelations(): array\n {\n return [\n // Returns only active additional fields\n 'afs' => function ($query) {\n $query->active();\n },\n ];\n }", "abstract public function getRelations();", "public function testAssociationProxyFindWithConditions(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->belongsToMany('Tags', [\n 'conditions' => ['SpecialTags.highlighted' => true],\n 'through' => 'SpecialTags',\n ]);\n $query = $table->Tags->find();\n $result = $query->toArray();\n $this->assertCount(1, $result);\n $this->assertSame(1, $result[0]->id);\n }", "abstract protected function getFetchJoins();", "abstract public function loadRelationships();", "public function findAll($relationshipNames=[],$trashed = false);", "public function requestsInclude(string $relationship): bool;", "public function hasRelationships()\n {\n return !empty($this->relationships);\n }", "public function hasAssociation($name);", "protected function relationLoaded()\n {\n return false;\n }", "public function getAvailableRelations () {\n\t$data = $this->getDefinition()->getFieldDefinition(\"availableRelations\")->preGetData($this);\n\t return $data;\n}", "public function isRelationAttribute($key);", "private function get_arr_relations_mm_simple()\n {\n $conf = $this->pObj->conf;\n $mode = $this->pObj->piVar_mode;\n $view = $this->pObj->view;\n\n $viewWiDot = $view . '.';\n $arr_return = array();\n\n\n // RETURN autoconfig is switched off\n if ( !$this->boolAutorelation )\n {\n if ( $this->pObj->b_drs_sql )\n {\n t3lib_div::devlog( '[INFO/SQL] Nothing to do, autoconfig is switched off.', $this->pObj->extKey, 0 );\n }\n return true;\n }\n // RETURN autoconfig is switched off\n // Don't do anything but load the TCA, if there is only one table\n if ( count( $this->pObj->arr_realTables_arrFields ) < 2 )\n {\n if ( $this->pObj->b_drs_sql )\n {\n t3lib_div::devlog( '[INFO/SQL] Nothing to do. There is no relation.', $this->pObj->extKey, 0 );\n }\n $tables = $this->pObj->arr_realTables_arrFields;\n foreach ( ( array ) $tables as $tableKey => $tableValue )\n {\n t3lib_div::loadTCA( $tableKey );\n if ( $this->pObj->b_drs_tca )\n {\n t3lib_div::devlog( '[INFO/TCA] $GLOBALS[\\'TCA\\'][\\'' . $tableKey . '\\'] is loaded.', $this->pObj->extKey, 0 );\n }\n }\n return true;\n }\n // Don't do anything but load the TCA, if there is only one table\n\n if ( $this->pObj->b_drs_sql )\n {\n t3lib_div::devlog( '[INFO/SQL] We try to build SQL relations automatically.', $this->pObj->extKey, 0 );\n }\n\n\n //////////////////////////////////\n //\n // Get autoconfig configuration\n\n $boolOneWayOnly = $this->arr_ts_autoconf_relation[ 'oneWayOnly' ];\n $boolSimpleRelations = $this->arr_ts_autoconf_relation[ 'simpleRelations' ];\n $boolSelfReference = $this->arr_ts_autoconf_relation[ 'simpleRelations.' ][ 'selfReference' ];\n $boolMMrelations = $this->arr_ts_autoconf_relation[ 'mmRelations' ];\n $allowedTCAconfigTypesCSV = $this->arr_ts_autoconf_relation[ 'TCAconfig.' ][ 'type.' ][ 'csvValue' ];\n $dontUseFieldsCSV = $this->arr_ts_autoconf_relation[ 'csvDontUseFields' ];\n // Get autoconfig configuration\n /////////////////////////////////////\n //\n // Initiate the global boolean for LEFT JOIN\n\n if ( $this->arr_ts_autoconf_relation[ 'left_join' ] == 1 || strtolower( $this->arr_ts_autoconf_relation[ 'left_join' ] == 'true' ) )\n {\n $this->b_left_join = true;\n }\n // Initiate the global boolean for LEFT JOIN\n /////////////////////////////////////\n //\n // Development Logging\n\n if ( $this->pObj->b_drs_sql )\n {\n if ( $boolOneWayOnly )\n {\n t3lib_div::devlog( '[INFO/SQL] Use only relations in the TCA of the local table ' . $this->pObj->localTable . '.', $this->pObj->extKey, 0 );\n }\n else\n {\n t3lib_div::devlog( '[INFO/SQL] Use relations in the TCA of the local table ' . $this->pObj->localTable . ' and of foreign tables.', $this->pObj->extKey, 0 );\n }\n if ( $boolSimpleRelations )\n {\n t3lib_div::devlog( '[INFO/SQL] Use simple relations.', $this->pObj->extKey, 0 );\n if ( $boolSelfReference )\n {\n t3lib_div::devlog( '[INFO/SQL] Use self references in simple relations.', $this->pObj->extKey, 0 );\n }\n else\n {\n t3lib_div::devlog( '[INFO/SQL] Don\\'t use self references in simple relations.', $this->pObj->extKey, 0 );\n }\n }\n else\n {\n t3lib_div::devlog( '[INFO/SQL] Don\\'t use simple relations.', $this->pObj->extKey, 0 );\n }\n if ( $boolMMrelations )\n {\n t3lib_div::devlog( '[INFO/SQL] Use MM relations.', $this->pObj->extKey, 0 );\n }\n else\n {\n t3lib_div::devlog( '[INFO/SQL] Don\\'t use MM relations.', $this->pObj->extKey, 0 );\n }\n if ( $this->b_left_join )\n {\n t3lib_div::devlog( '[INFO/SQL] Use LEFT JOIN is TRUE.', $this->pObj->extKey, 0 );\n }\n else\n {\n t3lib_div::devlog( '[INFO/SQL] Use LEFT JOIN is FALSE. We use FULL JOINS.', $this->pObj->extKey, 0 );\n }\n }\n // Development Logging\n //////////////////////////////////\n //\n // Process csv values\n // get config.type (should be select and/or group)\n $arrTCAtypes = explode( ',', $allowedTCAconfigTypesCSV );\n foreach ( ( array ) $arrTCAtypes as $key => $value )\n {\n $arrTCAtypes[ trim( $key ) ] = trim( $value );\n }\n if ( $this->pObj->b_drs_sql )\n {\n $csvTmpPrompt = implode( ', ', $arrTCAtypes );\n t3lib_div::devlog( '[INFO/SQL] Use only TCA columns with config.type: ' . $csvTmpPrompt, $this->pObj->extKey, 0 );\n }\n // get field names, which shouldn't processed for relation building\n if ( $dontUseFieldsCSV )\n {\n $arrNoColumns = explode( ',', $dontUseFieldsCSV );\n foreach ( ( array ) $arrNoColumns as $key => $value )\n {\n list($table, $field) = explode( '.', $value );\n $arrNoColumns[][ trim( $table ) ] = trim( $field );\n unset( $arrNoColumns[ $key ] );\n if ( $this->pObj->b_drs_sql )\n {\n $arrDontUseFields[] = $table . '.' . $field;\n }\n }\n }\n if ( ($this->pObj->b_drs_sql) && is_array( $arrDontUseFields ) )\n {\n $csvTmpPrompt = implode( ', ', $arrDontUseFields );\n t3lib_div::devlog( '[INFO/SQL] If this fields have a relation, don\\'t use it: ' . $csvTmpPrompt, $this->pObj->extKey, 0 );\n }\n // Process csv values\n //////////////////////////////////////////////////////////////////\n //\n // Loop through the TCA of the foreign tables\n\n $tables = $this->pObj->arr_realTables_arrFields;\n foreach ( ( array ) $tables as $tableKey => $tableValue )\n {\n t3lib_div::loadTCA( $tableKey );\n if ( $this->pObj->b_drs_tca )\n {\n t3lib_div::devlog( '[INFO/TCA] $GLOBALS[\\'TCA\\'][\\'' . $tableKey . '\\'] is loaded.', $this->pObj->extKey, 0 );\n }\n $arrColumns = $GLOBALS[ 'TCA' ][ $tableKey ][ 'columns' ];\n if ( is_array( $arrColumns ) )\n {\n foreach ( ( array ) $arrColumns as $columnsKey => $columnsValue )\n {\n $config = $columnsValue[ 'config' ];\n\n\n //////////////////////////////////////////////\n //\n // Look for a destination table\n\n if ( $this->pObj->b_drs_tca )\n {\n t3lib_div::devlog( '[INFO/TCA] \\'' . $tableKey . '.' . $columnsKey . '.config.type: \\'' . $config[ 'type' ] . '\\'', $this->pObj->extKey, 0 );\n }\n $boolDB = true;\n $foreignTable = false;\n $arrForeignTables = false;\n if ( $config[ 'internal_type' ] && $config[ 'internal_type' ] != 'db' )\n {\n // We don't have any field with any relation\n $boolDB = false;\n if ( $this->pObj->b_drs_tca && in_array( $config[ 'type' ], $arrTCAtypes ) )\n {\n t3lib_div::devlog( '[INFO/TCA] \\'' . $tableKey . '.' . $columnsKey . '.config.internal_type isn\\'t \\'db\\': There isn\\'t any relation.', $this->pObj->extKey, 0 );\n }\n }\n\n // There is a different workflow for select and group\n if ( $boolDB && in_array( 'select', $arrTCAtypes ) && $config[ 'type' ] == 'select' )\n {\n // Config.internal_type is 'db', user wants to process config.type 'select', the config.type is 'select'\n $foreignTable = $config[ 'foreign_table' ];\n if ( !empty( $foreignTable ) )\n {\n if ( $this->pObj->b_drs_sql )\n {\n $prompt = 'TCA \\'' . $tableKey . '.' . $columnsKey . '.config.foreign_table: \\'' . $foreignTable . '\\'';\n t3lib_div::devlog( '[INFO/SQL] ' . $prompt, $this->pObj->extKey, 0 );\n }\n }\n }\n if ( $boolDB && in_array( 'group', $arrTCAtypes ) && $config[ 'type' ] == 'group' )\n {\n // Config.internal_type is 'db', user wants to process config.type 'group', the config.type is 'group'\n $arrForeignTables = $this->pObj->objZz->getCSVasArray( $config[ 'allowed' ] );\n if ( $this->pObj->b_drs_sql )\n {\n $csvForeignTables = implode( ', ', $arrForeignTables );\n t3lib_div::devlog( '[INFO/SQL] TCA \\'' . $tableKey . '.' . $columnsKey . '.config.allowed: \\'' . $csvForeignTables . '\\'', $this->pObj->extKey, 0 );\n }\n if ( count( $arrForeignTables ) > 1 && ($this->pObj->b_drs_sql || $this->pObj->b_drs_error) )\n {\n t3lib_div::devlog( '[WARN/SQL] TCA \\'' . $tableKey . '.' . $columnsKey . '.config.allowed has more than one table.', $this->pObj->extKey, 2 );\n t3lib_div::devlog( '[ERROR/SQL] But ' . $this->pObj->extKey . ' can\\'t process more than one table.', $this->pObj->extKey, 3 );\n t3lib_div::devlog( '[HELP/SQL] Please configure your SQL relation manually.', $this->pObj->extKey, 1 );\n }\n $foreignTable = $arrForeignTables[ 0 ];\n }\n\n\n //////////////////////////////////////////////\n //\n // Only process if there is a foreign_table and if it is used\n//var_dump('sql_auto 1639', $foreignTable);\n if ( $foreignTable && in_array( $foreignTable, array_keys( $tables ) ) )\n {\n // There is a relation between the used table and the current table is in the TCA\n $boolRelation = true;\n if ( $boolOneWayOnly )\n {\n // Don't use relations from foreign tables\n if ( $tableKey != $this->pObj->localTable )\n {\n $boolRelation = false;\n }\n }\n if ( $boolRelation && !in_array( $config[ 'type' ], $arrTCAtypes ) )\n {\n // The TCA.table.column.x.config.type isn't an element in the TS allowedTCAconfigTypes\n $boolRelation = false;\n }\n if ( $boolRelation && is_array( $arrNoColumns ) )\n {\n // We should build a relation, but we have to check if it isn't one of the forbidden table.fields\n foreach ( ( array ) $arrNoColumns as $ncKey => $ncValue )\n {\n // var_dump($tableKey, $ncValue[$tableKey], $columnsKey);\n // -> \"tx_civserv_service\", \"sv_organisation\", \"sv_similar_services\"\n if ( $ncValue[ $tableKey ] == $columnsKey )\n {\n // The column is an element in the TS dontUseFields. It is forbidden.\n $boolRelation = false;\n }\n }\n }\n if ( $boolRelation )\n {\n // The TCA config has a MM array\n if ( $config[ 'MM' ] )\n {\n // Don't process MM relations automatically\n if ( !$boolMMrelations )\n {\n if ( $this->pObj->b_drs_sql )\n {\n t3lib_div::devlog( '[INFO/SQL] Result (MM): ' . $tableKey . ' - ' . $config[ 'MM' ] . ' - ' . $foreignTable, $this->pObj->extKey, 0 );\n t3lib_div::devlog( '[INFO/SQL] But MM relations shouldn\\'t processed automatically.', $this->pObj->extKey, 0 );\n t3lib_div::devlog( '[HELP/SQL] If you want to process it automatically, please enable the MM relation building.', $this->pObj->extKey, 1 );\n }\n }\n // Don't process MM relations automatically\n // Process MM relation automatically\n if ( $boolMMrelations )\n {\n $arr_return[ 'MM' ][ $tableKey ][ $config[ 'MM' ] ] = $foreignTable;\n // #9697, 100912, dwildt\n if ( !empty( $config[ 'MM_opposite_field' ] ) )\n {\n $this->arr_relations_opposite[ $tableKey ][ $config[ 'MM' ] ][ 'MM_opposite_field' ] = $config[ 'MM_opposite_field' ];\n }\n // #9697, 100912, dwildt\n if ( $this->pObj->b_drs_sql )\n {\n t3lib_div::devlog( '[INFO/SQL] Result (MM): ' . $tableKey . ' - ' . $config[ 'MM' ] . ' - ' . $foreignTable, $this->pObj->extKey, -1 );\n t3lib_div::devlog( '[HELP/SQL] Switch off the result above? Use TS config: ' .\n 'autoconfig.relations.csvDontUseFields = ..., ' . $tableKey . '.' . $columnsKey . ', ...', $this->pObj->extKey, 1 );\n }\n if ( $this->pObj->b_drs_sql && $config[ 'foreign_table_where' ] )\n {\n t3lib_div::devlog( '[WARN/SQL] In TCA is foreign_table_where configured. This may be a risk, because the browser won\\'t ' .\n 'process the clause: ' . $config[ 'foreign_table_where' ], $this->pObj->extKey, 2 );\n }\n }\n // Process MM relation automatically\n }\n // The TCA config has a MM array\n // The TCA config has a simple relation - a foreign_table but no MM array\n if ( !$config[ 'MM' ] )\n {\n // Don't process simple relations automatically\n if ( !$boolSimpleRelations )\n {\n if ( $this->pObj->b_drs_sql )\n {\n t3lib_div::devlog( '[INFO/SQL] Result (simple): ' . $tableKey . '.' . $columnsKey . ' - ' . $foreignTable, $this->pObj->extKey, 0 );\n t3lib_div::devlog( '[INFO/SQL] But simple relations shouldn\\'t processed automatically.', $this->pObj->extKey, 0 );\n t3lib_div::devlog( '[HELP/SQL] If you want to process it automatically, please enable the simple relation building.', $this->pObj->extKey, 1 );\n }\n }\n // Don't process simple relations automatically\n // Process simple relations automatically\n if ( $boolSimpleRelations )\n {\n // Foreign table is the local table, but self references aren't allowed\n $boll_process = true;\n if ( $this->pObj->localTable == $foreignTable && !$boolSelfReference )\n {\n if ( $this->pObj->b_drs_sql )\n {\n t3lib_div::devlog( '[INFO/SQL] Result (simple): ' . $tableKey . '.' . $columnsKey . ' - ' . $foreignTable, $this->pObj->extKey, 0 );\n t3lib_div::devlog( '[INFO/SQL] It is a self reference. But self references shouldn\\'t processed automatically.', $this->pObj->extKey, 0 );\n t3lib_div::devlog( '[HELP/SQL] If you want to process it automatically, please self reference relation building.', $this->pObj->extKey, 1 );\n }\n $boll_process = false;\n }\n // Foreign table is the local table, but self references aren't allowed\n // Foreign table isn't the local table or self references are allowed\n if ( $boll_process )\n {\n // Build the simple relation\n $arr_return[ 'simple' ][ $tableKey ][ $columnsKey ] = $foreignTable;\n if ( $this->pObj->b_drs_sql )\n {\n t3lib_div::devlog( '[INFO/SQL] Result (simple): ' . $tableKey . '.' . $columnsKey . ' - ' . $foreignTable, $this->pObj->extKey, -1 );\n t3lib_div::devlog( '[HELP/SQL] Switch off the result above? Use TS config: ' .\n 'autoconfig.relations.csvDontUseFields = ..., ' . $tableKey . '.' . $columnsKey . ', ...', $this->pObj->extKey, 1 );\n }\n if ( $this->pObj->b_drs_sql && $config[ 'foreign_table_where' ] )\n {\n t3lib_div::devlog( '[WARN/SQL] In TCA is foreign_table_where configured. This may be a risk, because the browser won\\'t ' .\n 'process the clause: ' . $config[ 'foreign_table_where' ], $this->pObj->extKey, 2 );\n }\n }\n // Foreign table isn't the local table or self references are allowed\n }\n // Process simple relations automatically\n }\n }\n }\n }\n }\n }\n // Loop through the TCA of the foreign tables\n\n return $arr_return;\n }", "function query() {\n foreach ($this->query->relationships as $alias => $info) {\n if ($info['table'] == 'og_membership') {\n // If there is a og_membership table present. Add some conditions.\n $rel = $this->relationship;\n $this->query->add_where_expression(NULL, $alias . '.gid = ' . $rel . '.gid');\n $this->query->add_where_expression(NULL, $alias . '.group_type = ' . $rel . '.group_type');\n break;\n }\n }\n\n parent::query();\n }", "public function isFromMany(): bool\n {\n return in_array($this->relationshipType, [self::MANY_TO_ONE, self::MANY_TO_MANY]);\n }" ]
[ "0.62805766", "0.5847258", "0.5722772", "0.5390441", "0.5385893", "0.5315944", "0.5306137", "0.5276502", "0.5257196", "0.5232405", "0.5211869", "0.518953", "0.51770484", "0.5125632", "0.5105597", "0.50536066", "0.5011992", "0.49898234", "0.49760202", "0.4945753", "0.49381316", "0.4937046", "0.4931888", "0.4928518", "0.49203843", "0.49201593", "0.49112272", "0.49111798", "0.49097562", "0.4907026" ]
0.59205055
1
Condition that a relationship has a certain origin.
public function has_origin( $origin ) { return $this->condition_factory->has_origin( $origin, $this->join_manager ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requestsInclude(string $relationship): bool;", "public function requestedRelationships(): bool;", "public function hasOriginConcepts()\n {\n return count($this->originConcepts) > 0;\n }", "public function hasRelationship()\n\t{\n\t\treturn $this->relationship !== null;\n\t}", "public function origin() {\n\t\treturn $this->belongsTo( 'App\\Origin' );\n\t}", "public function owns($relation)\n {\n return $relation->uid == $this->id;\n }", "public function requestsRelationships(): bool;", "public function owns($related) {\n return $this->id == $related->user_id;\n }", "public function owns($related)\n {\n return $this->id == $related->user_id;\n }", "public function hasRelationship($field) {\n\t\treturn is_array($this->defaults) && array_key_exists($field, $this->defaults) && $this->defaults[$field] instanceof Relationship;\n\t}", "final public function allowsRelation():bool\n {\n return !empty($this->getAttr('relation'));\n }", "public function has($relation);", "public function isToOne(): bool\n {\n return in_array($this->relationshipType, [self::ONE_TO_ONE, self::MANY_TO_ONE]);\n }", "public function getIsRelatedTo() {\n\t\treturn $this->isRelatedTo;\n\t}", "abstract public function hasJoins();", "public function hasRelation($relationName);", "public function isRelationHeadOn(): bool\n {\n return true;\n }", "protected function isRelation()\n {\n return (bool) $this->relation;\n }", "abstract protected function validateRelationship(RelationshipMetadata $relationship);", "protected function _checkIsRelationshipsRequest(): bool\n {\n return $this->_request()->getParam('action') === 'relationships';\n }", "function isOriginVisible() {\n\t\t\treturn (( $this->isInformationVisible( ) && Mage::getStoreConfigFlag( XML_PATH_OPTIONS_DISPLAY_ORIGIN ) ) ? true : false);\n\t\t}", "function checkIfRelationshipExists($user_1, $user_2, $require_accepted = FALSE) {\n $sql1 = \"SELECT * FROM \" . TABLE_RELATIONSHIPS . \" UR \"\n . \"WHERE UR.user_id_from = \" . db_input($user_1) . \" \"\n . \"AND UR.user_id_to = \" . db_input($user_2) . \" \";\n if ($require_accepted) {\n $sql .= \"AND UR.accepted = 1 \";\n }\n $sql1 .= 'AND UR.is_deleted = 0;';\n $sql2 = \"SELECT * FROM \" . TABLE_RELATIONSHIPS . \" UR \"\n . \"WHERE UR.user_id_from = \" . db_input($user_2) . \" \"\n . \"AND UR.user_id_to = \" . db_input($user_1) . \" \";\n if ($require_accepted) {\n $sql .= \"AND UR.accepted = 1 \";\n }\n $sql2 .= 'AND UR.is_deleted = 0;';\n return db_num_rows(db_query($sql1)) + db_num_rows(db_query($sql2));\n }", "public function hasRelationships()\n {\n return !empty($this->relationships);\n }", "public function hasRelations();", "public function hasRelationships()\n {\n return count($this->relationships) > 0;\n }", "function hasspouse() {\n global $db;\n\n $row = $db->get(\"select related_to from member where id=\" . $this->id);\n\n if (!empty($row['related_to'])) {\n return true;\n } else {\n return false;\n }\n }", "public function hasRelationship($key)\n {\n return null !== $this->getRelationship($key);\n }", "public function hasOwner()\n {\n return (\n isset($this->_data->from)\n && is_object($this->_data->from)\n && $this->from->id\n && is_numeric($this->from->id)\n );\n }", "public function isFrom()\n {\n return $this->derivedType === 'join_from';\n }", "public function isRelationAttribute($key);" ]
[ "0.65457284", "0.63803184", "0.6377524", "0.63646287", "0.62569433", "0.6099935", "0.6084041", "0.6051119", "0.60174656", "0.5933509", "0.5859272", "0.583811", "0.58117265", "0.5746264", "0.5731844", "0.57294476", "0.5708871", "0.5650019", "0.56007946", "0.55953383", "0.5592814", "0.5563458", "0.5554894", "0.55528563", "0.55161804", "0.5515691", "0.5494061", "0.54735273", "0.5409482", "0.54061496" ]
0.70727617
0
Condition that the association has an intermediary id.
public function has_intermediary_id() { return $this->condition_factory->has_intermediary_id(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasId(){\n return $this->_has(2);\n }", "public function hasId(){\n return $this->_has(2);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\n return $this->_has(1);\n }", "public function hasId(){\r\n return $this->_has(1);\r\n }", "public function hasId(){\n return $this->_has(4);\n }", "abstract public static function hasIdProperty(): bool;", "public function hasId(){\n return $this->_has(9);\n }", "public function has_id() {\n return !empty($this->id);\n }", "public function supportsAdditionalId();", "public function hasId(){\n return $this->_has(5);\n }", "public function intermediary_id( $relationship_id ) {\n\t\treturn $this->condition_factory->intermediary_id( $relationship_id );\n\t}", "public function hasItemId(){\r\n return $this->_has(1);\r\n }", "public function testOneHasManyOnlyIdsWithIds(): void\n {\n $data = [\n 'title' => 'article',\n 'body' => 'some content',\n 'comments' => [\n '_ids' => [1, 2],\n ['comment' => 'first comment'],\n ],\n ];\n\n $marshaller = new Marshaller($this->articles);\n $article = $marshaller->one($data, [\n 'associated' => ['Comments' => ['onlyIds' => true]],\n ]);\n $this->assertCount(2, $article->comments);\n }", "public function hasItemId(){\n return $this->_has(3);\n }", "public function hasEnterpriseId(){\n return $this->_has(8);\n }", "public function hasResourceID(){\n return $this->_has(3);\n }", "public function hasId()\n\t{\n\t\treturn ($this->id > 0);\n\t}", "public function hasId()\n\t{\n\t\treturn ($this->id > 0);\n\t}", "public function testOneBelongsToManyOnlyIdsWithIds(): void\n {\n $data = [\n 'title' => 'My title',\n 'body' => 'My content',\n 'author_id' => 1,\n 'tags' => [\n '_ids' => [1, 2],\n ['tag' => 'news'],\n ],\n ];\n $marshall = new Marshaller($this->articles);\n $result = $marshall->one($data, [\n 'associated' => ['Tags' => ['onlyIds' => true]],\n ]);\n $this->assertCount(2, $result->tags, 'Ids should be marshalled.');\n }", "public function hasEnterpriseid(){\n return $this->_has(8);\n }", "public function idCondition($condition) {\n }", "public function hasID()\n {\n return (isset($this->_objData[$this->_objField]) && $this->_objData[$this->_objField]);\n }", "public function issetId()\n {\n return !empty($this->id);\n }", "public function hasId()\n {\n return $this->getDao()->hasId();\n }", "public function has($id);", "public function canGetSpecificInvoiceById()\n {\n // Arrange\n if (! isset($this->invoice)) {\n $this->canCreateInvoice();\n }\n\n // Act\n\n $invoice = Ezypay::getInvoice($this->invoice['id']);\n\n // Assert\n $this->assertEquals($this->invoice['id'], $invoice['id']);\n\n $this->assertTrue(array_key_exists('id', $invoice));\n $this->assertTrue(array_key_exists('documentNumber', $invoice));\n $this->assertTrue(array_key_exists('date', $invoice));\n }" ]
[ "0.63684493", "0.63684493", "0.61363995", "0.61363995", "0.61363995", "0.61363995", "0.61363995", "0.6081608", "0.603623", "0.59888136", "0.59526294", "0.58948004", "0.578317", "0.5775434", "0.5773592", "0.5759385", "0.57553333", "0.57015586", "0.5667595", "0.5628301", "0.56270254", "0.56270254", "0.5576707", "0.55685973", "0.5567128", "0.5561765", "0.5549759", "0.55362034", "0.55280745", "0.5522637" ]
0.7716908
0
Query by a WP_Query arguments applied on an element of a specified role. WARNING: It is important that you read the documentation of Toolset_Association_Query_Condition_Wp_Query before using this.
public function wp_query( IToolset_Relationship_Role $for_role, $query_args, $confirmation = null ) { if( 'i_know_what_i_am_doing' !== $confirmation ) { throw new InvalidArgumentException(); } return $this->condition_factory->wp_query( $for_role, $query_args, $this->join_manager, $this->unique_table_alias ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_results( $args ) {\n\t\t\t$results = array();\n\n\t\t\t// Prepare args for quey.\n\t\t\t$args = $this->prepare_args( $args );\n\n\t\t\t// Get result groups.\n\t\t\tif ( ! empty( $args['role__in'] ) ) {\n\t\t\t\t$roles = acf_get_user_role_labels( $args['role__in'] );\n\t\t\t} else {\n\t\t\t\t$roles = acf_get_user_role_labels();\n\t\t\t}\n\n\t\t\t// Return a flat array of results when searching or when queriying one group only.\n\t\t\tif ( $this->is_search || count( $roles ) === 1 ) {\n\n\t\t\t\t// Query users and append to results.\n\t\t\t\t$wp_user_query = new WP_User_Query( $args );\n\t\t\t\t$users = (array) $wp_user_query->get_results();\n\t\t\t\t$total_users = $wp_user_query->get_total();\n\t\t\t\tforeach ( $users as $user ) {\n\t\t\t\t\t$results[] = $this->get_result( $user );\n\t\t\t\t}\n\n\t\t\t\t// Determine if more results exist.\n\t\t\t\t// As this query does not return grouped results, the calculation can be exact (\">\").\n\t\t\t\t$this->more = ( $total_users > count( $users ) + $args['offset'] );\n\n\t\t\t\t// Otherwise, group results via role.\n\t\t\t} else {\n\n\t\t\t\t// Unset args that will interfer with query results.\n\t\t\t\tunset( $args['role__in'], $args['role__not_in'] );\n\n\t\t\t\t// Loop over each role.\n\t\t\t\tforeach ( $roles as $role => $role_label ) {\n\n\t\t\t\t\t// Query users (for this role only).\n\t\t\t\t\t$args['role'] = $role;\n\t\t\t\t\t$wp_user_query = new WP_User_Query( $args );\n\t\t\t\t\t$users = (array) $wp_user_query->get_results();\n\t\t\t\t\t$total_users = $wp_user_query->get_total();\n\n\t\t\t\t\t// acf_log( $args );\n\t\t\t\t\t// acf_log( '- ', count($users) );\n\t\t\t\t\t// acf_log( '- ', $total_users );\n\n\t\t\t\t\t// If users were found for this query...\n\t\t\t\t\tif ( $users ) {\n\n\t\t\t\t\t\t// Append optgroup of results.\n\t\t\t\t\t\t$role_results = array();\n\t\t\t\t\t\tforeach ( $users as $user ) {\n\t\t\t\t\t\t\t$role_results[] = $this->get_result( $user );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$results[] = array(\n\t\t\t\t\t\t\t'text' => $role_label,\n\t\t\t\t\t\t\t'children' => $role_results,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// End loop when enough results have been found.\n\t\t\t\t\t\tif ( count( $users ) === $args['number'] ) {\n\n\t\t\t\t\t\t\t// Determine if more results exist.\n\t\t\t\t\t\t\t// As this query does return grouped results, the calculation is best left fuzzy to avoid querying the next group (\">=\").\n\t\t\t\t\t\t\t$this->more = ( $total_users >= count( $users ) + $args['offset'] );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t// Otherwise, modify the args so that the next query can continue on correctly.\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$args['offset'] = 0;\n\t\t\t\t\t\t\t$args['number'] -= count( $users );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If no users were found (for the current pagination args), but there were users found for previous pages...\n\t\t\t\t\t\t// Modify the args so that the next query is offset slightly less (the number of total users) and can continue on correctly.\n\t\t\t\t\t} elseif ( $total_users ) {\n\t\t\t\t\t\t$args['offset'] -= $total_users;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t// Ignore roles that will never return a result.\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the query results.\n\t\t\t *\n\t\t\t * @date 21/5/19\n\t\t\t * @since 5.8.1\n\t\t\t *\n\t\t\t * @param array $results The query results.\n\t\t\t * @param array $args The query args.\n\t\t\t * @param ACF_Ajax_Query $query The query object.\n\t\t\t */\n\t\t\treturn apply_filters( 'acf/ajax/query_users/results', $results, $args, $this );\n\t\t}", "function a_role()\n\t{\n\t\tif ($this->params->event == 'pre_get'){\n\t\t\t$this->_get_filtered(TRUE, FALSE);\n\t\t\t\n\t\t\tif (isset($this->params->for_user) && !empty($this->params->for_user)) {\n\t\t\t\t$this->params->where_in['id'] = $this->_get_role($this->params->for_user);\n\t\t\t}\n\t\t}\n\t}", "private static function where_args() {\n\n\t\tif ( null === self::$where_args ) {\n\t\t\t\n\t\t\tself::$where_args = new WPInputObjectType( [\n\t\t\t\t'name' => 'MenuItemQueryArgs',\n\t\t\t\t'fields' => function() {\n\t\t\t\t\treturn self::where_fields();\n\t\t\t\t},\n\t\t\t] );\n\t\t}\n\n\t\treturn ! empty( self::$where_args ) ? self::$where_args : null;\n\n\t}", "private function addConditionForRole() {\n switch(intval($this->input['role'])) {\n case NP_ACTIVE_ROLE_EDITORIAL_STAFF:\n case NP_ACTIVE_ROLE_DUTY_EDITOR:\n case NP_ACTIVE_ROLE_POOL:\n case NP_ACTIVE_ROLE_APPROVAL:\n case NP_ACTIVE_ROLE_NONE:\n $this->addWhere('workflow_status = ' . intval($this->input['role']));\n break;\n case '-1': // all\n }\n }", "function change_search_activity_arg( $query )\n {\n /**\n * Global Search Args used in Element list and map display\n * @since 1.2.4\n */\n global $st_search_args;\n if ( !$st_search_args ) $st_search_args = $_REQUEST;\n\n if (is_admin() and empty( $_REQUEST[ 'is_search_map' ] ) and empty( $_REQUEST[ 'is_search_page' ] )) return $query;\n\n $post_type = get_query_var( 'post_type' );\n $posts_per_page = st()->get_option( 'activity_posts_per_page', 12 );\n\n $tax_query = [];\n if ( $post_type == 'st_activity' ) {\n $query->set( 'author', '' );\n if ( !empty( $st_search_args[ 'item_name' ] ) ) {\n $query->set( 's', $st_search_args[ 'item_name' ] );\n }\n\n $query->set( 'posts_per_page', $posts_per_page );\n\n $has_tax_in_element = [];\n if ( is_array( $st_search_args ) ) {\n foreach ( $st_search_args as $key => $val ) {\n if ( strpos( $key, 'taxonomies--' ) === 0 && !empty( $val ) ) {\n $has_tax_in_element[ $key ] = $val;\n }\n }\n }\n if ( !empty( $has_tax_in_element ) ) {\n $tax_query = [];\n foreach ( $has_tax_in_element as $tax => $value ) {\n $tax_name = str_replace( 'taxonomies--', '', $tax );\n if ( !empty( $value ) ) {\n $value = explode( ',', $value );\n $tax_query[] = [\n 'taxonomy' => $tax_name,\n 'terms' => $value,\n 'operator' => 'IN',\n ];\n }\n }\n if ( !empty( $tax_query ) ) {\n $query->set( 'tax_query', $tax_query );\n }\n }\n if ( !empty( $st_search_args[ 'taxonomy' ] ) and $tax = $st_search_args[ 'taxonomy' ] and is_array( $tax ) ) {\n foreach ( $tax as $key => $value ) {\n if ( $value ) {\n $value = explode( ',', $value );\n if ( !empty( $value ) and is_array( $value ) ) {\n foreach ( $value as $k => $v ) {\n if ( !empty( $v ) ) {\n $ids[] = $v;\n }\n }\n }\n if ( !empty( $ids ) ) {\n $tax_query[] = [\n 'taxonomy' => $key,\n 'terms' => $ids,\n //'COMPARE'=>\"IN\",\n 'operator' => 'AND',\n 'include_children' => false\n ];\n }\n $ids = [];\n }\n }\n }\n $is_featured = st()->get_option( 'is_featured_search_activity', 'off' );\n if ( !empty( $is_featured ) and $is_featured == 'on' and empty( $st_search_args[ 'st_orderby' ] ) ) {\n $query->set( 'meta_key', 'is_featured' );\n $query->set( 'orderby', 'meta_value' );\n $query->set( 'order', 'DESC' );\n }\n if ( $is_featured == 'off' and !empty( $st_search_args[ 'orderby' ] ) and empty( $st_search_args[ 'st_orderby' ] ) ) {\n //Default Sorting\n $query->set( 'orderby', 'modified' );\n $query->set( 'order', 'desc' );\n }\n /**\n * Post In and Post Order By from Element\n * @since 1.2.4\n * @author dungdt\n */\n if ( !empty( $st_search_args[ 'st_ids' ] ) ) {\n $query->set( 'post__in', explode( ',', $st_search_args[ 'st_ids' ] ) );\n $query->set( 'orderby', 'post__in' );\n }\n if ( !empty( $st_search_args[ 'st_orderby' ] ) and $st_orderby = $st_search_args[ 'st_orderby' ] ) {\n if ( $st_orderby == 'sale' ) {\n $query->set( 'meta_key', 'adult_price' );// from 1.2.0\n $query->set( 'orderby', 'meta_value_num' ); // from 1.2.0\n }\n if ( $st_orderby == 'rate' ) {\n $query->set( 'meta_key', 'rate_review' );\n $query->set( 'orderby', 'meta_value_num' );\n }\n if ( $st_orderby == 'discount' ) {\n $query->set( 'meta_key', 'discount' );\n $query->set( 'orderby', 'meta_value_num' );\n }\n if ( $st_orderby == 'featured' ) {\n $query->set( 'meta_key', 'is_featured' );\n $query->set( 'orderby', 'meta_value' );\n $query->set( 'order', 'DESC' );\n }\n }\n if ( !empty( $st_search_args[ 'sort_taxonomy' ] ) and $sort_taxonomy = $st_search_args[ 'sort_taxonomy' ] ) {\n if ( isset( $st_search_args[ \"id_term_\" . $sort_taxonomy ] ) ) {\n $id_term = $st_search_args[ \"id_term_\" . $sort_taxonomy ];\n $tax_query[] = [\n [\n 'taxonomy' => $sort_taxonomy,\n 'field' => 'id',\n 'terms' => explode( ',', $id_term ),\n 'include_children' => false\n ],\n ];\n }\n }\n if ( !empty( $meta_query ) ) {\n $query->set( 'meta_query', $meta_query );\n }\n if ( !empty( $tax_query ) ) {\n $query->set( 'tax_query', $tax_query );\n }\n }\n }", "function filter_user_roles(WP_User_Query $user_query)\n {\n global $wpdb;\n\n if (isset($user_query->query_vars['peepso_roles'])){\n if (is_array($user_query->query_vars['peepso_roles']))\n {\n $roles = \"'\" . implode(\"', '\", $user_query->query_vars['peepso_roles']) . \"'\";\n } else\n {\n $roles = \"'\" . $user_query->query_vars['peepso_roles'] . \"'\";\n }\n $user_query->query_from .= \" LEFT JOIN `{$wpdb->prefix}\" . PeepSoUser::TABLE . \"` ON `{$wpdb->users}`.`ID` = `{$wpdb->prefix}\" . PeepSoUser::TABLE . \"`.`usr_id` \";\n $user_query->query_where .= \" AND `{$wpdb->prefix}\" . PeepSoUser::TABLE . \"`.`usr_role` IN ($roles)\";\n\n return $user_query;\n }\n }", "function acl_filter_where($where){\n global $wpdb;\n\n $current_user_id = get_current_user_id();\n\n //Берем из настроек нужные типы постов\n $post_types=get_post_types_for_acl_s();\n foreach($post_types as &$post_type){\n $post_type=\"'\".$post_type.\"'\";\n }\n $string_for_query=implode(',',$post_types);\n\n //Если это администратор, редактор или кто то с правом доступа, то отменяем контроль\n if (user_can($current_user_id, 'full_access_to_posts') or user_can($current_user_id, 'editor') or user_can($current_user_id, 'administrator')) return $where;\n\n $where .= \" AND\n if(\" . $wpdb->posts . \".post_type IN (\".$string_for_query.\"),\n if(\" . $wpdb->posts . \".ID IN (\n SELECT post_id\n FROM \" . $wpdb->postmeta .\"\n WHERE\n \" . $wpdb->postmeta .\".meta_key = 'acl_s_true'\n AND \" . $wpdb->postmeta .\".post_id = \" . $wpdb->posts . \".ID\n ),\n if(\" . $wpdb->posts . \".ID IN (\n SELECT post_id\n FROM \" . $wpdb->postmeta .\"\n WHERE\n \" . $wpdb->postmeta .\".meta_key = 'acl_users_s'\n AND \" . $wpdb->postmeta .\".post_id = \" . $wpdb->posts . \".ID\n AND \" . $wpdb->postmeta .\".meta_value = \" . $current_user_id .\"\n )\n ,1,0),1),\n 1)=1\";\n\n return $where;\n}", "function query() {\n foreach ($this->query->relationships as $alias => $info) {\n if ($info['table'] == 'og_membership') {\n // If there is a og_membership table present. Add some conditions.\n $rel = $this->relationship;\n $this->query->add_where_expression(NULL, $alias . '.gid = ' . $rel . '.gid');\n $this->query->add_where_expression(NULL, $alias . '.group_type = ' . $rel . '.group_type');\n break;\n }\n }\n\n parent::query();\n }", "function adjacent_bis( $where ) {\n global $current_user;\n get_currentuserinfo();\n\n //dump($current_user->roles[0]);\n $args = array(\n\t\t 'post_type'\t => array( 'post' ),\n\t\t //'showposts'\t => $slider_options['limit'],\n\t\t //'lang' => $current_language,\n//\t\t 'tax_query' => array(\n// array(\n// 'taxonomy' => 'templatesection',\n// 'field' => 'slug',\n// 'terms' => 'strona-glowna-slideshow',\n// ),\n// ),\n\t\t 'meta_query' => array(\n\t\t\t'relation' => 'AND',\n\t\t\t array(\n\t\t\t 'key' => 'access',\n\t\t\t 'value' => serialize(array('allowed' => $current_user->roles[0])),\n\t\t\t 'compare' => '<>',\n\t\t\t)\n\n\t\t ),\n\t\t 'orderby' => 'menu_order',\n\t\t 'order' => 'ASC'\n\t\t);\n\t\t$query = new WP_Query( $args );\n\t\t//dump($query);\n\t\tif ( $query->have_posts() ) {\n\t\t while ( $query->have_posts() ) {\n\t\t\t $query->the_post();\n\t\t\t $allowed[] = get_the_ID();\n\t\t\t}\n\t\t}\n\n$a = implode(',', $allowed);\nunset($allowed);\n\n global $wpdb;\n //return $where . \" AND p.ID NOT IN ( SELECT post_id FROM $wpdb->postmeta WHERE ($wpdb->postmeta.post_id = p.ID ) AND $wpdb->postmeta.access = 'my_field' )\";\n return $where . \" AND p.ID NOT IN ( '\".$a.\"')\";\n\n\n\n}", "function my_relationship_query( $args, $field, $post_id ) {\n\t\n // exclude current post from being selected\n $args['exclude'] = $post_id;\n\t\n\t\n\t// return\n return $args;\n \n}", "public function query() {\n\n\t\tif ( 'true' === $this->get_attr( 'is_archive_template' ) ) {\n\t\t\tglobal $wp_query;\n\t\t\t$query = $wp_query;\n\t\t\treturn $query;\n\t\t}\n\n\t\tif ( 'true' === $this->get_attr( 'use_custom_query' ) ) {\n\t\t\t$query_args = $this->get_custom_query_args();\n\t\t} else {\n\t\t\t$query_args = $this->get_default_query_args();\n\t\t}\n\n\t\t$query = new \\WP_Query( $query_args );\n\n\t\treturn $query;\n\t}", "function cim_query($type = 'post', $count = 19, $order = 'date', $category = null, $exclude = null, $offset = 0)\n{\n\n // Set the simple query stuff\n $args = array(\n 'post_status' => 'publish',\n 'posts_per_page' => $count,\n );\n\n // Set Post Type\n switch ($type) {\n\n case 'post':\n case 'blogs':\n case 'articles':\n case 'article':\n case 'blog':\n {\n $args['post_type'] = 'post';\n $args['tax_query'] = array(\n array(\n 'taxonomy' => 'cim_blog_type',\n 'field' => 'slug',\n 'terms' => 'gear-software',\n 'operator' => 'NOT IN'\n )\n );\n break;\n }\n\n case 'gs':\n case 'gear':\n case 'gear-software':\n {\n $args['post_type'] = 'post';\n $args['tax_query'] = array(\n array(\n 'taxonomy' => 'cim_blog_type',\n 'field' => 'slug',\n 'terms' => 'gear-software',\n )\n );\n break;\n }\n\n case 'career':\n case 'careers':\n {\n $args['post_type'] = 'page';\n $args['meta_query'] = array(\n 'template_clause' => array(\n 'key' => '_wp_page_template',\n 'value' => 'template-career-single.php',\n 'compare' => '=',\n ),\n );\n break;\n }\n\n case 'career-category':\n case 'career-categories':\n {\n $args['post_type'] = 'page';\n $args['meta_query'] = array(\n 'template_clause' => array(\n 'key' => '_wp_page_template',\n 'value' => 'template-career-category.php',\n 'compare' => '=',\n ),\n );\n break;\n }\n }\n\n // Set Query Order\n if ($order == 'date'):\n $args['orderby'] = 'post_date';\n $args['order'] = 'DESC';\n elseif ($order == 'title'):\n $args['orderby'] = 'title';\n $args['order'] = 'ASC';\n else:\n $args['meta_key'] = 'trend_period_views';\n $args['orderby'] = array('meta_value_num' => 'DESC');\n endif;\n\n // Set Category\n if ($category) {\n $args['category'] = $category;\n }\n\n // Exclude current post\n if (is_single() || is_singular('schools')) {\n if ($exclude) {\n if (substr($exclude, -1) == ',') {\n $args['exclude'] = $exclude . get_the_ID();\n } else {\n $args['exclude'] = $exclude . ',' . get_the_ID();\n }\n } else {\n $args['exclude'] = get_the_ID();\n }\n }\n\n\n // Offset Query\n if ($offset != 0) {\n $args['offset'] = $offset;\n }\n\n return get_posts($args);\n\n}", "public function and(...$args): Query\n {\n return $this->setConditionOrClosure(Condition\\ConditionAnd::class, $args);\n }", "private function _s_get_related_posts_query_args( $args = array() ) {\n\t \n global $post;\n \n $categories = get_the_category( $post->ID );\n if ($categories) {\n \n $category_ids = array();\n foreach ($categories as $individual_category) {\n $category_ids[] = $individual_category->term_id;\n }\n \n $default_args = array(\n 'category__in' => $category_ids,\n 'post__not_in' => array( $post->ID ),\n 'posts_per_page' => 3,\n 'ignore_sticky_posts' => 1,\n 'orderby' => 'rand'\n );\n \n return wp_parse_args( $args, $default_args );\n }\n \n return false;\n \n }", "private function query_orders( $args ) {\n\n // set base query arguments\n $query_args = array(\n 'fields' => 'ids',\n 'post_type' => 'shop_order',\n 'post_status' => array_keys( wc_get_order_statuses() ),\n );\n\n // add status argument\n if (!empty( $args[ 'status' ] ) ) {\n\n $statuses = 'wc-' . str_replace( ',', ',wc-', $args[' status' ] );\n $statuses = explode( ',', $statuses );\n $query_args[ 'post_status' ] = $statuses;\n\n unset( $args[ 'status' ] );\n }\n\n $query_args = $this->merge_query_args( $query_args, $args );\n\n // the merge_query_args strips the count\n\n $query_args[ 'posts_per_page' ] = $args[ 'posts_per_page' ];\n\n // new instance of WP_Query\n return new WP_Query( $query_args );\n }", "function ca_condition_user_roles($account, $settings) {\n $settings['roles'] = array_filter($settings['roles']);\n\n if ($settings['operator'] == 'AND') {\n foreach ($settings['roles'] as $key) {\n if (!isset($account->roles[$key])) {\n return FALSE;\n }\n }\n return TRUE;\n }\n else {\n foreach ($settings['roles'] as $key) {\n if (isset($account->roles[$key])) {\n return TRUE;\n }\n }\n return FALSE;\n }\n}", "public static function fill_query_vars( $args ) {\n\t\t$defaults = array(\n\t\t\t'blog_id' => $GLOBALS['blog_id'],\n\t\t\t'role' => '',\n\t\t\t'role__in' => array(),\n\t\t\t'role__not_in' => array(),\n\t\t\t'meta_key' => '',\n\t\t\t'meta_value' => '',\n\t\t\t'meta_compare' => '',\n\t\t\t'include' => array(),\n\t\t\t'exclude' => array(),\n\t\t\t'search' => '',\n\t\t\t'search_columns' => array(),\n\t\t\t'orderby' => 'login',\n\t\t\t'order' => 'ASC',\n\t\t\t'offset' => '',\n\t\t\t'number' => '',\n\t\t\t'paged' => 1,\n\t\t\t'count_total' => true,\n\t\t\t'fields' => 'all',\n\t\t\t'who' => '',\n\t\t\t'has_published_posts' => null,\n\t\t);\n\n\t\treturn wp_parse_args( $args, $defaults );\n\t}", "function search_political_ads($query, $extra_args = array()) {\n global $wpdb;\n $parsed_query = parse_political_ad_query($query);\n\n // Candidates, Sponsors, and Sponsor Type are nested meta values\n $or_post_ids = array();\n $not_post_ids = array();\n $and_post_sets = array();\n $general_and_ids = array(); // \"and\" that was set to general implies ANY category match, not EVERY category match\n $use_matched_post_ids = false;\n $use_general_and = false;\n\n if(sizeof($parsed_query['candidate'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['candidate'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}postmeta\n WHERE meta_key LIKE %s\n AND meta_value LIKE %s\n \",\n 'ad_candidates_%_ad_candidate',\n '%'.$query_part['value'].'%'\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->post_id;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n if(sizeof($parsed_query['sponsor'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['sponsor'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}postmeta\n WHERE meta_key LIKE %s\n AND meta_value LIKE %s\n \",\n 'ad_sponsors_%_ad_sponsor',\n '%'.$query_part['value'].'%'\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->post_id;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['sponsor_type'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['sponsor_type'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}postmeta\n WHERE meta_key LIKE %s\n AND meta_value = %s\n \",\n 'ad_sponsors_%_sponsor_type',\n $query_part['value']\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->post_id;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['subject'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['subject'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}postmeta\n WHERE meta_key LIKE %s\n AND meta_value LIKE %s\n \",\n 'ad_subjects_%_ad_subject',\n '%'.$query_part['value'].'%'\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->post_id;\n }\n\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['message'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['message'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}postmeta\n WHERE meta_key LIKE %s\n AND meta_value LIKE %s\n \",\n 'ad_message',\n $query_part['value']\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->post_id;\n }\n\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['type'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['type'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}postmeta\n WHERE meta_key LIKE %s\n AND meta_value LIKE %s\n \",\n 'ad_type',\n $query_part['value']\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->post_id;\n }\n\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['archive_id'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['archive_id'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}postmeta\n WHERE meta_key LIKE %s\n AND meta_value = %s\n \",\n 'archive_id',\n $query_part['value']\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->post_id;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n // Market, Channel, and Location are instance values\n if(sizeof($parsed_query['network'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['network'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}ad_instances\n WHERE network = %s\n GROUP BY wp_identifier\n \",\n $query_part['value']\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->wp_identifier;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['market'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['market'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}ad_instances\n WHERE market = %s\n GROUP BY wp_identifier\n \",\n $query_part['value']\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->wp_identifier;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['location'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['location'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}ad_instances\n WHERE location LIKE %s\n GROUP BY wp_identifier\n \",\n '%'.$query_part['value'].'%'\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->wp_identifier;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['program'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['program'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}ad_instances\n WHERE program LIKE %s\n GROUP BY wp_identifier\n \",\n '%'.$query_part['value'].'%'\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->wp_identifier;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['program_type'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['program_type'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}ad_instances\n WHERE program_type LIKE %s\n GROUP BY wp_identifier\n \",\n $query_part['value']\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->wp_identifier;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['after'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['after'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}ad_instances\n WHERE start_time >= %s\n GROUP BY wp_identifier\n \",\n date('Y-m-d H:i:s', strtotime($query_part['value']))\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->wp_identifier;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['before'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['before'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}ad_instances\n WHERE start_time <= %s\n GROUP BY wp_identifier\n \",\n date('Y-m-d H:i:s', strtotime($query_part['value']))\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->wp_identifier;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n if(sizeof($parsed_query['data_since'])) {\n $use_matched_post_ids = true;\n foreach($parsed_query['data_since'] as $query_part) {\n if($query_part['value'] == \"\")\n continue;\n\n $rows = $wpdb->get_results($wpdb->prepare(\n \"SELECT *\n FROM {$wpdb->prefix}ad_instances\n WHERE date_created >= %s\n GROUP BY wp_identifier\n \",\n date('Y-m-d H:i:s', strtotime($query_part['value']))\n ));\n\n $temp_ids = array();\n foreach($rows as $row) {\n $temp_ids[] = $row->wp_identifier;\n }\n switch($query_part['boolean']) {\n case 'GENERAL_NOT':\n case 'NOT':\n $not_post_ids = array_merge($not_post_ids, $temp_ids);\n break;\n case 'GENERAL_AND':\n $use_general_and = true;\n $general_and_ids = array_merge($general_and_ids, $temp_ids);\n break;\n case 'AND':\n $and_post_sets[] = $temp_ids;\n break;\n case 'GENERAL_OR':\n case 'OR':\n $or_post_ids = array_merge($or_post_ids, $temp_ids);\n break;\n }\n }\n }\n\n // Proccess the booleans\n $matched_post_ids = array();\n\n // Add the \"or\" set as a new and set\n $and_post_sets[] = $or_post_ids;\n\n // Did we have a general AND?\n if($use_general_and)\n $and_post_sets[] = $general_and_ids;\n\n if(sizeof($and_post_sets) == 1)\n $matched_post_ids = $and_post_sets[0];\n else\n $matched_post_ids = call_user_func_array('array_intersect', $and_post_sets);\n\n // Remove the \"not\" set\n $matched_post_ids = array_diff($matched_post_ids, $not_post_ids);\n\n // Remove dupes because why not\n $matched_post_ids = array_unique($matched_post_ids);\n\n // We have a list of matched post IDs, lets load up\n $base_args = array(\n 'post_type' => 'archive_political_ad',\n 'post_status' => 'publish',\n 'orderby' => 'post_date',\n 'order' => 'DESC'\n );\n if($use_matched_post_ids) {\n if(sizeof($matched_post_ids) > 0) {\n $base_args['post__in'] = $matched_post_ids;\n } else {\n $base_args['post__in'] = array(-1);\n }\n }\n\n $args = array_merge($base_args, $extra_args);\n\n $wp_query = new WP_Query($args);\n return $wp_query;\n}", "function tbcf_query_people( $args = array() ) {\n\n\treturn apply_filters( 'tbcf_query_people', new WP_Query( array_merge( array(\n\t\t'post_type' => 'ctc_person',\n\t\t'paged' => tbcf_page_num(),\n\t\t'order' => 'ASC',\n\t\t'orderby' => 'menu_order'\n\t), $args ) ) );\n\n}", "public function has_available_elements() {\n\t\t$conditions = array();\n\n\t\tforeach( Toolset_Relationship_Role::parent_child() as $role ) {\n\t\t\t$conditions[] = $this->element_status(\n\t\t\t\tToolset_Association_Query_Condition_Element_Status::STATUS_AVAILABLE,\n\t\t\t\t$role\n\t\t\t);\n\t\t}\n\n\t\treturn $this->do_and( $conditions );\n\t}", "public function testSearchAuthorQuery() {\n\t\t$user_id = $this->factory->user->create( array( 'user_login' => 'john', 'role' => 'administrator' ) );\n\n\t\tep_create_and_sync_post( array( 'post_content' => 'findme test 1' ) );\n\t\tep_create_and_sync_post( array( 'post_content' => 'findme test 2' ) );\n\t\tep_create_and_sync_post( array( 'post_content' => 'findme test 3', 'post_author' => $user_id ) );\n\n\t\tep_refresh_index();\n\n\t\t$args = array(\n\t\t\t's' => 'john boy',\n\t\t\t'search_fields' => array(\n\t\t\t\t'post_title',\n\t\t\t\t'post_excerpt',\n\t\t\t\t'post_content',\n\t\t\t\t'author_name'\n\t\t\t),\n\t\t);\n\n\t\t$query = new WP_Query( $args );\n\n\t\t$this->assertEquals( 1, $query->post_count );\n\t\t$this->assertEquals( 1, $query->found_posts );\n\t}", "function bbp_get_reply_author_role($args = array())\n{\n}", "public function layered_nav_query( $filtered_posts ) {\n\t\tglobal $_chosen_attributes;\n\n\t\tif ( sizeof( $_chosen_attributes ) > 0 ) {\n\n\t\t\t$matched_products = array(\n\t\t\t\t'and' => array(),\n\t\t\t\t'or' => array()\n\t\t\t);\n\t\t\t$filtered_attribute = array(\n\t\t\t\t'and' => false,\n\t\t\t\t'or' => false\n\t\t\t);\n\n\t\t\tforeach ( $_chosen_attributes as $attribute => $data ) {\n\t\t\t\t$matched_products_from_attribute = array();\n\t\t\t\t$filtered = false;\n\n\t\t\t\tif ( sizeof( $data['terms'] ) > 0 ) {\n\t\t\t\t\tforeach ( $data['terms'] as $value ) {\n\n\t\t\t\t\t\t$posts = get_posts(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'post_type' \t=> 'product',\n\t\t\t\t\t\t\t\t'numberposts' \t=> -1,\n\t\t\t\t\t\t\t\t'post_status' \t=> 'publish',\n\t\t\t\t\t\t\t\t'fields' \t\t=> 'ids',\n\t\t\t\t\t\t\t\t'no_found_rows' => true,\n\t\t\t\t\t\t\t\t'tax_query' => array(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'taxonomy' \t=> $attribute,\n\t\t\t\t\t\t\t\t\t\t'terms' \t=> $value,\n\t\t\t\t\t\t\t\t\t\t'field' \t=> 'term_id'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! is_wp_error( $posts ) ) {\n\n\t\t\t\t\t\t\tif ( sizeof( $matched_products_from_attribute ) > 0 || $filtered ) {\n\t\t\t\t\t\t\t\t$matched_products_from_attribute = $data['query_type'] == 'or' ? array_merge( $posts, $matched_products_from_attribute ) : array_intersect( $posts, $matched_products_from_attribute );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$matched_products_from_attribute = $posts;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$filtered = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( sizeof( $matched_products[ $data['query_type'] ] ) > 0 || $filtered_attribute[ $data['query_type'] ] === true ) {\n\t\t\t\t\t$matched_products[ $data['query_type'] ] = ( $data['query_type'] == 'or' ) ? array_merge( $matched_products_from_attribute, $matched_products[ $data['query_type'] ] ) : array_intersect( $matched_products_from_attribute, $matched_products[ $data['query_type'] ] );\n\t\t\t\t} else {\n\t\t\t\t\t$matched_products[ $data['query_type'] ] = $matched_products_from_attribute;\n\t\t\t\t}\n\n\t\t\t\t$filtered_attribute[ $data['query_type'] ] = true;\n\n\t\t\t\t$this->filtered_product_ids_for_taxonomy[ $attribute ] = $matched_products_from_attribute;\n\t\t\t}\n\n\t\t\t// Combine our AND and OR result sets\n\t\t\tif ( $filtered_attribute['and'] && $filtered_attribute['or'] )\n\t\t\t\t$results = array_intersect( $matched_products[ 'and' ], $matched_products[ 'or' ] );\n\t\t\telse\n\t\t\t\t$results = array_merge( $matched_products[ 'and' ], $matched_products[ 'or' ] );\n\n\t\t\tif ( $filtered ) {\n\n\t\t\t\tWC()->query->layered_nav_post__in = $results;\n\t\t\t\tWC()->query->layered_nav_post__in[] = 0;\n\n\t\t\t\tif ( sizeof( $filtered_posts ) == 0 ) {\n\t\t\t\t\t$filtered_posts = $results;\n\t\t\t\t\t$filtered_posts[] = 0;\n\t\t\t\t} else {\n\t\t\t\t\t$filtered_posts = array_intersect( $filtered_posts, $results );\n\t\t\t\t\t$filtered_posts[] = 0;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn (array) $filtered_posts;\n\t}", "public function check_custom_query_args( $query ) {\n\t\tif( ! $query instanceof WP_Query ) {\n\t\t\t// Something weird is happening.\n\t\t\treturn;\n\t\t}\n\n\t\tif( array_key_exists( self::RELATIONSHIP_QUERY_ARG, $query->query_vars ) ) {\n\t\t\t$query->{self::RELATIONSHIP_QUERY_ARG} = $query->query_vars[ self::RELATIONSHIP_QUERY_ARG ];\n\t\t}\n\t}", "public function get_qry_from_cache( $args ) {\n $expiration = mashsb_get_expiration();\n\n if (MASHSB_DEBUG){\n delete_transient('mashwidget_' . md5( json_encode( $args ) ));\n }\n \n if( false === ( $qry = get_transient( 'mashwidget_' . md5( json_encode( $args ) ) ) ) ) {\n $wpq = new WP_Query( $args );\n set_transient( 'mashwidget_' . md5( json_encode( $args ) ), $wpq, $expiration );\n //wp_die( var_dump($wpq)); \n return $wpq; \n } else {\n //wp_die( var_dump($qry) );\n return $qry;\n }\n }", "function bbp_get_user_object_query($args = array(), $context = '', $rel_key = '', $rel_type = 'post')\n{\n}", "function custom_posts_where( $where, $query ) {\r\n \r\n global $wpdb;\r\n if ( is_main_query() && is_search() ) {\r\n \r\n //* get additional where clause for the user\r\n $user_where = get_user_posts_where();\r\n \r\n $where .= \" OR (\r\n {$wpdb->term_taxonomy}.taxonomy IN( 'category', 'post_tag' ) \r\n AND\r\n {$wpdb->terms}.name LIKE '%\" . esc_sql( get_query_var( 's' ) ) . \"%'\r\n {$user_where}\r\n )\";\r\n \r\n }\r\n return $where;\r\n \r\n}", "function get_users_by_role( $role ) {\r\n $wp_user_search = new WP_User_Search( \"\", \"\", $role );\r\n return $wp_user_search->get_results();\r\n }", "private function find( array $args ) {\n\t\t$args = array_merge( array(\n\t\t\t'no_found_rows' => true,\n\t\t\t'update_post_meta_cache' => true,\n\t\t\t'update_post_term_cache' => false,\n\t\t), $args );\n\n\t\t$args[ 'post_type' ] = array( $this->post_type_name );\n\n\t\treturn $this->query->query( $args );\n\n\t}", "public function getRelationshipQuery($relationshipNames,$query);" ]
[ "0.53159106", "0.52566475", "0.5162429", "0.50626385", "0.501493", "0.49961072", "0.49691856", "0.49552718", "0.4940095", "0.49205726", "0.49157065", "0.48289403", "0.48158357", "0.47922727", "0.47805318", "0.47679585", "0.4756924", "0.47383025", "0.47064126", "0.4703543", "0.46629906", "0.4643892", "0.46305683", "0.46299088", "0.46261692", "0.46055013", "0.45997897", "0.45881858", "0.45530668", "0.45390832" ]
0.62791854
0
Query by a string search in elements of a selected role. Note that the behaviour may be different per domain.
public function search( $search_string, IToolset_Relationship_Role $for_role, $is_exact = false ) { return $this->condition_factory->search( $search_string, $is_exact, $for_role, $this->join_manager ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchByRole($search, $role)\n {\n return $this->model\n ->select(\n DB::raw(\"CONCAT(COALESCE(first_name,''), ' ',COALESCE(last_name,''), ' | ', COALESCE(email,'')) AS full_name\"),\n 'id'\n )\n ->where(function ($query) use ($search){\n $query->whereRaw(\"CONCAT(COALESCE(first_name,''), ' ', COALESCE(last_name,'')) like ?\", ['%' . $search . '%'])\n ->orWhere('email', 'like', '%' . $search . '%');\n })\n ->whereHas('roles', function ($query) use ($role){\n $query->where('slug', $role);\n })\n ->get('full_name', 'id');\n }", "public function on_selected_user_roles_callback($search_string) {\r\n // Wordpress roles\r\n global $wp_roles;\r\n // Output array\r\n $data = array();\r\n\r\n // Check if wordpress roles are set\r\n if (!isset($wp_roles)){\r\n $wp_roles = new WP_Roles();\r\n }\r\n\r\n // Get role names\r\n $user_roles = $wp_roles->get_names();\r\n\r\n // Search string\r\n foreach($user_roles as $key=>$value){\r\n if ( (preg_match(\"/$search_string/i\", $value)) || (preg_match(\"/\\b$search_string\\b/i\", $key)) ){\r\n $data[] = array(\r\n 'value' => $key,\r\n 'label' => $value,\r\n );\r\n }\r\n }\r\n\r\n // Return data array\r\n return $data;\r\n }", "public function search( $str = null ) {\n\t\t// TODO: SELECT based on search string\n\t}", "public function search(Request $request)\n {\n return Role::where('name', 'like', 'custom-%'.$request->input('key').'%')->get();\n }", "function get_users_by_role( $role ) {\r\n $wp_user_search = new WP_User_Search( \"\", \"\", $role );\r\n return $wp_user_search->get_results();\r\n }", "public function findByRole($role) {\n $qb = $this->_em->createQueryBuilder();\n $qb->select('u')\n ->from($this->_entityName, 'u')\n ->where('u.roles LIKE :roles')\n ->setParameter('roles', '%' . $role . '%');\n return $qb->getQuery()->getResult();\n }", "function searchElements($xml, $query) {\r\n\t// variable to store uppercase\r\n\t$upper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ\"; // add any characters...\r\n\t//variable to store lower calse\r\n\t$lower = \"abcdefghijklmnopqrstuvwxyzæøå\"; // ...that are missing\r\n\r\n\t/**\r\n\t * convert both title and descripton into lower case and lower to upper case mix and match\r\n\t */\r\n\t$arg_title = \"translate(title, '$upper', '$lower')\";\r\n\t$arg_query = \"translate('$query', '$upper', '$lower')\";\r\n\r\n\t$arg_descriptions = \"translate(description, '$upper', '$lower')\";\r\n\t$arg_query = \"translate('$query', '$upper', '$lower')\";\r\n\treturn $xml->xpath(\"//item[contains($arg_title, $arg_query) or contains($arg_descriptions, $arg_query)]\");\r\n}", "public function search($text) {\n\t $text1 = explode(\" \",$text);\n\t $sql = null;\n\t $text = array_filter($text1);\n\t foreach($text as $val) {\n\t\t$sql .= $val.' | ';\n\t }\n\t $cond1 = substr($sql,0,-3);\n\t $userid = Yii::app()->user->id;\n\t $user = Yii::app()->db2->createCommand()\n\t\t->selectDistinct('e.experiment_id')\n\t\t->from('experiments e')\n\t\t->leftJoin('variables v', 'e.experiment_id = v.experiment__id')\n\t\t->leftJoin('constants c', 'e.experiment_id = c.experiment__id')\n\t\t->leftJoin('conclusions cc', 'e.experiment_id = cc.experiment__id')\n\t\t->leftJoin('metrics m', 'e.experiment_id = m.experiment__id')\n\t\t->leftJoin('trials t', 'e.experiment_id = t.experiment__id')\n\t\t->leftJoin('documents d', 'e.experiment_id = d.experiment__id')\n\t\t->leftJoin('access_grants a', 'e.experiment_id = a.experiment__id')\n\t\t//->where(\"(e.user__id = \" . Yii::app()->user->id . \" OR a.user__id = \" . Yii::app()->user->id.\") AND ((\n\t\t->where(\"(a.user__id = \" . Yii::app()->user->id.\" OR e.organization__id IN (SELECT DISTINCT organization__id FROM memberships WHERE user__id = \" . Yii::app()->user->id . \" )) AND ((\n\t\te.ts_en @@ to_tsquery('{$cond1}')) OR (v.ts_en @@ to_tsquery('{$cond1}')) OR (c.ts_en @@ to_tsquery('{$cond1}')) OR (cc.ts_en @@ to_tsquery('{$cond1}')) OR (m.ts_en @@ to_tsquery('{$cond1}')) OR (t.ts_en @@ to_tsquery('{$cond1}')) OR (d.ts_en @@ to_tsquery('{$cond1}')))\")->queryAll();\n\t\t// to print result use ->queryAll()\n\t\t// to print query use ->text;\n\t\treturn $user;\n\t}", "public static function search() {\n\n $string = Input::get('string');\n\n\n $results = Musician::Where('first_name', 'like', \"$string%\")\n ->orWhere('last_name', 'like', \"$string%\")\n ->orWhere('stagename', 'like', \"$string%\")->get();\n\n return ($results->toArray());\n }", "function Search($type,$string,$dir=\"\") {\r\n addLog(\"mpd->Search()\");\r\n if ( !in_array($type, MPD_SEARCH) ) {\r\n addErr( \"mpd->Search(): invalid search type\" );\r\n return NULL;\r\n } else {\r\n $ver = explode(\".\",$this->mpd_version);\r\n if (intval($ver[1]) >= 21 || intval($ver[0]) > 0) {\r\n // Advanced search syntax since mpd 0.21\r\n if (strlen($dir)>0) {\r\n $string = \"(($type contains '$string') AND (base '$dir'))\";\r\n } else {\r\n $string = \"($type contains '$string')\";\r\n }\r\n if ( is_null($resp = $this->SendCommand(MPD_CMD_SEARCH,$string))) return NULL;\r\n } else {\r\n if ( is_null($resp = $this->SendCommand(MPD_CMD_SEARCH,$type,$string))) return NULL;\r\n }\r\n $searchlist = $this->_parseFileListResponse($resp);\r\n }\r\n addLog( \"mpd->Search() / return \".print_r($searchlist,true) );\r\n return $searchlist;\r\n }", "public function search();", "public function get_all_request_items_search($string){\n $query = \"SELECT users.user_email,item.item_name,request_item.quantity,item.is_returnable,request_item.is_fullfilled FROM request INNER JOIN request_item ON request.request_id = request_item.request_id INNER JOIN users ON request.user_id = users.user_id INNER JOIN item ON request_item.item_id = item.item_id HAVING request_item.is_deleted = 0 AND users.user_email like '%\".$string.\"%'\";\n $result = $this->db->query($query);\n return $result;\n }", "public function GetByName ($roleName);", "function a_role()\n\t{\n\t\tif ($this->params->event == 'pre_get'){\n\t\t\t$this->_get_filtered(TRUE, FALSE);\n\t\t\t\n\t\t\tif (isset($this->params->for_user) && !empty($this->params->for_user)) {\n\t\t\t\t$this->params->where_in['id'] = $this->_get_role($this->params->for_user);\n\t\t\t}\n\t\t}\n\t}", "public function role($value){\n \treturn $this->builder->where('role', $value);\n }", "function roles_filter_role_name($role_name, $user_guid = null) {\r\n\tif (!isset($user_guid)) {\r\n\t\t$user_guid = elgg_get_logged_in_user_guid();\r\n\t}\r\n\treturn roles()->filterName($role_name, get_entity($user_guid) ? : null);\r\n}", "function searchSomeGroupsByStatus($n, $m, $search, $status) {\n// parentheses not needed in where clause, for clarity as\n// role search should override status filter.\n $q = prepareQuery(\"\n SELECT\n `groupID`,\n `name`,\n `status`,\n `description`\n FROM\n `group_page`\n WHERE\n (`name` LIKE :keyword AND\n FIND_IN_SET (`status`, :statuses)) OR \n `status` = :search\n ORDER BY\n `name`\n LIMIT\n :n, :m\n \");\n\n $keyword = \"%$search%\";\n $q->bindParam(':keyword', $keyword);\n $q->bindParam(':search', $search);\n $q->bindParam(':n', $n, PDO::PARAM_INT);\n $q->bindParam(':m', $m, PDO::PARAM_INT);\n $statuses = implode(',', $status);\n $q->bindParam(':statuses', $statuses);\n $q->execute();\n return $q;\n}", "protected function _applySearchToQuery() {\n\t\tif (!isset($this->_searchString) || empty($this->_searchString)) return;\n\t\t\n\t\t// join on any necessary relations.\n\t\t// make sure fields are searched.\n\t\t$search_like = array();\n\t\tforeach ($this->_searchFields as $alias => $fields) {\n\t\t\tforeach ($fields as $field) {\n\t\t\t\t$search_like[] = $alias . '.' . $field . ' LIKE \"%' . $this->_searchString . '%\"';\n\t\t\t}\n\t\t}\n\t\t$where = '(' . implode(' OR ', $search_like) . ')';\n\t\t$this->query()->addWhere($where);\n\t}", "public function searchableAs();", "public function testSearchStrExpl()\r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$obj = new CAntObject($dbh, \"activity\", null, $this->user);\r\n\t\t$index = $obj->getIndex();\r\n\r\n\t\t// Single email address\r\n\t\t$qstr = \"[email protected]\";\r\n\t\t$terms = $index->queryStringToTerms($qstr);\r\n\t\t$this->assertEquals($terms[0], \"[email protected]\");\r\n\r\n\t\t// terms and phrases\r\n\t\t$qstr = \"[email protected] \\\"in quotes\\\" single\";\r\n\t\t$terms = $index->queryStringToTerms($qstr);\r\n\t\t$this->assertEquals($terms[0], \"[email protected]\");\r\n\t\t$this->assertEquals($terms[1], \"\\\"in quotes\\\"\");\r\n\t\t$this->assertEquals($terms[2], \"single\");\r\n\t}", "public function applySearch();", "function search($searchterm, $searchtype, $type, $id) {\r\n\r\n\t\t//$id - The user or admin ID\r\n\t\t//$type - designates a user(2) or administrator (1)\r\n\t\t//$searchterm - The term to search for in the database\r\n\t\t//$searchtype - specified the method of searching the database\r\n\r\n\t\tSWITCH($searchtype) {\r\n\t\t\tCASE 1:\r\n\t\t\t\t//SEARCH BY DESCRIPTION\r\n\t\t\t\tif($type == 2) {\r\n\t\t\t\t\t//They are a user, search through only incidents they have created\r\n\t\t\t\t\treturn ($this->query('SELECT * FROM incidents WHERE description LIKE \"%'. $searchterm .'%\" AND user_id='. $id .';'));\r\n\t\t\t\t} else if($type == 1) {\r\n\t\t\t\t\t//They are an admin, search all incidents\r\n\t\t\t\t\treturn ($this->query('SELECT * FROM incidents WHERE description LIKE \"%'. $searchterm .'%\";'));\r\n\t\t\t\t} //end if\r\n\t\t\t\tbreak;\r\n\t\t\tCASE 2:\r\n\t\t\t\t//SEARCH BY PROBLEM\r\n\t\t\t\tif($type == 2) {\r\n\t\t\t\t\t//They are a user, search through only incidents they have created\r\n\t\t\t\t\treturn ($this->query('SELECT * FROM incidents WHERE content LIKE \"%'. $searchterm .'%\" AND user_id='. $id .';'));\r\n\t\t\t\t} else if($type == 1) {\r\n\t\t\t\t\t//They are an admin, search all incidents\r\n\t\t\t\t\treturn ($this->query('SELECT * FROM incidents WHERE content LIKE \"%'. $searchterm .'%\";'));\r\n\t\t\t\t} //end if\r\n\t\t\t\tbreak;\r\n\t\t\tCASE 3:\r\n\t\t\t\t//SEARCH BY WORKLOG\r\n\t\t\t\tif($type == 2) {\r\n\t\t\t\t\t//They are a user, search through only incidents they have created\r\n\t\t\t\t\treturn($this->query('SELECT * FROM incidents WHERE user_id='. $id .' AND \r\n\t\t\t\t\t\tid IN (SELECT incident_id FROM worklogs WHERE content LIKE \"%'. $searchterm .'%\");'));\r\n\t\t\t\t} else if($type == 1) {\r\n\t\t\t\t\t//They are an admin, search all incidents\r\n\t\t\t\t\treturn ($this->query('SELECT * FROM incidents WHERE id IN (SELECT incident_id FROM worklogs WHERE content LIKE \"%'. $searchterm .'%\");'));\r\n\t\t\t\t} //end if\r\n\t\t\t\tbreak;\r\n\t\t\tDEFAULT:\r\n\t\t\t\treturn false;\r\n\t\t\t\tbreak;\r\n\t\t} //end switch\r\n\r\n\t}", "public function searchOrigin($query);", "public function search($string) {\n\n $this->wait(1);\n $this->byName($this->keyword)->value($string);\n $this->byCssSelector($this->searchBtn)->click();\n }", "function searchMyElements($xml, $query,$root) {\r\n\t$upper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ\"; // add any characters...\r\n\t$lower = \"abcdefghijklmnopqrstuvwxyzæøå\"; // ...that are missing\r\n\r\n\t$arg_title = \"translate(title, '$upper', '$lower')\";\r\n\t$arg_query = \"translate('$query', '$upper', '$lower')\";\r\n\r\n\t$arg_descriptions = \"translate(description, '$upper', '$lower')\";\r\n\t$arg_query = \"translate('$query', '$upper', '$lower')\";\r\n\r\n\t$xpath =\"//\".\"$root\".\"[contains($arg_title, $arg_query) or contains($arg_descriptions, $arg_query)]\";\r\n\r\n\treturn $xml->xpath($xpath);\r\n}", "function BasicSearchWhere() {\n\t\tglobal $Security, $student_subjects;\n\t\t$sSearchStr = \"\";\n\t\t$sSearchKeyword = $student_subjects->BasicSearchKeyword;\n\t\t$sSearchType = $student_subjects->BasicSearchType;\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$sSearch = trim($sSearchKeyword);\n\t\t\tif ($sSearchType <> \"\") {\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\n\t\t\t}\n\t\t}\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$student_subjects->setSessionBasicSearchKeyword($sSearchKeyword);\n\t\t\t$student_subjects->setSessionBasicSearchType($sSearchType);\n\t\t}\n\t\treturn $sSearchStr;\n\t}", "public static function search();", "protected function querySearch(Params $params)\n {\n $results = array();\n $query = $params->has('query') ? $this->sanitize($params->get('query')) : '';\n $key = $params->has('key') ? $params->get('key') : false;\n\n foreach (self::$list as $roleId => $displayName) {\n if (empty($query) || strpos($this->sanitize($roleId), $query) !== false || strpos($this->sanitize($displayName), $query) !== false) {\n $results[] = self::transform($roleId, $displayName);\n }\n }\n $this->setTotal(count($results));\n\n return array_slice($results, $this->getOffset(), $this->getLimit());\n }", "function search()\n\t{\n\t\n\t\t$filter = null;\n\t\t$sort = null;\n\t \n\t \tif ($this->searchString)\n\t \t{\n\t \t\tif ($this->searchField==\"name\") $filter = $this->nameFilter();\n\t \t\telse $filter = $this->searchField.\"='\".$this->searchString.\"'\";\n\t\t}\n\n\t\tif ($this->searchSort)\n\t\t{\n\t\t\tif ($this->searchSort==\"name\") $sort = \"first_name,last_name\";\n\t\t\telse $sort = $this->searchSort;\n\t\t}\n\t\t\n\t\t//run the query\t \n\t\t$sql = \"SELECT auth.accounts.*,(first_name || ' ' || last_name) AS full_name FROM auth.accounts \";\n\t\tif ($filter) $sql .= \" WHERE \".$filter;\n\t\tif ($sort) $sql .= \" ORDER BY \".$sort;\n\n\t\treturn $this->DB->fetch($sql);\n\t \n\t}", "public function search($query, $type = '', $offset = 0);" ]
[ "0.5963054", "0.5933557", "0.5875939", "0.58505857", "0.5669182", "0.564988", "0.5556998", "0.55479944", "0.5538515", "0.5513523", "0.55007786", "0.5485658", "0.54187703", "0.5400187", "0.53726786", "0.536528", "0.53632873", "0.5301802", "0.5269744", "0.5269474", "0.5260295", "0.5252554", "0.52521676", "0.5246", "0.52417874", "0.5241614", "0.52377427", "0.52140397", "0.5200589", "0.51981986" ]
0.64153606
0
Query by a specific association ID. This will also set the limit of the result count to one.
public function association_id( $association_id ) { $this->limit( 1 ); return $this->condition_factory->association_id( $association_id ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function fetchOneAssoc();", "public function fetchOne(\r\n\t\t$assocKey = NULL)\r\n\t{\r\n\t\t$limit = clone $this->limit;\r\n\t\t$this->limit->ResetElements('1');\r\n\t\tif($data = $this->fetchAll($assocKey)){\r\n\t\t\treturn reset($data);\r\n\t\t}\r\n\t\t$this->limit = clone $limit;\r\n\t\treturn NULL;\r\n\t}", "public abstract function query($id);", "public function findById($id_association)\n \t {\n \t \t$baseDeDonne = $this->accesBaseDeDonnee();\n \t \t$sql = $baseDeDonne->prepare(\"SELECT * FROM association_vehicule_conducteur WHERE id_association= \".$id_association);\n\n \t \t$sql->execute();\n\n \t \t$getResultat = $sql->fetchAll(PDO::FETCH_CLASS, 'Association');\n\n \t \treturn $getResultat;\n\t }", "static public function magicSearch($query, $limit, $associationId)\r\n {\r\n $params = array('association_id' => $associationId,\r\n 'state' => self::STATE_ENABLED,\r\n 'magic'=> $query);\r\n\r\n $q = self::getQuerySearch($params);\r\n $q->limit($limit);\r\n\r\n return $q->execute();\r\n }", "public function fetch_one($id = 0);", "function _fetch_first($query_id, $assoc=false) {\n $arr = $this->_fetch($query_id, $assoc);\n return $arr;\n }", "public function myFindOne($id)\n\t{\n\t\treturn $this \n\t\t-> createQueryBuilder('a')\n\t\t-> where('a.id = :id')\n\t\t-> setParameter ('id', $id)\n\t\t-> getQuery()\n\t\t-> getResult()\n\t\t;\n\t}", "public function findOne($id, $relation);", "function queryAssociation_SEEMS_OUDATED(Model $Model, Model $LinkModel, $type, $association, $assocData, &$queryData, $external, &$resultSet, $recursive, $stack) {\n\t\tif ($query = $this->generateAssociationQuery($Model, $LinkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) {\n\t\t\tif (!isset($resultSet) || !is_array($resultSet)) {\n\t\t\t\tif (Configure::read() > 0) {\n\t\t\t\t\techo '<div style = \"font: Verdana bold 12px; color: #FF0000\">' . sprintf(__('SQL Error in model %s:', true), $Model->alias) . ' ';\n\t\t\t\t\tif (isset($this->error) && $this->error != null) {\n\t\t\t\t\t\techo $this->error;\n\t\t\t\t\t}\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t$count = count($resultSet);\n\n\t\t\tif ($type === 'hasMany' && (!isset($assocData['limit']) || empty($assocData['limit']))) {\n\t\t\t\t$ins = $fetch = array();\n\t\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t\tif ($in = $this->insertQueryData('{$__cakeID__$}', $resultSet[$i], $association, $Model, $stack)) {\n\t\t\t\t\t\t$ins[] = $in;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!empty($ins)) {\n\t\t\t\t\t$fetch = array();\n\t\t\t\t\t$ins = array_chunk($ins, 1000);\n\t\t\t\t\tforeach ($ins as $i) {\n\t\t\t\t\t\t$q = str_replace('{$__cakeID__$}', implode(', ', $i), $query);\n\t\t\t\t\t\t$q = str_replace('= (', 'IN (', $q);\n\t\t\t\t\t\t$res = $this->fetchAll($q, $Model->cacheQueries, $Model->alias);\n\t\t\t\t\t\t$fetch = array_merge($fetch, $res);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!empty($fetch) && is_array($fetch)) {\n\t\t\t\t\tif ($recursive > 0) {\n\n\t\t\t\t\t\tforeach ($LinkModel->__associations as $type1) {\n\t\t\t\t\t\t\tforeach ($LinkModel->{$type1} as $assoc1 => $assocData1) {\n\t\t\t\t\t\t\t\t$deepModel =& $LinkModel->{$assoc1};\n\t\t\t\t\t\t\t\t$tmpStack = $stack;\n\t\t\t\t\t\t\t\t$tmpStack[] = $assoc1;\n\n\t\t\t\t\t\t\t\tif ($LinkModel->useDbConfig === $deepModel->useDbConfig) {\n\t\t\t\t\t\t\t\t\t$db =& $this;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$db =& ConnectionManager::getDataSource($deepModel->useDbConfig);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$db->queryAssociation($LinkModel, $deepModel, $type1, $assoc1, $assocData1, $queryData, true, $fetch, $recursive - 1, $tmpStack);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $this->_mergeHasMany($resultSet, $fetch, $association, $Model, $LinkModel, $recursive);\n\t\t\t} elseif ($type === 'hasAndBelongsToMany') {\n\t\t\t\t$ins = $fetch = array();\n\t\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t\tif ($in = $this->insertQueryData('{$__cakeID__$}', $resultSet[$i], $association, $Model, $stack)) {\n\t\t\t\t\t\t$ins[] = $in;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$foreignKey = $Model->hasAndBelongsToMany[$association]['foreignKey'];\n\t\t\t\t$joinKeys = array($foreignKey, $Model->hasAndBelongsToMany[$association]['associationForeignKey']);\n\t\t\t\tlist($with, $habtmFields) = $Model->joinModel($Model->hasAndBelongsToMany[$association]['with'], $joinKeys);\n\t\t\t\t$habtmFieldsCount = count($habtmFields);\n\n\t\t\t\tif (!empty($ins)) {\n\t\t\t\t\t$fetch = array();\n\t\t\t\t\t$ins = array_chunk($ins, 1000);\n\t\t\t\t\tforeach ($ins as $i) {\n\t\t\t\t\t\t$q = str_replace('{$__cakeID__$}', '(' .implode(', ', $i) .')', $query);\n\t\t\t\t\t\t$q = str_replace('= (', 'IN (', $q);\n\t\t\t\t\t\t$q = str_replace(' WHERE 1 = 1', '', $q);\n\n\t\t\t\t\t\t$q = $this->insertQueryData($q, null, $association, $Model, $stack);\n\t\t\t\t\t\tif ($q != false) {\n\t\t\t\t\t\t\t$res = $this->fetchAll($q, $Model->cacheQueries, $Model->alias);\n\t\t\t\t\t\t\t$fetch = array_merge($fetch, $res);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t$row =& $resultSet[$i];\n\n\t\t\t\tif ($type !== 'hasAndBelongsToMany') {\n\t\t\t\t\t$q = $this->insertQueryData($query, $resultSet[$i], $association, $Model, $stack);\n\t\t\t\t\tif ($q != false) {\n\t\t\t\t\t\t$fetch = $this->fetchAll($q, $Model->cacheQueries, $Model->alias);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$fetch = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!empty($fetch) && is_array($fetch)) {\n\t\t\t\t\tif ($recursive > 0) {\n\n\t\t\t\t\t\tforeach ($LinkModel->__associations as $type1) {\n\t\t\t\t\t\t\tforeach ($LinkModel->{$type1} as $assoc1 => $assocData1) {\n\n\t\t\t\t\t\t\t\t$deepModel =& $LinkModel->{$assoc1};\n\t\t\t\t\t\t\t\tif (($type1 === 'belongsTo') || ($deepModel->alias === $Model->alias && $type === 'belongsTo') || ($deepModel->alias != $Model->alias)) {\n\t\t\t\t\t\t\t\t\t$tmpStack = $stack;\n\t\t\t\t\t\t\t\t\t$tmpStack[] = $assoc1;\n\t\t\t\t\t\t\t\t\tif ($LinkModel->useDbConfig == $deepModel->useDbConfig) {\n\t\t\t\t\t\t\t\t\t\t$db =& $this;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$db =& ConnectionManager::getDataSource($deepModel->useDbConfig);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$db->queryAssociation($LinkModel, $deepModel, $type1, $assoc1, $assocData1, $queryData, true, $fetch, $recursive - 1, $tmpStack);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($type == 'hasAndBelongsToMany') {\n\t\t\t\t\t\t$merge = array();\n\t\t\t\t\t\tforeach($fetch as $j => $data) {\n\t\t\t\t\t\t\tif (isset($data[$with]) && $data[$with][$foreignKey] === $row[$Model->alias][$Model->primaryKey]) {\n\t\t\t\t\t\t\t\tif ($habtmFieldsCount > 2) {\n\t\t\t\t\t\t\t\t\t$merge[] = $data;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$merge[] = Set::diff($data, array($with => $data[$with]));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (empty($merge) && !isset($row[$association])) {\n\t\t\t\t\t\t\t$row[$association] = $merge;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->_mergeAssociation($resultSet[$i], $merge, $association, $type);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->_mergeAssociation($resultSet[$i], $fetch, $association, $type);\n\t\t\t\t\t}\n\t\t\t\t\t$resultSet[$i][$association] = $LinkModel->afterfind($resultSet[$i][$association]);\n\n\t\t\t\t} else {\n\t\t\t\t\t$tempArray[0][$association] = false;\n\t\t\t\t\t$this->_mergeAssociation($resultSet[$i], $tempArray, $association, $type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function fetch($id);", "public function limitToId(int $id): IExtendedQueryBuilder;", "public function query($id) {\n }", "public function fetchById($id);", "public function fetchById($id);", "public function fetch( $query_id=null );", "public function getUserByLimitAndIdMaior($Id_EnterpriseCategoryAwardCompetition, $limit, $competitionId = 2013)\r\n {\r\n $query = $this->select()\r\n ->setIntegrityCheck(false)\r\n ->from(\r\n array('ep' => 'EnterpriseCategoryAwardCompetition'), array('EnterpriseProgramaId' => 'Id')\r\n )\r\n ->join(\r\n array('ul' => 'UserLocality'), 'ep.EnterpriseId = ul.EnterpriseId',\r\n null\r\n )\r\n ->join(\r\n array('u' => 'User'), 'ul.UserId = u.Id', array('UserId' => 'u.Id', 'u.FirstName') \r\n )\r\n ->join(\r\n array('e' => 'Enterprise'), 'ep.EnterpriseId = e.Id', array('e.SocialName') \r\n ) \r\n ->where('ep.Id >= ?', $Id_EnterpriseCategoryAwardCompetition)\r\n ->where('ep.CompetitionId = ?', $competitionId)\r\n ->limit($limit) \r\n ;\r\n echo $query.\"\\n\\n\";\r\n $objResult = $this->fetchAll($query);\r\n \r\n\t\treturn $objResult;\r\n }", "function fetch($id, $fetchMode=self::FETCH_OBJ, $fetchSubset=null) {\n\t\t$criteriaExp = Metadata::get($this->class)->pkCriteria($id);\n\t\treturn $this->execFetchOne(__FUNCTION__, 0, null, $criteriaExp, $fetchMode, $fetchSubset);\n\t}", "function getAssoc($sql, $offset = 0, $limit = null, $prefetch = 50);", "public function fetchById($id)\n {\n $searchRule = \"[Id] = '$id'\";\n return $this->fetchOne($searchRule);\n }", "public static function findById($id) {\n\t\treturn self::find(array(\n\t\t\t'where' => array('id = ?', $id),\n\t\t\t'limit' => 1\n\t\t));\n\t}", "public function getUserByLimitAndIdMaiorJoinExecution($Id_EnterpriseCategoryAwardCompetition, $limit, $competitionId = 2014)\r\n {\r\n $query = $this->select()\r\n ->setIntegrityCheck(false)\r\n ->from(\r\n array('ep' => 'EnterpriseCategoryAwardCompetition'), array('EnterpriseProgramaId' => 'Id')\r\n )\r\n ->join(\r\n array('ul' => 'UserLocality'), 'ep.EnterpriseId = ul.EnterpriseId',\r\n null\r\n )\r\n ->join(\r\n array('u' => 'User'), 'ul.UserId = u.Id', array('UserId' => 'u.Id', 'u.FirstName') \r\n )\r\n ->join(\r\n array('e' => 'Enterprise'), 'ep.EnterpriseId = e.Id', array('e.SocialName') \r\n ) \r\n ->join(\r\n array('x' => 'Execution'), 'x.UserId = ul.UserId and x.QuestionnaireId = 51' \r\n ) \r\n ->joinLeft(\r\n array('EP' => 'ExecutionPontuacao'), 'EP.ExecutionId = x.Id' , null \r\n ) \r\n ->where('ep.Id >= ?', $Id_EnterpriseCategoryAwardCompetition)\r\n ->where('ep.CompetitionId = ?', $competitionId)\r\n ->where(\"e.Status = ('A')\")\r\n ->where('x.DevolutivePath is not null')\r\n ->where('EP.NegociosTotal is null')\r\n ->limit($limit) \r\n ;\r\n echo $query.\"\\n\\n\";\r\n $objResult = $this->fetchAll($query);\r\n \r\n\t\treturn $objResult;\r\n }", "abstract protected function fetch($id);", "public function findObjectById($id = null)\n {\n $qb = $this->createQueryBuilder('a')\n ->select('a')\n ->where('a.id = :id')\n ->setParameter('id', $id)\n ->setMaxResults(1);\n\n return $qb->getQuery()->getOneOrNullResult();\n }", "public function findById( $id = 0 ) {\n\t\treturn $this->where( [\n\t\t\t'WHERE ID=' . $id,\n\t\t\t'LIMIT 1'\n\t\t] )[0];\n\t}", "public function limit($limit) {\n $this->innerQuery->limit($limit);\n }", "public function searchId(int $id);", "public function byId($id);", "public function byId($id);", "public function getOne($id);" ]
[ "0.5515331", "0.5480664", "0.54112834", "0.5351988", "0.53297156", "0.521112", "0.51978946", "0.51230633", "0.5070932", "0.5067966", "0.5053456", "0.5037369", "0.49822333", "0.49796155", "0.49796155", "0.4944741", "0.49242878", "0.49156523", "0.48981163", "0.48855263", "0.48392272", "0.4815915", "0.4814594", "0.4801331", "0.47950825", "0.47640675", "0.4763724", "0.47365582", "0.47365582", "0.47165152" ]
0.5542997
0
Indicate that get_results() should return instances of IToolset_Association.
public function return_association_instances() { $this->result_transformation = new Toolset_Association_Query_Result_Transformation_Association_Instance(); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_results() {\n\n\t\tif( $this->was_used ) {\n\t\t\t_doing_it_wrong(\n\t\t\t\t__FUNCTION__,\n\t\t\t\t'The association query object should not be reused. Create a new instance if you need to run another query.',\n\t\t\t\tTOOLSET_COMMON_VERSION\n\t\t\t);\n\t\t}\n\n\t\t$this->was_used = true;\n\n\t\t// Default value if no result transformation was selected.\n\t\tif( null === $this->result_transformation ) {\n\t\t\t$this->return_association_instances();\n\t\t}\n\n\t\t// Sometimes it's not as straightforward as \"get current language\"\n\t\t$this->determine_translation_language();\n\n\t\t$this->apply_restrictions();\n\n\t\t// We do this only after restrictions have been applied.\n\t\t$this->element_selector_provider->create_selector(\n\t\t\t$this->unique_table_alias, $this->join_manager, $this\n\t\t);\n\n\t\t$query = $this->build_sql_query();\n\t\t$rows = toolset_ensarr( $this->wpdb->get_results( $query ) );\n\n\t\tif( $this->need_found_rows ) {\n\t\t\t$this->found_rows = (int) $this->wpdb->get_var( 'SELECT FOUND_ROWS()' );\n\t\t}\n\n\t\t$results = array();\n\t\tforeach( $rows as $row ) {\n\t\t\t$result = $this->result_transformation->transform( $row, $this->element_selector_provider->get_selector() );\n\n\t\t\tif ( null !== $result ) {\n\t\t\t\t$results[] = $result;\n\t\t\t}\n\t\t}\n\n\t\t$this->clear_restrictions();\n\n\t\treturn $results;\n\t}", "abstract public function getRelationResults(): Collection;", "public function getAssociations();", "public function getAssociations(): array;", "public function testListTargetAssociations()\n {\n }", "function test_models_multiple_results(){\n\n\t\t// ---- Arrange\n\t\t$this->factory->post->create_many(10, array(\n\t\t\t'post_type' => 'book'\n\t\t));\n\n\t\t// ---- Act\n\t\t$books = $this->app->book->find();\n\n\t\t// ---- Assert\n\t\t$this->assertTrue(true, 'Asserts if the book->find() returns an array');\n\t\t$this->assertInstanceOf('PostObject', $books[0], 'Asserts if is an array of PostObject');\n\n\t}", "public function testListSourceAssociations()\n {\n }", "public function getAssociations()\n {\n return $this->xpath('object', 'UML - Association', '');\n }", "public function testAssociationProxyFindNoJoinRecords(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->belongsToMany('Tags');\n $table->Tags->junction()->deleteAll('1=1');\n\n $query = $table->Tags->find();\n $result = $query->toArray();\n $this->assertCount(3, $result);\n }", "public function testGetAssocReturnsArrayWhenSet()\n {\n $adapter = $this->adapterMock;\n \n $accountsTable = new Account($adapter); // getInstance doesn't work well in testing\n \n // test returns the correct array\n $userAssoc = $accountsTable->getAssoc('user'); // returns and array with User\n $transactionsAssoc = $accountsTable->getAssoc('transactions'); // returns and array with Transaction\n \n $this->assertEquals($userAssoc['type'], 'belongsTo');\n $this->assertEquals($userAssoc['foreign_key'], 'user_id');\n $this->assertTrue($userAssoc['table'] instanceof User);\n \n $this->assertEquals($transactionsAssoc['type'], 'hasMany');\n $this->assertEquals($transactionsAssoc['foreign_key'], 'account_id');\n $this->assertTrue($transactionsAssoc['table'] instanceof Transaction);\n }", "public function testAssociationProxyFindWithConditions(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->belongsToMany('Tags', [\n 'conditions' => ['SpecialTags.highlighted' => true],\n 'through' => 'SpecialTags',\n ]);\n $query = $table->Tags->find();\n $result = $query->toArray();\n $this->assertCount(1, $result);\n $this->assertSame(1, $result[0]->id);\n }", "public function testAssociationProxyFindWithComplexConditions(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->belongsToMany('Tags', [\n 'conditions' => [\n 'OR' => [\n 'SpecialTags.highlighted' => true,\n ],\n ],\n 'through' => 'SpecialTags',\n ]);\n $query = $table->Tags->find();\n $result = $query->toArray();\n $this->assertCount(1, $result);\n $this->assertSame(1, $result[0]->id);\n }", "public function testCommunicationObjectsReturned()\r\n {\r\n // get a repository to search with\r\n $repo = $this->em->getRepository(Communication::class);\r\n\r\n // create an array with values to search with\r\n $searches = array();\r\n $searches[] = 'Collection';\r\n\r\n // query the database\r\n $results = $repo->communicationSearch($searches);\r\n\r\n // create a new ReflectionClass object, using the returned object at index 0\r\n //$resultReflection = new \\ReflectionClass(get_class($results[0]));\r\n\r\n // Assert that the name of the Reflection object is 'Communication'\r\n //$this->assertTrue($resultReflection->getShortName() == 'Communication');\r\n\r\n $this->AssertTrue(is_a($results[0],Communication::class));\r\n }", "public function testFindRelatedExtract() {\n\t\t$expected = array(array(\n\t\t\t'id' => 'active',\n\t\t\t'name' => 'active',\n\t\t\t'slug' => 'active',\n\t\t\t'shop_product_id' => 'multi-category'\n\t\t), array(\n\t\t\t'id' => 'another',\n\t\t\t'name' => 'another',\n\t\t\t'slug' => 'another',\n\t\t\t'shop_product_id' => 'multi-category'\n\t\t));\n\n\t\t$result = $this->{$this->modelClass}->find('related', array(\n\t\t\t'shop_product_id' => 'multi-category',\n\t\t\t'extract' => true\n\t\t));\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function testGeneratedAssociations(): void\n {\n $articles = $this->getTableLocator()->get('Articles');\n $tags = $this->getTableLocator()->get('Tags');\n $conditions = ['SpecialTags.highlighted' => true];\n $assoc = $articles->belongsToMany('Tags', [\n 'sourceTable' => $articles,\n 'targetTable' => $tags,\n 'foreignKey' => 'foreign_key',\n 'targetForeignKey' => 'target_foreign_key',\n 'through' => 'SpecialTags',\n 'conditions' => $conditions,\n ]);\n // Generate associations\n $assoc->junction();\n\n $tagAssoc = $articles->getAssociation('Tags');\n $this->assertNotEmpty($tagAssoc, 'btm should exist');\n $this->assertEquals($conditions, $tagAssoc->getConditions());\n $this->assertSame('target_foreign_key', $tagAssoc->getTargetForeignKey());\n $this->assertSame('foreign_key', $tagAssoc->getForeignKey());\n\n $jointAssoc = $articles->getAssociation('SpecialTags');\n $this->assertNotEmpty($jointAssoc, 'has many to junction should exist');\n $this->assertInstanceOf(HasMany::class, $jointAssoc);\n $this->assertSame('foreign_key', $jointAssoc->getForeignKey());\n\n $articleAssoc = $tags->getAssociation('Articles');\n $this->assertNotEmpty($articleAssoc, 'reverse btm should exist');\n $this->assertInstanceOf(BelongsToMany::class, $articleAssoc);\n $this->assertEquals($conditions, $articleAssoc->getConditions());\n $this->assertSame('foreign_key', $articleAssoc->getTargetForeignKey(), 'keys should swap');\n $this->assertSame('target_foreign_key', $articleAssoc->getForeignKey(), 'keys should swap');\n\n $jointAssoc = $tags->getAssociation('SpecialTags');\n $this->assertNotEmpty($jointAssoc, 'has many to junction should exist');\n $this->assertInstanceOf(HasMany::class, $jointAssoc);\n $this->assertSame('target_foreign_key', $jointAssoc->getForeignKey());\n }", "public function testGetAssociated() {\n\t\t$user = new User();\n\t\t$result = $user->getAssociated();\n\t\t$this->assertEquals('hasOne', $result['Address']['type']);\n\t\t$this->assertTrue($result['Address']['embedded']);\n\t\t$this->assertEquals('hasOne', $result['Account']['type']);\n\t\t$this->assertTrue($result['Account']['reference']);\n\t\t$this->assertEquals('hasMany', $result['PhoneNumber']['type']);\n\t\t$this->assertTrue($result['PhoneNumber']['embedded']);\n\n\t\t$number = new PhoneNumber();\n\t\t$expected = array('OwningUser' => array('type' => 'belongsTo'));\n\t\t$result = $number->getAssociated();\n\t\t$this->assertEquals('belongsTo', $result['OwningUser']['type']);\n\t\t$this->assertTrue($result['OwningUser']['reference']);\n\t}", "abstract protected function getRelations();", "public function hasResults(){\n return $this->_has(2);\n }", "public function hasResults(){\n return $this->_has(2);\n }", "public function hasResults(){\n return $this->_has(2);\n }", "protected function _getRelationRecords(){ }", "private function set_relationships()\n {\n if (empty($this->relationships)) {\n $options = ['has_one', 'has_many', 'has_many_pivot'];\n foreach ($options as $option) {\n if (isset($this->{$option}) && !empty($this->{$option})) {\n foreach ($this->{$option} as $key => $relation) {\n $single_query = false;\n if (!is_array($relation)) {\n $foreign_model = $relation;\n $model = $this->parse_model_dir($foreign_model);\n $foreign_model = $model['foreign_model'];\n $foreign_model_name = $model['foreign_model_name'];\n\n $this->load->model($foreign_model, $foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n $foreign_key = $this->{$foreign_model_name}->primary_key;\n $local_key = $this->primary_key;\n $pivot_local_key = $this->table.'_'.$local_key;\n $pivot_foreign_key = $foreign_table.'_'.$foreign_key;\n $get_relate = false;\n } else {\n if ($this->is_assoc($relation)) {\n $foreign_model = $relation['foreign_model'];\n $model = $this->parse_model_dir($foreign_model);\n $foreign_model = $model['model_dir'].$model['foreign_model'];\n $foreign_model_name = $model['foreign_model_name'];\n\n if (array_key_exists('foreign_table', $relation)) {\n $foreign_table = $relation['foreign_table'];\n } else {\n $this->load->model($foreign_model, $foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n }\n\n $foreign_key = $relation['foreign_key'];\n $local_key = $relation['local_key'];\n if ($option == 'has_many_pivot') {\n $pivot_table = $relation['pivot_table'];\n $pivot_local_key = (array_key_exists('pivot_local_key', $relation)) ? $relation['pivot_local_key'] : $this->table.'_'.$this->primary_key;\n $pivot_foreign_key = (array_key_exists('pivot_foreign_key', $relation)) ? $relation['pivot_foreign_key'] : $foreign_table.'_'.$foreign_key;\n $get_relate = (array_key_exists('get_relate', $relation) && ($relation['get_relate'] === true)) ? true : false;\n }\n if ($option=='has_one' && isset($relation['join']) && $relation['join'] === true) {\n $single_query = true;\n }\n } else {\n $foreign_model = $relation[0];\n $model = $this->parse_model_dir($foreign_model);\n $foreign_model = $model['model_dir'].$model['foreign_model'];\n $foreign_model_name = $model['foreign_model_name'];\n $this->load->model($foreign_model);\n $foreign_table = $this->{$foreign_model}->table;\n $foreign_key = $relation[1];\n $local_key = $relation[2];\n if ($option=='has_many_pivot') {\n $pivot_local_key = $this->table.'_'.$this->primary_key;\n $pivot_foreign_key = $foreign_table.'_'.$foreign_key;\n $get_relate = (isset($relation[3]) && ($relation[3] === true)) ? true : false;\n }\n }\n }\n\n if ($option=='has_many_pivot' && !isset($pivot_table)) {\n $tables = [$this->table, $foreign_table];\n sort($tables);\n $pivot_table = $tables[0].'_'.$tables[1];\n }\n\n $this->relationships[$key] = [\n 'relation' => $option,\n 'relation_key' => $key,\n 'foreign_model' => strtolower($foreign_model),\n 'foreign_model_name' => strtolower($foreign_model_name),\n 'foreign_table' => $foreign_table,\n 'foreign_key' => $foreign_key,\n 'local_key' => $local_key\n ];\n\n if ($option == 'has_many_pivot') {\n $this->relationships[$key]['pivot_table'] = $pivot_table;\n $this->relationships[$key]['pivot_local_key'] = $pivot_local_key;\n $this->relationships[$key]['pivot_foreign_key'] = $pivot_foreign_key;\n $this->relationships[$key]['get_relate'] = $get_relate;\n }\n\n if ($single_query === true) {\n $this->relationships[$key]['joined'] = true;\n }\n }\n }\n }\n }\n }", "public function getAssociates();", "private function getActualResultsArray() : array {\n\t\t$results = [];\n\n\t\tif (isset($this->results['results']['organic'])) {\n\t\t\t$results = $this->results['results']['organic'];\n\t\t}\n\n\t\treturn $results;\n\t}", "public function testAssociationProxyFindWithConditionsMatching(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->belongsToMany('Tags', [\n 'conditions' => ['SpecialTags.highlighted' => true],\n 'through' => 'SpecialTags',\n ]);\n $query = $table->Tags->find()->matching('Articles', function (SelectQuery $query) {\n return $query->where(['Articles.id' => 1]);\n });\n // The inner join on special_tags excludes the results.\n $this->assertSame(0, $query->count());\n }", "abstract public function retrieveCollection(&$params = array(), $asEntites = false);", "public function requestedRelationships(): bool;", "public function getAssociationInfo()\n {\n return $this->association_info;\n }", "public function results_obj ( /* void */ )\n {\n return $this->results(DB_FETCH_OBJ);\n }", "public function getTestCaseResults(): array;" ]
[ "0.5905405", "0.58535665", "0.583704", "0.5725895", "0.5716244", "0.54626", "0.5385685", "0.5335656", "0.53273827", "0.53073835", "0.51562893", "0.50893915", "0.50150234", "0.5001923", "0.49759823", "0.49534154", "0.493601", "0.48889595", "0.48889595", "0.48889595", "0.4878085", "0.486857", "0.4838544", "0.4827748", "0.48242185", "0.48073214", "0.48057765", "0.4782731", "0.47768152", "0.47659558" ]
0.589794
1
Indicate that get_results() should return UIDs of associations.
public function return_association_uids() { $this->result_transformation = new Toolset_Association_Query_Result_Transformation_Association_Uid(); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getRelationResults(): Collection;", "public function getAssociations();", "public function get_results() {\n\n\t\tif( $this->was_used ) {\n\t\t\t_doing_it_wrong(\n\t\t\t\t__FUNCTION__,\n\t\t\t\t'The association query object should not be reused. Create a new instance if you need to run another query.',\n\t\t\t\tTOOLSET_COMMON_VERSION\n\t\t\t);\n\t\t}\n\n\t\t$this->was_used = true;\n\n\t\t// Default value if no result transformation was selected.\n\t\tif( null === $this->result_transformation ) {\n\t\t\t$this->return_association_instances();\n\t\t}\n\n\t\t// Sometimes it's not as straightforward as \"get current language\"\n\t\t$this->determine_translation_language();\n\n\t\t$this->apply_restrictions();\n\n\t\t// We do this only after restrictions have been applied.\n\t\t$this->element_selector_provider->create_selector(\n\t\t\t$this->unique_table_alias, $this->join_manager, $this\n\t\t);\n\n\t\t$query = $this->build_sql_query();\n\t\t$rows = toolset_ensarr( $this->wpdb->get_results( $query ) );\n\n\t\tif( $this->need_found_rows ) {\n\t\t\t$this->found_rows = (int) $this->wpdb->get_var( 'SELECT FOUND_ROWS()' );\n\t\t}\n\n\t\t$results = array();\n\t\tforeach( $rows as $row ) {\n\t\t\t$result = $this->result_transformation->transform( $row, $this->element_selector_provider->get_selector() );\n\n\t\t\tif ( null !== $result ) {\n\t\t\t\t$results[] = $result;\n\t\t\t}\n\t\t}\n\n\t\t$this->clear_restrictions();\n\n\t\treturn $results;\n\t}", "public function getAssociations(): array;", "public function get_found_rows_directly() {\n\t\t$this->need_found_rows()\n\t\t\t->limit( 1 )\n\t\t\t->return_association_uids()\n\t\t\t->get_results();\n\n\t\treturn $this->get_found_rows();\n\t}", "function _findPendingOrganizations() {\n\t\t//find any user_org links\n\t\t$finder = new Cgn_DataItem('crm_acct');\n\t\t$finder->andWhere('is_active', 0);\n\t\t/*\n\t\t$finder = new Cgn_DataItem('cgn_account');\n\t\t$finder->_cols[] = 'cgn_account.*';\n\t\t$finder->hasOne('crm_acct', 'org_account_id', 'Tacct', 'cgn_account_id');\n\t\t$finder->andWhere('Tacct.crm_acct_id', NULL, 'IS');\n\n\t\t//organizational accounts have user_id=0\n\t\t$finder->andWhere('cgn_user_id', 0);\n//\t\t$finder->andWhere('Tacct.cgn_account_id', $oids, 'IN');\n\t\t$finder->_rsltByPkey = FALSE;\n\t\t//TODO: add date checking with valid_thru\n\t\t */\n\t\t$supportAccounts = $finder->find();\n\t\treturn $supportAccounts;\n\t}", "public function getAssociations()\n {\n return $this->xpath('object', 'UML - Association', '');\n }", "public function testListTargetAssociations()\n {\n }", "function getUniqueResults()\r\n\t{\r\n\t\t$obj_ids = array();\r\n\t\tforeach($this->results as $result)\r\n\t\t{\r\n\t\t\tif(in_array($result['obj_id'],$obj_ids))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$obj_ids[] = $result['obj_id'];\r\n\t\t\t$objects[] = $result;\r\n\t\t}\r\n\t\treturn $objects ? $objects : array();\r\n\t}", "function queryAssociation_SEEMS_OUDATED(Model $Model, Model $LinkModel, $type, $association, $assocData, &$queryData, $external, &$resultSet, $recursive, $stack) {\n\t\tif ($query = $this->generateAssociationQuery($Model, $LinkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) {\n\t\t\tif (!isset($resultSet) || !is_array($resultSet)) {\n\t\t\t\tif (Configure::read() > 0) {\n\t\t\t\t\techo '<div style = \"font: Verdana bold 12px; color: #FF0000\">' . sprintf(__('SQL Error in model %s:', true), $Model->alias) . ' ';\n\t\t\t\t\tif (isset($this->error) && $this->error != null) {\n\t\t\t\t\t\techo $this->error;\n\t\t\t\t\t}\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t$count = count($resultSet);\n\n\t\t\tif ($type === 'hasMany' && (!isset($assocData['limit']) || empty($assocData['limit']))) {\n\t\t\t\t$ins = $fetch = array();\n\t\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t\tif ($in = $this->insertQueryData('{$__cakeID__$}', $resultSet[$i], $association, $Model, $stack)) {\n\t\t\t\t\t\t$ins[] = $in;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!empty($ins)) {\n\t\t\t\t\t$fetch = array();\n\t\t\t\t\t$ins = array_chunk($ins, 1000);\n\t\t\t\t\tforeach ($ins as $i) {\n\t\t\t\t\t\t$q = str_replace('{$__cakeID__$}', implode(', ', $i), $query);\n\t\t\t\t\t\t$q = str_replace('= (', 'IN (', $q);\n\t\t\t\t\t\t$res = $this->fetchAll($q, $Model->cacheQueries, $Model->alias);\n\t\t\t\t\t\t$fetch = array_merge($fetch, $res);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!empty($fetch) && is_array($fetch)) {\n\t\t\t\t\tif ($recursive > 0) {\n\n\t\t\t\t\t\tforeach ($LinkModel->__associations as $type1) {\n\t\t\t\t\t\t\tforeach ($LinkModel->{$type1} as $assoc1 => $assocData1) {\n\t\t\t\t\t\t\t\t$deepModel =& $LinkModel->{$assoc1};\n\t\t\t\t\t\t\t\t$tmpStack = $stack;\n\t\t\t\t\t\t\t\t$tmpStack[] = $assoc1;\n\n\t\t\t\t\t\t\t\tif ($LinkModel->useDbConfig === $deepModel->useDbConfig) {\n\t\t\t\t\t\t\t\t\t$db =& $this;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$db =& ConnectionManager::getDataSource($deepModel->useDbConfig);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$db->queryAssociation($LinkModel, $deepModel, $type1, $assoc1, $assocData1, $queryData, true, $fetch, $recursive - 1, $tmpStack);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $this->_mergeHasMany($resultSet, $fetch, $association, $Model, $LinkModel, $recursive);\n\t\t\t} elseif ($type === 'hasAndBelongsToMany') {\n\t\t\t\t$ins = $fetch = array();\n\t\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t\tif ($in = $this->insertQueryData('{$__cakeID__$}', $resultSet[$i], $association, $Model, $stack)) {\n\t\t\t\t\t\t$ins[] = $in;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$foreignKey = $Model->hasAndBelongsToMany[$association]['foreignKey'];\n\t\t\t\t$joinKeys = array($foreignKey, $Model->hasAndBelongsToMany[$association]['associationForeignKey']);\n\t\t\t\tlist($with, $habtmFields) = $Model->joinModel($Model->hasAndBelongsToMany[$association]['with'], $joinKeys);\n\t\t\t\t$habtmFieldsCount = count($habtmFields);\n\n\t\t\t\tif (!empty($ins)) {\n\t\t\t\t\t$fetch = array();\n\t\t\t\t\t$ins = array_chunk($ins, 1000);\n\t\t\t\t\tforeach ($ins as $i) {\n\t\t\t\t\t\t$q = str_replace('{$__cakeID__$}', '(' .implode(', ', $i) .')', $query);\n\t\t\t\t\t\t$q = str_replace('= (', 'IN (', $q);\n\t\t\t\t\t\t$q = str_replace(' WHERE 1 = 1', '', $q);\n\n\t\t\t\t\t\t$q = $this->insertQueryData($q, null, $association, $Model, $stack);\n\t\t\t\t\t\tif ($q != false) {\n\t\t\t\t\t\t\t$res = $this->fetchAll($q, $Model->cacheQueries, $Model->alias);\n\t\t\t\t\t\t\t$fetch = array_merge($fetch, $res);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t$row =& $resultSet[$i];\n\n\t\t\t\tif ($type !== 'hasAndBelongsToMany') {\n\t\t\t\t\t$q = $this->insertQueryData($query, $resultSet[$i], $association, $Model, $stack);\n\t\t\t\t\tif ($q != false) {\n\t\t\t\t\t\t$fetch = $this->fetchAll($q, $Model->cacheQueries, $Model->alias);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$fetch = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!empty($fetch) && is_array($fetch)) {\n\t\t\t\t\tif ($recursive > 0) {\n\n\t\t\t\t\t\tforeach ($LinkModel->__associations as $type1) {\n\t\t\t\t\t\t\tforeach ($LinkModel->{$type1} as $assoc1 => $assocData1) {\n\n\t\t\t\t\t\t\t\t$deepModel =& $LinkModel->{$assoc1};\n\t\t\t\t\t\t\t\tif (($type1 === 'belongsTo') || ($deepModel->alias === $Model->alias && $type === 'belongsTo') || ($deepModel->alias != $Model->alias)) {\n\t\t\t\t\t\t\t\t\t$tmpStack = $stack;\n\t\t\t\t\t\t\t\t\t$tmpStack[] = $assoc1;\n\t\t\t\t\t\t\t\t\tif ($LinkModel->useDbConfig == $deepModel->useDbConfig) {\n\t\t\t\t\t\t\t\t\t\t$db =& $this;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$db =& ConnectionManager::getDataSource($deepModel->useDbConfig);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$db->queryAssociation($LinkModel, $deepModel, $type1, $assoc1, $assocData1, $queryData, true, $fetch, $recursive - 1, $tmpStack);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($type == 'hasAndBelongsToMany') {\n\t\t\t\t\t\t$merge = array();\n\t\t\t\t\t\tforeach($fetch as $j => $data) {\n\t\t\t\t\t\t\tif (isset($data[$with]) && $data[$with][$foreignKey] === $row[$Model->alias][$Model->primaryKey]) {\n\t\t\t\t\t\t\t\tif ($habtmFieldsCount > 2) {\n\t\t\t\t\t\t\t\t\t$merge[] = $data;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$merge[] = Set::diff($data, array($with => $data[$with]));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (empty($merge) && !isset($row[$association])) {\n\t\t\t\t\t\t\t$row[$association] = $merge;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->_mergeAssociation($resultSet[$i], $merge, $association, $type);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->_mergeAssociation($resultSet[$i], $fetch, $association, $type);\n\t\t\t\t\t}\n\t\t\t\t\t$resultSet[$i][$association] = $LinkModel->afterfind($resultSet[$i][$association]);\n\n\t\t\t\t} else {\n\t\t\t\t\t$tempArray[0][$association] = false;\n\t\t\t\t\t$this->_mergeAssociation($resultSet[$i], $tempArray, $association, $type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function cleanupAssociations() {\n\t\t$options = array(\n\t\t\t'type' => 'object',\n\t\t\t'subtype' => 'openid_client::association',\n\t\t\t'metadata_name_value_pairs' => array(\n\t\t\t\tarray('name' => 'expires', 'value' => time(), 'operand' => '<')\n\t\t\t),\n\t\t\t'limit' => 0,\n\t\t);\n\t\t$associations = elgg_get_entities_from_metadata($options);\n\t\t$total = count($associations);\n\n\t\tforeach ($associations as $association) {\n\t\t\t$association->delete();\n\t\t}\n\n\t\treturn $total;\n\t}", "public function testGetAssociated() {\n\t\t$user = new User();\n\t\t$result = $user->getAssociated();\n\t\t$this->assertEquals('hasOne', $result['Address']['type']);\n\t\t$this->assertTrue($result['Address']['embedded']);\n\t\t$this->assertEquals('hasOne', $result['Account']['type']);\n\t\t$this->assertTrue($result['Account']['reference']);\n\t\t$this->assertEquals('hasMany', $result['PhoneNumber']['type']);\n\t\t$this->assertTrue($result['PhoneNumber']['embedded']);\n\n\t\t$number = new PhoneNumber();\n\t\t$expected = array('OwningUser' => array('type' => 'belongsTo'));\n\t\t$result = $number->getAssociated();\n\t\t$this->assertEquals('belongsTo', $result['OwningUser']['type']);\n\t\t$this->assertTrue($result['OwningUser']['reference']);\n\t}", "public function getUserOrganizations();", "public function findParticipantsByRelatedDates() {\t\t\n\t\t// load all feUser IDs from association with date\n\t\t$uids = array();\n\t\t$this->databaseConnection = $GLOBALS['TYPO3_DB'];\n\t\t$table = 'tx_datectimeline_domain_model_date_fe_users_mm';\n\t\t$select = 'uid_foreign';\n\t\t$where = '';\n\t\t$groupBy = 'uid_foreign';\n\t\t$res = $this->databaseConnection->exec_SELECTquery($select, $table, $where, $groupBy, '', '');\n\t\tif ($res) {\n\t\t\twhile ($row = $this->databaseConnection->sql_fetch_assoc($res)) {\n\t\t\t\t$uids[] = $row['uid_foreign'];\n\t\t\t}\n\t\t} else {\n\t\t\treturn $res;\n\t\t}\n\t\t\n\t\tif (!empty($uids)) {\n\t\t\t$query = $this->createQuery();\t \t\n \t$querySettings = $query->getQuerySettings();\n \t \t$querySettings->setRespectStoragePage(FALSE);\n \t$query->setQuerySettings($querySettings);\n\t\t\t$query->matching($query->in('uid', $uids));\n\t\t\treturn $query->execute();\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "public function testListSourceAssociations()\n {\n }", "public function testAssociationProxyFindNoJoinRecords(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->belongsToMany('Tags');\n $table->Tags->junction()->deleteAll('1=1');\n\n $query = $table->Tags->find();\n $result = $query->toArray();\n $this->assertCount(3, $result);\n }", "public function requestedRelationships(): bool;", "private function getActualResultsArray() : array {\n\t\t$results = [];\n\n\t\tif (isset($this->results['results']['organic'])) {\n\t\t\t$results = $this->results['results']['organic'];\n\t\t}\n\n\t\treturn $results;\n\t}", "public function hasResults(){\n return $this->_has(2);\n }", "public function hasResults(){\n return $this->_has(2);\n }", "public function hasResults(){\n return $this->_has(2);\n }", "function get_results( $args ) {\n\t\t\t$results = array();\n\n\t\t\t// Prepare args for quey.\n\t\t\t$args = $this->prepare_args( $args );\n\n\t\t\t// Get result groups.\n\t\t\tif ( ! empty( $args['role__in'] ) ) {\n\t\t\t\t$roles = acf_get_user_role_labels( $args['role__in'] );\n\t\t\t} else {\n\t\t\t\t$roles = acf_get_user_role_labels();\n\t\t\t}\n\n\t\t\t// Return a flat array of results when searching or when queriying one group only.\n\t\t\tif ( $this->is_search || count( $roles ) === 1 ) {\n\n\t\t\t\t// Query users and append to results.\n\t\t\t\t$wp_user_query = new WP_User_Query( $args );\n\t\t\t\t$users = (array) $wp_user_query->get_results();\n\t\t\t\t$total_users = $wp_user_query->get_total();\n\t\t\t\tforeach ( $users as $user ) {\n\t\t\t\t\t$results[] = $this->get_result( $user );\n\t\t\t\t}\n\n\t\t\t\t// Determine if more results exist.\n\t\t\t\t// As this query does not return grouped results, the calculation can be exact (\">\").\n\t\t\t\t$this->more = ( $total_users > count( $users ) + $args['offset'] );\n\n\t\t\t\t// Otherwise, group results via role.\n\t\t\t} else {\n\n\t\t\t\t// Unset args that will interfer with query results.\n\t\t\t\tunset( $args['role__in'], $args['role__not_in'] );\n\n\t\t\t\t// Loop over each role.\n\t\t\t\tforeach ( $roles as $role => $role_label ) {\n\n\t\t\t\t\t// Query users (for this role only).\n\t\t\t\t\t$args['role'] = $role;\n\t\t\t\t\t$wp_user_query = new WP_User_Query( $args );\n\t\t\t\t\t$users = (array) $wp_user_query->get_results();\n\t\t\t\t\t$total_users = $wp_user_query->get_total();\n\n\t\t\t\t\t// acf_log( $args );\n\t\t\t\t\t// acf_log( '- ', count($users) );\n\t\t\t\t\t// acf_log( '- ', $total_users );\n\n\t\t\t\t\t// If users were found for this query...\n\t\t\t\t\tif ( $users ) {\n\n\t\t\t\t\t\t// Append optgroup of results.\n\t\t\t\t\t\t$role_results = array();\n\t\t\t\t\t\tforeach ( $users as $user ) {\n\t\t\t\t\t\t\t$role_results[] = $this->get_result( $user );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$results[] = array(\n\t\t\t\t\t\t\t'text' => $role_label,\n\t\t\t\t\t\t\t'children' => $role_results,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// End loop when enough results have been found.\n\t\t\t\t\t\tif ( count( $users ) === $args['number'] ) {\n\n\t\t\t\t\t\t\t// Determine if more results exist.\n\t\t\t\t\t\t\t// As this query does return grouped results, the calculation is best left fuzzy to avoid querying the next group (\">=\").\n\t\t\t\t\t\t\t$this->more = ( $total_users >= count( $users ) + $args['offset'] );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t// Otherwise, modify the args so that the next query can continue on correctly.\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$args['offset'] = 0;\n\t\t\t\t\t\t\t$args['number'] -= count( $users );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If no users were found (for the current pagination args), but there were users found for previous pages...\n\t\t\t\t\t\t// Modify the args so that the next query is offset slightly less (the number of total users) and can continue on correctly.\n\t\t\t\t\t} elseif ( $total_users ) {\n\t\t\t\t\t\t$args['offset'] -= $total_users;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t// Ignore roles that will never return a result.\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the query results.\n\t\t\t *\n\t\t\t * @date 21/5/19\n\t\t\t * @since 5.8.1\n\t\t\t *\n\t\t\t * @param array $results The query results.\n\t\t\t * @param array $args The query args.\n\t\t\t * @param ACF_Ajax_Query $query The query object.\n\t\t\t */\n\t\t\treturn apply_filters( 'acf/ajax/query_users/results', $results, $args, $this );\n\t\t}", "public function getAffiliatemembers();", "public function test_select_relation__one_to_many__no_match()\n {\n $user = (new \\Stack\\Entity\\User)->fetchById(2);\n $this->assertTrue($user->exists());\n $this->assertEquals('Romaric', $user['name']);\n $this->assertEquals([], $user['articles']);\n }", "public function testGetAssocReturnsArrayWhenSet()\n {\n $adapter = $this->adapterMock;\n \n $accountsTable = new Account($adapter); // getInstance doesn't work well in testing\n \n // test returns the correct array\n $userAssoc = $accountsTable->getAssoc('user'); // returns and array with User\n $transactionsAssoc = $accountsTable->getAssoc('transactions'); // returns and array with Transaction\n \n $this->assertEquals($userAssoc['type'], 'belongsTo');\n $this->assertEquals($userAssoc['foreign_key'], 'user_id');\n $this->assertTrue($userAssoc['table'] instanceof User);\n \n $this->assertEquals($transactionsAssoc['type'], 'hasMany');\n $this->assertEquals($transactionsAssoc['foreign_key'], 'account_id');\n $this->assertTrue($transactionsAssoc['table'] instanceof Transaction);\n }", "protected function _getRelationRecords(){ }", "public static function populateOrganizations() {\n //drupal_set_message(\"populateOrganizations\");\n /*\n * STEP 1: Write an AJAX call to retrieve url above\n * Search Drupal 8 Ajax call\n */\n\n $organizations = self::getRestOrganizations();\n //\\Drupal::logger('icrp')->notice($organizations);\n //drupal_set_message(\"gettype(organizations): \".gettype($organizations));\n\n /*\n * STEP 2: Save into enitity type Organization\n * Ignore if array is empty\n */\n if (sizeof($organizations) > 0) {\n self::checkOrganizations($organizations);\n }\n }", "abstract public function associated_values();", "function quiz_get_participants($quizid) {\n/// (users with records in quiz_attempts and quiz_question_versions)\n\n global $CFG;\n\n //Get users from attempts\n $us_attempts = get_records_sql(\"SELECT DISTINCT u.id, u.id\n FROM {$CFG->prefix}user u,\n {$CFG->prefix}quiz_attempts a\n WHERE a.quiz = '$quizid' and\n u.id = a.userid\");\n\n //Get users from question_versions\n $us_versions = get_records_sql(\"SELECT DISTINCT u.id, u.id\n FROM {$CFG->prefix}user u,\n {$CFG->prefix}quiz_question_versions v\n WHERE v.quiz = '$quizid' and\n u.id = v.userid\");\n\n //Add us_versions to us_attempts\n if ($us_versions) {\n foreach ($us_versions as $us_version) {\n $us_attempts[$us_version->id] = $us_version;\n }\n }\n //Return us_attempts array (it contains an array of unique users)\n return ($us_attempts);\n\n}", "public function requestsRelationships(): bool;" ]
[ "0.5928663", "0.5829645", "0.5784382", "0.5774597", "0.54583484", "0.5439556", "0.5367514", "0.53531504", "0.53318024", "0.53252023", "0.5294501", "0.520905", "0.51542103", "0.5085211", "0.50111914", "0.49813786", "0.49554724", "0.49452013", "0.49374416", "0.49374416", "0.49374416", "0.4935546", "0.4932956", "0.49323973", "0.49198627", "0.4919825", "0.4897965", "0.48935372", "0.48883814", "0.4885687" ]
0.5845081
1
Indicate that get_results() should return element IDs from a selected role.
public function return_element_ids( IToolset_Relationship_Role $role ) { $this->result_transformation = new Toolset_Association_Query_Result_Transformation_Element_Id( $role ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function a_role()\n\t{\n\t\tif ($this->params->event == 'pre_get'){\n\t\t\t$this->_get_filtered(TRUE, FALSE);\n\t\t\t\n\t\t\tif (isset($this->params->for_user) && !empty($this->params->for_user)) {\n\t\t\t\t$this->params->where_in['id'] = $this->_get_role($this->params->for_user);\n\t\t\t}\n\t\t}\n\t}", "public function testFindByRoleIdWhichExists()\r\n {\r\n $mockObj = $this->_createMockDataObject();\r\n\r\n $mock = $this->_getInstanceManagerWithMockSoapClient();\r\n\r\n // SOAP client should return a single Role object when\r\n // the specified Role ID exists in D2L\r\n $mock->getSoapClient()->addCallback(\"UserManagement\", \"GetRole\",\r\n function($args) use (&$mockObj) {\r\n $mockObj->RoleId->Id = $args['RoleId']['Id'];\r\n $mockObj->RoleId->Source = $args['RoleId']['Source'];\r\n\r\n $result = new stdClass();\r\n $result->Role = $mockObj;\r\n return $result;\r\n }\r\n );\r\n\r\n $apiRole = new D2LWS_Role_API($mock);\r\n $roleObj = $apiRole->findByID(9999);\r\n\r\n $this->assertEquals(9999, $roleObj->getRoleID());\r\n }", "public function testFindByRoleIdWhichDoesNotExist()\r\n {\r\n $mockObj = $this->_createMockDataObject();\r\n\r\n $mock = $this->_getInstanceManagerWithMockSoapClient();\r\n\r\n // SOAP client should return empty response when D2L\r\n // could not find a role to match the ID specified\r\n $mock->getSoapClient()->addCallback(\"UserManagement\", \"GetRole\",\r\n function($args) use (&$mockObj) {\r\n $result = new stdClass();\r\n return $result;\r\n }\r\n );\r\n\r\n $apiRole = new D2LWS_Role_API($mock);\r\n $roleObj = $apiRole->findByID(9999);\r\n }", "function islandora_workflow_get_users_with_role($rid) {\n $user_ids = array();\n $result = db_query('SELECT uid FROM {users_roles} WHERE rid = %d', $rid);\n while ($row = mysql_fetch_assoc($result)) {\n $user_ids[] = $row['uid'];\n }\n return $user_ids;\n}", "public static function get_ids($include_nologin = false, $include_unapproved = false){\n\n // Redirect this shortcut request to full internal function\n return self::get_role_field_values('role_id', $include_nologin, $include_unapproved);\n\n }", "function get_users_by_role( $role ) {\r\n $wp_user_search = new WP_User_Search( \"\", \"\", $role );\r\n return $wp_user_search->get_results();\r\n }", "public function roleAccess($role_id)\n {\n $menu = $this->db->get('user_menu');\n return $menu->result_array();\n\n //$email = $this->db->get_where('user', ['email' => $email])\n //return $email->row_array();\n //return $this->db->get_where('user', ['email' => $email])->row_array();\n //return $this->db->get_where('user_role', ['id' => $role_id])->row_array();\n \n }", "public function get_roles();", "abstract protected function _getRoleResources($role);", "protected function doGetRoles(): array\n {\n $output = [];\n\n $UserRolesDb = new \\Rdb\\Modules\\RdbAdmin\\Models\\UserRolesDb($this->Container);\n $options = [];\n $options['unlimited'] = true;\n $options['sortOrders'] = [['sort' => 'userrole_priority', 'order' => 'ASC']];\n if (isset($_GET['search']['value']) && !empty(trim($_GET['search']['value']))) {\n $options['search'] = trim($_GET['search']['value']);\n }\n $result = $UserRolesDb->listItems($options);\n unset($options);\n\n $output['draw'] = $this->Input->get('draw', 1, FILTER_SANITIZE_NUMBER_INT);\n $output['recordsTotal'] = ($result['total'] ?? 0);\n $output['recordsFiltered'] = $output['recordsTotal'];\n $output['listItems'] = ($result['items'] ?? []);\n $output['restrictedPriority'] = $UserRolesDb->restrictedPriority;\n\n unset($UserRolesDb);\n\n // populate additional data.\n if (is_array($output['listItems'])) {\n foreach ($output['listItems'] as $row) {\n if (in_array((int) $row->userrole_priority, $output['restrictedPriority'])) {\n $row->restrictedPriority = true;\n } else {\n $row->restrictedPriority = false;\n }\n }// endforeach;\n unset($row);\n }\n\n return $output;\n }", "function get_results( $args ) {\n\t\t\t$results = array();\n\n\t\t\t// Prepare args for quey.\n\t\t\t$args = $this->prepare_args( $args );\n\n\t\t\t// Get result groups.\n\t\t\tif ( ! empty( $args['role__in'] ) ) {\n\t\t\t\t$roles = acf_get_user_role_labels( $args['role__in'] );\n\t\t\t} else {\n\t\t\t\t$roles = acf_get_user_role_labels();\n\t\t\t}\n\n\t\t\t// Return a flat array of results when searching or when queriying one group only.\n\t\t\tif ( $this->is_search || count( $roles ) === 1 ) {\n\n\t\t\t\t// Query users and append to results.\n\t\t\t\t$wp_user_query = new WP_User_Query( $args );\n\t\t\t\t$users = (array) $wp_user_query->get_results();\n\t\t\t\t$total_users = $wp_user_query->get_total();\n\t\t\t\tforeach ( $users as $user ) {\n\t\t\t\t\t$results[] = $this->get_result( $user );\n\t\t\t\t}\n\n\t\t\t\t// Determine if more results exist.\n\t\t\t\t// As this query does not return grouped results, the calculation can be exact (\">\").\n\t\t\t\t$this->more = ( $total_users > count( $users ) + $args['offset'] );\n\n\t\t\t\t// Otherwise, group results via role.\n\t\t\t} else {\n\n\t\t\t\t// Unset args that will interfer with query results.\n\t\t\t\tunset( $args['role__in'], $args['role__not_in'] );\n\n\t\t\t\t// Loop over each role.\n\t\t\t\tforeach ( $roles as $role => $role_label ) {\n\n\t\t\t\t\t// Query users (for this role only).\n\t\t\t\t\t$args['role'] = $role;\n\t\t\t\t\t$wp_user_query = new WP_User_Query( $args );\n\t\t\t\t\t$users = (array) $wp_user_query->get_results();\n\t\t\t\t\t$total_users = $wp_user_query->get_total();\n\n\t\t\t\t\t// acf_log( $args );\n\t\t\t\t\t// acf_log( '- ', count($users) );\n\t\t\t\t\t// acf_log( '- ', $total_users );\n\n\t\t\t\t\t// If users were found for this query...\n\t\t\t\t\tif ( $users ) {\n\n\t\t\t\t\t\t// Append optgroup of results.\n\t\t\t\t\t\t$role_results = array();\n\t\t\t\t\t\tforeach ( $users as $user ) {\n\t\t\t\t\t\t\t$role_results[] = $this->get_result( $user );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$results[] = array(\n\t\t\t\t\t\t\t'text' => $role_label,\n\t\t\t\t\t\t\t'children' => $role_results,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// End loop when enough results have been found.\n\t\t\t\t\t\tif ( count( $users ) === $args['number'] ) {\n\n\t\t\t\t\t\t\t// Determine if more results exist.\n\t\t\t\t\t\t\t// As this query does return grouped results, the calculation is best left fuzzy to avoid querying the next group (\">=\").\n\t\t\t\t\t\t\t$this->more = ( $total_users >= count( $users ) + $args['offset'] );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t// Otherwise, modify the args so that the next query can continue on correctly.\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$args['offset'] = 0;\n\t\t\t\t\t\t\t$args['number'] -= count( $users );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If no users were found (for the current pagination args), but there were users found for previous pages...\n\t\t\t\t\t\t// Modify the args so that the next query is offset slightly less (the number of total users) and can continue on correctly.\n\t\t\t\t\t} elseif ( $total_users ) {\n\t\t\t\t\t\t$args['offset'] -= $total_users;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t// Ignore roles that will never return a result.\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters the query results.\n\t\t\t *\n\t\t\t * @date 21/5/19\n\t\t\t * @since 5.8.1\n\t\t\t *\n\t\t\t * @param array $results The query results.\n\t\t\t * @param array $args The query args.\n\t\t\t * @param ACF_Ajax_Query $query The query object.\n\t\t\t */\n\t\t\treturn apply_filters( 'acf/ajax/query_users/results', $results, $args, $this );\n\t\t}", "function roles_get_all_selectable_roles() {\r\n\treturn roles()->getSelectable();\r\n}", "function webquest_get_participants($webquestid) {\r\n//for a given instance of webquest. Must include every user involved\r\n//in the instance, independient of his role (student, teacher, admin...)\r\n//See other modules as example.\r\n\r\n return false;\r\n}", "public function getResultTag()\n {\n return 'role';\n }", "public function role_ajax(){\n\t\t$tmp_classID\t= $this->pdh->get('member', 'classid', array($this->in->get('requestid')));\n\t\t$mystatus\t\t= $this->pdh->get('calendar_raids_attendees', 'myattendees', array($this->url_id, $this->user->data['user_id']));\n\t\t$myrole\t\t\t= ($mystatus['member_role'] > 0) ? $mystatus['member_role'] : $this->pdh->get('member', 'defaultrole', array($this->in->get('requestid')));\n\t\techo $this->jquery->dd_create_ajax($this->pdh->get('roles', 'memberroles', array($tmp_classID)), array('selected'=>$myrole));exit;\n\t}", "function get_by_id() {\n $id = (isset($_REQUEST['ro_idroles'])) ? $_REQUEST['ro_idroles'] : '';\n $result = $this->app_roles_model->get_by_id($id);\n echo json_encode($result);\n }", "function getStaffRoles()\r\n {\r\n return $this->getRecords(\"SELECT * FROM roles WHERE RoleID NOT IN (1, 2, 9, 11, 6, 7) ORDER BY Title\");\r\n }", "public function getListAccountWithIDRole($id);", "function get_role($id) {\n $id = mysqli_real_escape_string($this->connection, $id); \n return $this->query(\n \"SELECT username, job.name as JobName, kwds.id as kwdsID, job.id as JobID, user_id AS UserID\n FROM kwds, role, job, user\n WHERE user_id=user.id AND job.id=job_id AND kwds.id=kwds_id AND role_id='$id'\"\n );\n }", "public function findrole ()\r\n\t{\r\n\t\t\r\n\t require_once(\"../model/gettersettermodel.php\");\r\n\t $find=new Register();\r\n \t$fetch = $find->findRole();\r\n\t\trequire_once(\"../View/fetchRole.php\");\r\n\t}", "public static function makeCandidateParticipantRoleSelection ( $_participantMemeberID=null, $_participantMemeberTokenID=null) \n {\n\t\t$_qry = Doctrine_Query::create()\n\t\t\t\t->select(self::appendQueryFields())\n\t\t\t\t->from(\"TeamMemberParticipantRole tmMbrPrtRol\") \n\t\t\t\t->innerJoin(\"tmMbrPrtRol.TeamGameParticipation sprtGmPrtn on tmMbrPrtRol.team_game_participation_id = sprtGmPrtn.id \") \n\t\t\t\t->innerJoin(\"tmMbrPrtRol.TeamMemberParticipant tmMbrPrt on tmMbrPrtRol.team_member_participant_id = tmMbrPrt.id \") \n\t\t\t\t->innerJoin(\"tmMbrPrt.Team prtTm on tmMbrPrt.team_id = prtTm.id \") \n\t\t\t\t->innerJoin(\"sprtGmPrtn.GameCategory gmCat on sprtGmPrtn.sport_game_category_id = gmCat.id \") \n\t\t\t\t->innerJoin(\"sprtGmPrtn.SportGame sprtGm on sprtGmPrtn.sport_game_id = sprtGm.id \") \n\t\t\t\t->innerJoin(\"prtTm.Tournament trnmt on prtTm.tournament_id = trnmt.id \") \n\t\t\t\t->innerJoin(\"tmMbrPrt.Person prsn on tmMbrPrt.person_id = prsn.id \") \n\t\t\t\t->innerJoin(\"prtTm.Organization org on prtTm.org_id = org.id \") \n\t\t\t\t->orderBy(\"tmMbrPrt.id DESC\")\n\t\t\t\t->where(\"tmMbrPrt.id IS NOT NULL\");\n\t\t\t\t//if(!is_null($_orgID)) $_qry = $_qry->addWhere(\"prtTm.org_id = ?\", $_orgID);\n\t\t\t\tif(!is_null($_participantMemeberID)) $_qry = $_qry->addWhere(\"tmMbrPrt.id = ? AND tmMbrPrt.token_id = ? \", array($_participantMemeberID, $_participantMemeberTokenID));\n\t\t\t\t\n\t\t\t$_qry = $_qry->execute(array(), Doctrine_Core::HYDRATE_RECORD); \n\n\t\treturn ( count($_qry) <= 0 ? null:$_qry ); \n\t}", "abstract public function getRoles();", "function getRoles();", "public function testAllowRole()\n {\n $this->assertEmpty($this->Authorizer->getData());\n\n $this->Authorizer->action('index', function($auth) {\n $auth->allowRole(1);\n });\n\n $this->assertNotEmpty($this->Authorizer->getData());\n\n $data = $this->Authorizer->getData();\n\n $this->assertTrue(Hash::get($data, \"users.index.roles.1\"));\n $this->assertArrayHasKey(1, Hash::get($data, \"users.index.roles\"));\n $this->assertArrayNotHasKey(2, Hash::get($data, \"users.index.roles\"));\n $this->assertArrayNotHasKey(3, Hash::get($data, \"users.index.roles\"));\n }", "public function testFetchAll()\n {\n $user = new P4Cms_User(\n array(\n 'id' => 'roletester',\n 'fullName' => 'Test Roles',\n 'email' => '[email protected]'\n )\n );\n $user->save();\n\n // add few roles first\n $newRoles = array('Editor', 'Admin', 'Moderator', 'Publisher', 'Writer');\n foreach ($newRoles as $roleId) {\n $role = new P4Cms_Acl_Role;\n $role->setId($roleId)\n ->addUser($user)\n ->save();\n }\n\n $roles = P4Cms_Acl_Role::fetchAll();\n $rolesIds = $roles->invoke('getId');\n\n $this->assertTrue(\n $roles instanceof P4Cms_Model_Iterator,\n \"Expected instance of P4Cms_Model_Iterator.\"\n );\n\n // verify that getRoleId() returns same value as getId()\n foreach ($roles as $role) {\n $this->assertSame(\n $role->getId(),\n $role->getRoleId(),\n \"Expected getRoleId() is same as getId().\"\n );\n }\n\n // verify that all new roles are present in result\n foreach ($newRoles as $roleId) {\n $this->assertTrue(\n in_array($roleId, $rolesIds),\n \"Expected added role $roleId is present\"\n . \" in fetchAll() result.\"\n );\n }\n\n // verify that anonymous virtual role is present in result\n $this->assertTrue(\n in_array(P4Cms_Acl_Role::ROLE_ANONYMOUS, $rolesIds),\n \"Expected anonymous virtual role is present\"\n . \" in fetchAll() result.\"\n );\n\n // do the same with FETCH_HIDE_VIRTUAL option\n $roles = P4Cms_Acl_Role::fetchAll(\n array(P4Cms_Acl_Role::FETCH_HIDE_VIRTUAL => true)\n );\n $rolesIds = $roles->invoke('getId');\n\n // verify that all new roles are present in result\n foreach ($newRoles as $roleId) {\n $this->assertTrue(\n in_array($roleId, $rolesIds),\n \"Expected added role $roleId is present\"\n . \" in fetchAll() result.\"\n );\n }\n\n // verify that anonymous virtual role is not present\n $this->assertFalse(\n in_array(P4Cms_Acl_Role::ROLE_ANONYMOUS, $rolesIds),\n \"Expected anonymous virtual role is not present\"\n . \" in fetchAll() result when FETCH_HIDE_VIRTUAL option was used.\"\n );\n }", "function wl_get_editable_roles($test) {\n\n\t\t$wp_capabilities = array();\n\t\tif (current_user_can('administrator') || current_user_can('manage_roles')) {\n\t\t\t\n\t\t\t$wp_capabilities = wl_getEditableRoleNames();\n\t\t\t\n\t\t\t$result = 'success';\n\t\t\t$message = _(\"Roles loaded.\");\n\t\t}else{\n\t\t\t$result = 'error';\n\t\t\t$message = _(\"You don't have rights to do that\");\n\t\t}\n\t\t\n\t\techo json_encode(array('result'=>$result, 'data'=>$wp_capabilities, 'message' => $message));\n\t\twp_die();\n\t}", "function getAllRoles()\r\n\t{\r\n\t\t$roles_rs = mysql_query(\"SELECT \r\n\t\t\t\t\t\t\t\t\t\t*\r\n\t\t\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\t\t\tacl_junction_user_role\r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\tuser_id ='\". $this->user_id .\"'\r\n\t\t\t\t\t\t\t\t\t\");\r\n\t\t// 2. Putting the results in the Role Array\r\n\t\tif(mysql_num_rows($roles_rs)>0)\r\n\t\t{\r\n\t\t\t$this->user_role_ar = array();\r\n\t\t\twhile($roles_row = mysql_fetch_array($roles_rs))\r\n\t\t\t{\r\n\t\t\t\t$this->user_role_ar[] = $roles_row['role_id'];\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function role_ids() {\n if (! isset($this->_vars['role_ids'])) {\n\n // Get user's roles\n $role_ids = entity::dao('user\\acl\\role')->by_user($this->vars['id']);\n\n // Get user's groups\n if ($group_ids = entity::dao('acl\\group\\user')->by_user($this->vars['id'])) {\n // Get those group's roles\n foreach (entity::dao('acl\\group\\role')->by_acl_group_multi($group_ids) as $group_role_ids) {\n foreach ($group_role_ids as $group_role_id) {\n $role_ids[] = $group_role_id;\n }\n }\n }\n\n $this->_vars['role_ids'] = array_unique($role_ids);\n }\n\n return $this->_vars['role_ids'];\n }", "public function loadRights($role_id){\n\n\t @session_start();\n\t\t$stmt = $this->db->prepare(\"SELECT r.rights_code FROM role_privilege rp LEFT JOIN rights r ON rp.rights_id=r.rights_id WHERE rp.role_id = $role_id\");\n\n\t\t$stmt->execute();\n\n\t\t$result = $stmt->fetchAll();\n\n\t\treturn $result;\n\n\t}", "function checkRoleAdminUsingUserId($varName) {\n $listUsers = array();\n $db = new DB_CONNECT();\n $result = mysql_query(\"SELECT * from user_role where roleId = 1 AND UserId = \" . $varName) or die(mysql_error());\n if (mysql_num_rows($result) > 0) {\n return true;\n }\n return false;\n}" ]
[ "0.61081576", "0.5900434", "0.58938754", "0.58861864", "0.58157444", "0.56192577", "0.5581967", "0.5547985", "0.5512669", "0.54794055", "0.5457761", "0.54315674", "0.54158926", "0.53993064", "0.5386091", "0.538418", "0.53645164", "0.5350662", "0.53390193", "0.5334458", "0.53150123", "0.5305823", "0.5304419", "0.5293594", "0.52804", "0.5279762", "0.5278572", "0.5271027", "0.5270419", "0.52583945" ]
0.61466455
0
Indicate that get_results() should return IToolset_Element instances from a selected role.
public function return_element_instances( IToolset_Relationship_Role $role ) { $this->result_transformation = new Toolset_Association_Query_Result_Transformation_Element_Instance( $role ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResults() {\n $choiceId = $this->SessionData->getChoiceId();\n $currentUserId = $this->Auth->user('id');\n $tool = $this->SessionData->getLtiTool();\n \n $canViewResults = $this->Selections->ChoosingInstances->Choices->ChoicesUsers->canViewResults($choiceId, $currentUserId, $tool);\n if(!$canViewResults) {\n throw new ForbiddenException(__('Not permitted to view Choice results.'));\n }\n \n //Get the choosing instance\n $choosingInstance = $this->Selections->ChoosingInstances->findByChoiceId($choiceId, true)->first()->toArray();\n \n //Get the selections\n list($options, $optionIndexesById, $selections, $selectionIndexesById, $statistics) = $this->Selections->getForResults($choosingInstance);\n \n //pr($optionsSelectedCounts);\n //pr($selections);\n //pr($options);\n \n $this->set(compact('choosingInstance', 'options', 'optionIndexesById', 'selections', 'selectionIndexesById'));\n $this->set('_serialize', ['choosingInstance', 'options', 'optionIndexesById', 'selections', 'selectionIndexesById']);\n }", "public function return_element_ids( IToolset_Relationship_Role $role ) {\n\t\t$this->result_transformation = new Toolset_Association_Query_Result_Transformation_Element_Id( $role );\n\t\treturn $this;\n\t}", "private function _getSelectResult() {\n $items = $this->body->SelectResult->Item();\n\n if ( $items ) {\n foreach ( $items as $item ) {\n $this->_items[(string)$item->Name] = $this->_getObject($item->Attribute);\n }\n }\n }", "function roles_get_all_selectable_roles() {\r\n\treturn roles()->getSelectable();\r\n}", "public function getResultTag()\n {\n return 'role';\n }", "abstract protected function _getRoleResources($role);", "public function getResultsList(){\n return $this->_get(2);\n }", "public function getResultsList(){\n return $this->_get(2);\n }", "public function getResultsList(){\n return $this->_get(2);\n }", "public function findrole ()\r\n\t{\r\n\t\t\r\n\t require_once(\"../model/gettersettermodel.php\");\r\n\t $find=new Register();\r\n \t$fetch = $find->findRole();\r\n\t\trequire_once(\"../View/fetchRole.php\");\r\n\t}", "public function has_available_elements() {\n\t\t$conditions = array();\n\n\t\tforeach( Toolset_Relationship_Role::parent_child() as $role ) {\n\t\t\t$conditions[] = $this->element_status(\n\t\t\t\tToolset_Association_Query_Condition_Element_Status::STATUS_AVAILABLE,\n\t\t\t\t$role\n\t\t\t);\n\t\t}\n\n\t\treturn $this->do_and( $conditions );\n\t}", "public function getTestCaseResults(): array;", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }", "public function getResults()\n {\n return parent::getResults();\n }" ]
[ "0.57096314", "0.5337535", "0.532857", "0.5184033", "0.5175342", "0.51698947", "0.5110143", "0.5110143", "0.5110143", "0.50057733", "0.500131", "0.49826807", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187", "0.49747187" ]
0.5738613
0
Indicate that no result ordering is needed.
public function dont_order() { $this->orderby = $this->orderby_factory->nothing(); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requireInternalSorting()\r\n {\r\n return !$this->_isSorted;\r\n }", "static function defaultSort() { return 'failcount' ; }", "public function seeEmptyResult()\n {\n \\PHPUnit_Framework_Assert::assertEmpty($this->last_result);\n }", "public function output_no_results() {\n\t\tget_job_manager_template( 'content-no-jobs-found.php' );\n\t}", "function test_incomplete_order_parameters_in_view(){\n\t\tself::clear_get_values();\n\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 1;\n\n\t\tself::remove_view_order( $dynamic_view );\n\n\t\t// Only order - should be ignored completely\n\t\t$extra_atts = array( 'order_by' => '', 'order' => 'DESC' );\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Jamie', 'frm_pagination_cont' ), array( 'Steve', 'Steph' ), $extra_atts );\n\t\tself::run_get_display_data_tests( $d, 'view with no order_by and order=DESC' );\n\t}", "public function isOrdered()\n {\n return (null !== $this->orderBy);\n }", "public function testQuerySelectOrderByWithoutDirection()\n {\n $sql = 'SELECT * FROM \"table\" ORDER BY \"id\" ASC';\n $select = (new Select($this->mockConnection))->from('table')->orderBy('id');\n $this->assertEquals($sql, $select->toSql());\n }", "public function noop() {\n\t\t$ch = $this->curl();\n\t\t$this->setParams($ch, $this->getBasicParams(\"noop\"));\n\t\treturn $this->getResult($ch);\n }", "function test_incomplete_order_parameters_in_view_2(){\n\t\tself::clear_get_values();\n\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 1;\n\n\t\tself::remove_view_order( $dynamic_view );\n\n\t\t// Only order_by - should automatically set order to ASC if this is the case\n\t\t$extra_atts = array( 'order_by' => 'id', 'order' => '' );\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Steve', 'frm_pagination_cont' ), array( 'Jamie', 'Steph' ), $extra_atts );\n\t\tself::run_get_display_data_tests( $d, 'view with order_by=id and no order' );\n\t}", "public function setNoOrders()\r\n\t{\r\n\t\t$this->_send_orders = false;\r\n\t}", "public function test_Valid_EmptyTrip(): void\r\n {\r\n\t\t$sorter = new TripSorter();\r\n\t\t$results = $sorter->sort([]);\r\n\r\n\t\t$this->assertEquals([], iterator_to_array($results, $use_keys = false), \"Incorrect results\");\r\n\t\t$this->assertEquals(\"\", $results->printSummary(), \"Incorrect trip summary\");\r\n }", "public function no_items();", "public function testFetchEmpty()\n {\n $this->skip('abstract method');\n }", "function testNoRows() {\n\t\t// return a proper false response\n\t\t$good = $this->loader->init('users', $this->userColumns);\n\t\t$this->assertTrue($good);\n\t\t\n\t\t$numberAdded = $this->loader->commit($this->pdo());\n\t\t$this->assertEquals(-1, $numberAdded);\n\t}", "private function resetResults(): void\n {\n $this->results = [\n 'published' => [],\n 'skipped' => [],\n ];\n }", "public function setDefaultOrder()\n\t{\n\t\t$this->getSelect()->reset(Zend_Db_Select::ORDER);\n\t\treturn $this->setOrder('history_id', 'DESC');\n\t}", "function checkDocSort($result)\n {\n\n if (!empty($this->bloxconfig['IDs']) && empty($this->bloxconfig['orderBy'])) {\n $rows = array();\n foreach ($result as $row) {\n $rows[$row['id']] = $row;\n\n }\n $ids = explode(',', $this->bloxconfig['IDs']);\n $result = array();\n foreach ($ids as $id) {\n $result[] = $rows[$id];\n }\n }\n\n return $result;\n }", "function getOrder()\n {\n return 0;\n }", "function getOrder()\n {\n return 0;\n }", "private function noResult(){\t\t\t\n\t\t\treturn 'Nenhum resultado encontrado.';\n\t}", "public function isOrdered()\n {\n \t\n }", "public function testWithoutMode()\n {\n $filter = new Sort();\n $filter->setChoices(\n [\n 'default' => [\n 'label' => 'default sorting',\n 'field' => 'name',\n 'order' => 'asc',\n 'default' => true,\n ],\n ]\n );\n $filter->setRequestField('sort');\n\n $state = new FilterState();\n $state->setActive(true);\n $state->setValue('default');\n\n $modifiedSearch = new Search();\n $filter->modifySearch($modifiedSearch, $state, new SearchRequest(['sort' => 'default']));\n\n $documentIterator = $this\n ->getMockBuilder('ONGR\\ElasticsearchBundle\\Result\\DocumentIterator')\n ->disableOriginalConstructor()\n ->getMock();\n\n $viewData = $this\n ->getMockBuilder('ONGR\\FilterManagerBundle\\Filter\\ViewData')\n ->setMethods(['getState', 'addChoice'])\n ->disableOriginalConstructor()\n ->getMock();\n\n $viewData\n ->expects($this->any())\n ->method('getState')\n ->willReturn($state);\n\n\n $filter->getViewData($documentIterator, $viewData);\n }", "public function neverReturned($result)\n {\n a::assertNotContains($result, $this->values, \"{$this->signature} never returned the expected result\");\n }", "public function getOptOutDisplayOrder()\n\t{\n\t\treturn 0;\n\t}", "protected function orderResults()\n {\n $this->setSortParameters();\n\n if (isset($this->sortBy)) {\n // Remove any orders from the query and order by the selected column\n $this->store->refreshOrderBy();\n\n $column = $this->columns[$this->sortBy];\n\n // Check if the column has a custom sort\n if ($column->hasSort()) {\n $callback = $column->getSort();\n\n $callback($this->store, $column->isDescending());\n } else {\n if (isset($this->sortDir)) {\n $this->store->orderBy($this->sortBy, $this->sortDir);\n } else {\n $this->store->orderBy($this->sortBy, 'asc');\n }\n }\n }\n }", "public function no_items()\n {\n }", "function getOrder() {\r\n return 1;\r\n }", "public function removeSort()\n {\n $this->order = \"\";\n $this->sort = \"\";\n }", "public function testQuerySelectOrderByWithNullDirection()\n {\n $sql = 'SELECT * FROM \"table\" ORDER BY \"id\"';\n $select = (new Select($this->mockConnection))->from('table')->orderBy('id', null);\n $this->assertEquals($sql, $select->toSql());\n }", "function getOrder()\n {\n return 1;\n }" ]
[ "0.5995188", "0.5809251", "0.5558876", "0.54674745", "0.5442929", "0.53906035", "0.5370166", "0.53539085", "0.5346625", "0.53189164", "0.53064585", "0.530507", "0.5302346", "0.52984303", "0.52680176", "0.5233763", "0.52308357", "0.5230218", "0.5230218", "0.52285993", "0.52274394", "0.520693", "0.52032083", "0.5200559", "0.5191902", "0.513721", "0.51336944", "0.5129782", "0.51149315", "0.50873905" ]
0.59367615
1
Order results by a title of element of given role. Note that ordering by intermediary posts will cause the associations without those to be excluded from results.
public function order_by_title( IToolset_Relationship_Role $for_role ) { $this->orderby = $this->orderby_factory->title( $for_role, $this->join_manager ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ak_order_by_post_title( $query ){\n\t\t// Check if page is category page\n\t\tif ( $query->is_category() ){\n\t\t\t// Order by title and ascending\n\t\t\t$query->set( 'orderby', 'title' );\n\t\t\t$query->set( 'order', 'asc' );\n\t\t}\n\t}", "function sort_pois() {\n\t\tusort($this->pois, array(__CLASS__, 'compare_title'));\n\t\tdo_action('mappress_sort_pois', $this);\n\t}", "public function testSearchPostTitleOrderbyQuery() {\n\t\tep_create_and_sync_post( array( 'post_title' => 'ordertest 333' ) );\n\t\tep_create_and_sync_post( array( 'post_title' => 'ordertest 111' ) );\n\t\tep_create_and_sync_post( array( 'post_title' => 'ordertest 222' ) );\n\n\t\tep_refresh_index();\n\n\t\t$args = array(\n\t\t\t's' => 'ordertest',\n\t\t\t'orderby' => 'title',\n\t\t\t'order' => 'DESC',\n\t\t);\n\n\t\t$query = new WP_Query( $args );\n\n\t\t$this->assertEquals( 3, $query->post_count );\n\t\t$this->assertEquals( 3, $query->found_posts );\n\t\t$this->assertEquals( 'ordertest 333', $query->posts[0]->post_title );\n\t\t$this->assertEquals( 'ordertest 222', $query->posts[1]->post_title );\n\t\t$this->assertEquals( 'ordertest 111', $query->posts[2]->post_title );\n\t}", "public function order( $query )\n { \n return $query->orderByTitleDesc();\n }", "public function test_get_memberships_ordered_by_title() {\n\t\twp_set_current_user( $this->user_allowed );\n\n\t\t// create 3 memberships.\n\t\t$memberships = $this->factory->membership->create_many( 3, array() );\n\n\t\t$membership_first = new LLMS_Membership( $memberships[0] );\n\t\t$membership_first->set( 'title', 'Membership B' );\n\t\t$membership_second = new LLMS_Membership( $memberships[1] );\n\t\t$membership_second->set( 'title', 'Membership A' );\n\t\t$membership_second = new LLMS_Membership( $memberships[2] );\n\t\t$membership_second->set( 'title', 'Membership C' );\n\n\t\t$request = new WP_REST_Request( 'GET', $this->route );\n\t\t$request->set_param( 'orderby', 'title' ); // default is id.\n\n\t\t$response = $this->server->dispatch( $request );\n\n\t\t$response_data = $response->get_data();\n\n\t\t// Check retrieved memberships are ordered by title asc.\n\t\t$this->assertEquals( 'Membership A', $response_data[0]['title']['rendered'] );\n\t\t$this->assertEquals( 'Membership B', $response_data[1]['title']['rendered'] );\n\t\t$this->assertEquals( 'Membership C', $response_data[2]['title']['rendered'] );\n\t}", "public function order_by_rating($args) {\n global $wpdb;\n\n $args['fields'] .= \", AVG( $wpdb->commentmeta.meta_value ) as average_rating \";\n $args['where'] .= \" AND ( $wpdb->commentmeta.meta_key = 'rating' OR $wpdb->commentmeta.meta_key IS null ) \";\n $args['join'] .= \"\n LEFT OUTER JOIN $wpdb->comments ON($wpdb->posts.ID = $wpdb->comments.comment_post_ID)\n LEFT JOIN $wpdb->commentmeta ON($wpdb->comments.comment_ID = $wpdb->commentmeta.comment_id)\n \";\n $args['orderby'] = \"average_rating DESC, $wpdb->posts.post_date DESC\";\n $args['groupby'] = \"$wpdb->posts.ID\";\n remove_filter('posts_clauses', array($this, 'order_by_rating'), 10, 1);\n return $args;\n }", "public static function search_posts_orderby( $orderby, $query ) {\n\t\tglobal $wpdb;\n\n\t\tif ( $query->is_main_query() && is_search() && ! $query->get( 'exact' ) ) {\n\n\t\t\t$search_order_by_title = $query->get( 'search_orderby_title' );\n\n\t\t\t// Check if search_orderby_title is set by WP_Query::parse_search.\n\t\t\tif ( is_array( $search_order_by_title ) && $search_order_by_title ) {\n\n\t\t\t\t// Get search orderby query.\n\t\t\t\t$orderby = self::parse_search_order( $query->query_vars );\n\n\t\t\t\t// Add order by title length.\n\t\t\t\t$orderby .= \" , CHAR_LENGTH( $wpdb->posts.post_title ) ASC, $wpdb->posts.post_title ASC\";\n\t\t\t}\n\t\t}\n\n\t\treturn $orderby;\n\t}", "function cmp($a, $b)\n{\n\treturn strcmp($a[\"Title\"], $b[\"Title\"]);\n}", "function coauthor_sort( $orderby, $query_vars, $taxonomies ) {\n\tif ( ! empty( $query_vars['object_ids'] ) && ( 0 < count( $taxonomies ) ) ) {\n\t\t$orderby = 'tr.term_order';\n\t}\n\n\treturn $orderby;\n}", "function default_wiki_entries_orderby( $query ) {\n\n // Be sure that we are on the Backend\n if( ! is_admin() || ! $query->is_main_query() || $query->query_vars['post_type'] !== 'wp_pedia_term' )\n return;\n \n // Orderby should not be manually modified\n if ( $query->get('orderby') == '' ) {\n\n $query->set( 'orderby', 'title' );\n $query->set( 'order', 'asc' );\n\n }\n\n }", "public function testSearchPostNameOrderbyQuery() {\n\t\tep_create_and_sync_post( array( 'post_title' => 'postname-ordertest-333' ) );\n\t\tep_create_and_sync_post( array( 'post_title' => 'postname-ordertest-111' ) );\n\t\tep_create_and_sync_post( array( 'post_title' => 'postname-ordertest-222' ) );\n\n\n\t\tep_refresh_index();\n\n\t\t$args = array(\n\t\t\t's' => 'postname ordertest',\n\t\t\t'orderby' => 'name',\n\t\t\t'order' => 'ASC',\n\t\t);\n\n\t\t$query = new WP_Query( $args );\n\n\t\t$this->assertEquals( 3, $query->post_count );\n\t\t$this->assertEquals( 3, $query->found_posts );\n\t\t$this->assertEquals( 'postname-ordertest-111', $query->posts[0]->post_name );\n\t\t$this->assertEquals( 'postname-ordertest-222', $query->posts[1]->post_name );\n\t\t$this->assertEquals( 'postname-ordertest-333', $query->posts[2]->post_name );\n\t}", "function sortTestimonials($a, $b)\n{\n return strcmp($a->siteTestimonialId, $b->siteTestimonialId);\n}", "function wporg_archive_orderby( $orderby, $query ) {\n\tglobal $wpdb;\n\n\tif ( is_admin() ) {\n\t\treturn $orderby;\n\t}\n\n\t// Group courses by their category\n\tif ( $query->is_main_query() && $query->is_post_type_archive( 'course' ) ) {\n\t\t$orderby = $wpdb->term_relationships . '.term_taxonomy_id DESC, ' . $orderby;\n\t}\n\n\treturn $orderby;\n}", "public function sortASC() {\n $this->addOrder('e.EventDate', 'ASC');\n }", "private static function sortCompareByTitle($obj1, $obj2) {\n return self::sortCompareByAttr($obj1, $obj2, 'title');\n }", "public function test_get_memberships_ordered_by_title_descending() {\n\t\twp_set_current_user( $this->user_allowed );\n\n\t\t// create 3 memberships.\n\t\t$memberships = $this->factory->membership->create_many( 3, array() );\n\n\t\t$membership_first = new LLMS_Membership( $memberships[0] );\n\t\t$membership_first->set( 'title', 'Membership B' );\n\t\t$membership_second = new LLMS_Membership( $memberships[1] );\n\t\t$membership_second->set( 'title', 'Membership A' );\n\t\t$membership_second = new LLMS_Membership( $memberships[2] );\n\t\t$membership_second->set( 'title', 'Membership C' );\n\n\t\t$request = new WP_REST_Request( 'GET', $this->route );\n\t\t$request->set_param( 'orderby', 'title' ); // default is id.\n\t\t$request->set_param( 'order', 'desc' ); // default is 'asc'.\n\n\t\t$response = $this->server->dispatch( $request );\n\t\t$response_data = $response->get_data();\n\n\t\t// Check retrieved memberships are ordered by title desc.\n\t\t$this->assertEquals( 'Membership C', $response_data[0]['title']['rendered'] );\n\t\t$this->assertEquals( 'Membership B', $response_data[1]['title']['rendered'] );\n\t\t$this->assertEquals( 'Membership A', $response_data[2]['title']['rendered'] );\n\t}", "public function title()\n\t{\n\t\t$titleFields = $this->getTable()->getFieldsByRole('title');\n\t\tif(!@count($titleFields)) return $this;\n\t\t\n\t\t\n\t\tforeach($titleFields as $fieldName => $field)\n\t\t{\n\t\t\tif(isset($field['refTableClass']))\n\t\t\t{\n\t\t\t\t$this->setIntegrityCheck(false);\n\t\t\t $joinModel = new $field['refTableClass'];\n\t\t\t $refTableFields = is_array($field['refTableTitleFields']) ? $field['refTableTitleFields'] : array();\n\t\t\t\t\n\t\t\t $this->joinLeft($joinModel->info('name'), \"`{$joinModel->info('name')}`.`{$joinModel->getPrimary()}` = `{$this->info('name')}`.`{$fieldName}`\", $refTableFields);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $this;\n\t\t\n\t}", "function usort_reorder($a,$b){\r\n $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'blog_title'; //If no sort, default to title\r\n $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc\r\n $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order\r\n return ($order==='asc') ? $result : -$result; //Send final sort direction to usort\r\n }", "function maybe_orderby() {\n\t\t$this->validate_orderby_order();\n\n\t\tforeach ( (array) $this->orderby as $priority => $orderby ) {\n\t\t\tswitch ( $orderby ) {\n\t\t\t\tcase 'date':\n\t\t\t\t\t$mod = new \\SearchWP\\Mod();\n\n\t\t\t\t\t$mod->raw_join_sql( function( $runtime ) {\n\t\t\t\t\t\tglobal $wpdb;\n\n\t\t\t\t\t\treturn \"LEFT JOIN {$wpdb->posts} swpqueryorder ON (swpqueryorder.ID = {$runtime->get_foreign_alias()}.id)\";\n\t\t\t\t\t} );\n\n\t\t\t\t\t$mod->order_by( 'swpqueryorder.post_date', $this->order[ $priority ], $priority + 1 );\n\n\t\t\t\t\t$this->mods[] = $mod;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'rand':\n\t\t\t\tcase 'random':\n\t\t\t\t\t$mod = new \\SearchWP\\Mod();\n\t\t\t\t\t$mod->order_by( 'random', $priority );\n\n\t\t\t\t\t$this->mods[] = $mod;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'relevance':\n\t\t\t\t\t// By default there is already a relevance Mod in place at priority 10.\n\t\t\t\t\t// $mod = new \\SearchWP\\Mod();\n\t\t\t\t\t// $mod->order_by( 'relevance', $this->order[ $priority ], $priority + 1 );\n\n\t\t\t\t\t// $this->mods[] = $mod;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'title':\n\t\t\t\t\t$mod = new \\SearchWP\\Mod();\n\n\t\t\t\t\t$mod->raw_join_sql( function( $runtime ) {\n\t\t\t\t\t\tglobal $wpdb;\n\n\t\t\t\t\t\treturn \"LEFT JOIN {$wpdb->posts} swpqueryorder ON (swpqueryorder.ID = {$runtime->get_foreign_alias()}.id)\";\n\t\t\t\t\t} );\n\n\t\t\t\t\t$mod->order_by( 'swpqueryorder.post_title', $this->order[ $priority ], $priority + 1 );\n\n\t\t\t\t\t$this->mods[] = $mod;\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function testOrmOrderBy()\n {\n $eventsModel = new IdiormDbal('events');\n\n $eventsModel->orderBy('title', 'asc');\n\n $events = $eventsModel->get();\n\n $this->assertEquals('Art', $events[0]['title']);\n\n $this->assertEquals('Music', $events[count($events) - 1]['title']);\n }", "public function orderByDisplayName() {\n \t\n }", "public static function parse_search_order( $q ) {\n\t\tglobal $wpdb;\n\n\t\tif ( $q['search_terms_count'] > 1 ) {\n\t\t\t$num_terms = count( $q['search_orderby_title'] );\n\n\t\t\t// If the search terms contain negative queries, don't bother ordering by sentence matches.\n\t\t\t$like = $_like = '';\n\t\t\tif ( ! preg_match( '/(?:\\s|^)\\-/', $q['s'] ) ) {\n\t\t\t\t$like = '%' . $wpdb->esc_like( $q['s'] ) . '%';\n\t\t\t}\n\n\t\t\t$search_orderby = '';\n\n\t\t\t// Sentence match in 'post_title'.\n\t\t\tif ( $like ) {\n\t\t\t\t$search_orderby .= $wpdb->prepare( \"WHEN $wpdb->posts.post_title LIKE %s THEN 1 \", $like );\n\t\t\t\t$_like = str_replace( '-', '_', sanitize_title_with_dashes( $q['s'] ) );\n\t\t\t\t$_like = '%' . $wpdb->esc_like( $_like ) . '%';\n\t\t\t\tif ( $_like !== $like ) {\n\t\t\t\t\t// Sentence match in 'post_title' with spaces replaced with underscores.\n\t\t\t\t\t$search_orderby .= $wpdb->prepare( \"WHEN $wpdb->posts.post_title LIKE %s THEN 2 \", $_like );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Sanity limit, sort as sentence when more than 6 terms.\n\t\t\t// (few searches are longer than 6 terms and most titles are not)\n\t\t\tif ( $num_terms < 7 ) {\n\t\t\t\t// all words in title\n\t\t\t\t$search_orderby .= 'WHEN ' . implode( ' AND ', $q['search_orderby_title'] ) . ' THEN 3 ';\n\t\t\t\t// any word in title, not needed when $num_terms == 1\n\t\t\t\tif ( $num_terms > 1 )\n\t\t\t\t\t$search_orderby .= 'WHEN ' . implode( ' OR ', $q['search_orderby_title'] ) . ' THEN 4 ';\n\t\t\t}\n\n\t\t\t// Sentence match in 'post_content'.\n\t\t\tif ( $like ) {\n\t\t\t\t$search_orderby .= $wpdb->prepare( \"WHEN $wpdb->posts.post_content LIKE %s THEN 5 \", $like );\n\t\t\t}\n\n\t\t\tif ( $search_orderby ) {\n\t\t\t\t$search_orderby = '(CASE ' . $search_orderby . 'ELSE 6 END)';\n\t\t\t}\n\t\t} else {\n\t\t\t// Single word or sentence search.\n\t\t\t$search_orderby = reset( $q['search_orderby_title'] ) . ' DESC';\n\t\t}\n\n\t\treturn $search_orderby;\n\t}", "function posts_orderby_lastname ($orderby_statement) \n{\n $orderby_statement = \"RIGHT(post_title, LOCATE(' ', REVERSE(post_title)) - 1) ASC\";\n return $orderby_statement;\n}", "public function getMovieOrdering()\n\t{\n\t\treturn array('title_asc', 'title_desc', 'year_asc', 'year_desc', 'rating_asc', 'rating_desc');\n\t}", "function sortByMultilingual($dbresult, $field, $descending) {\n\t$temp = array();\n\tforeach ($dbresult as $key=>$row) {\n\t\t$temp[$key] = get_language_string($row[$field]);\n\t}\n\tnatcasesort($temp);\n\t$result = array();\n\tforeach ($temp as $key=>$title) {\n\t\tif ($descending) {\n\t\t\tarray_unshift($result, $dbresult[$key]);\n\t\t} else {\n\t\t\t$result[] = $dbresult[$key];\n\t\t}\n\t}\n\treturn $result;\n}", "protected function orderResults()\n {\n $this->setSortParameters();\n\n if (isset($this->sortBy)) {\n // Remove any orders from the query and order by the selected column\n $this->store->refreshOrderBy();\n\n $column = $this->columns[$this->sortBy];\n\n // Check if the column has a custom sort\n if ($column->hasSort()) {\n $callback = $column->getSort();\n\n $callback($this->store, $column->isDescending());\n } else {\n if (isset($this->sortDir)) {\n $this->store->orderBy($this->sortBy, $this->sortDir);\n } else {\n $this->store->orderBy($this->sortBy, 'asc');\n }\n }\n }\n }", "public function default_sorting_based_on_model_fields(): void\n {\n $request = $this->makeRequestWithSort(\n [\n ['field' => 'title'],\n ]\n );\n\n $postA = factory(Post::class)->create(['title' => 'post A']);\n $postB = factory(Post::class)->create(['title' => 'post B']);\n $postC = factory(Post::class)->create(['title' => 'post C']);\n\n $query = Post::query();\n\n $queryBuilder = new QueryBuilder(\n Post::class,\n new ParamsValidator([], [], ['title']),\n new RelationsResolver([], []),\n new SearchBuilder([])\n );\n $queryBuilder->applySortingToQuery($query, $request);\n\n $posts = $query->get();\n\n $this->assertEquals($postA->id, $posts[0]->id);\n $this->assertEquals($postB->id, $posts[1]->id);\n $this->assertEquals($postC->id, $posts[2]->id);\n }", "public function order_result( $result, Entities\\Collection $collection, $include_disabled = false ) {\n\t\t$order = $collection->get_metadata_order();\n\t\tif ( $order ) {\n\t\t\t$order = ( is_array( $order ) ) ? $order : unserialize( $order );\n\n\t\t\tif ( is_array( $result ) ) {\n\t\t\t\t$result_ordinate = [];\n\t\t\t\t$not_ordinate = [];\n\n\t\t\t\tforeach ( $result as $item ) {\n\t\t\t\t\t$id = $item->WP_Post->ID;\n\t\t\t\t\t$index = array_search( $id, array_column( $order, 'id' ) );\n\n\t\t\t\t\tif ( $index !== false ) {\n\n\t\t\t\t\t\t// skipping metadata disabled if the arg is set\n\t\t\t\t\t\tif ( ! $include_disabled && isset( $order[ $index ]['enabled'] ) && ! $order[ $index ]['enabled'] ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$enable = ( isset( $order[ $index ]['enabled'] ) ) ? $order[ $index ]['enabled'] : true;\n\t\t\t\t\t\t$item->set_enabled_for_collection( $enable );\n\n\t\t\t\t\t\t$result_ordinate[ $index ] = $item;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$not_ordinate[] = $item;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tksort( $result_ordinate );\n\t\t\t\t$result_ordinate = array_merge( $result_ordinate, $not_ordinate );\n\n\t\t\t\treturn $result_ordinate;\n\t\t\t} // if the result is a wp query object\n\t\t\telse {\n\t\t\t\t$posts = $result->posts;\n\t\t\t\t$result_ordinate = [];\n\t\t\t\t$not_ordinate = [];\n\n\t\t\t\tforeach ( $posts as $item ) {\n\t\t\t\t\t$id = $item->ID;\n\t\t\t\t\t$index = array_search( $id, array_column( $order, 'id' ) );\n\n\t\t\t\t\tif ( $index !== false ) {\n\t\t\t\t\t\t$result_ordinate[ $index ] = $item;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$not_ordinate[] = $item;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tksort( $result_ordinate );\n\t\t\t\t$result->posts = $result_ordinate;\n\t\t\t\t$result->posts = array_merge( $result->posts, $not_ordinate );\n\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public function posts_orderby( $orderby, $query ) {\r\n\t\t// is it sorted by post views?\r\n\t\tif ( ( isset( $query->pvc_orderby ) && $query->pvc_orderby ) ) {\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\t$order = $query->get( 'order' );\r\n\t\t\t$orderby = ( ! isset( $query->query['views_query']['hide_empty'] ) || $query->query['views_query']['hide_empty'] === true ? 'post_views' : 'pvc.count' ) . ' ' . $order . ', ' . $wpdb->prefix . 'posts.ID ' . $order;\r\n\t\t}\r\n\r\n\t\treturn $orderby;\r\n\t}", "function am_woocommerce_catalog_orderby( $args ) {\n\t$args['meta_key'] = '';\n\t$args['orderby'] = 'date';\n\t$args['order'] = 'asc';\n return $args;\n}" ]
[ "0.5833786", "0.5580913", "0.5409731", "0.5059296", "0.5056495", "0.5052017", "0.50352335", "0.49832454", "0.49524295", "0.49391812", "0.48804557", "0.48075724", "0.47938192", "0.4784702", "0.47782183", "0.47739106", "0.46974117", "0.46699744", "0.46602318", "0.464967", "0.46484697", "0.46216568", "0.4610276", "0.44752082", "0.44661364", "0.44371608", "0.44341156", "0.44338635", "0.4404301", "0.4374145" ]
0.637297
0
Order results by a value of a certain custom field on a selected element role.
public function order_by_field_value( Toolset_Field_Definition $field_definition, IToolset_Relationship_Role $for_role ) { switch( $field_definition->get_domain() ) { case Toolset_Element_Domain::POSTS: $cast_to_numeric = $field_definition->get_type() instanceof Toolset_Field_Type_Definition_Numeric ? 'SIGNED' : null; $this->orderby = $this->orderby_factory->postmeta( $field_definition->get_meta_key(), $for_role, $this->join_manager, $cast_to_numeric ); break; default: throw new RuntimeException( 'Element domain not supported.' ); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function order($field, $order = 'asc');", "public function addSortField($field, $order = SolrQuery::ORDER_DESC) {}", "function idies_custom_columns_column_orderby( $query ) {\n\t \n\t\t$orderby = $query->get( 'orderby');\n\t \n\t\tif( 'reviewer' == $orderby ) {\n\t\t\t$query->set('meta_key','idies_update_reviewer');\n\t\t\t$query->set('orderby','meta_value');\n\t\t}\n\t \n\t\tif( 'update_status' == $orderby ) {\n\t\t\t$query->set('meta_key','idies_update_status');\n\t\t\t$query->set('orderby','meta_value');\n\t\t}\n\t}", "function click_sort($order) {\n $this->query->query->propertyOrderBy($this->real_field, $order);\n }", "public function addGroupSortField($field, $order) {}", "function orderBy($team_data, $field){\n $code = \"return strnatcmp(\\$a['$field'], \\$b['$field']);\";\n usort($team_data, create_function('$a,$b', $code));\n return $team_data;\n }", "public function orderFieldName();", "public function addExpandSortField($field, $order) {}", "public function user_column_orderby( $query ) {\n\t\n\t\tif( 'WP_User_Query' != get_class( $query ) )\n\t\t\treturn $query;\n\t\n\t\t$vars = $query->query_vars;\n\t\n\t\t//echo '<pre>'; var_dump( get_class( $query ) ); echo '</pre>'; exit; //Debug\n\t\n\t\tif ( !isset( $vars['orderby'] ) || 'has_mp_account' != $vars['orderby'] )\n\t\t\treturn $query;\n\t\n\t\t/** We store a different mp_user_id for production and sandbox environments **/\n\t\t$umeta_key = 'mp_user_id';\n\t\tif( !$this->mp->is_production() )\n\t\t\t$umeta_key .= '_sandbox';\n\t\n\t\tglobal $wpdb;\n\t\t$query->query_from .= \" LEFT JOIN $wpdb->usermeta m ON ($wpdb->users.ID = m.user_id AND m.meta_key = '$umeta_key')\";\n\t\t$query->query_orderby = \"ORDER BY m.meta_value \".$vars['order'];\n\t\n\t\treturn $query;\n\t}", "function addSortOrder($field, $direction=\"ASC\")\r\n\t{\r\n\t\t$this->m_orderby[$field] = $direction;\r\n\t}", "function order($field, $asc = true) {\n\t\t$this->_order[] = $field;\n\t\t$this->_order[] = $asc;\n\t}", "protected function orderResults()\n {\n $this->setSortParameters();\n\n if (isset($this->sortBy)) {\n // Remove any orders from the query and order by the selected column\n $this->store->refreshOrderBy();\n\n $column = $this->columns[$this->sortBy];\n\n // Check if the column has a custom sort\n if ($column->hasSort()) {\n $callback = $column->getSort();\n\n $callback($this->store, $column->isDescending());\n } else {\n if (isset($this->sortDir)) {\n $this->store->orderBy($this->sortBy, $this->sortDir);\n } else {\n $this->store->orderBy($this->sortBy, 'asc');\n }\n }\n }\n }", "function hs_column_orderby($orderby, $wp_query) {\n\t\tglobal $wpdb;\n\t \n\t\t$wp_query->query = wp_parse_args($wp_query->query);\n // Sort Impressions\n\t\tif ( 'impressions' == @$wp_query->query['orderby'] )\n\t\t\t$orderby = \"(SELECT CAST(meta_value as decimal) FROM $wpdb->postmeta WHERE post_id = $wpdb->posts.ID AND meta_key = 'hs_impressions') \" . $wp_query->get('order');\n\n // Sort Clicks\n\t\tif ( 'clicks' == @$wp_query->query['orderby'] )\n\t\t\t$orderby = \"(SELECT CAST(meta_value as decimal) FROM $wpdb->postmeta WHERE post_id = $wpdb->posts.ID AND meta_key = 'hs_clicks') \" . $wp_query->get('order');\n\n // Sort CTR\n if ( 'ctr' == @$wp_query->query['orderby'] )\n $orderby = \"((SELECT CAST(meta_value as decimal) FROM $wpdb->postmeta WHERE post_id = $wpdb->posts.ID AND meta_key = 'hs_clicks')/(SELECT CAST(meta_value as decimal) FROM $wpdb->postmeta WHERE post_id = $wpdb->posts.ID AND meta_key = 'hs_impressions')) \" . $wp_query->get('order');\n\n //echo $orderby;\n\t\treturn $orderby;\n \n\t}", "function test_field_id_asc_with_order_param(){\n\t\tself::clear_get_values();\n\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 1;\n\n\t\tself::remove_view_order( $dynamic_view );\n\t\t$order_row = array(\n\t\t\t'type' => 'field',\n\t\t\t'col' => '493ito',\n\t\t\t'dir' => 'ASC',\n\t\t);\n\t\tself::add_order_to_view( $dynamic_view, $order_row );\n\n\t\t// Add order param, should override order in View\n\t\t$extra_atts = array( 'order_by' => 'id', 'order' => 'DESC' );\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Steve', 'frm_pagination_cont' ), array( 'Jamie', 'Steph' ), $extra_atts );\n\t\tself::run_get_display_data_tests( $d, 'view with field ASC and order=id order_by=DESC params' );\n\t}", "function test_field_id_asc_order_in_view(){\n\t\tself::clear_get_values();\n\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 1;\n\n\t\tself::remove_view_order( $dynamic_view );\n\t\t$order_row = array(\n\t\t\t'type' => 'field',\n\t\t\t'col' => '493ito',\n\t\t\t'dir' => 'ASC',\n\t\t);\n\t\tself::add_order_to_view( $dynamic_view, $order_row );\n\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Jamie', 'frm_pagination_cont' ), array( 'Steve', 'Steph' ) );\n\t\tself::run_get_display_data_tests( $d, 'view with field ASC' );\n\t}", "public function orderBy($field, $direction = 'ASC');", "public function processListQueryOrderBy() {\n\t\tif (!empty($this->values['\\Object\\Form\\Model\\Dummy\\Sort'])) {\n\t\t\tforeach ($this->values['\\Object\\Form\\Model\\Dummy\\Sort'] as $k => $v) {\n\t\t\t\tif (!empty($v['__sort'])) {\n\t\t\t\t\t$name = $this->detail_fields['\\Object\\Form\\Model\\Dummy\\Sort']['elements']['__sort']['options']['options'][$v['__sort']]['name'];\n\t\t\t\t\t$this->misc_settings['list']['sort'][$name] = $v['__order'];\n\t\t\t\t\t$this->query->orderby([$v['__sort'] => $v['__order']]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function _getOrderField() {\n\t\t$orderList = $this->_getOrderList();\n\t\t$result = null;\n\t\tforeach ($orderList as $orderField) {\n\t\t\tif (!$this->hasField($orderField)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$result = $orderField;\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $result;\n\t}", "function custom_get_terms_orderby( $orderby, $args ) {\n if ( isset( $args['orderby'] ) && 'include' == $args['orderby'] ) {\n $include = implode(',', array_map( 'absint', $args['include'] ));\n $orderby = \"FIELD( t.term_id, $include )\";\n }\n return $orderby;\n}", "public function orderBy($field, $order = 'asc')\n {\n }", "public function register_rest_orderby_fields() {\n\t\t\t$post_type = UAGB_Helper::get_post_types();\n\n\t\t\tforeach ( $post_type as $key => $type ) {\n\t\t\t\tadd_filter( \"rest_{$type['value']}_collection_params\", array( $this, 'add_orderby' ), 10, 1 );\n\t\t\t}\n\t\t}", "private static function orderby_enum() {\n\n\t\tif ( null === self::$orderby_enum ) {\n\n\t\t\tself::$orderby_enum = new WPEnumType(\n\t\t\t\t$name = 'orderby',\n\t\t\t\t$values = [\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'NONE',\n\t\t\t\t\t\t'value' => 'none',\n\t\t\t\t\t\t'description' => __( 'No order', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'ID',\n\t\t\t\t\t\t'value' => 'ID',\n\t\t\t\t\t\t'description' => __( 'Order by the object\\'s id. Note the capitalization', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'AUTHOR',\n\t\t\t\t\t\t'value' => 'author',\n\t\t\t\t\t\t'description' => __( 'Order by author', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'TITLE',\n\t\t\t\t\t\t'value' => 'title',\n\t\t\t\t\t\t'description' => __( 'Order by title', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'SLUG',\n\t\t\t\t\t\t'value' => 'name',\n\t\t\t\t\t\t'description' => __( 'Order by slug', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'DATE',\n\t\t\t\t\t\t'value' => 'date',\n\t\t\t\t\t\t'description' => __( 'Order by date', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'MODIFIED',\n\t\t\t\t\t\t'value' => 'modified',\n\t\t\t\t\t\t'description' => __( 'Order by last modified date', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'PARENT',\n\t\t\t\t\t\t'value' => 'parent',\n\t\t\t\t\t\t'description' => __( 'Order by parent ID', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'COMMENT_COUNT',\n\t\t\t\t\t\t'value' => 'comment_count',\n\t\t\t\t\t\t'description' => __( 'Order by number of comments', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'RELEVANCE',\n\t\t\t\t\t\t'value' => 'relevance',\n\t\t\t\t\t\t'description' => __( 'Order by search terms in the following order: First, whether the entire sentence is matched. Second, if all the search terms are within the titles. Third, if any of the search terms appear in the titles. And, fourth, if the full sentence appears in the contents.', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'IN',\n\t\t\t\t\t\t'value' => 'post__in',\n\t\t\t\t\t\t'description' => __( 'Preserve the ID order given in the IN array', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'NAME_IN',\n\t\t\t\t\t\t'value' => 'post_name__in',\n\t\t\t\t\t\t'description' => __( 'Preserve slug order given in the NAME_IN array', 'wp-graphql' ),\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\n\t\t}\n\n\t\treturn self::$orderby_enum;\n\n\t}", "public function orderBy($field)\n {\n\n $data = $this->Recordset;\n if (!empty($data)) {\n if (!is_array($field)) {\n $field = array($field);\n }\n $field = array_map('strtoupper', $field);\n\n usort($data, function ($a, $b) use ($field) {\n $retval = 0;\n foreach ($field as $fieldname) {\n if(!$this->CaseFolding) $fieldname = strtolower($fieldname);\n if ($retval == 0) {\n if($this->getFieldTypes($fieldname)=='integer') {\n $retval = $a[$fieldname] - $b[$fieldname];\n } else {\n $retval = strnatcmp($a[$fieldname], $b[$fieldname]);\n }\n }\n }\n return $retval;\n });\n }\n $this->Recordset = $data;\n }", "function SortByField($sSearchHandle,$sFieldName,$bNumericSort,$bAscending)\n {\n $sFieldName = urlencode($sFieldName);\n $sRequestUrl = \"SearchHandle=\".$sSearchHandle.\"&FieldName=\".$sFieldName.\"&NumericSort=\".$bNumericSort.\"&Ascending=\".$bAscending;\n return $this->GetResult($sRequestUrl,__FUNCTION__);\n }", "public function getSortOrder();", "function add_orderby($table, $field, $order, $alias = '', $params = array()) {\n // We can't use any alias in YQL query, so just use the real field name.\n $as = $alias = $field;\n\n if ($field) {\n $as = $this->add_field($table, $field, $as, $params);\n }\n\n $orderby = array(\n 'field' => $as,\n 'order' => $order,\n );\n\n $this->orderby[] = $orderby;\n }", "public function custom_orderby( $orderby, $query ){\n\t\tglobal $wpdb;\n\n\t\tif ( self::is_admin_page() && ! empty( $query->query['orderby'] ) && 'post_password' == $query->query['orderby'] ) {\n\t\t\t$orderby = \"$wpdb->posts.post_password \" . $query->query['order'];\n\t\t}\n\n\t\treturn $orderby;\n\t}", "function order_by_video_release_date_column( $query ) {\n if ( !is_admin() ) return; // Check that we are on serverside (wp-admin)\n $orderby = $query->get( 'orderby' );\n if ( 'video_release_date' == $orderby ) { // When 'Concert date' column label is clicked (and 'video_release_date' thereby set as $orderby) hook into that query and query with\n $query->set( 'meta_key', 'video_release_date' ); // ... custom field with key 'video_release_date'\n $query->set( 'orderby', 'meta_value_num' ); // ... order by the value of this field for each video (as a number -> 'meta_value_NUM')\n }\n }", "function order_by_release_column( $query ) {\n if ( !is_admin() ) return; // Check that we are on serverside (wp-admin)\n $orderby = $query->get( 'orderby' );\n if ( 'release' == $orderby ) { // When 'Concert date' column label is clicked (and 'release' thereby set as $orderby) hook into that query and query with\n $query->set( 'meta_key', 'release' ); // ... custom field with key 'release'\n $query->set( 'orderby', 'meta_value' ); // ... order by the value of this field for each track\n }\n }", "public function replyToSortCustomColumn( $aTerms, $aTaxonomies, $aArgs ) {\n \n if ( 'edit-tags.php' == $GLOBALS['pagenow'] && isset( $_GET{'orderby'} ) && 'custom' == $_GET{'orderby'} ) {\n usort( $aTerms, array( $this, '_replyToSortByCustomOptionValue' ) );\n }\n return $aTerms;\n \n }" ]
[ "0.64627963", "0.61933804", "0.61603487", "0.61418235", "0.5975", "0.58385426", "0.58042526", "0.5659749", "0.56441915", "0.5638719", "0.5605423", "0.5605143", "0.5594682", "0.55868316", "0.5574048", "0.5539795", "0.5537732", "0.5529229", "0.5510687", "0.5492137", "0.5488274", "0.5466205", "0.5449842", "0.5441664", "0.54336333", "0.54288375", "0.5426249", "0.54018307", "0.5389245", "0.53760785" ]
0.6356028
1
Make sure that the elements in results will never get translated.
public function dont_translate_results() { $this->element_selector_provider->attempt_translating_elements( false ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function shouldTranslate();", "public function testTranslate()\n\t{\n\t\t$this->assertSame(\n\t\t\t'+$(general : CurrentDate)$ | ' . \\App\\Language::translate('LBL_SECONDS') . '==' . \\App\\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',\n\t\t\tstatic::$parserClean->setContent('+$(general : CurrentDate)$ | $(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parseTranslations()->getContent(),\n\t\t\t'Clean instance: Only translations should be replaced');\n\t\t$this->assertSame(\n\t\t\t'+$(general : CurrentDate)$ | ' . \\App\\Language::translate('LBL_SECONDS') . '==' . \\App\\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',\n\t\t\tstatic::$parserClean->setLanguage('pl-PL')->setContent('+$(general : CurrentDate)$ | $(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parseTranslations()->getContent(),\n\t\t\t'Clean instance: Only translations should be replaced(setLanguage)');\n\n\t\t$this->assertSame(\n\t\t\t'+' . \\App\\Language::translate('LBL_SECONDS') . '==' . \\App\\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',\n\t\t\tstatic::$parserClean->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),\n\t\t\t'Clean instance: Translations should be equal');\n\t\tstatic::$parserClean->withoutTranslations(true);\n\n\t\t$this->assertSame(\n\t\t\t'+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+',\n\t\t\tstatic::$parserClean->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),\n\t\t\t'Clean instance: Translations should be equal');\n\t\tstatic::$parserClean->withoutTranslations(false);\n\n\t\t$this->assertSame(\n\t\t\t'+' . \\App\\Language::translate('LBL_SECONDS') . '==' . \\App\\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',\n\t\t\tstatic::$parserRecord->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),\n\t\t\t'Record instance: Translations should be equal');\n\t\tstatic::$parserRecord->withoutTranslations(true);\n\n\t\t$this->assertSame(\n\t\t\t'+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+',\n\t\t\tstatic::$parserRecord->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),\n\t\t\t'Record instance: Translations should be equal');\n\t\tstatic::$parserRecord->withoutTranslations(false);\n\t}", "public function prepareElements()\n {\n if ( false === $this->isMultiLanguage() )\n {\n $this->remove( 'all' );\n }\n }", "public function getUntranslated() { return $this->untranslated; }", "public function translationsOnly() {\n\t\t$data = json_decode($this->lastResult);\n\t\tif (!$data) throw new Exception('This method only supports API answers in json. Set \\'json\\' format and call \\'translate\\' method again, before calling \\'translationsOnly\\'');\n\t\t$results = array();\n\t\tif (isset($data->tuc)) {\n\t\t\tforeach ($data->tuc as $trans) {\n\t\t\t\tif (isset($trans->phrase))\n\t\t\t\t\t$results[] = $trans->phrase->text;\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}", "public function supportsTranslations() {\n \treturn tx_tcaobjects_div::supportsTranslations($this->_table); \n }", "public function handleUntranslated() {\n $this->pages['untranslated'] = TRUE;\n }", "function translate() {}", "public function testBindTranslationNonTranslatable()\n {\n $this->doc = new CmsArticle();\n $this->doc->id = '/functional/' . $this->testNodeName;\n $this->dm->persist($this->doc);\n $this->dm->bindTranslation($this->doc, 'en');\n }", "private function populateTranslations()\n {\n //translations\n $aRelated = $this->getRelatedRecords();\n if (isset($aRelated[$this->relation]) && $aRelated[$this->relation] != null) \n {\n if (is_array($aRelated[$this->relation])) \n {\n foreach ($aRelated[$this->relation] as $model) \n {\n $this->_models[$model->getAttribute($this->localeField)] = $model;\n }\n } \n else \n {\n $model = $aRelated[$this->relation];\n $this->_models[$model->getAttribute($this->localeField)] = $model;\n }\n }\n }", "public function testFindAllByLocaleWhenNoTranslationsExists()\n {\n $redis = $this->createRedisStub();\n $locale = $this->createLocaleModel('en');\n\n $redis->shouldReceive('smembers')\n ->with(sprintf(TranslationRedisRepository::LOCALE_TRANSLATIONS_KEY, $locale->getName()))\n ->once()\n ->andReturn([]);\n\n $this->assertEmpty(\n $this->createRepository($redis)->findAllByLocale($locale),\n 'Method should return empty array'\n );\n }", "public function setShouldTranslate($flag);", "public function testFindTranslationWithUntranslatedChildren()\n {\n $this->dm->persist($this->doc);\n $this->dm->bindTranslation($this->doc, 'en');\n\n $this->doc->topic = 'Un autre sujet';\n $this->dm->bindTranslation($this->doc, 'fr');\n $this->dm->flush();\n\n $testNode = $this->node->getNode($this->testNodeName);\n $testNode->addNode('new-comment');\n $this->session->save();\n\n $this->dm->clear();\n\n $this->doc = $this->dm->findTranslation($this->class, '/functional/' . $this->testNodeName, 'fr');\n $this->assertEquals('fr', $this->doc->locale);\n $children = $this->doc->getChildren();\n $this->assertCount(1, $children);\n foreach ($children as $comment) {\n $this->assertInstanceOf('Doctrine\\ODM\\PHPCR\\Document\\Generic', $comment);\n $this->assertNull($this->dm->getUnitOfWork()->getCurrentLocale($comment));\n }\n\n $this->dm->clear();\n\n $this->doc = $this->dm->findTranslation($this->class, '/functional/' . $this->testNodeName, 'en');\n $children = $this->dm->getChildren($this->doc);\n $this->assertCount(1, $children);\n foreach ($children as $comment) {\n $this->assertInstanceOf('Doctrine\\ODM\\PHPCR\\Document\\Generic', $comment);\n $this->assertNull($this->dm->getUnitOfWork()->getCurrentLocale($comment));\n }\n }", "function testDoNotParseNonExistingLangs() {\n\t\t$_GET = array('url' => 'foo');\n\t\tCaracoleI18n::init();\n\t\t$result = $_GET['url'];\n\t\t$this->assertEqual($result, 'foo');\n\t}", "public function preventFromTransformation();", "protected function translatable() : bool\n {\n return true;\n }", "public function getProcessedIgnoresEnglish() {\n $observerClient = $this->getConnectedClientMock();\n $observerDrupal = $this->getMock('EntityXliffFtp\\Utils\\DrupalHandler');\n\n // We expect that DrupalHandler::languageList() will never be called.\n $observerDrupal->expects($this->never())\n ->method('languageList');\n\n // We expect that SFTP::rawList will never be called.\n $observerClient->expects($this->never())\n ->method('rawList');\n\n // Instantiate Querier and call getProcessable with ONLY English.\n $querier = new Querier($observerClient, $observerDrupal);\n $querier->getProcessed(array('en' => (object) array()));\n }", "function FailTrans() {\n return;\n }", "public function testNoTranslationsOnSetup() {\n // Assert there is not translations in the database.\n $strings = $this->localStorage->getStrings([]);\n $this->assertEquals(count($strings), 0, 'Found 0 source strings in the database.');\n $translations = $this->localStorage->findTranslation([]);\n $this->assertNull($translations, 'Found 0 translations strings in the database.');\n }", "public function test_get_optimized_translation_resources_with_invalid_resources()\n {\n $return_value['en']['xml']['Chamilo\\Libraries'] = 'en.xml';\n\n $this->translationResourcesFinderMock->expects($this->once())->method('findTranslationResources')->will(\n $this->returnValue($return_value));\n\n $translation_resources_optimizer = new TranslationResourcesOptimizer(\n $this->translationLoadersMocks,\n $this->translationResourcesFinderMock,\n $this->cache_path);\n\n $translation_resources_optimizer->getOptimizedTranslationResources();\n }", "public static function reset()\n {\n self::getTranslator()->reset();\n }", "private function translateFacets() {\n $found_ids = array();\n $found_results = array();\n $translated_terms = array();\n $facets = $this->facetComponent->getFacets();\n foreach ($facets as $key => $facet) {\n // The key should start with 'category_' or 'location_'\n $start = substr($key, 0, 9);\n if (in_array($start, array('category_', 'location_'))) {\n $items = $facet->getResult()->getItems();\n foreach ($items as $item) {\n $found_ids[$item->getValue()] = $item->getValue();\n }\n }\n }\n\n // Translate the facets.\n if ($translations = culturefeed_search_term_translations($found_ids, TRUE)) {\n\n // Preferred language.\n $preferred_language = culturefeed_search_get_preferred_language();\n\n // Translate the facets labels.\n foreach ($facets as $key => $facet) {\n // The key should start with 'category_' or 'location_'\n $start = substr($key, 0, 9);\n if (in_array($start, array('category_', 'location_'))) {\n $items = $facet->getResult()->getItems();\n foreach ($items as $item) {\n // Translate if found.\n if (!empty($translations[$item->getValue()][$preferred_language])) {\n $item->setLabel($translations[$item->getValue()][$preferred_language]);\n }\n }\n }\n }\n\n }\n\n }", "private function resetResults(): void\n {\n $this->results = [\n 'published' => [],\n 'skipped' => [],\n ];\n }", "function _checkTranslate()\n\t{\n\t\tglobal $lng, $ilSetting, $ilUser, $rbacsystem;\n\n\t\tif (!$ilSetting->get(\"lang_ext_maintenance\")\n\t\tor !$ilSetting->get(\"lang_translate_\".$lng->getLangKey()))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($ilUser->getId())\n\t\t{\n\t\t\t$ref_id = self::_lookupLangFolderRefId();\n\t\t\treturn $rbacsystem->checkAccess(\"read,write\", (int) $ref_id);\n\t\t}\n\t\treturn false;\n\t}", "public function hasMissingTranslations()\n\t{\n\t\treturn !empty($this->_messages);\n\t}", "private function getTranslations()\n\t{\n\t\t$this->translations = $this->wpml->getAllTranslations($this->data['post_id']);\n\t}", "private function shouldTranslateOnGet()\n\t{\n\t\treturn isset($this->translateOnGet) ? $this->translateOnGet : false;\n\t}", "public function testFindAllByLocaleWhenTranslationsExistsButOneOfThemIsCorrupted()\n {\n $redis = $this->createRedisStub();\n $locale = $this->createLocaleModel('ru');\n\n $redis->shouldReceive('smembers')\n ->with(sprintf(TranslationRedisRepository::LOCALE_TRANSLATIONS_KEY, $locale->getName()))\n ->once()\n ->andReturn(['{\"key\": \"hello\", \"translation\": \"привет\"}', '[{zxcv\"key\": \"how are you?\", vv\"translation\": \"как дела?\"}']);\n\n $this->assertEquals(\n [new TranslationModel($locale, \"hello\", \"привет\")],\n $this->createRepository($redis)->findAllByLocale($locale),\n 'Method should return TranslationModel'\n );\n }", "public function translateMessages()\r\n\t{\r\n\t\tforeach ($this->messages as $key => $message)\r\n\t\t{\r\n\t\t\t$this->messages[$key] = Lang::trans($message);\r\n\t\t}\r\n\t}", "private function _set_translate(){\n\t\t$this->_translate=\n\t\t\tisset($this->_input_encoding) && $this->_input_encoding!=\"\" && \n\t\t\tisset($this->_output_encoding) && $this->_output_encoding!=\"\" && \n\t\t\t$this->_input_encoding!=$this->_output_encoding;\n\t}" ]
[ "0.6537043", "0.5763646", "0.5715632", "0.5530568", "0.5521177", "0.55112666", "0.5500426", "0.54821265", "0.53727776", "0.536006", "0.5343137", "0.5292815", "0.5281838", "0.5274265", "0.5204584", "0.51827145", "0.51692945", "0.515468", "0.513971", "0.5107676", "0.5095428", "0.5076213", "0.50723547", "0.50058043", "0.5000034", "0.49995872", "0.49975505", "0.49949637", "0.49831527", "0.49587387" ]
0.70071226
0
Set the preferred translation language from a given element ID and domain. See determine_translation_language() for details.
public function set_translation_language_by_element_id_and_domain( $element_id, $domain ) { if( Toolset_Element_Domain::POSTS !== $domain ) { // no language information there return $this; } $post_language = $this->wpml_service->get_post_language( $element_id ); if( ! empty( $post_language ) ) { $this->set_translation_language( $post_language ); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function determine_translation_language() {\n\t\tif( ! $this->wpml_service->is_wpml_active_and_configured() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif( ! $this->wpml_service->is_showing_all_languages() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif( null === $this->translation_language ) {\n\t\t\t// Here, we may try to determine the language by some other means.\n\t\t\treturn;\n\t\t}\n\n\t\t$this->element_selector_provider->set_translation_language( $this->translation_language );\n\t}", "private function set_locale() {\n\t\t$etc_i18n = new i18n;\n\t\t$etc_i18n->set_domain( self::PLUGIN_ID );\n\n\t\tadd_action( 'plugins_loaded', array( $etc_i18n, 'load_plugin_textdomain' ) );\n\t}", "private static function setLocale($languageID) {\n\t\t// set locale for\n\t\t// string comparison\n\t\t// character classification and conversion\n\t\t// date and time formatting\n\t\tif (!defined('PAGE_DIRECTION')) define('PAGE_DIRECTION', self::$languages[$languageID]->get('wcf.global.pageDirection'));\n\t\tsetlocale(LC_COLLATE, self::$languages[$languageID]->get('wcf.global.locale.unix').'.UTF-8', self::$languages[$languageID]->get('wcf.global.locale.unix'), self::$languages[$languageID]->get('wcf.global.locale.win'));\n\t\tsetlocale(LC_CTYPE, self::$languages[$languageID]->get('wcf.global.locale.unix').'.UTF-8', self::$languages[$languageID]->get('wcf.global.locale.unix'), self::$languages[$languageID]->get('wcf.global.locale.win'));\n\t}", "private function _set_default_language()\n\t{\n\t\t$lang \t\t= $this->platform->post('partner/language/get',array('partner_id' => $this->_partner_id, 'funnel_id' => $this->_funnel_id));\n\n\t\t// if grabbing language was unsuccessful, set session and return\n\t\tif ( ! $lang['success'] OR ! is_array($lang['data']) OR empty($lang['data'])):\n\n\t\t\treturn;\n\n\t\tendif;\n\n\t\t// set global language variable\n\t\t$this->_language \t= (isset($lang['data']['slug']) AND ! empty($lang['data']['slug']))? $lang['data']['slug']: $this->_language;\n\t}", "public function setTranslation($orig, $translation, $language);", "function setTransDomain($transDomain);", "private function set_locale() {\n\n\t\t$plugin_i18n = new WP_Primary_Category_I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "function setLanguage($language);", "protected function setLanguage()\n\t{\n\t\t$matches = array();\n\n\t\tif ($this->owner->user->hasState('__locale'))\n\t\t\t$language = $this->owner->user->getState('__locale');\n\t\telse if (preg_match('/^\\/([a-z]{2}(?:_[a-z]{2})?)\\//i',\n\t\t\t\tsubstr($this->owner->request->url, strlen($this->owner->baseUrl)), $matches) !== false\n\t\t\t\t&& isset($matches[1]) && in_array($matches[1], array_keys($this->owner->cms->languages)))\n\t\t\t$language = $matches[1];\n\t\telse\n\t\t\t$language = $this->owner->cms->defaultLocale;\n\n\t\t$this->owner->language = $language;\n\t}", "public function setLanguageValue($languageID, $value);", "public function useDomain($domain) {\n \t$this->translation->useDomain($domain);\n\t}", "function SetSurveyLanguage($surveyid, $sLanguage)\n{\n $surveyid = sanitize_int($surveyid);\n $default_language = Yii::app()->getConfig('defaultlang');\n\n if (isset($surveyid) && $surveyid > 0) {\n\n $default_survey_language = Survey::model()->findByPk($surveyid)->language;\n $additional_survey_languages = Survey::model()->findByPk($surveyid)->getAdditionalLanguages();\n\n if (\n empty($sLanguage) //check if there\n || (!in_array($sLanguage, $additional_survey_languages)) //Is the language in the survey-language array\n || ($default_survey_language == $sLanguage) //Is the $default_language the chosen language?\n ) {\n // Language not supported, fall back to survey's default language\n $_SESSION['survey_'.$surveyid]['s_lang'] = $default_survey_language;\n } else {\n $_SESSION['survey_'.$surveyid]['s_lang'] = $sLanguage;\n }\n\n App()->setLanguage($_SESSION['survey_'.$surveyid]['s_lang']);\n Yii::app()->loadHelper('surveytranslator');\n LimeExpressionManager::SetEMLanguage($_SESSION['survey_'.$surveyid]['s_lang']);\n } else {\n\n if (!$sLanguage) {\n $sLanguage = $default_language;\n }\n\n $_SESSION['survey_'.$surveyid]['s_lang'] = $sLanguage;\n App()->setLanguage($_SESSION['survey_'.$surveyid]['s_lang']);\n }\n\n}", "private function set_locale() {\n\n\t\t$plugin_i18n = new Sepa_Traderiq_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function set_locale() {\n\t\t\tload_plugin_textdomain( PAS_SLUG, false, PAS_GLOBAL_DIR . 'language' );\n\t }", "public static function gettext_domain_restore()\n {\n # which we've been actualy using until now. We want it replaced with\n # the language below it.\n\n array_pop(self::$gettext_langprefs_stack);\n\n $size = count(self::$gettext_langprefs_stack);\n if ($size > 0)\n {\n $langprefs = self::$gettext_langprefs_stack[$size - 1];\n self::gettext_set_lang($langprefs);\n }\n else\n {\n # The stack is empty. This means we're going out of OKAPI code and\n # we want the original textdomain reestablished.\n\n textdomain(self::$gettext_original_domain);\n self::$gettext_original_domain = null;\n }\n }", "public function setTranslationDomain($translationDomain);", "private function change_translation_of( $trid, $el_id, $el_type, $language_code, $src_language_code ) {\n\t\t$src_language_code = empty( $src_language_code )\n\t\t\t? $this->sitepress->get_source_language_by_trid( $trid ) : $src_language_code;\n\t\tif ( $src_language_code !== $language_code ) {\n\t\t\t$this->wpdb->update(\n\t\t\t\t$this->wpdb->prefix . 'icl_translations',\n\t\t\t\tarray(\n\t\t\t\t\t'trid' => $trid,\n\t\t\t\t\t'language_code' => $language_code,\n\t\t\t\t\t'source_language_code' => $src_language_code,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'element_type' => $el_type,\n\t\t\t\t\t'element_id' => $el_id,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$context = explode( '_', $el_type );\n\n\t\t\tdo_action(\n\t\t\t\t'wpml_translation_update',\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'update',\n\t\t\t\t\t'trid' => $trid,\n\t\t\t\t\t'element_id' => $el_id,\n\t\t\t\t\t'element_type' => $el_type,\n\t\t\t\t\t'context' => $context[0],\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new Pressapps_Fullscreen_Login_i18n();\n\t\t$plugin_i18n->set_domain( $this->get_plugin_name() );\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "public function setLanguage($id)\n {\n $coreUILanguages = Config::get('languagesUI');\n\n if (isset($coreUILanguages[$id - 1])) {\n $_SESSION['user']['language_id'] = $id;\n $_SESSION['user']['language'] = $coreUILanguages[$id - 1];\n setcookie('L', $coreUILanguages[$id - 1]);\n } else {\n return array('success' => false);\n }\n\n DM\\Users::update(\n array(\n 'id' => User::getId()\n , 'language_id' => $id\n )\n );\n\n return array('success' => true);\n }", "public function trans($id, array $parameters = [], $domain = NULL, $locale = NULL);", "private static function set_locale() {\n\n $plugin_i18n = new PTB_Extra_i18n();\n $plugin_i18n->set_domain(self::$plugin_name);\n $plugin_i18n->load_plugin_textdomain();\n }", "private function set_locale() {\n $plugin_i18n = new Internationalization();\n\n $this->loader->add_action( 'after_setup_theme', $plugin_i18n, 'load_theme_textdomain' );\n }", "function changeLanguage($langString){\n\t\txContext::$front->setup_i18n($langString);\t\t\n\t}", "protected function volatile_set_locale($id)\n\t{\n\t\tI18n\\set_locale($id);\n\t}", "public function set_language($lang) {\n\t\t// Convert BR to PT.\n\t\tif ($lang == \"br\") {\n\t\t\t$lang = \"pt\";\n\t\t}\n\n\t\tsetcookie(\"lang\", $lang, time() + 31536000, \"/\");\n\t\t$this->cl = $lang;\n\t}", "public function setLanguage($val) {\n $this->_language = $val;\n }", "public function setCurrentLanguage($strLanguage);", "public function trans($id, array $parameters = array(), $domain = null, $locale = null);", "private function set_locale() {\n\n\t\t$plugin_i18n = new Onyx_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function setLanguageOverrides() {\n $this->negotiator->setCurrentUser($this->currentUser);\n if ($this->languageManager instanceof ConfigurableLanguageManagerInterface) {\n $this->languageManager->setNegotiator($this->negotiator);\n $this->languageManager->setConfigOverrideLanguage($this->languageManager->getCurrentLanguage());\n }\n // After the language manager has initialized, set the default langcode for\n // the string translations.\n $langcode = $this->languageManager->getCurrentLanguage()->getId();\n $this->translation->setDefaultLangcode($langcode);\n }" ]
[ "0.6103343", "0.60103846", "0.60093373", "0.59220326", "0.5894868", "0.5886216", "0.58184063", "0.58176893", "0.57948613", "0.5780077", "0.5770148", "0.57619417", "0.5733749", "0.5704082", "0.56984955", "0.56954765", "0.56885636", "0.56842035", "0.5657208", "0.56248087", "0.5613881", "0.560971", "0.5605253", "0.56031305", "0.55775636", "0.5572645", "0.55682987", "0.5558777", "0.55313736", "0.55252373" ]
0.76375365
0
Determine an alternative to the translation language (what language version of the results should be chosen). This will be used only if applicable if WPML is active and the current language is set to "All languages", in which case we're forced to pick one. If we have a valid lang code, we'll pass it to the element selector. Otherwise, it will use the default language.
private function determine_translation_language() { if( ! $this->wpml_service->is_wpml_active_and_configured() ) { return; } if( ! $this->wpml_service->is_showing_all_languages() ) { return; } if( null === $this->translation_language ) { // Here, we may try to determine the language by some other means. return; } $this->element_selector_provider->set_translation_language( $this->translation_language ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getLang()\n {\n if (array_key_exists($this->context->language->iso_code, $this->supportedLangs)) {\n return $this->supportedLangs[$this->context->language->iso_code];\n }\n \n return $this->defaultLang;\n }", "private static function _pickLanguage($updateTo = null)\n {\n $user = Globals::getUser();\n\n if ($updateTo !== null) {\n $return = $updateTo;\n } elseif (self::_isRobot()) {\n $return = Globals::getDefaultSiteLanguage();\n } elseif (!empty($user) && $user->isLoggedIn() && isset($user->lang) && !empty($user->lang)) {\n // Logged-in user with their own preference\n $return = $user->lang;\n } elseif ($subdomainLang = Globals::getSubdomainLanguage()) {\n $return = $subdomainLang;\n } else {\n // Automatic locale detection\n $locale = new Zend_Locale();\n $strLocale = $locale->toString();\n $parts = explode('_', $strLocale);\n $localeLang = $parts[0];\n $return = $localeLang;\n }\n\n $supportedLanguages = explode(',', GLOBAL_SUPPORTED_LANG);\n if (!in_array($return, $supportedLanguages)) {\n Globals::getLogger()->error(\"Language not supported: '$return'. Supported languages: \" . GLOBAL_SUPPORTED_LANG, Zend_Log::INFO);\n\n // Pick English in case of unsupported language\n $return = 'en';\n\n }\n\n return $return;\n }", "function wpml_language_switch() {\n\t$lang = icl_get_languages('skip_missing=N');\n\t$ret = '';\n\tif(count($lang) > 0) {\n\tforeach($lang as $value) {\n\t\t$ret .= ($value['active'] == 0) ? '<li class=\"language dropdown menu-item\"><a href=\"' . $value['url'] . '\">' .\n\t\t\t$value['native_name'] . '</a></li>' : '';\n\t}\n\t}\n\treturn $ret;\n}", "public function getFallbackLanguage($mixID);", "public function getDefaultLanguage();", "protected function getTargetLocale()\n\t{\n\t\tif (craft()->isLocalized())\n\t\t{\n\t\t\t$targetLocale = $this->getSettings()->targetLocale;\n\n\t\t\tif ($targetLocale)\n\t\t\t{\n\t\t\t\treturn $targetLocale;\n\t\t\t}\n\t\t\telse if (isset($this->element))\n\t\t\t{\n\t\t\t\treturn $this->element->locale;\n\t\t\t}\n\t\t}\n\n\t\treturn craft()->getLanguage();\n\t}", "function wpml_get_default_language() {\n\t\treturn pll_default_language();\n\t}", "function wpv_wpml_icl_current_language($lang) { // TODO check why is this needed: it just returns the default language when looking for the current language...\n global $sitepress;\n\n return $sitepress->get_default_language();\n}", "public function getTargetLanguage(): string;", "public function negotiateLanguage()\n\t{\n\t\t$default = $this->configRepository->get('app.locale');\n\t\t$supported = array();\n\t\tforeach ($this->configRepository->get('laravel-localization::supportedLocales') as $lang => $language)\n\t\t{\n\t\t\t$supported[$lang] = $lang;\n\t\t}\n\n\t\tif (!count($supported))\n\t\t{\n\t\t\treturn $default;\n\t\t}\n\n\t\tif (Request::header('Accept-Language'))\n\t\t{\n\t\t\t$matches = array();\n\t\t\t$generic_matches = array();\n\t\t\tforeach (explode(',', Request::header('Accept-Language')) as $option)\n\t\t\t{\n\t\t\t\t$option = array_map('trim', explode(';', $option));\n\n\t\t\t\t$l = strtolower($option[0]);\n\t\t\t\tif (isset($option[1]))\n\t\t\t\t{\n\t\t\t\t\t$q = (float) str_replace('q=', '', $option[1]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$q = null;\n\t\t\t\t\t// Assign default low weight for generic values\n\t\t\t\t\tif ($l == '*/*')\n\t\t\t\t\t{\n\t\t\t\t\t\t$q = 0.01;\n\t\t\t\t\t}\n\t\t\t\t\telseif (substr($l, -1) == '*')\n\t\t\t\t\t{\n\t\t\t\t\t\t$q = 0.02;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Unweighted values, get high weight by their position in the\n\t\t\t\t// list\n\t\t\t\t$q = isset($q) ? $q : 1000 - count($matches);\n\t\t\t\t$matches[$l] = $q;\n\n\t\t\t\t//If for some reason the Accept-Language header only sends language with country\n\t\t\t\t//we should make the language without country an accepted option, with a value\n\t\t\t\t//less than it's parent.\n\t\t\t\t$l_ops = explode('-', $l);\n\t\t\t\tarray_pop($l_ops);\n\t\t\t\twhile (!empty($l_ops))\n\t\t\t\t{\n\t\t\t\t\t//The new generic option needs to be slightly less important than it's base\n\t\t\t\t\t$q -= 0.001;\n\t\t\t\t\t$op = implode('-', $l_ops);\n\t\t\t\t\tif (empty($generic_matches[$op]) || $generic_matches[$op] > $q)\n\t\t\t\t\t{\n\t\t\t\t\t\t$generic_matches[$op] = $q;\n\t\t\t\t\t}\n\t\t\t\t\tarray_pop($l_ops);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$matches = array_merge($generic_matches, $matches);\n\n\t\t\tarsort($matches, SORT_NUMERIC);\n\n\t\t\tforeach ($matches as $key => $q)\n\t\t\t{\n\t\t\t\tif (isset($supported[$key]))\n\t\t\t\t{\n\t\t\t\t\treturn $supported[$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If any (i.e. \"*\") is acceptable, return the first supported format\n\t\t\tif (isset($matches['*']))\n\t\t\t{\n\t\t\t\treturn array_shift($supported);\n\t\t\t}\n\t\t}\n\n\t\tif (Request::server('REMOTE_HOST'))\n\t\t{\n\t\t\t$lang = strtolower(end($h = explode('.', Request::server('REMOTE_HOST'))));\n\t\t\tif (isset($supported[$lang]))\n\t\t\t{\n\t\t\t\treturn $supported[$lang];\n\t\t\t}\n\t\t}\n\n\t\treturn $default;\n\t}", "public function default_language()\n {\n // Check if the language exists\n return (in_array($this->default_language, $this->found_languages)) ? $this->default_language : 'en';\n }", "function lang()\n {\n global $CFG;\n $language = $CFG->item('language');\n\n $lang = array_search($language, $this->languages);\n if ($lang)\n {\n return $lang;\n }\n\n return NULL; // this should not happen\n }", "protected function determineLanguage()\n {\n $languages = [\n 'de-DE' => 'ALE',\n 'es-ES' => 'CAS',\n 'ca-ES' => 'CAT',\n 'zh-CN' => 'CHI',\n 'zh-TW' => 'CHI',\n 'da-DK' => 'DAN',\n 'en-US' => 'ENG',\n 'fi-FI' => 'FIN',\n 'fr-FR' => 'FRA',\n 'el-GR' => 'GRE',\n 'nl-NL' => 'HOL',\n 'hu-HU' => 'HUN',\n 'hi-IN' => 'IND',\n 'it-IT' => 'ITA',\n 'ja-JP' => 'JPN',\n 'ko-KR' => 'KOR',\n 'ms-MY' => 'MAL',\n 'nb-NO' => 'NOR',\n 'pl-PL' => 'POL',\n 'pt-PT' => 'POR',\n 'ru-RU' => 'RUS',\n 'sv-SE' => 'SUE',\n 'th-TH' => 'TAI',\n 'tr-TR' => 'TUR'\n ];\n\n // Determine language from 'locale' query parameter\n if (!empty($this->request->getQuery('locale'))) {\n if (!empty($languages[$this->request->getQuery('locale')])) {\n $this->_language = $languages[$this->request->getQuery('locale')];\n }\n }\n\n // Just in case the headers contain 'Accept-Language', use this\n if (empty($this->_language) && !empty($this->request->getHeader('Accept-Language'))) {\n $requestedLanguages = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n\n $found = false;\n foreach ($requestedLanguages as $language) {\n $components = explode(';', $language);\n\n if (!empty($components[0])) {\n $setLanguage = $components[0];\n\n if (!empty($languages[$setLanguage])) {\n $this->_language = $languages[$setLanguage];\n $found = true;\n }\n }\n\n if ($found) {\n break;\n }\n }\n }\n\n // In case everything failed, use default 'ENG' language\n if (empty($this->_language)) {\n $this->_language = 'ENG';\n }\n }", "function _detect_lang()\n\t{\n\t\t //lixlpixel_get_env_var('HTTP_ACCEPT_LANGUAGE');\n\t\t //lixlpixel_get_env_var('HTTP_USER_AGENT');\n\t\tglobal $config_lang;\n\t\t $_AL=strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n\t\t $_UA=strtolower($_SERVER['HTTP_USER_AGENT']);\n\n\t\t // Try to detect Primary language if several languages are accepted.\n\t\t foreach($config_lang['available'] as $K)\n\t\t {\n\t\t\t if(strpos($_AL, $K)===0)\n\t\t\t return $K;\n\t\t }\n\n\t\t // Try to detect any language if not yet detected.\n\t\t foreach($config_lang['available'] as $K)\n\t\t {\n\t\t\t if(strpos($_AL, $K)!==false)\n\t\t\t return $K;\n\t\t }\n\t\t foreach($config_lang['available'] as $K)\n\t\t {\n\t\t\t //if(preg_match(\"/[[( ]{$K}[;,_-)]/\",$_UA)) // matching other letters (create an error for seo spyder)\n\t\t\t return $K;\n\t\t }\n\n\t\t // Return default language if language is not yet detected.\n\t\t return $config_lang['default'];\n\t}", "public static function getLanguage() {\n\t\t//--\n\t\tglobal $configs;\n\t\t//--\n\t\tif(strlen((string)self::$cache['#LANGUAGE#']) == 2) {\n\t\t\tif(SmartFrameworkRuntime::ifInternalDebug()) {\n\t\t\t\tif(SmartFrameworkRuntime::ifDebug()) {\n\t\t\t\t\tSmartFrameworkRegistry::setDebugMsg('extra', '***REGIONAL-TEXTS***', [\n\t\t\t\t\t\t'title' => 'Get Language from Internal Cache',\n\t\t\t\t\t\t'data' => 'Content: '.self::$cache['#LANGUAGE#']\n\t\t\t\t\t]);\n\t\t\t\t} //end if\n\t\t\t} //end if\n\t\t\treturn (string) self::$cache['#LANGUAGE#'];\n\t\t} //end if\n\t\t//--\n\t\t$the_lang = 'en'; // default\n\t\t//--\n\t\tif(is_array($configs)) {\n\t\t\tif(is_array($configs['regional'])) {\n\t\t\t\t$tmp_lang = (string) strtolower((string)$configs['regional']['language-id']);\n\t\t\t\tif(self::validateLanguage($tmp_lang)) {\n\t\t\t\t\t$the_lang = (string) $tmp_lang;\n\t\t\t\t\tif(SmartFrameworkRuntime::ifInternalDebug()) {\n\t\t\t\t\t\tif(SmartFrameworkRuntime::ifDebug()) {\n\t\t\t\t\t\t\tSmartFrameworkRegistry::setDebugMsg('extra', '***REGIONAL-TEXTS***', [\n\t\t\t\t\t\t\t\t'title' => 'Get Language from Configs',\n\t\t\t\t\t\t\t\t'data' => 'Content: '.$the_lang\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t} //end if\n\t\t\t\t\t} //end if\n\t\t\t\t} //end if\n\t\t\t} //end if\n\t\t} //end if\n\t\t//--\n\t\tself::$cache['#LANGUAGE#'] = (string) strtolower((string)$the_lang);\n\t\t//--\n\t\treturn (string) self::$cache['#LANGUAGE#'];\n\t\t//--\n\t}", "public function aaiCurrentLang() {\n global $language;\n $code = $language->language;\n\n /*if ($code == 'en') {\n $code = LANGUAGE_NONE;\n }*/\n\n return $code;\n }", "private function language_prop($lang)\n {\n static $crystal_languages, $crystal_language_aliases;\n \n // user HTTP_ACCEPT_LANGUAGE if no language is specified\n if (empty($lang) || $lang == 'auto') {\n $accept_langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n $lang = str_replace('-', '_', $accept_langs[0]);\n }\n \n if (empty($crystal_languages)) {\n @include(INSTALL_PATH . 'program/localization/index.inc');\n }\n \n // check if we have an alias for that language\n if (!isset($crystal_languages[$lang]) && isset($crystal_language_aliases[$lang])) {\n $lang = $crystal_language_aliases[$lang];\n }\n // try the first two chars\n else if (!isset($crystal_languages[$lang])) {\n $short = substr($lang, 0, 2);\n \n // check if we have an alias for the short language code\n if (!isset($crystal_languages[$short]) && isset($crystal_language_aliases[$short])) {\n $lang = $crystal_language_aliases[$short];\n }\n // expand 'nn' to 'nn_NN'\n else if (!isset($crystal_languages[$short])) {\n $lang = $short.'_'.strtoupper($short);\n }\n }\n\n if (!isset($crystal_languages[$lang]) || !is_dir(INSTALL_PATH . 'program/localization/' . $lang)) {\n $lang = 'en_US';\n }\n\n return $lang;\n }", "public function detectLang()\n\t{\n\t\t$cookieName = $this->getCookieName();\n\t\t$lang = $this->httpRequest->getCookie($cookieName);\n\t\tif ($lang && $this->isAllowed($lang)) {\n\t\t\treturn $lang;\n\t\t}\n\n\t\t$lang = $this->httpRequest->detectLanguage($this->allowedLangs);\n\t\tif ($this->isAllowed($lang)) {\n\t\t\treturn $lang;\n\t\t}\n\n\t\treturn $this->defaultLang;\n\t}", "public function getTranslationLanguage();", "function icl_get_default_language() {\n\t\treturn pll_default_language();\n\t}", "function _getLang(){\n\tif(function_exists('__getLang')) return __getLang(); # run the hook if any\n\tif(_arg('lang')) $lang = _arg('lang');\n\telse $lang = _defaultLang();\n\treturn ($lang) ? $lang : _defaultLang();\n}", "public function selected_language() \n {\n // return the selected language if its set already\n if(!empty($this->language)) return $this->language;\n \n // Load language cookie\n $this->language = $this->Input->cookie('language', true);\n\n //Load the default language if the user hasnt selected a language yet\n if($this->language == false || !in_array($this->language, $this->found_languages))\n {\n // Get the users prefered language\n $prefered = null;\n if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))\n {\n $prefered = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n }\n \n // Check and make sure the language is installed\n $this->language = (!in_array($prefered, $this->found_languages)) ? $this->default_language() : $prefered;\n \n // Update the language cookie\n $this->Input->set_cookie('language', $this->language);\n }\n\n // Set globals\n return $this->language;\n }", "private static function getLang()\n\t{\n\t\t$lang = mb_strtolower(LANGUAGE_ID);\n\t\t$supportedLangs = static::getSupportedLangs();\n\t\t$lang = in_array($lang, $supportedLangs) ? $lang : array_shift($supportedLangs);\n\t\treturn $lang;\n\t}", "public function suggested_lang($uri, $fallback = NULL) {\n\n // Default fallback is the index 0 of langs array.\n // This array cannot be empty.\n if ($fallback === NULL)\n $fallback = $this->_langs[0];\n\n $parts = explode(\"/\", $uri);\n\n // Matches the prepended language.\n if (count($parts) > 0 && in_array($parts[0], $this->_langs)) {\n return $parts[0];\n }\n\n // Match the first part of the uri that has a translated value by url files.\n foreach ($parts as &$part) {\n\n foreach ($this->_langs as $lang) {\n\n // Safe to use, translation tables are cached in I18n\n $table = i18n::load('url-' . $lang);\n\n if (($key = array_search($part, $table))) {\n return $lang;\n }\n }\n }\n\n // If request is available, we can grab the fallback from the browser language.\n if (Request::$current !== NULL) {\n $fallback = Request::$current->headers()->preferred_language($this->_langs);\n }\n\n // Cookie of fallback\n return Cookie::get(\"lang\", $fallback);\n }", "function getDefaultLanguage() {\n\t\t$_userLanguage = isset($_SESSION[\"prefs\"][\"Language\"]) ? $_SESSION[\"prefs\"][\"Language\"] : \"\";\n\t\t$_parts = explode(\"_\", $_userLanguage);\n\t\t$_userLanguage = $_parts[0];\n\n\t\t// trying to get locale string out of interface languae\n\t\t$_key = \"\";\n\t\tforeach ($GLOBALS[\"WE_LANGS\"] as $_k=>$_v) {\n\t\t\tif ($_v == $_userLanguage) {\n\t\t\t\t$_key = $_k;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$_defLang = $GLOBALS['weDefaultFrontendLanguage'];\n\n\t\t// if default language is not equal with frontend language\n\t\tif (substr($_defLang,0,strlen($_key)) !== $_key) {\n\t\t\t// get first language that fits\n\t\t\tforeach($GLOBALS[\"weFrontendLanguages\"] as $_k=>$_v) {\n\t\t\t\t$_parts = explode(\"_\", $_k);\n\t\t\t\tif ($_parts[0] === $_key) {\n\t\t\t\t\t$_defLang = $_k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $_defLang;\n\t}", "function _defaultQueryLang(){\n\tglobal $lc_defaultLang;\n\treturn str_replace('-', '_', $lc_defaultLang);\n}", "function default_lang()\n {\n $browser_lang = !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ',') : '';\n $browser_lang = substr($browser_lang, 0,2);\n return (array_key_exists($browser_lang, $this->languages)) ? $browser_lang: 'en';\n }", "public static function getLanguage($default='default') {\r\n\t\tswitch (TYPO3_MODE) {\r\n\t\t\tcase 'BE':\r\n\r\n\t\t\t\t// Return language or default\r\n\t\t\t\tif ($GLOBALS['LANG'] instanceof language) {\r\n\t\t\t\t\t$lang = strtolower($GLOBALS['LANG']->lang);\r\n\t\t\t\t\treturn ($lang == 'default') ? $default : $lang;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'FE':\r\n\r\n\t\t\t\t// Return language or default\r\n\t\t\t\tif ($GLOBALS['TSFE'] instanceof tslib_fe) {\r\n\t\t\t\t\treturn $GLOBALS['TSFE']->lang;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn $default;\r\n\t}", "function supplang_switcher( array $options = array() ) {\n // Default values\n $options['wrapper'] = isset( $options['wrapper'] ) ? $options['wrapper'] : true;\n $options['script'] = isset( $options['script'] ) ? $options['script'] : true;\n $options['raw'] = isset( $options['raw'] ) ? $options['raw'] : false;\n $options['template'] = isset( $options['template'] ) ? $options['template'] : '%s';\n\n if ( $options['script']) {\n wp_enqueue_script(\n 'supplang-language-switcher',\n plugin_dir_url( __FILE__ ) . 'js/language-switcher.js',\n array( 'jquery' ),\n filemtime( plugin_dir_path( __FILE__ ) . 'js/language-switcher.js' ),\n true\n );\n }\n if ( $options['raw'] ) {\n return supplang_languages();\n } else {\n include 'templates/language-selector.php';\n }\n}", "public function findPreferred() {\n if(!is_null($this->preferred)) return $this->preferred; \n foreach($this->data as $lang) {\n if($lang->isPreferred()) return $this->preferred = $lang;\n }\n return $this->preferred = $this->findDefault();\n }" ]
[ "0.6406377", "0.6310971", "0.62709683", "0.62623864", "0.6240943", "0.6204249", "0.6202675", "0.6179138", "0.6174234", "0.6166187", "0.61607695", "0.614215", "0.6139752", "0.6137824", "0.60741144", "0.6069976", "0.60521984", "0.6030639", "0.6021202", "0.59840775", "0.596592", "0.5963818", "0.594666", "0.59291136", "0.5910101", "0.5902782", "0.5894705", "0.5892685", "0.5892115", "0.58799875" ]
0.7569429
0
Get the url show the diff between revisions
public function getDiffUrl(string $from, string $to): string;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFileCompareUrl($revision, $path, $peg_revision = null) {\n $params = array('repository_id'=>$this->getId(), 'project_id'=>$this->getProjectId());\n \n if($revision !== null) {\n if (instance_of($revision, 'Commit')) {\n $params['r'] = $revision->getRevision();\n } else {\n $params['r'] = $revision;\n } // if\n } // if\n \n if ($peg_revision !== null) {\n $params['peg'] = $peg_revision;\n } // if\n \n if($path !== null) {\n $params['path'] = $path;\n } // if\n \n return assemble_url('repository_compare',$params);\n }", "function getNewVersionUrl() {\n \treturn assemble_url('project_file_new_version', array('project_id' => $this->getProjectId(), 'file_id' => $this->getId()));\n }", "public function getGitUrl();", "public function getGitWebUrl();", "function getViewUrl() {\n return $this->getHistoryUrl();\n }", "function getViewUrl() {\n return assemble_url('repository_commit', array('project_id'=>$this->getProjectId(), 'repository_id'=>$this->getParentId(), 'r'=>$this->getRevision()));\n }", "function vopros_answer_diffs_show($answer, $old_revision_id, $new_revision_id) {\n module_load_include('inc', 'diff', 'diff.pages');\n $old_answer = vopros_answer_load($answer->answer_id, $old_revision_id);\n $old_answer->account = user_load($old_answer->revision_uid);\n $new_answer = vopros_answer_load($answer->answer_id, $new_revision_id);\n $new_answer->account = user_load($new_answer->revision_uid);\n\n // Generate table header (date, username, logmessage).\n $old_header = t('!date by !username', array(\n '!date' => l(format_date($old_answer->revision_timestamp), \"admin/vopros/answers/$answer->answer_id/revisions/$old_answer->revision_id/view\"),\n '!username' => theme('username', (array) $old_answer),\n ));\n $new_header = t('!date by !username', array(\n '!date' => l(format_date($new_answer->revision_timestamp), \"admin/vopros/answers/$answer->answer_id/revisions/$new_answer->revision_id/view\"),\n '!username' => theme('username', (array) $new_answer),\n ));\n\n $old_log = $old_answer->log != '' ? '<p class=\"revision-log\">'. filter_xss($old_answer->log) .'</p>' : '';\n $new_log = $new_answer->log != '' ? '<p class=\"revision-log\">'. filter_xss($new_answer->log) .'</p>' : '';\n\n // Get the next and previous revisions.\n $revisions = vopros_answer_revision_list($answer);\n ksort($revisions);\n $prev_revision = $next_revision_id = 0;\n $get_next_revision = FALSE;\n foreach ($revisions as $revision_id => $value) {\n if ($get_next_revision == TRUE) {\n $get_next_revision = FALSE;\n $next_revision_id = $revision_id;\n }\n if ($revision_id == $new_answer->revision_id) {\n $get_next_revision = TRUE;\n }\n if ($revision_id == $old_answer->revision_id) {\n $prev_revision_id = $prev_revision;\n }\n $prev_revision = $revision_id;\n }\n\n if ($next_revision_id) {\n $next_link = l(t('next diff >'), 'admin/vopros/answers/'. $answer->answer_id .'/revisions/view/'. $new_answer->revision_id .'/'. $next_revision_id);\n }\n else {\n $next_link = '';\n }\n if ($prev_revision_id) {\n $prev_link = l(t('< previous diff'), 'admin/vopros/answers/'. $answer->answer_id .'/revisions/view/'. $prev_revision_id .'/'. $old_answer->revision_id);\n }\n else {\n $prev_link = '';\n }\n\n $cols = _diff_default_cols();\n $header = _diff_default_header($old_header, $new_header);\n $rows = array();\n if ($old_log || $new_log) {\n $rows[] = array(\n array(\n 'data' => $old_log,\n 'colspan' => 2\n ),\n array(\n 'data' => $new_log,\n 'colspan' => 2\n )\n );\n }\n $rows[] = array(\n array(\n 'data' => $prev_link,\n 'class' => array('diff-prevlink'),\n 'colspan' => 2\n ),\n array(\n 'data' => $next_link,\n 'class' => array('diff-nextlink'),\n 'colspan' => 2\n )\n );\n $rows = array_merge($rows, _vopros_answer_diff_rows($old_answer, $new_answer));\n $output = theme('diff_table', array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => array('diff')), 'cols' => $cols));\n\n if ($answer->revision_id == $new_answer->revision_id) {\n $output .= '<div class=\"diff-section-title\">'. t('Current revision:') .'</div>';\n }\n else {\n $output .= '<div class=\"diff-section-title\">'. t('Revision of !new_date:', array('!new_date' => format_date($new_answer->revision_timestamp))) .'</div>';\n }\n return $output;\n}", "public function revsDiff($data): Response\n {\n $this->transport->setMethod(\"POST\")->setData($data)->request($this->db . \"/_revs_diff\");\n\n return $this->transport->getResponse();\n }", "function getFileHistoryUrl($revision, $path, $peg_revision) {\n $params = array('repository_id'=>$this->getId(), 'project_id'=>$this->getProjectId());\n \n if($revision !== null) {\n if (instance_of($revision, 'Commit')) {\n $params['r'] = $revision->getRevision();\n } else {\n $params['r'] = $revision;\n } // if\n } // if\n \n if ($peg_revision !== null) {\n $params['peg'] = $peg_revision;\n } // if\n \n if($path !== null) {\n $params['path'] = $path;\n } // if\n \n return assemble_url('repository_file_history',$params);\n }", "public function getChangeLogUrl()\n {\n return $this->_sChangeLogUrl;\n }", "function getCommitUrl($revision) {\n return assemble_url('repository_commit', array('repository_id'=>$this->getId(), 'project_id'=>$this->getProjectId(), 'r'=> $revision));\n }", "abstract public function diffRevisions($new, $old);", "public function getRevisionLog();", "public function actGeteditorurl() {\n $lTemplate = $this -> getVal('template');\n $lChili = new CApi_Chili_Client($this -> mJobId);\n $lRet = $lChili -> showEditor($lTemplate);\n \n echo Zend_Json::encode($lRet);\n }", "public function getGridUrl()\n {\n return $this->getUrl('*/*/revisions', array('_current'=>true));\n }", "public function getVcsWebUrl();", "public function getDiff();", "function getURLView(){\r\n\t\t$TDB \t= $this->getTDB();\r\n\t\t$Branch = $TDB->getBranch();\r\n\t\t$Track \t= $TDB->getTrack();\t\t\r\n\t\treturn \"/don-vi/\".$Branch->getKey().\"/bao-cao/\".$Track->getId().\"/khach-hang/\".$this->getIdTDB().\"/\".$this->getId();\r\n\t}", "protected function _link() {\n\n\t\treturn $this->lastChanges( $this->request()::$url );\n\t}", "protected function _link() {\n\n\t\treturn $this->lastChanges( $this->request()::$url );\n\t}", "protected function _link() {\n\n\t\treturn $this->lastChanges( $this->request()::$url );\n\t}", "public function getVcsUrl();", "function getPortalFileCompareUrl($portal, $revision = null, $path = null) {\n \t$params = array('portal_name' => $portal->getSlug(), 'repository_id' => $this->getId());\n \t\n \tif($revision !== null) {\n \t\tif(instance_of($revision, 'Commit')) {\n \t\t\t$params['r'] = $revision->getRevision();\n \t\t} else {\n \t\t\t$params['r'] = $revision;\n \t\t} // if\n \t} // if\n \t\n \tif($path !== null) {\n \t\t$params['path'] = $path;\n \t} // if\n \t\n \treturn assemble_url('portal_repository_compare', $params);\n }", "function get_diff_as_html()\r\n {\r\n $diff = $this->get_difference();\r\n\r\n $html = array();\r\n $html[] = '<div class=\"difference\" style=\"background-image: url(' . Theme :: get_image_path(ContentObject :: get_content_object_type_namespace($diff->get_object()->get_type())) . 'logo/' . $diff->get_object()->get_icon_name() . '.png);\">';\r\n $html[] = '<div class=\"titleleft\">';\r\n $html[] = $diff->get_object()->get_title();\r\n $html[] = date(\" (d M Y, H:i:s O)\", $diff->get_object()->get_creation_date());\r\n $html[] = '</div>';\r\n $html[] = '<div class=\"titleright\">';\r\n $html[] = $diff->get_version()->get_title();\r\n $html[] = date(\" (d M Y, H:i:s O)\", $diff->get_version()->get_creation_date());\r\n $html[] = '</div>';\r\n\r\n foreach ($diff->get_difference() as $d)\r\n {\r\n if ($d instanceof Difference_Engine_Op_change)\r\n {\r\n $td = new Difference_Engine(explode(\" \", $d->get_orig()), explode(\" \", $d->get_final()));\r\n\r\n $html[] = '<div class=\"left\">';\r\n $html_change = array();\r\n foreach ($td->getDiff() as $t)\r\n {\r\n $html_change[] = $t->parse('final', true);\r\n }\r\n $html[] = implode(' ', $html_change);\r\n $html[] = '</div>';\r\n\r\n $html[] = '<div class=\"right\">';\r\n $html_change = array();\r\n foreach ($td->getDiff() as $t)\r\n {\r\n $html_change[] = $t->parse('orig', true);\r\n }\r\n $html[] = implode(' ', $html_change);\r\n $html[] = '</div>';\r\n\r\n $html[] = '<br style=\"clear:both;\" />';\r\n }\r\n else\r\n {\r\n $html[] = '<div class=\"left\">';\r\n $html[] = print_r($d->parse('final'), true) . '';\r\n $html[] = '</div>';\r\n $html[] = '<div class=\"right\">';\r\n $html[] = print_r($d->parse('orig'), true) . '';\r\n $html[] = '</div>';\r\n $html[] = '<br style=\"clear:both;\" />';\r\n }\r\n }\r\n $html[] = '</div>';\r\n\r\n return implode(\"\\n\", $html);\r\n }", "function getUpdateUrl() {\n return assemble_url('repository_update', array('repository_id'=>$this->getId(), 'project_id'=>$this->getProjectId()));\n }", "public function historyAction() {\n\t\t$this->_helper->layout()->disableLayout();\n\t\t$resourceid = $this->_request->getParam('id');\n\t\t$versions = StudentResourceService::getPreviousVersions($resourceid);\n\t\t$this->view->versions = $versions;\n\t}", "function tasks_revision_url($annotation) {\n\treturn \"tasks/revision/$annotation->id\";\n}", "public function getLatestRevision();", "function getHistoryUrl($commit_author = null) {\n $params = array('repository_id'=>$this->getId(),'project_id'=>$this->getProjectId());\n \n if (!is_null($commit_author)) {\n $params['filter_by_author'] = $commit_author;\n } // if\n \n return assemble_url('repository_history', $params);\n }", "function terminus_api_site_environment_onserverdev_diff_get($site_uuid, $environment, $file_path = \"\") {\n $realm = 'site';\n $uuid = $site_uuid;\n $path = 'environments/' . $environment . '/on-server-development/diff?path=' . rawurlencode($file_path);\n $method = 'GET';\n\n return terminus_request($realm, $uuid, $path, $method);\n}" ]
[ "0.6638298", "0.65905046", "0.6507044", "0.6485062", "0.64252436", "0.64160687", "0.6337979", "0.63313425", "0.63064176", "0.62830263", "0.62120795", "0.6195591", "0.61116517", "0.6080631", "0.6033607", "0.5970072", "0.5959837", "0.5956136", "0.5935443", "0.5935443", "0.5935443", "0.5911578", "0.5877054", "0.58611107", "0.5848917", "0.58431154", "0.58378977", "0.58364075", "0.5833692", "0.58050203" ]
0.67553943
0
Get all revisions up to $revision
public function getRevisionsTo(string $revision): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRevisions()\n {\n return $this->_revisions;\n }", "public function getRevisions() {\n return $this->revisions;\n }", "public function revisionOverview() {\n $entityTypeId = $this->entityTypeId;\n $entity = $this->currentRoute->getParameter($entityTypeId);\n $account = $this->currentUser();\n $langcode = $entity->language()->getId();\n $langname = $entity->language()->getName();\n $languages = $entity->getTranslationLanguages();\n $hasTranslations = (count($languages) > 1);\n /* @var \\Drupal\\custom_entity_tools\\EntityBaseStorage $entityStorage */\n $entityStorage = $this->entityTypeManager()->getStorage($this->entityTypeId);\n\n $build['#title'] = $hasTranslations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $entity->label()]) : $this->t('Revisions for %title', ['%title' => $entity->label()]);\n $header = [$this->t('Revision'), $this->t('Operations')];\n\n $revertPermission = (($account->hasPermission(\"revert $entityTypeId revisions\") || $account->hasPermission(\"administer $entityTypeId entities\")));\n $deletePermission = (($account->hasPermission(\"delete $entityTypeId revisions\") || $account->hasPermission(\"administer $entityTypeId entities\")));\n\n $rows = [];\n\n $vids = $entityStorage->revisionIds($entity);\n\n $latestRevision = TRUE;\n\n foreach (array_reverse($vids) as $vid) {\n /** @var \\Drupal\\custom_entity_tools\\Entity\\EntityBaseInterface $revision */\n $revision = $entityStorage->loadRevision($vid);\n // Only show revisions that are affected by the language that is being\n // displayed.\n if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = \\Drupal::service('date.formatter')->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $entity->getRevisionId()) {\n $link = $this->l($date, new Url(\"entity.$entityTypeId.revision\", [$entityTypeId => $entity->id(), 'revision' => $vid]));\n }\n else {\n $link = $entity->link($date);\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => \\Drupal::service('renderer')->renderPlain($username),\n 'message' => ['#markup' => $revision->getRevisionLogMessage(), '#allowed_tags' => Xss::getHtmlTagList()],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latestRevision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latestRevision = FALSE;\n }\n else {\n $links = [];\n if ($revertPermission) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => Url::fromRoute(\"entity.$entityTypeId.revision_revert_confirm\", [\n $entityTypeId => $entity->id(),\n 'revision' => $vid,\n ]),\n ];\n }\n\n if ($deletePermission) {\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute(\"entity.$entityTypeId.revision_delete_confirm\", [\n $entityTypeId => $entity->id(),\n 'revision' => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n }\n\n $build['revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }", "public function revision($revision = 'tip')\n {\n $this->addOption('rev', $revision);\n\n /* For the fluent API */\n return $this;\n }", "function getRevisions() {\n if($this->revisions === false) {\n $this->revisions = Files::findRevisions($this, $this->getState(), $this->getVisibility());\n } // if\n return $this->revisions;\n }", "public function getAllRevisionLogs();", "public function setRevision($var)\n {\n GPBUtil::checkInt32($var);\n $this->revision = $var;\n\n return $this;\n }", "public function revisionOverview() {\n // Get entity type id.\n $entity_type_id = $this->entityType;\n\n // Get storage.\n $storage = $this\n ->entityTypeManager()\n ->getStorage($this->entityType);\n\n // Load the entity.\n $entity = $storage->load($this->entityId);\n\n // Get the current user.\n $account = $this->currentUser();\n\n // Build the renderable array.\n $build['#title'] = $this->t('Revisions for %title', ['%title' => $entity->label()]);\n $header = [$this->t('Revision'), $this->t('Operations')];\n\n // Get the entity type admin permission.\n $admin_permission = $entity\n ->getEntityType()\n ->getAdminPermission();\n\n // Check if currect user has the admin permission.\n $user_is_admin = $account->hasPermission($admin_permission);\n\n $rows = [];\n\n // Get the revision ids.\n $vids = $storage->revisionIds($entity);\n\n $latest_revision = TRUE;\n\n // Iterate the revisions.\n foreach (array_reverse($vids) as $vid) {\n $revision = $storage->loadRevision($vid);\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = $this->dateFormatter->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $entity->getRevisionId()) {\n $link = Link::fromTextAndUrl($date, new Url(\"entity.{$entity_type_id}.revision\", [\n $entity_type_id => $entity->id(),\n \"{$entity_type_id}_revision\" => $vid,\n ]))->toString();\n }\n else {\n $link = $entity->toLink($date)->toString();\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => $this->renderer->renderPlain($username),\n 'message' => [\n '#markup' => $revision->getRevisionLogMessage(),\n '#allowed_tags' => Xss::getHtmlTagList(),\n ],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latest_revision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latest_revision = FALSE;\n }\n else {\n $links = [];\n if ($user_is_admin) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => Url::fromRoute(\"entity.{$entity_type_id}.revision_revert\", [\n $entity_type_id => $entity->id(),\n \"{$entity_type_id}_revision\" => $vid,\n ]),\n ];\n\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute(\"entity.{$entity_type_id}.revision_delete\", [\n $entity_type_id => $entity->id(),\n \"{$entity_type_id}_revision\" => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n\n $build['revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }", "function get_entry_revision($entry_id, $revision_id) {\r\n\r\n global $mongo, $readPreference;\r\n\r\n $filter = ['entry_id' => $entry_id, '_id' => new MongoDB\\BSON\\ObjectID($revision_id)];\r\n $options = ['sort' => ['_id' => -1], 'limit' => 1];\r\n $query = new MongoDB\\Driver\\Query($filter, $options);\r\n $cursor = $mongo->executeQuery('memoryatlas.entries', $query, $readPreference);\r\n\r\n foreach ($cursor as $doc) {\r\n return $doc;\r\n }\r\n}", "public static function get_all_revisions() {\n\t\t$post = self::get_post();\n\n\t\tif ( ! $post ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$revisions = wp_get_post_revisions( $post->ID, array(\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby' => 'date',\n\t\t\t'order' => 'DESC',\n\t\t) );\n\n\t\treturn $revisions;\n\t}", "public function getRevisionLog();", "public function getRevisions($first, $num) {\n $revs = array();\n $lines = array();\n $count = 0;\n\n $num = max($num, 0);\n if($num == 0) {\n return $revs;\n }\n\n if($first < 0) {\n $first = 0;\n } else if(@file_exists($this->getFilename())) {\n // skip current revision if the page exists\n $first = max($first + 1, 0);\n }\n\n $file = $this->getChangelogFilename();\n\n if(!@file_exists($file)) {\n return $revs;\n }\n if(filesize($file) < $this->chunk_size || $this->chunk_size == 0) {\n // read whole file\n $lines = file($file);\n if($lines === false) {\n return $revs;\n }\n } else {\n // read chunks backwards\n $fp = fopen($file, 'rb'); // \"file pointer\"\n if($fp === false) {\n return $revs;\n }\n fseek($fp, 0, SEEK_END);\n $tail = ftell($fp);\n\n // chunk backwards\n $finger = max($tail - $this->chunk_size, 0);\n while($count < $num + $first) {\n $nl = $this->getNewlinepointer($fp, $finger);\n\n // was the chunk big enough? if not, take another bite\n if($nl > 0 && $tail <= $nl) {\n $finger = max($finger - $this->chunk_size, 0);\n continue;\n } else {\n $finger = $nl;\n }\n\n // read chunk\n $chunk = '';\n $read_size = max($tail - $finger, 0); // found chunk size\n $got = 0;\n while($got < $read_size && !feof($fp)) {\n $tmp = @fread($fp, max(min($this->chunk_size, $read_size - $got), 0));\n if($tmp === false) {\n break;\n } //error state\n $got += strlen($tmp);\n $chunk .= $tmp;\n }\n $tmp = explode(\"\\n\", $chunk);\n array_pop($tmp); // remove trailing newline\n\n // combine with previous chunk\n $count += count($tmp);\n $lines = array_merge($tmp, $lines);\n\n // next chunk\n if($finger == 0) {\n break;\n } // already read all the lines\n else {\n $tail = $finger;\n $finger = max($tail - $this->chunk_size, 0);\n }\n }\n fclose($fp);\n }\n\n // skip parsing extra lines\n $num = max(min(count($lines) - $first, $num), 0);\n if ($first > 0 && $num > 0) { $lines = array_slice($lines, max(count($lines) - $first - $num, 0), $num); }\n else if($first > 0 && $num == 0) { $lines = array_slice($lines, 0, max(count($lines) - $first, 0)); }\n else if($first == 0 && $num > 0) { $lines = array_slice($lines, max(count($lines) - $num, 0)); }\n\n // handle lines in reverse order\n for($i = count($lines) - 1; $i >= 0; $i--) {\n $tmp = parseChangelogLine($lines[$i]);\n if($tmp !== false) {\n $this->cache[$this->id][$tmp['date']] = $tmp;\n $revs[] = $tmp['date'];\n }\n }\n\n return $revs;\n }", "public function revisions($file, $limit = 10)\n\t{\n\t\t$call = 'revisions/' . $this->root . '/' . $this->encodePath($file);\n\t\t$params = array(\n\t\t\t'rev_limit' => ($limit < 1) ? 1 : (($limit > 1000) ? 1000 : (int) $limit),\n\t\t);\n\t\t$response = $this->fetch('GET', self::API_URL, $call, $params);\n\t\treturn $response;\n\t}", "public function getLatestRevision();", "public function useRevision(Revision $revision)\n {\n return $this->object()->useRevision($revision);\n }", "public function setRevision ($rev)\n {\n $this->_revision = (int) $rev;\n return $this;\n }", "public function node_revision_list(\\stdClass $node)\n {\n return node_revision_list($node);\n }", "private function _allrevisionssince($option) {\n\t\t$this->addTable('revision', 'rev');\n\t\t$this->addSelect(['rev_id', 'rev_timestamp']);\n\t\t$this->addOrderBy('rev_id');\n\t\t$this->setOrderDir('DESC');\n\t\t$this->addWhere($this->tableNames['page'].'.page_id=rev.rev_page AND rev.rev_timestamp >= '.$this->DB->addQuotes($option));\n\t}", "function getRevisions($id, $first, $num, $chunk_size = 8192, $media = false) {\n if($media) {\n $changelog = new MediaChangeLog($id, $chunk_size);\n } else {\n $changelog = new PageChangeLog($id, $chunk_size);\n }\n return $changelog->getRevisions($first, $num);\n}", "public function getRevision()\n {\n return $this->revision;\n }", "public function getRevision()\n {\n return $this->revision;\n }", "public function revisionOverview(ChartEntityInterface $chart_entity) {\n $account = $this->currentUser();\n $chart_entity_storage = $this->entityTypeManager()->getStorage('chart_entity');\n\n $langcode = $chart_entity->language()->getId();\n $langname = $chart_entity->language()->getName();\n $languages = $chart_entity->getTranslationLanguages();\n $has_translations = (count($languages) > 1);\n $build['#title'] = $has_translations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $chart_entity->label()]) : $this->t('Revisions for %title', ['%title' => $chart_entity->label()]);\n\n $header = [$this->t('Revision'), $this->t('Operations')];\n $revert_permission = (($account->hasPermission(\"revert all chart entity revisions\") || $account->hasPermission('administer chart entity entities')));\n $delete_permission = (($account->hasPermission(\"delete all chart entity revisions\") || $account->hasPermission('administer chart entity entities')));\n\n $rows = [];\n\n $vids = $chart_entity_storage->revisionIds($chart_entity);\n\n $latest_revision = TRUE;\n\n foreach (array_reverse($vids) as $vid) {\n /** @var \\Drupal\\chart_intigration\\ChartEntityInterface $revision */\n $revision = $chart_entity_storage->loadRevision($vid);\n // Only show revisions that are affected by the language that is being\n // displayed.\n if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = $this->dateFormatter->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $chart_entity->getRevisionId()) {\n $link = $this->l($date, new Url('entity.chart_entity.revision', [\n 'chart_entity' => $chart_entity->id(),\n 'chart_entity_revision' => $vid,\n ]));\n }\n else {\n $link = $chart_entity->link($date);\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => $this->renderer->renderPlain($username),\n 'message' => [\n '#markup' => $revision->getRevisionLogMessage(),\n '#allowed_tags' => Xss::getHtmlTagList(),\n ],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latest_revision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latest_revision = FALSE;\n }\n else {\n $links = [];\n if ($revert_permission) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => $has_translations ?\n Url::fromRoute('entity.chart_entity.translation_revert', [\n 'chart_entity' => $chart_entity->id(),\n 'chart_entity_revision' => $vid,\n 'langcode' => $langcode,\n ]) :\n Url::fromRoute('entity.chart_entity.revision_revert', [\n 'chart_entity' => $chart_entity->id(),\n 'chart_entity_revision' => $vid,\n ]),\n ];\n }\n\n if ($delete_permission) {\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute('entity.chart_entity.revision_delete', [\n 'chart_entity' => $chart_entity->id(),\n 'chart_entity_revision' => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n }\n\n $build['chart_entity_revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }", "public function getRevision()\n {\n return $this->_rev;\n }", "public function getRevById($id){\n return $this->where('id_rev', $id)->find();\n }", "private function _allrevisionsbefore($option) {\n\t\t$this->addTable('revision', 'rev');\n\t\t$this->addSelect(['rev_id', 'rev_timestamp']);\n\t\t$this->addOrderBy('rev_id');\n\t\t$this->setOrderDir('DESC');\n\t\t$this->addWhere($this->tableNames['page'].'.page_id=rev.rev_page AND rev.rev_timestamp < '.$this->DB->addQuotes($option));\n\t}", "public function GetAllRevisions($_page_id, $_orderby = null)\n {\n $q = self::$DB->SelectQuery(array(\"pages as p\", \"page_revisions as pr\", \"users as u\" => \"u.user_id = pr.rev_user\"));\n $q->fields = array(\"u.*\",\"pr.rev_page_name\",\"pr.rev_date\",\"pr.rev_id\",\"p.*\");\n $q->conditions = \"pr.page_id = p.page_id AND p.page_id = ?\";\n $q->parameters = array($_page_id);\n if(!is_null($_orderby))\n {\n $q->order = $_orderby;\n }\n\n $res = self::$DB->Process($q);\n\n return $res;\n }", "public function getTocAsList(AM_Model_Db_Revision $oRevision)\n {\n $oVocabulary = $oRevision->getVocabularyToc();\n $oQuery = $this->getAdapter()\n ->select()\n ->from(array('t1' => 'term'), null)\n ->joinLeft(array('t2' => 'term'), 't2.parent_term = t1.id AND t2.deleted = \"no\"' . $this->getAdapter()->quoteInto(' AND (t2.revision = ? OR t2.revision IS NULL)', $oRevision->id), null)\n ->joinLeft(array('t3' => 'term'), 't3.parent_term = t2.id AND t3.deleted = \"no\"' . $this->getAdapter()->quoteInto(' AND (t3.revision = ? OR t3.revision IS NULL)', $oRevision->id), null)\n ->joinLeft(array('t4' => 'term'), 't4.parent_term = t3.id AND t4.deleted = \"no\"' . $this->getAdapter()->quoteInto(' AND (t4.revision = ? OR t4.revision IS NULL)', $oRevision->id), null)\n ->joinLeft(array('t5' => 'term'), 't5.parent_term = t4.id AND t5.deleted = \"no\"' . $this->getAdapter()->quoteInto(' AND (t5.revision = ? OR t5.revision IS NULL)', $oRevision->id), null)\n ->where('t1.vocabulary = ?', $oVocabulary->id)\n ->where('t1.revision = ? OR t1.revision IS NULL', $oRevision->id)\n ->where('t1.parent_term is null')\n ->where('t1.deleted = ?', 'no')\n ->order(array('t1.id', 't2.id', 't3.id', 't4.id', 't5.id',))\n ->columns(array(\n 'id1' => 't1.id',\n 'id2' => 't2.id',\n 'id3' => 't3.id',\n 'id4' => 't4.id',\n 'id5' => 't5.id',\n 'title1' => 't1.title',\n 'title2' => 't2.title',\n 'title3' => 't3.title',\n 'title4' => 't4.title',\n 'title5' => 't5.title'\n ));\n\n $aResult = $this->getAdapter()->fetchAll($oQuery);\n\n $aToc = array();\n $sGlue = ' / ';\n foreach ($aResult as $row) {\n if ($row['id5']) {\n $aToc[$row['id5']] = implode($sGlue, array($row['title1'], $row['title2'], $row['title3'], $row['title4'], $row['title5']));\n } else if ($row['id4']) {\n $aToc[$row['id4']] = implode($sGlue, array($row['title1'], $row['title2'], $row['title3'], $row['title4']));\n } else if ($row['id3']) {\n $aToc[$row['id3']] = implode($sGlue, array($row['title1'], $row['title2'], $row['title3']));\n } else if ($row['id2']) {\n $aToc[$row['id2']] = implode($sGlue, array($row['title1'], $row['title2']));\n } else if ($row['id1']) {\n $aToc[$row['id1']] = implode($sGlue, array($row['title1']));\n }\n }\n\n return $aToc;\n }", "public function revisionShow($revision) {\n $entity = $this->entityTypeManager()->getStorage($this->entityTypeId)->loadRevision($revision);\n $view_builder = $this->entityTypeManager()->getViewBuilder($this->entityTypeId);\n return $view_builder->view($entity);\n }", "public function getRevisionsAround($rev1, $rev2, $max = 50) {\n $max = floor(abs($max) / 2)*2 + 1;\n $rev1 = max($rev1, 0);\n $rev2 = max($rev2, 0);\n\n if($rev2) {\n if($rev2 < $rev1) {\n $rev = $rev2;\n $rev2 = $rev1;\n $rev1 = $rev;\n }\n } else {\n //empty right side means a removed page. Look up last revision.\n $revs = $this->getRevisions(-1, 1);\n $rev2 = $revs[0];\n }\n //collect revisions around rev2\n list($revs2, $allrevs, $fp, $lines, $head, $tail) = $this->retrieveRevisionsAround($rev2, $max);\n\n if(empty($revs2)) return array(array(), array());\n\n //collect revisions around rev1\n $index = array_search($rev1, $allrevs);\n if($index === false) {\n //no overlapping revisions\n list($revs1,,,,,) = $this->retrieveRevisionsAround($rev1, $max);\n if(empty($revs1)) $revs1 = array();\n } else {\n //revisions overlaps, reuse revisions around rev2\n $revs1 = $allrevs;\n while($head > 0) {\n for($i = count($lines) - 1; $i >= 0; $i--) {\n $tmp = parseChangelogLine($lines[$i]);\n if($tmp !== false) {\n $this->cache[$this->id][$tmp['date']] = $tmp;\n $revs1[] = $tmp['date'];\n $index++;\n\n if($index > floor($max / 2)) break 2;\n }\n }\n\n list($lines, $head, $tail) = $this->readAdjacentChunk($fp, $head, $tail, -1);\n }\n sort($revs1);\n //return wanted selection\n $revs1 = array_slice($revs1, max($index - floor($max/2), 0), $max);\n }\n\n return array(array_reverse($revs1), array_reverse($revs2));\n }", "public function getRevisionsBetween(string $from, string $to): array;" ]
[ "0.63415426", "0.6315627", "0.6194511", "0.6182229", "0.6157854", "0.6103514", "0.6023218", "0.5980237", "0.5892988", "0.5852799", "0.580577", "0.5751261", "0.5734312", "0.56830966", "0.5650457", "0.56365234", "0.55342394", "0.5533692", "0.55326104", "0.5462336", "0.5462336", "0.5450201", "0.5421221", "0.53358245", "0.5321564", "0.53165203", "0.5307004", "0.5305258", "0.5296897", "0.5278896" ]
0.7634433
0
Get all revisions between $from and $to
public function getRevisionsBetween(string $from, string $to): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllBetween(int $from, int $to)\n {\n }", "public function getRevisionsTo(string $revision): array;", "public function getRevisionsAround($rev1, $rev2, $max = 50) {\n $max = floor(abs($max) / 2)*2 + 1;\n $rev1 = max($rev1, 0);\n $rev2 = max($rev2, 0);\n\n if($rev2) {\n if($rev2 < $rev1) {\n $rev = $rev2;\n $rev2 = $rev1;\n $rev1 = $rev;\n }\n } else {\n //empty right side means a removed page. Look up last revision.\n $revs = $this->getRevisions(-1, 1);\n $rev2 = $revs[0];\n }\n //collect revisions around rev2\n list($revs2, $allrevs, $fp, $lines, $head, $tail) = $this->retrieveRevisionsAround($rev2, $max);\n\n if(empty($revs2)) return array(array(), array());\n\n //collect revisions around rev1\n $index = array_search($rev1, $allrevs);\n if($index === false) {\n //no overlapping revisions\n list($revs1,,,,,) = $this->retrieveRevisionsAround($rev1, $max);\n if(empty($revs1)) $revs1 = array();\n } else {\n //revisions overlaps, reuse revisions around rev2\n $revs1 = $allrevs;\n while($head > 0) {\n for($i = count($lines) - 1; $i >= 0; $i--) {\n $tmp = parseChangelogLine($lines[$i]);\n if($tmp !== false) {\n $this->cache[$this->id][$tmp['date']] = $tmp;\n $revs1[] = $tmp['date'];\n $index++;\n\n if($index > floor($max / 2)) break 2;\n }\n }\n\n list($lines, $head, $tail) = $this->readAdjacentChunk($fp, $head, $tail, -1);\n }\n sort($revs1);\n //return wanted selection\n $revs1 = array_slice($revs1, max($index - floor($max/2), 0), $max);\n }\n\n return array(array_reverse($revs1), array_reverse($revs2));\n }", "public function get_content_FromTo($from, $to) {\n if ( isset( $this->_data[$from] ) ) {\n $data = array();\n $i = 0;\n while ($from + $i <= $to && isset($this->_data[$from + $i])) {\n $data[$i] = $this->_data[$i + $from];\n $i++;\n }\n return $data;\n } else {\n return false;\n }\n }", "public function get_content_FromTo($from, $to) {\n if ( isset ( $this->_data[$from] ) ) {\n $data = array();\n $i = 0;\n while ($from + $i <= $to && isset($this->_data[$from + $i])) {\n $data[$i] = $this->_data[$i + $from];\n $i++;\n }\n return $data;\n } else {\n return false;\n }\n }", "protected function _diff($from, $to)\n {\n // Load the from and to models\n $fromModels = $this->_initializeModels($from);\n $toModels = $this->_initializeModels($to);\n\n // Build schema information for the models\n $fromInfo = $this->_buildModelInformation($fromModels);\n $toInfo = $this->_buildModelInformation($toModels);\n\n // Build array of changes between the from and to information\n $changes = $this->_buildChanges($fromInfo, $toInfo);\n\n $this->_cleanup();\n\n return $changes;\n }", "public function getAllRevisionLogs();", "public function subSet($from, $to);", "function getRecentsSince($from,$to=null,$ns='',$flags=0){\n global $conf;\n $recent = array();\n\n if($to && $to < $from)\n return $recent;\n\n // read all recent changes. (kept short)\n if ($flags & RECENTS_MEDIA_CHANGES) {\n $lines = @file($conf['media_changelog']);\n } else {\n $lines = @file($conf['changelog']);\n }\n if(!$lines) return $recent;\n\n // we start searching at the end of the list\n $lines = array_reverse($lines);\n\n // handle lines\n $seen = array(); // caches seen lines, _handleRecent() skips them\n\n foreach($lines as $line){\n $rec = _handleRecent($line, $ns, $flags, $seen);\n if($rec !== false) {\n if ($rec['date'] >= $from) {\n if (!$to || $rec['date'] <= $to) {\n $recent[] = $rec;\n }\n } else {\n break;\n }\n }\n }\n\n return array_reverse($recent);\n}", "public function getByData($from,$to)\n {\n return $outlay = Outlay::whereBetween('date',[$from,$to])->orderBy('updated_at', 'DESC')->get();\n }", "function history($model, $id, $conditions = null, $fields = null, $order = null, $limit = null, $recursive = null) {\n\t\t\n\t\textract($this->settings[$model->alias]);\n\t\t\n\t\tif (!$id) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$model = new $model->alias;\n\t\t$version = $model->revision(null, true);\n\t\t$conditions = array(\n\t\t\t$version->alias.'.'.$version->primaryKey => $id\n\t\t);\n\t\t$results = $version->findAll($conditions, $fields, $order, $limit, $recursive);\n\t\t\n\t\t$dates = Set::extract($results, \"{n}.$version->alias.$date_start\");\n\t\tforeach ($version->__associations as $association) {\n\t\t\tforeach ($version->$association as $name => $assoc) {\n\t\t\t\tswitch ($association) {\n\t\t\t\t\tcase 'hasOne':\n\t\t\t\t\tcase 'belongsTo':\n\t\t\t\t\t\t$dates = array_merge($dates, Set::extract($results, \"{n}.$name.$date_start\"));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'hasAndBelongsToMany':\n\t\t\t\t\tcase 'hasMany':\n\t\t\t\t\t\t$data = Set::extract($results, \"{n}.$name.{n}.$date_start\");\n\t\t\t\t\t\t$dates = array_merge($dates, $this->__flatten($data));\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tunset($results);\n\t\t$dates = Set::filter(array_unique($dates));\n\t\t$revisions = array();\n\t\tforeach ($dates as $d) {\n\t\t\t$model = new $model->alias;\n\t\t\t$version = $model->revision($d);\n\t\t\t$conditions = array(\n\t\t\t\t$version->alias.'.'.$version->primaryKey => $id\n\t\t\t);\n\t\t\t$tmp = $version->find($conditions, $fields, $order, $limit, $recursive);\n\t\t\tif (!empty($tmp)) {\n\t\t\t\t$revisions[$d] = $tmp;\n\t\t\t}\n\t\t}\n\t\tkrsort($revisions);\n\t\treturn $revisions;\n\t}", "public static function get_all_revisions() {\n\t\t$post = self::get_post();\n\n\t\tif ( ! $post ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$revisions = wp_get_post_revisions( $post->ID, array(\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby' => 'date',\n\t\t\t'order' => 'DESC',\n\t\t) );\n\n\t\treturn $revisions;\n\t}", "private function range($from)\n {\n try {\n $to = request()->input('to') ? Carbon::createFromFormat('Y-m-d', request()->input('to')) : Carbon::now();\n } catch (\\Exception $e) {\n $to = Carbon::now();\n }\n\n try {\n $from = request()->input('from') ? Carbon::createFromFormat('Y-m-d', request()->input('from')) : $from;\n } catch (\\Exception $exception) {\n $from = $to;\n }\n\n if ($from->diffInDays($to) < 1) {\n $unit = 'hour';\n $format = '';\n } elseif($from->diffInMonths($to) < 3) {\n $unit = 'day';\n $format = 'Y-m-d';\n } elseif ($from->diffInYears($to) < 2) {\n $unit = 'month';\n $format = 'Y-m';\n } else {\n $unit = 'year';\n $format = 'Y';\n }\n\n // Reset the date range if it exceeds the limits\n if ($from->diffInYears($to) >= 100) {\n $to = Carbon::now();\n $from = $to;\n }\n\n // Get the old period date range\n $to_old = (clone $from)->subDays(1);\n $from_old = (clone $to_old)->subDays($from->diffInDays($to));\n\n return ['from' => $from->format('Y-m-d'), 'to' => $to->format('Y-m-d'), 'from_old' => $from_old->format('Y-m-d'), 'to_old' => $to_old->format('Y-m-d'), 'unit' => $unit, 'format' => $format];\n }", "public function getAll($bankAccount = NULL, $from = NULL, $to = NULL) {\n\t\t//$params = (!empty($filter)) ? '?view='.$filter : NULL;\n\t\t$fromQuery = (!empty($from)) ? '&from_date=' . $from : NULL;\n\t\t$toQuery = (!empty($to)) ? '&to_date=' . $to : NULL;\n\t\t$toReturn = array();\n\t\t$urls = array();\n\n\t\tif ($bankAccount === NULL || is_array($bankAccount)) {\n\t\t\t$ba = new BankAccounts();\n\t\t\t$bankAccounts = $ba->getAll();\n\t\t\tforeach ($bankAccounts as $b) {\n\t\t\t\t$urls[] = $b->url;\n\t\t\t}\n\t\t} else {\n\t\t\t$urls[] = $bankAccount;\n\t\t}\n\t\t// foreach bank accounts\n\t\tforeach ($urls as $url) {\n\t\t\t$request['url'] = $GLOBALS['cfg']['api_url']\n\t\t\t\t\t. '/bank_transaction_explanations?bank_account='\n\t\t\t\t\t. $bankAccount . $fromQuery . $toQuery;\n\n\t\t\t$request['body'] = '';\n\t\t\t$request['method'] = 'GET';\n\t\t\t$request['type'] = 'application/json';\n\t\t\t$result = $this->invoke_api($request);\n\n\t\t\tif (NULL !== $result) {\n\t\t\t\tforeach ($result->bank_transaction_explanations as $bankExplanation) {\n\t\t\t\t\t$tmp = new BankExplanation();\n\t\t\t\t\tforeach ($bankExplanation as $name => $value) {\n\t\t\t\t\t\t$tmp->$name = $value;\n\t\t\t\t\t}\n\t\t\t\t\t$toReturn[] = $tmp;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn $toReturn;\n\t}", "public function getRevisions()\n {\n return $this->_revisions;\n }", "function getRevisions($id, $first, $num, $chunk_size = 8192, $media = false) {\n if($media) {\n $changelog = new MediaChangeLog($id, $chunk_size);\n } else {\n $changelog = new PageChangeLog($id, $chunk_size);\n }\n return $changelog->getRevisions($first, $num);\n}", "public function getRevisions() {\n return $this->revisions;\n }", "public function getByRange(Carbon $from, Carbon $to) {\n\t\treturn $this->model\n\t\t\t\t->where('begins_at', '<=', $to)\n\t\t\t\t->where('ends_at', '>=', $from->copy()->addHours(5)) // Only get after 5am\n\t\t\t\t->orderBy(DB::raw(\"date_trunc('day', begins_at)\"), 'ASC')\n\t\t\t\t->orderBy('city_name', 'ASC')\n\t\t\t\t->get();\n\t}", "public function setDateRange($from, $to)\r\n {\r\n $this->_reset()\r\n ->addAttributeToSelect('*')\r\n ->addOrderedQty($from, $to)\r\n ->setOrder('ordered_qty', self::SORT_ORDER_DESC);\r\n\t\t$this->_select->where('order.vendor_id=?',$this->_vendor_id);\r\n return $this;\r\n }", "public function revisionOverview() {\n $entityTypeId = $this->entityTypeId;\n $entity = $this->currentRoute->getParameter($entityTypeId);\n $account = $this->currentUser();\n $langcode = $entity->language()->getId();\n $langname = $entity->language()->getName();\n $languages = $entity->getTranslationLanguages();\n $hasTranslations = (count($languages) > 1);\n /* @var \\Drupal\\custom_entity_tools\\EntityBaseStorage $entityStorage */\n $entityStorage = $this->entityTypeManager()->getStorage($this->entityTypeId);\n\n $build['#title'] = $hasTranslations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $entity->label()]) : $this->t('Revisions for %title', ['%title' => $entity->label()]);\n $header = [$this->t('Revision'), $this->t('Operations')];\n\n $revertPermission = (($account->hasPermission(\"revert $entityTypeId revisions\") || $account->hasPermission(\"administer $entityTypeId entities\")));\n $deletePermission = (($account->hasPermission(\"delete $entityTypeId revisions\") || $account->hasPermission(\"administer $entityTypeId entities\")));\n\n $rows = [];\n\n $vids = $entityStorage->revisionIds($entity);\n\n $latestRevision = TRUE;\n\n foreach (array_reverse($vids) as $vid) {\n /** @var \\Drupal\\custom_entity_tools\\Entity\\EntityBaseInterface $revision */\n $revision = $entityStorage->loadRevision($vid);\n // Only show revisions that are affected by the language that is being\n // displayed.\n if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = \\Drupal::service('date.formatter')->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $entity->getRevisionId()) {\n $link = $this->l($date, new Url(\"entity.$entityTypeId.revision\", [$entityTypeId => $entity->id(), 'revision' => $vid]));\n }\n else {\n $link = $entity->link($date);\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => \\Drupal::service('renderer')->renderPlain($username),\n 'message' => ['#markup' => $revision->getRevisionLogMessage(), '#allowed_tags' => Xss::getHtmlTagList()],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latestRevision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latestRevision = FALSE;\n }\n else {\n $links = [];\n if ($revertPermission) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => Url::fromRoute(\"entity.$entityTypeId.revision_revert_confirm\", [\n $entityTypeId => $entity->id(),\n 'revision' => $vid,\n ]),\n ];\n }\n\n if ($deletePermission) {\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute(\"entity.$entityTypeId.revision_delete_confirm\", [\n $entityTypeId => $entity->id(),\n 'revision' => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n }\n\n $build['revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }", "public function getDiffUrl(string $from, string $to): string;", "public function getRevisionRange($file, $r1, $r2)\n {\n return array();\n }", "public function diffVersions($path = '', $revFrom = 0, $revTo = 0) {\r\n\r\n require_once 'ext/Diff/Diff.php';\r\n require_once 'ext/Diff/Renderer.php';\r\n require_once 'ext/Diff/Renderer/unified.php';\r\n\r\n $this->mime_array = $this->get_mime_array();\r\n\r\n //Get a list of objects to be updated.\r\n $objects_list = $this->getLogsForUpdate($path, $revFrom, $revTo, false);\r\n if (!is_null($objects_list)) {\r\n// print_r($objects_list);\r\n foreach ($objects_list['files'] as $file) {\r\n if ($file != '') {\r\n\r\n $path_info = pathinfo($file);\r\n $mime_type = $this->mime_array[$path_info['extension']];\r\n\r\n if (strpos($mime_type, \"text\") !== false) {\r\n\r\n $file_revFrom = $this->getFile($file, $revFrom);\r\n $file_revFrom =\r\n $this->explodeX(array(\"\\r\\n\", \"\\r\", \"\\n\"), $file_revFrom);\r\n\r\n $file_revTo = $this->getFile($file, $revTo);\r\n $file_revTo = $this->explodeX(array(\"\\r\\n\", \"\\r\", \"\\n\"), $file_revTo);\r\n\r\n\r\n /* Create the Diff object. */\r\n $diff = new Text_Diff('auto', array($file_revFrom, $file_revTo));\r\n\r\n /* Output the diff in unified format. */\r\n $renderer = new Text_Diff_Renderer_unified();\r\n $result = $renderer->render($diff);\r\n if (strlen($result) > 1) {\r\n /*\r\n echo \"Index: \" . $file . \" \\r\\n\";\r\n echo \"===================================================================\" . \" \\r\\n\";\r\n echo \"--- \" . $file . \" (revision \" . $revFrom . \")\" . \" \\r\\n\";\r\n echo \"+++ \" . $file . \" (revision \" . $revTo . \")\" . \" \\r\\n\";\r\n echo $renderer->render($diff) . \" \\r\\n\";\r\n */\r\n }\r\n }\r\n }\r\n }\r\n foreach ($objects_list['filesDelete'] as $file) {\r\n if ($file != '') {\r\n\r\n $path_info = pathinfo($file);\r\n $mime_type = $this->mime_array[$path_info['extension']];\r\n\r\n if (strpos($mime_type, \"text\") !== false) {\r\n\r\n $file_revFrom = $this->getFile($file, $revFrom);\r\n $file_revFrom =\r\n $this->explodeX(array(\"\\r\\n\", \"\\r\", \"\\n\"), $file_revFrom);\r\n\r\n $file_revTo = $this->getFile($file, $revTo);\r\n $file_revTo = $this->explodeX(array(\"\\r\\n\", \"\\r\", \"\\n\"), $file_revTo);\r\n\r\n\r\n /* Create the Diff object. */\r\n $diff = new Text_Diff('auto', array($file_revFrom, $file_revTo));\r\n\r\n /* Output the diff in unified format. */\r\n $renderer = new Text_Diff_Renderer_unified();\r\n $result = $renderer->render($diff);\r\n if (strlen($result) > 1) {\r\n /*\r\n echo \"Index: \" . $file . \" \\r\\n\";\r\n echo \"===================================================================\" . \" \\r\\n\";\r\n echo \"--- \" . $file . \" (revision \" . $revFrom . \")\" . \" \\r\\n\";\r\n echo \"+++ \" . $file . \" (revision \" . $revTo . \")\" . \" \\r\\n\";\r\n echo $renderer->render($diff) . \" \\r\\n\";\r\n */\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "public function downloadTransactionsFromTo(\\DateTime $from, \\DateTime $to)\n {\n return ApiDownloadHandler::instance($this->token)->downloadFromTo($from, $to);\n }", "public function fetchActivityIdsByDateRange($from, $to)\n {\n $rsm = new ResultSetMapping();\n $rsm->addScalarResult('activity_id', 'activity');\n $sql = 'SELECT DISTINCT t.activity_id FROM timeslices t WHERE t.started_at BETWEEN ? AND ?';\n $query = $this->getEntityManager()\n ->createNativeQuery($sql, $rsm)\n ->setParameter(1, $from)\n ->setParameter(2, $to);\n return array_map(\"array_pop\", $query->getResult());\n }", "public function getDocumentRange($from, $to, $searchId = null, $xml = true)\n {\n if ($searchId === null)\n $searchId = $this->searchId;\n\n $nativeQuery = wcmCache::fetch('wcmBizsearch_' . $searchId);\n if ($nativeQuery === false)\n {\n $this->lastErrorMsg = sprintf(getConst(_BIZ_INVALID_ID), $searchId);\n return null;\n }\n $sql = $nativeQuery['querySelect'];\n\n $rs = $this->database->executeQuery($sql, array(), $from, $to - $from + 1);\n if ($rs === null)\n {\n $this->lastErrorMsg = $this->database->lastErrorMsg;\n return null;\n }\n\n if ($xml)\n $result = '<resultSet>';\n else\n $result = array();\n\n while ($rs->next())\n {\n $row = $rs->getRow();\n $bizobject = @new $row['classname']($this->project, $row['id']);\n if ($bizobject && $bizobject->id)\n {\n if ($xml)\n $result .= '<result>' . $bizobject->toXML() . '</result>';\n else\n $result[] = $bizobject;\n }\n }\n\n if ($xml)\n $result .= '</resultSet>';\n\n return $result;\n }", "function getRevisions() {\n if($this->revisions === false) {\n $this->revisions = Files::findRevisions($this, $this->getState(), $this->getVisibility());\n } // if\n return $this->revisions;\n }", "private static function getPosts()\n {\n $from = isset($_GET['from']) ? $_GET['from'] : 0;\n $to = isset($_GET['to']) ? $_GET['to'] : 30;\n $sql = \"SELECT * FROM posts ORDER BY id DESC LIMIT ?, ?\";\n\n DB::respond($sql, 'ii', [$from, $to]);\n }", "public function get_att_change_request($from, $to, $id){\n\t\t$this->loadModel('HrAttChange');\n\t\t$this->HrAttChange->unBindModel(array('hasOne' => array('Todo','HrAttStatus'), 'belongsTo' => array('Home','HrAttendance')));\t\t\n\t\t$change_req = $this->HrAttChange->find('all', array('fields'=> array('att_date'), 'conditions' => array('att_date between ? and ?' => array($from, $to),\n\t\t'HrAttChange.app_users_id' => $id, 'is_approve' => 'N')));\n\t\t$req = array();\n\t\t\t\n\t\tforeach($change_req as $req_data){\n\t\t\t$req[] = $req_data['HrAttChange']['att_date'];\n\t\t}\n\t\treturn $req;\n\t}", "public function GetAllRevisions($_page_id, $_orderby = null)\n {\n $q = self::$DB->SelectQuery(array(\"pages as p\", \"page_revisions as pr\", \"users as u\" => \"u.user_id = pr.rev_user\"));\n $q->fields = array(\"u.*\",\"pr.rev_page_name\",\"pr.rev_date\",\"pr.rev_id\",\"p.*\");\n $q->conditions = \"pr.page_id = p.page_id AND p.page_id = ?\";\n $q->parameters = array($_page_id);\n if(!is_null($_orderby))\n {\n $q->order = $_orderby;\n }\n\n $res = self::$DB->Process($q);\n\n return $res;\n }" ]
[ "0.64618325", "0.6428727", "0.5907843", "0.58913594", "0.58890146", "0.5774128", "0.5757497", "0.5717453", "0.5645002", "0.5619927", "0.5595563", "0.5525597", "0.5508549", "0.55035937", "0.5499559", "0.54974073", "0.54955953", "0.54857904", "0.5481262", "0.5475615", "0.5447705", "0.53769284", "0.5364554", "0.53474367", "0.5323684", "0.5316745", "0.53138745", "0.5293048", "0.52799225", "0.52765286" ]
0.8747673
0
Store a newly created Payment in storage.
public function store(CreatePaymentRequest $request) { $input = $request->all(); $payment = $this->paymentRepository->create($input); $this->paymentRepository->attachInvoices($payment, $request->get('invoices')); Flash::success('Payment saved successfully.'); if(! isset( $input['ticket_id'])){ return redirect(route('payments.index')); } else { Actionable::create(['ticket_action_id'=>$input['action_id'],'ticket_id'=>$input['ticket_id'],'actionable_type'=>Payment::class,'actionable_id'=>$payment->id]); TicketActionStatues::create(['ticket_action_id'=>$input['action_id'],'ticket_id'=>$input['ticket_id'],'status'=>1]); return redirect('/tickets/'.$input['ticket_id']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function persist(Payment $payment) : Transference;", "public function store(StorePaymentRequest $request)\n {\n $result = DB::connection('tenant')->transaction(function () use ($request) {\n $payment = Payment::create($request->all());\n\n $payment\n ->load('form')\n ->load('paymentable')\n ->load('details.allocation')\n ->load('details.referenceable.form');\n\n return new ApiResource($payment);\n });\n\n return $result;\n }", "public function store(Requests\\PaymentMethodStoreRequest $request)\n {\n PaymentMethod::create($request->all());\n return redirect(\"/backend/paymentmethods\")->with(\"message\", \"New payment method was created successfully!\");\n }", "public function store(PaymentRequest $request)\n {\n $data = $request->all();\n $data['transfer_date'] = $data['transfer_date_submit'];\n\n\n if (!$this->paymentRepository->store($data))\n Flash::error('Ya existe un pago para este mes.');\n else\n Flash::message('Pago agregado correctamente');\n\n return Redirect::back();\n }", "function store_free_payment() {\r\n require_once('payment.class.php');\r\n\r\n $payment = new Payment;\r\n $payment->id = $_SESSION['payment_id'];\r\n $payment->payment_method = '(none)';\r\n $payment->is_completed = 1;\r\n $payment->completed_at = Util::epoch_to_datetime();\r\n $payment->is_verified = 1;\r\n $payment->verified_at = Util::epoch_to_datetime();\r\n $payment->save();\r\n}", "public function store(Request $request)\n {\n $requestData = $request->all();\n \n payment::create($requestData);\n\n return redirect('admin/payment')->with('flash_message', 'payment added!');\n }", "public function store(PaymentRequest $request)\n {\n $this->paymentRepositoryInterface->storePayment($request);\n return redirect(adminRedirectRoute('payment'))->withSuccess('Payment Created Successfully.');\n }", "public function store(Request $request)\n {\n $newOrder = session()->get('newOrder');\n\n $order = Order::create(array_merge($newOrder, ['user_id' => Auth::id(),'unassigned_at'=>Carbon::now()]));\n \n $newOrder = array_merge($newOrder,['id' => $order->id]);\n\n session()->put('newOrder', $newOrder);\n \n FileUpload::where('fileUuid', $newOrder['fileUuid'])->update(['order_id'=>$order->id,'fileUuid'=> NULL]);\n\n $payment = new CreatePayment();\n\n return $payment->create();\n \n }", "public function store(CreatestripePaymentRequest $request)\n {\n $input = $request->all();\n\n $stripePayment = $this->stripePaymentRepository->create($input);\n\n Flash::success('Stripe Payment saved successfully.');\n\n return redirect(route('stripePayments.index'));\n }", "public function persist()\n {\n if(request()->has('plan_id'))\n {\n $record = request()->except(['_token', 'plan_id']);\n\n NursingCarePlan::find(request('plan_id'))->update($record);\n }\n else\n {\n $record = request()->except('_token');\n\n NursingCarePlan::create($record);\n }\n }", "public function store()\n {\n request()->validate(['id' => 'required']);\n\n $payment = request()->user()->payments()->find(request('id'));\n\n if (! $payment) {\n throw new AuthorizationException();\n }\n\n $nextPayment = PayAction::instance()\n ->pay(Payment::findOrFail(request('id')))\n ->getNextPayment();\n\n return ['next_payment' => $nextPayment];\n }", "public function store(Request $request)\n {\n $client_id = $request->session()->get('client_id');\n $program_id = $request->session()->get('program_id');\n $step_id = $request->session()->get('step_id');\n $receipt_id = $request->session()->get('receipt_id');\n $location = $request->session()->get('location');\n $opening_fee = $request->session()->get('opening_fee');\n $embassy_student_fee = $request->session()->get('embassy_student_fee');\n $service_solicitor_fee = $request->session()->get('service_solicitor_fee');\n $other = $request->session()->get('other');\n $comments = $request->session()->get('comments');\n $created_at = $request->session()->get('created_at');\n\n\n $payment = Payment::updateOrCreate(\n [\n 'client_id' => $client_id,\n 'program_id' => $program_id,\n 'step_id' => $step_id\n ],\n [\n 'receipt_id' => $receipt_id,\n 'location' => $location,\n 'opening_fee' => $opening_fee,\n 'embassy_student_fee' => $embassy_student_fee,\n 'service_solicitor_fee' => $service_solicitor_fee,\n 'other' => $other,\n 'created_by' => Auth::user()->id,\n 'comments' => $comments,\n 'created_at' => $created_at,\n ]);\n\n\n $counter = 0;\n $counter = $request->counter;\n $payment_id = $payment->id;\n $bank_charges = BankCharge::all();\n\n for ($i=0; $i < $counter + 1; $i++) { \n $charge = 0;\n $cheque_verified = 1;\n $online_verified = 1;\n $bkash_salman_verified = 1;\n $bkash_corporate_verified = 1;\n $payment_type = Input::get('payment_type-' . $i);\n $bank_deposited = Input::get('bank_name-' . $i);\n $after_charge = 0;\n\n if($payment_type == 'card') {\n\n $POS_machine = Input::get('pos_machine-' . $i);\n $city_bank = Input::get('city_bank-' . $i);\n $card_type = Input::get('card_type-' . $i);\n $charge = 0;\n $bank_deposited = Input::get('bank_name-' . $i);\n\n switch ($POS_machine) {\n\n case 'city':\n\n $bank_deposited = 'scb';\n if($card_type == 'amex') {\n $charge = $bank_charges->where('bank_name', 'city_bank_amex')->first()->bank_charge;\n } else {\n\n if($city_bank == 'yes') {\n $charge = $bank_charges->where('bank_name', 'city_bank')->first()->bank_charge;\n } else {\n $charge = $bank_charges->where('bank_name', 'city_bank_other')->first()->bank_charge;\n }\n }\n \n break;\n\n case 'brac':\n\n $bank_deposited = 'brac';\n $charge = $bank_charges->where('bank_name', 'brac_bank')->first()->bank_charge;\n break;\n\n case 'ebl':\n \n $bank_deposited = 'ebl';\n $charge = $bank_charges->where('bank_name', 'ebl')->first()->bank_charge;\n break;\n\n case 'ucb':\n \n $bank_deposited = 'ucb';\n $charge = $bank_charges->where('bank_name', 'ucb')->first()->bank_charge;\n break;\n\n case 'dbbl':\n \n $bank_deposited = 'dbbl';\n $charge = $bank_charges->where('bank_name', 'dbbl')->first()->bank_charge;\n break;\n\n default:\n }\n\n } else if($payment_type == 'cheque') {\n\n $cheque_verified = -1;\n\n } else if($payment_type == 'online') {\n\n $online_verified = -1;\n\n } else if($payment_type == 'upay') {\n\n $charge = $bank_charges->where('bank_name', 'upay')->first()->bank_charge;\n\n } else if($payment_type == 'bkash_corporate') {\n\n $charge = $bank_charges->where('bank_name', 'bkash_corporate')->first()->bank_charge;\n $bkash_corporate_verified = -1;\n\n } else if($payment_type == 'bkash_salman') {\n\n $charge = $bank_charges->where('bank_name', 'bkash_salman')->first()->bank_charge;\n $bkash_salman_verified = -1;\n\n } else if($payment_type == 'pay_gic') {\n\n $charge = $bank_charges->where('bank_name', 'pay_gic')->first()->bank_charge;\n $online_verified = -1;\n\n } else if($payment_type == 'pay_gic_ssl') {\n\n $charge = $bank_charges->where('bank_name', 'pay_gic_ssl')->first()->bank_charge;\n $online_verified = -1;\n\n } else {\n\n // Do nothing\n }\n\n $amount_paid = Input::get('total_amount-' . $i);\n\n if($charge > 0) {\n $after_charge = $amount_paid - (($charge / 100) * $amount_paid);\n } else {\n $after_charge = $amount_paid;\n }\n\n PaymentType::create([\n 'payment_id' => $payment_id,\n 'payment_type' => $payment_type,\n 'card_type' => Input::get('card_type-' . $i),\n 'name_on_card' => Input::get('name_on_card-' . $i),\n 'card_number' => Input::get('card_number-' . $i),\n 'expiry_date' => Input::get('expiry_date-' . $i),\n 'pos_machine' => Input::get('pos_machine-' . $i),\n 'approval_code' => Input::get('approval_code-' . $i),\n 'phone_number' => Input::get('phone_number-' . $i),\n 'cheque_number' => Input::get('cheque_number-' . $i),\n 'bank_name' => $bank_deposited,\n 'cheque_verified' => $cheque_verified,\n 'online_verified' => $online_verified,\n 'bkash_salman_verified' => $bkash_salman_verified,\n 'bkash_corporate_verified' => $bkash_corporate_verified,\n 'bank_charge' => $charge,\n 'amount_paid' => Input::get('total_amount-' . $i),\n 'amount_received' => $after_charge,\n 'deposit_date' => Input::get('deposit_date-' . $i),\n 'created_at' => $created_at,\n ]);\n \n }\n\n // If there is a due date\n\n if($request->due_date) {\n\n $total_paid = PaymentType::where('payment_id', $payment->id)->sum('amount_paid');\n $dues = $request->total_amount - $total_paid;\n\n Payment::find($payment_id)->update([\n 'dues' => $dues,\n 'due_date' => Input::get('due_date'),\n ]);\n }\n\n // Get the current steps of the client\n $client_programs = ClientProgram::assignedSteps($program_id, $client_id);\n\n if($client_programs->steps) {\n $step_array = json_decode($client_programs->steps);\n } else {\n $step_array = [];\n }\n\n // Add the steps in the steps array\n if (!(in_array($step_id, $step_array))) {\n array_push($step_array, $step_id);\n } \n\n // If the step is a new one then it is added to client profile\n ClientProgram::updateOrCreate(\n ['client_id' => $client_id, 'program_id' => $program_id],\n ['steps' => json_encode($step_array)]\n );\n\n // Getting the list of tasks for the client\n $program_tasks = Task::getUserTasks($step_id, 'client');\n\n // Getting the list of tasks for the spouse\n $spouse_program_tasks = Task::getUserTasks($step_id, 'spouse');\n\n // Adding all the tasks to the client task table\n foreach ($program_tasks as $program_task) {\n ClientTask::updateOrCreate(\n ['client_id' => $client_id, 'step_id' => $step_id, 'task_id' => $program_task->id],\n ['client_id' => $client_id,\n 'step_id' => $step_id,\n 'task_id' => $program_task->id,\n 'deadline' => Carbon::now()->addDays($program_task->duration),\n ]\n );\n }\n\n // Adding all the tasks to the spouse task table\n foreach ($spouse_program_tasks as $spouse_program_task) {\n SpouseTask::updateOrCreate(\n ['client_id' => $client_id, 'step_id' => $step_id, 'task_id' => $spouse_program_task->id],\n ['client_id' => $client_id, 'step_id' => $step_id, 'task_id' => $spouse_program_task->id]\n );\n }\n\n // Getting the current list of RMs currently assigned to the client\n $associated_rms = RmClient::where('client_id', $client_id)->pluck('rm_id')->toArray();\n\n // Getting the current list of Counselor currently assigned to the client\n $associated_counselors = CounsellorClient::where('client_id', $client_id)->pluck('counsellor_id')->toArray();\n\n // adding one to the target for the assigned RM\n foreach ($associated_rms as $associated_rm) {\n Target::addOneToTarget($associated_rm);\n }\n\n // adding one to the target for the assigned Counslor\n foreach ($associated_counselors as $associated_counselor) {\n Target::addOneToTarget($associated_counselor);\n }\n\n $request->session()->forget([\n 'receipt_id',\n 'location',\n 'client_id',\n 'program_id',\n 'step_id',\n 'opening_fee',\n 'embassy_student_fee',\n 'service_solicitor_fee',\n 'other',\n 'comments',\n 'created_at',\n 'total_amount'\n ]);\n\n return redirect()->route('payment.acknowledgement'); \n\n }", "public function store(Request $request)\n {\n\n $request['remaining_Amount'] = $request['total_Amount'] - $request['first_Amount'];\n $payment = Payment::create($request->all());\n $payment->save();\n $request['pay'] = $request['first_Amount'];\n Pays::create($request->all());\n return redirect('/payment')->with('success', 'The Payment has been added');\n }", "public function testItStoreNewPayment()\n {\n $response = $this->post(route('payments'), [\n 'payment_name' => $this->faker->words(3, true)\n ]);\n\n $response->assertStatus(302);\n $response->assertRedirect(route('payments'));\n }", "public function store(Request $request)\n {\n\n $request->validate([\n 'title' => 'required|string|max:65535',\n 'amount' => 'required|regex:/^\\d*(\\.\\d{1,2})?$/',\n 'purchase_date' => 'required|date',\n 'guide_money' => 'required|boolean'\n ]);\n\n // Create Payment\n $p = new Payment();\n $p->title = $request->input('title');\n $p->amount = $request->input('amount');\n $p->purchase_date = $request->input('purchase_date');\n $p->guide_money = boolval($request->input('guide_money'));\n\n // Check type of money used to determin if needs to be paid back.\n if($p->guide_money) {\n $p->paid_back = true;\n }\n else {\n $p->paid_back = false;\n }\n\n $p->approved = false;\n $p->user_id = $request->user()->id;\n $p->ref_id = $p->generateReadableId();\n $p->save();\n\n return $p;\n }", "public function store(PaymentMethodFormRequest $request)\n {\n // Retrieving Tenant Details\n $tenant = Sentinel::getUser()->tenant->id;\n\n $method = new PaymentMethod;\n\n $method->name = $request->name;\n $method->account_number = $request->account_number;\n $method->tenant_id = $tenant;\n\n $method->save();\n\n Alert::success('New Payment Method Registered!');\n\n return Redirect::to('paymentMethods');\n }", "public function store(PaymentDetailStoreRequest $request)\n {\n try {\n $payment_detail = PaymentDetail::create($request->all());\n return response()->json(['success' => \"El detalle del pago {$payment_detail->id} ha sido registrado\"], 201);\n } catch (\\Throwable $th) {\n return response()->json(['errors' => $th->getMessage()], 400);\n }\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Payment::$rules, Payment::$messages);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\t//$erporder = Erporder::find(Input::get('order'));\n\n\t\t$payment = new Payment;\n\n\t\t$client = Client::findOrFail(Input::get('order'));\n\n\t\t$payment->client_id = Input::get('order');\n\t\t$payment->erporder_id = Input::get('order');\n\t\t$payment->amount_paid = Input::get('amount');\n\t\t\t\n\t\t$payment->paymentmethod_id = Input::get('paymentmethod');\n\t\t$payment->account_id = Input::get('account');\n\t\t$payment->received_by = Input::get('received_by');\n\t\t$payment->date = date(\"Y-m-d\",strtotime(Input::get('pay_date')));\n\t\t$payment->save();\n\n\n\t\t\n\n \n if($client->type=='Customer'){\n DB::table('accounts')\n ->join('payments','accounts.id','=','payments.account_id')\n ->join('erporders','payments.client_id','=','erporders.client_id')\n ->where('accounts.id', Input::get('account'))\n ->where('erporders.type','sales')\n ->increment('accounts.balance', Input::get('amount'));\n\n\n $data = array(\n\t\t\t'date' => date(\"Y-m-d\",strtotime(Input::get('paydate'))), \n\t\t\t'debit_account' => Input::get('account'),\n\t\t\t'credit_account' => Input::get('credit_account'),\n\t\t\t'description' => Input::get('description'),\n\t\t\t'amount' => Input::get('amount'),\n\t\t\t'initiated_by' => Input::get('received_by')\n\t\t\t);\n\t\t\n\t\t$journal = new Journal;\n\n\t\t$journal->journal_entry($data);\n }else{\n \tDB::table('accounts')\n ->join('payments','accounts.id','=','payments.account_id')\n ->join('erporders','payments.client_id','=','erporders.client_id')\n ->where('accounts.id', Input::get('account'))\n ->where('erporders.type','purchases')\n ->decrement('accounts.balance', Input::get('amount'));\n\n $data = array(\n\t\t\t'date' => date(\"Y-m-d\",strtotime(Input::get('paydate'))), \n\t\t\t'debit_account' => Input::get('account'),\n\t\t\t'credit_account' => 3,\n\t\t\t'description' => Input::get('description'),\n\t\t\t'amount' => Input::get('amount'),\n\t\t\t'initiated_by' => Input::get('received_by')\n\t\t\t);\n\t\t\n\t\t$journal = new Journal;\n\n\t\t$journal->journal_entry($data);\n }\n\n\n \n\t\treturn Redirect::route('payments.index')->withFlashMessage('Payment successfully created!');\n\t}", "public function store(Request $request)\n {\n unset($request['_token']);\n $id = Auth::guard('merchant')->id();\n $array = [\n 'payment_methoed_name' => $request['payment_methoed_name'],\n 'account_number' => $request['account_number'],\n 'branch_address' => $request['branch_address'],\n 'payee_name' => $request['payee_name'],\n 'merchant_id' => $id\n ];\n try {\n PaymentMethoed::create($array);\n return back()->with('success', \"Successfully saved\");\n }\n catch (\\Exception $exception){\n return back()->with('failed', $exception->getMessage());\n }\n }", "public function store()\n {\n $this->validate([\n 'Order_Id' => 'required',\n 'Item_Id' => 'required',\n 'Sequence' => 'required',\n 'Keterangan' => 'required',\n ]);\n \n Transaction::updateOrCreate(['id' => $this->transaction_id], [\n 'Order_Id' => $this->Order_Id,\n 'Item_Id' => $this->Item_Id,\n 'Sequence' => $this->Sequence,\n 'Keterangan' => $this->Keterangan\n ]);\n \n session()->flash('message', \n $this->transaction_id ? 'Transaction Updated Successfully.' : 'Transaction Created Successfully.');\n \n $this->closeModal();\n $this->resetInputFields();\n }", "public function create(Payment $request){\n\n\t\t$data = $request->all();\n\t\tProductPayment::create($data);\n\n\t\treturn redirect()->route('list_payment');\n\t}", "public function store(Request $request)\n {\n\n $userAuth = AuthUser::user();\n $email = $userAuth->email;\n\n if ($this->existenPagosPendientes($email)) {\n \\Alert::message('En este momento presenta un proceso de pago cuya transacción \n se encuentra pendiente de recibir confirmación por parte de su entidad financiera, \n por favor espere unos minutos y vuelva a consultar más tarde para verificar si su pago fue confirmado de forma exitosa.',\n 'danger');\n return back();\n }\n $total = $request->input('total');\n $currency = $request->input('currency');\n $description = $request->input('description');\n $expiration = date('c', strtotime('+1 day'));\n $ipAddress = request()->ip();\n $userAgent = $request->server('HTTP_USER_AGENT');\n\n\n //Saving object on database\n\n $payment = New Payment();\n $payment->description = $description;\n $payment->person = $email;\n $payment->total = $total;\n $payment->currency = $currency;\n $payment->expiration = $expiration;\n $payment->ip_address = $ipAddress;\n $payment->user_agent = $userAgent;\n\n $payment->save();\n\n\n $returnUrl = 'http://127.0.0.1:8000/payment-response/' . $payment->id;\n\n $placetopay = new PlacetoPay([\n 'login' => env('P2P_ID'),\n 'tranKey' => env('P2P_SECRET_KEY'),\n 'url' => env('P2P_END_POINT')\n\n ]);\n\n $request = [\n 'payment' => [\n 'reference' => $payment->id,\n 'description' => $description,\n 'amount' => [\n 'currency' => $currency,\n 'total' => $total,\n ],\n ],\n 'expiration' => $expiration,\n 'returnUrl' => $returnUrl,\n 'ipAddress' => $ipAddress,\n 'userAgent' => $userAgent,\n ];\n\n $response = $placetopay->request($request);\n\n\n if ($response->isSuccessful()) {\n // STORE THE $response->requestId() and $response->processUrl() on your DB associated with the payment order\n // Redirect the client to the processUrl\n $payment->request_id = $response->requestId();\n $payment->process_url = $response->processUrl();\n $payment->save();\n return redirect()->away($response->processUrl());\n } else {\n // There was some error so check the message and log it\n\n \\Alert::message($response->status()->message(), 'danger');\n return back();\n }\n\n\n }", "public function save(OrderPaymentInterface $orderPayment): OrderPaymentInterface;", "public function store(Request $request)\n {\n $rules = [\n 'month_id' => 'required|numeric', \n 'day' => 'required|numeric', \n 'name' => 'required', \n 'price' => 'required|numeric', \n 'paid' => 'numeric'\n ];\n\n $this->validate($request, $rules);\n\n $data = $request->all();\n\n $payment = Payment::create($data);\n\n return $this->showOne($payment, 201);\n }", "public function store(Request $request)\n {\n $pricing = pricing::find($request->package_id);\n $Payer = auth()->guard('admin')->user();\n $payment = new payment();\n $payment->name = $Payer->name;\n $payment->email = $Payer->email;\n $payment->admin_id = $Payer->id;\n $payment->package_id = $request->package_id;\n $payment->amount = $pricing->price;\n $payment->account_number = $request->account_number;\n $payment->bank_swift_code = $request->swift_code;\n $payment->branch_name = $request->branch_name;\n $payment->branch_address = $request->branch_address;\n $payment->account_name = $request->account_name;\n if($Payer->role_id == 1){\n $payment->status = \"success\";\n }else{\n $payment->status = \"pending\";\n }\n $payment->save();\n return response::json($payment);\n //\n }", "public function store()\n {\n try{\n $validator = Validator::make($this->request->all(), [\n 'name' => 'required|max:255'\n ]);\n\n if(!$validator->fails()) {\n $name = $this->request->input('name');\n\n $payment_methods_repeated = PaymentMethods::where('name', $name)->count();\n if($payment_methods_repeated == 0){\n $payment_methods_trash = PaymentMethods::withTrashed()->where('name', $name)->count();\n\n if($payment_methods_trash == 0){\n $payment_methods = new PaymentMethods;\n $payment_methods->create($this->request->all());\n\n $this->res['message'] = 'Metodo de Pago creado correctamente.';\n $this->status_code = 200;\n } else {\n PaymentMethods::withTrashed()->where('name', $name)->restore();\n\n $payment_methods = PaymentMethods::where('name', $name)->first();\n\n $payment_methods->updateOrCreate(['id' => $payment_methods->id], $this->request->all());\n\n $this->res['message'] = 'Metodo de Pago restaurado correctamente.';\n $this->status_code = 200;\n }\n } else {\n $this->res['message'] = 'El Metodo de Pago ya existe.';\n $this->status_code = 423;\n }\n } else {\n $this->res['message'] = 'Por favor llene todos los campos requeridos o revise la longitud de los campos.';\n $this->status_code = 422;\n }\n } catch(\\Exception $e) {\n $this->res['message'] = 'Error en el sistema.'.$e;\n $this->status_code = 422;\n }\n\n return response()->json($this->res, $this->status_code);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'billing_id' => 'required|numeric',\n 'payment_amount' => 'required|numeric',\n 'payment_date' => 'required',\n 'payment_type' => 'required'\n ]);\n $sum = 0;\n $bill = Billing::find($request['billing_id']);\n foreach ($bill->payments as $payment) {\n $sum += $payment->payment_amount;\n }\n $balance = $bill->bill_amount - $sum;\n if ($balance > 0) {\n $bill->bill_balance = $bill->bill_balance - $request['payment_amount'];\n $bill->save();\n Payment::create([\n 'billing_id' => $request['billing_id'],\n 'payment_date' => $request['payment_date'],\n 'payment_amount' => $request['payment_amount'],\n 'payment_type' => $request['payment_type']\n ]);\n flash('Payment made successfully. New Balance is '.$bill->bill_balance)->important();\n return redirect('payments');\n }\n flash('Sorry that bill has already been paid', 'danger')->important();\n return redirect('payments');\n }", "public function store(Request $request)\n {\n\n $input = $request->except('_token');\n $input['amount'] = str_replace(',','.',$input['amount']);\n $input['code'] = Uuid::uuid4();\n\n $rules = [\n 'amount'=>'required|numeric',\n 'description'=>'required'\n ];\n\n $validation = \\Validator::make($input,$rules);\n if($validation->passes()){\n Payment::create($input);\n return redirect(route('adcp.dashboard'));\n }else{\n return redirect()->back()->withInput()->withErrors($validation->errors());\n }\n }", "public function store(Request $request)\n {\n $doctor_id;\n if(Auth::user()->role == \"secretaria\"){\n $doctor_id = $request->doctor;\n }else{\n $doctor_id = Auth::user()->id;\n }\n $this->validate($request,[\n 'monto' => 'required | integer',\n 'fecha' => 'required | date',\n 'tratamiento' => 'required | string',\n 'paciente' => 'required | integer',\n ]);\n $payment = new Payment;\n $payment->monto = $request->monto;\n $payment->fecha = $request->fecha;\n $payment->tratamiento = $request->tratamiento;\n $payment->patient_id =$request->paciente;\n $payment->doctor_id = $doctor_id;\n $payment->save();\n\n return redirect()-> route('payment.index')->with('success', 'Pago registrado con éxito');\n }", "public function store(Request $request)\n {\n $this->paymentsRepository->create($request->only('name', 'description'));\n\n return redirect()->route('admin.auth.payments.index')->withFlashSuccess(__('alerts.backend.payments.created'));\n }" ]
[ "0.73852026", "0.67656326", "0.6668322", "0.6662363", "0.6661448", "0.659971", "0.65760094", "0.65430254", "0.6512636", "0.6491769", "0.6472647", "0.645231", "0.64458597", "0.64091027", "0.6400491", "0.6386526", "0.6375908", "0.6373461", "0.6334321", "0.6327555", "0.63236743", "0.63179296", "0.6311131", "0.63079506", "0.6297782", "0.62872195", "0.62871164", "0.6272988", "0.62671787", "0.6257406" ]
0.69840777
1
Returns all of the pages that are related to a certain page
private function getRelatedPagesForPage($pageId) { try { $language = $this->context->language->id; $shop = $this->context->shop->id; $qry = (new DbQuery()) ->select('id_related') ->from($this->table_related) ->where('`id_parent`='.$pageId); $result = Db::getInstance()->ExecuteS($qry); if (!$result) return []; $final = []; foreach ($result as $res) { array_push($final, $res['id_related']); } return $final; } catch (Exception $e) { Logger::addLog("CustomHTMLPages getRelatedPagesForPage Exception: {$e->getMessage()}"); return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getRelatedPages()\n {\n return\n DB::query(\"\nSELECT id, cdate, title FROM articles\nWHERE id IN (SELECT bind FROM pages_related WHERE item = {$this->id})\nORDER BY cdate DESC\")\n ->fetchAll(PDO::FETCH_FUNC, function ($id, $cdate, $title) {\n return [\n 'id' => (int)$id,\n 'cdate' => FFIECommon::_date_format($cdate),\n 'title' => trim($title)\n ];\n });\n }", "public function getListPage()\n {\n //use relation;\n //return Category::with('RelationCategory')->get();\n return Page::where('delete_flag', 0)->get();\n }", "private function getPagesThisPageIsRelatedTo($pageId)\n {\n try\n {\n $language = $this->context->language->id;\n $shop = $this->context->shop->id;\n\n $qry = (new DbQuery())\n ->select('id_parent')\n ->from($this->table_related)\n ->where('`id_related`='.$pageId);\n\n $result = Db::getInstance()->ExecuteS($qry);\n\n if (!$result)\n return [];\n\n $final = [];\n foreach ($result as $res)\n {\n array_push($final, $res['id_parent']);\n }\n return $final;\n }\n catch (Exception $e)\n {\n Logger::addLog(\"CustomHTMLPages getPagesThisPageIsRelatedTo Exception: {$e->getMessage()}\");\n return null;\n }\n }", "public function getPages();", "public function ownedByPages()\n {\n return $this->relationshipTrashedFilter($this->morphedByMany('App\\Api\\V1\\Models\\Page', 'fragmentable'));\n }", "public function pages()\n\t{\n\t\treturn $this->oneToMany(__NAMESPACE__ . '\\Page', 'event_id');\n\t}", "public function pages()\n {\n return $this->hasMany('App\\Model\\Page');\n }", "public function pages()\n {\n return $this->morphedByMany(Page::class, 'assetable');\n }", "public function getRelated() {\r\n\r\n $result = NULL;\r\n\r\n\t\t$sql = Connection::getHandle()\r\n ->prepare(\"SELECT destination_pagetype AS pagetype, destination_pageid AS pageid\r\n FROM bs_related WHERE source_pagetype=? AND source_pageid=? ORDER BY position ASC\");\r\n\r\n\t\tif ( $sql->execute(array($this->type, $this->getId())) ) {\r\n\r\n while ($row = $sql->fetch(PDO::FETCH_ASSOC)) {\r\n\r\n $result[] = $row;\r\n }\r\n }\r\n\t\treturn $result;\r\n\t}", "public function pages()\n {\n return $this->belongsToMany(Page::class, 'page_tags', 'tag_id', 'subject_id')->where('subject_type', Page::class);\n }", "private function getPages()\n {\n $pageRepo = new PageRepository(new Page);\n return $pageRepo->listPages('name', 'asc', 1)->whereIn('parent_id', [1]);\n }", "public function pages() {\n # Define a one-to-many relationship.\n return $this->hasMany('App\\Page');\n }", "protected function getPages() {\nglobal $_LW;\n$pages=[];\nif ($tid=$this->getHandbookTemplateID()) {\n\t// If page is tagged \"Single Page Handbook\", don't traverse page\n\t$single_page_handbook=($_LW->dbo->query('select', '1', 'livewhale_pages', 'livewhale_pages.host='.$_LW->escape($_LW->CONFIG['HTTP_HOST']).' AND livewhale_pages.path='.$_LW->escape($_SERVER['PHP_SELF']))->innerJoin('livewhale_tags2any', 'livewhale_tags2any.id2=livewhale_pages.id AND livewhale_tags2any.type=\"pages\"')->innerJoin('livewhale_tags', 'livewhale_tags.title=\"Single Page Handbook\" AND livewhale_tags.id=livewhale_tags2any.id1')->exists()->run() ? true : false);\n\tif (!empty($single_page_handbook)) {\n\t\t$pages[]=$_SERVER['PHP_SELF']; // use only the current page\n\t\treturn $pages;\n\t}\n\t// Otherwise, traverse nav to find pages\n\tif ($res2=$_LW->dbo->query('select', 'livewhale_pages_navs_items.pid, livewhale_pages_navs_items.depth, livewhale_pages_navs_items.position, livewhale_pages_navs_items.path', 'livewhale_pages_navs_items', 'livewhale_pages_navs_items.path='.$_LW->escape($_SERVER['PHP_SELF']).' AND livewhale_pages_navs_items.status=1 AND livewhale_pages_navs_items.host='.$_LW->escape($_LW->CONFIG['HTTP_HOST']))\n\t->innerJoin('livewhale_pages', 'livewhale_pages.host=livewhale_pages_navs_items.host AND livewhale_pages.path=livewhale_pages_navs_items.path AND livewhale_pages.tid='.(int)$tid)\n\t->firstRow()->run()) { // select handbook page from a navigation\n\t\t$pages[$res2['position']]=$res2['path']; // add the current page\n\t\t$position=(int)$res2['position'];\n\t\t$nav=$res2['pid'];\n\t\t// add preceeding pages at the same depth that use the handbook template\n\t\tif ($position>0) {\n\t\t\tfor ($i=$position-1;$i>=0;$i--) {\n\t\t\t\tif ($res3=$_LW->dbo->query('select', 'livewhale_pages_navs_items.position, livewhale_pages_navs_items.path', 'livewhale_pages_navs_items', 'livewhale_pages_navs_items.status=1 AND livewhale_pages_navs_items.pid='.$nav.' AND livewhale_pages_navs_items.host='.$_LW->escape($_LW->CONFIG['HTTP_HOST']).' AND livewhale_pages_navs_items.path IS NOT NULL AND livewhale_pages_navs_items.position='.$i)\n\t\t\t\t->innerJoin('livewhale_pages', 'livewhale_pages.host=livewhale_pages_navs_items.host AND livewhale_pages.path=livewhale_pages_navs_items.path AND livewhale_pages.tid='.(int)$tid)\n\t\t\t\t->firstRow()->run()) {\n\t\t\t\t\t$pages[$res3['position']]=$res3['path'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\t// add subsequent pages at the same depth that use the handbook template\n\t\tfor ($i=$position+1,$max=$position+30;$i<=$max;$i++) {\n\t\t\tif ($res3=$_LW->dbo->query('select', 'livewhale_pages_navs_items.position, livewhale_pages_navs_items.path', 'livewhale_pages_navs_items', 'livewhale_pages_navs_items.status=1 AND livewhale_pages_navs_items.pid='.$nav.' AND livewhale_pages_navs_items.host='.$_LW->escape($_LW->CONFIG['HTTP_HOST']).' AND livewhale_pages_navs_items.path IS NOT NULL AND livewhale_pages_navs_items.position='.$i)\n\t\t\t->innerJoin('livewhale_pages', 'livewhale_pages.host=livewhale_pages_navs_items.host AND livewhale_pages.path=livewhale_pages_navs_items.path AND livewhale_pages.tid='.(int)$tid)\n\t\t\t->firstRow()->run()) {\n\t\t\t\t$pages[$res3['position']]=$res3['path'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t};\n\t\t};\n\t\t// add any children that use the handbook template in case this is a parent\n\t\tfor ($i=$position+1,$max=$position+30;$i<=$max;$i++) {\n\t\t\tif ($res3=$_LW->dbo->query('select', 'livewhale_pages_navs_items.position, livewhale_pages_navs_items.path', 'livewhale_pages_navs_items', 'livewhale_pages_navs_items.status=1 AND livewhale_pages_navs_items.pid='.$nav.' AND livewhale_pages_navs_items.host='.$_LW->escape($_LW->CONFIG['HTTP_HOST']).' AND livewhale_pages_navs_items.depth='.$_LW->escape($res2['depth']+1).' AND livewhale_pages_navs_items.path IS NOT NULL AND livewhale_pages_navs_items.position='.$i)\n\t\t\t->innerJoin('livewhale_pages', 'livewhale_pages.host=livewhale_pages_navs_items.host AND livewhale_pages.path=livewhale_pages_navs_items.path AND livewhale_pages.tid='.(int)$tid)\n\t\t\t->firstRow()->run()) {\n\t\t\t\t$pages[$res3['position']]=$res3['path'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t};\n\t\t};\n\t\t// add parent if there may be one that uses the handbook template\n\t\tif ($res2['depth']!=0) {\n\t\t\tif ($res3=$_LW->dbo->query('select', 'livewhale_pages_navs_items.position, livewhale_pages_navs_items.path', 'livewhale_pages_navs_items', 'livewhale_pages_navs_items.pid='.(int)$res2['pid'].' AND livewhale_pages_navs_items.status=1 AND livewhale_pages_navs_items.pid='.$nav.' AND livewhale_pages_navs_items.host='.$_LW->escape($_LW->CONFIG['HTTP_HOST']).' AND livewhale_pages_navs_items.depth='.$_LW->escape($res2['depth']-1).' AND livewhale_pages_navs_items.position<'.(int)$res2['position'])->orderBy('livewhale_pages_navs_items.position DESC')\n\t\t\t->innerJoin('livewhale_pages', 'livewhale_pages.host=livewhale_pages_navs_items.host AND livewhale_pages.path=livewhale_pages_navs_items.path AND livewhale_pages.tid='.(int)$tid)\n\t\t\t->firstRow()\n\t\t\t->run()) {\n\t\t\t\t$pages[$res3['position']]=$res3['path'];\n\t\t\t};\n\t\t};\n\t}\n\telse { // else if the page is not found in any nav\n\t\tif ($_LW->dbo->query('select', '1', 'livewhale_pages', 'host='.$_LW->escape($_LW->CONFIG['HTTP_HOST']).' AND path='.$_LW->escape($_SERVER['PHP_SELF']).' AND tid='.(int)$tid)\n\t\t->exists()\n\t\t->run()) {\n\t\t\t$pages[]=$_SERVER['PHP_SELF'];\n\t\t};\n\t};\n\tif (!empty($pages)) { // sort the handbook pages\n\t\tksort($pages);\n\t};\n};\nreturn $pages;\n}", "public function\tpages()\n\t{\n\t\treturn\t$this->hasMany('App\\Page',\t'menu_id');\n\t}", "public function getPages()\n {\n return $this->hasMany(Page::className(), ['create_user_id' => 'id']);\n }", "public function getPagesTree();", "public function pages()\n {\n return $this->Page\n ->where('response_type', 'Function')\n ->orderBy('dvs_admin','asc')\n ->paginate();\n }", "public function findAll()\n {\n $sql = \"SELECT \n `id`,\n `slug`, \n `title` \n FROM \n `page`\n \";\n $stmt = $this->PDO->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(\\PDO::FETCH_OBJ);\n }", "function getpages(){\n \t\n }", "public function pages()\n\t{\n\t\tinclude_once(\"class.page.php\");\n\t\tglobal $db;\n\t\t$pages = Array();\n\t\tif($result = $db->query(\"SELECT \".$db->getPrefix().\"module_pages.id, s_page, s_description FROM\n\t\t\t\".$db->getPrefix().\"module_pages, \".$db->getPrefix().\"tpl_show_pages\n\t\t\tWHERE\n\t\t\t\".$db->getPrefix().\"module_pages.id=\".$db->getPrefix().\"tpl_show_pages.id_page\n\t\t\tAND \".$this->id.\"=\".$db->getPrefix().\"tpl_show_pages.id_section\n\t\t\tORDER BY \".$db->getPrefix().\"tpl_show_pages.i_sort;\"))\n\t\t{\n\t\t\twhile( $line = mysql_fetch_array( $result ) )\n\t\t\t{\n\t\t\t\t$pages[$line[1]] = new Page($line[0], $line[1], $line[2]);\n\t\t\t}\n\t\t}\n\t\treturn $pages;\n\t}", "public function pageCategories()\n {\n return PageCategory::where('page_id', $this->id)->get();\n }", "public function pageInstances()\n {\n return $this->hasMany(PageInstance::class)\n ->orderBy('id');\n }", "public function getPage();", "public function getPage();", "public function getPage();", "public final function GetPages()\n\t{\n\t\t$db =& $this->GetDb();\n\t\t$query = \"SELECT C.active, C.type, C.content_id, C.parent_id, C.hierarchy, C.menu_text, CP.content FROM \" . cms_db_prefix() . \"content C\n\t\t\tLEFT JOIN \" . cms_db_prefix() . \"content_props CP ON CP.content_id = C.content_id AND CP.prop_name = ?\n\t\t\tORDER BY hierarchy\";\n\t\t$dbresult = $db->Execute($query, array('redirect_page'));\n\t\tif(!$pages = $dbresult->GetArray())\n\t\t\treturn array();\n\t\treturn $pages;\n\t}", "private function getPages()\n {\n $pages = new ArrayList();\n $config = Config::inst()->get('SEO_Sitemap','objects');\n\n foreach($this->objects as $className => $value){\n\n $object = $className::get()->filter([\n 'Robots:not' => 'noindex,nofollow',\n 'SitemapHide' => 0\n ]);\n\n foreach($object as $page){\n if(!$page instanceof Page){\n $page->Link = $this->getPrefix($className, $page);\n }\n $pages->push($page);\n }\n }\n $pages->Sort('Priority DESC');\n return $pages;\n }", "public function listAll()\n {\n return $this->page->get()->pluck('title', 'id')->all();\n }", "public function getPages(){\n\t\t$result = $this->_db->select(\"SELECT pag_id,pag_name FROM page\");\n\t\treturn $result;\n\t}", "public function getPages() {\n if(empty($this->pages)) {\n $db = \\Helper::getDB();\n $db->where('documentId', $db->escape($this->getId()));\n $db->orderBy('p.id', 'ASC');\n $db->join('comments c', 'c.itemId = p.id AND c.type = \"page\" ', 'LEFT');\n $db->groupBy('p.id');\n $results = $db->get('document_pages p', NULL, '*, count(c.id) as commentsCount, p.id as id');\n\n $i = 1;\n foreach($results as $result) {\n $hasComments = $result['commentsCount'] > 0 ? TRUE : FALSE;\n $this->pages[$i] = new \\Models\\Page($result['id'], $i, $this->getPath(). DS . $i .'.'. IMAGE_TYPE, $hasComments);\n $i++;\n }\n }\n\n return $this->pages;\n }" ]
[ "0.7682923", "0.66811717", "0.6588261", "0.6484287", "0.6474059", "0.63287044", "0.6320583", "0.62351096", "0.620491", "0.61423445", "0.6088597", "0.6053359", "0.6042612", "0.604223", "0.6010539", "0.59666264", "0.5935846", "0.59239984", "0.59203106", "0.5914605", "0.5887764", "0.58705336", "0.5854128", "0.5854128", "0.5854128", "0.5851984", "0.5778575", "0.57443696", "0.5680516", "0.56705964" ]
0.6952177
1
Converts the pages to a tree for the sitemap
public function convertToTree($pages) { if (!is_array($pages) || count($pages) == 0) return; $classes = (gettype($pages[0]) == 'array') ? $this->convertToClasses($pages) : $pages; $roots = []; foreach ($classes as $page) { $page->computeFullURL(); if ($page->parent == null) { array_push($roots, $page); } } $url = $this->getShopURL($this->context); // Clear all parent links foreach ($classes as $page) { $page->url = $url.'/'.$page->url; $page->parent = null; } return $roots; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPagesTree();", "public static function convertToPages() {\n $crawlData = Crawl::whereNull(\"converted\")->get();\n foreach($crawlData as $crawl) {\n Page::createPage(array(\n \"page\" => array(\n \"published\" => $crawl->published,\n \"menu_id\" => $crawl->menu_id,\n \"parent_id\" => $crawl->parent_id,\n \"slug\" => $crawl->slug ? $crawl->slug : Helper::createPageSlug($crawl->title)\n ),\n \"content\" => array(\n \"title\" => $crawl->title,\n \"body\" => $crawl->content\n )\n ));\n $crawl->converted = date(\"Y-m-d H:i:s\");\n $crawl->save();\n }\n }", "function getPages($storeVars)\n\t{\n\t\t$pageId = Jrequest::getVar('pageId',0);\n\t\t$db = JFactory::getDBO();\n\t\t$db->setQuery(\"SELECT id FROM #__content WHERE featured='1' \" );\n\t\t$featureds = $db->loadResultArray();\n\t\t//ADD END ms: 23.03.2011\n\n\t\t$doc =& JFactory::getDocument();\n\t\trequire_once(JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'menutypes.php');//need this when saving moving page\n\t\t$model = new PagesAndItemsModelMenutypes();\n\t\t//see how many loops we need\n\t\t$menutypes = PagesAndItemsHelper::getMenutypes();\n\t\t$loops = count($menutypes);\n\t\t$extension = 'com_menus';\n\t\t$lang = &JFactory::getLanguage();\n\t\t//$lang->load(strtolower($extension), JPATH_ADMINISTRATOR, null, false, false);\n\t\t$lang->load(strtolower($extension), JPATH_ADMINISTRATOR, null, false, false) || $lang->load(strtolower($extension), JPATH_ADMINISTRATOR, $lang->getDefault(), false, false);\n\t\t$html = '';\n\n\t\t$path = realpath(dirname(__FILE__).DS.'..');\n\t\trequire_once($path.DS.'extensions'.DS.'htmlhelper.php');\n\t\t$htmlelements = ExtensionHtmlHelper::importExtension('page_tree',null,true,null,true);\n\t\t$dispatcher = &JDispatcher::getInstance();\n\t\t$htmlelement->html = '';\n\t\t$dispatcher->trigger('onGetHtmlelement',array(&$htmlelement,'page_tree'));\n\t\t$html .= '<table class=\"piadminform xadminform tree\" width=\"98%\"><tbody><tr><td valign=\"top\">';\n\t\tif($htmlelement->html != '')\n\t\t{\n\t\t\t$html .= '<div class=\"dtree dtree_container\">';\n\n\t\t\t\t\t$html .= $htmlelement->html;\n\t\t\t$html .= '</div>';\n\t\t}\n\t\t$menuItemsTypes = PagesAndItemsHelper::getMenuItemsTypes();\n\t\t//$config = PagesAndItemsHelper::getConfigAsRegistry();\n\t\t//$useCheckedOut = $config->get('useCheckedOut',0);\n\t\t$useCheckedOut = PagesAndItemsHelper::getUseCheckedOut();\n\t\t$sub_task = JRequest::getVar('sub_task','');\n\t\tfor($m = 0; $m < $loops; $m++)\n\t\t{\n\t\t\t$menuitems = PagesAndItemsHelper::getMenutypeMenuitems($menutypes[$m]);\n\t\t\t$script = '';\n\t\t\t$html .= '<div class=\"dtree dtree_container\">';\n\t\t\t$html .= '<p><a href=\"javascript: d'.$m.'.openAll();\">'.JText::_('COM_PAGESANDITEMS_OPEN_ALL').'</a> | <a href=\"javascript: d'.$m.'.closeAll();\">'.JText::_('COM_PAGESANDITEMS_CLOSE_ALL').'</a></p>';\n\t\t\t$script .= \"d$m = new dTree('d$m');\\n\";\n\t\t\t/*\n\t\t\tCOMMENT:\n\t\t\t\there we set the icons for dTree not in dTree.js\n\t\t\t\tso we can change the dir aeasy\n\t\t\t*/\n\t\t\t$script .= PagesAndItemsHelper::getdTreeIcons(\"d\".$m);\n\t\t\t/*\n\t\t\t$script .= \"d$m.config = {target: null,folderLinks\t: false,\n\t\tuseSelection\t: true,\n\t\tuseCookies\t: false,\n\t\tuseLines\t: true,\n\t\tuseIcons\t: true,\n\t\tuseStatusText\t: false,\n\t\tcloseSameLevel\t: false,\n\t\tinOrder\t\t: false};\";\n\t\t*/\n\t\t\t//$html .= \"};\\n\";\n\t\t\t\n\t\t\t/*\n\t\t\t\tCOMMENT\n\t\t\t\tin Joomla 1.6\n\t\t\t\twe have one parent_id=0 in table #__menus\n\t\t\t\tbut more parent_id=1 in table #__menus\n\n\t\t\t\tparent_id=1 in table #__menus = menutype:'', title:Menu_Item_Root, alias:root\n\n\t\t\t*/\n\t\t\tif (PagesAndItemsHelper::getIsJoomlaVersion('<','1.6'))\n\t\t\t{\n\t\t\t\t$script .= \"d$m.add(0,-1,'\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$script .= \"d$m.add(1,-1,'\";\n\t\t\t}\n\t\t\t$script .= PagesAndItemsHelper::getMenutypeTitle($menutypes[$m]);\n\t\t\t\n\t\t\tif($useCheckedOut && $sub_task == 'edit')\n\t\t\t{\n\t\t\t\t$script .= \"','#\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$script .= \"','index.php?option=com_pagesanditems&view=page&layout=root&menutype=\";\n\t\t\t\t$script .= strtolower($menutypes[$m]);\n\t\t\t}\n\t\t\t\n\t\t\t$script .= \"','','','','',true);\\n\";\n\n\t\t\t//$imagePath = PagesAndItemsHelper::getDirIcons();\n\t\t\t//make javascript-array from menu-items\n\t\t\t$counter = 0;\n\t\t\t//loop menuitems\n\t\t\tforeach($menuitems as $row)\n\t\t\t{\n\t\t\t\t$counter++;\n\t\t\t\t$image = '';\n\t\t\t\t$imageNoAccess = '';\n\t\t\t\t$row->menu_item_article_pi = false;\n\t\t\t\t$row->menu_item_article_no_access = false;\n\t\t\t\t$itemtype_no_access = array();\n\t\t\t\t$not_installed_no_access = false;\n\t\t\t\t$pageType = null;\n\t\t\t\tif($row->type == 'components'){\n\t\t\t\t\t//backward compatibility for site which were migrated from Joomla 1.5\n\t\t\t\t\t$row->type = 'component';\n\t\t\t\t}\n\t\t\t\tif($row->type != 'component')\n\t\t\t\t{\n\t\t\t\t\t$pageType = $row->type;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$pageType =$model->buildPageType($row->link);\n\t\t\t\t\tif(!isset($menuItemsTypes[$pageType]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$pageType = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!$pageType)\n\t\t\t\t{\n\t\t\t\t\t//we have an component without option???\n\t\t\t\t\t//i think is an unistallet component\n\t\t\t\t\t//we set the image to component_no_access\n\t\t\t\t\t//we need an $this->menuItemsTypes->not_installed_no_access\n\t\t\t\t\t$pageType = 'not_installed_no_access';\n\t\t\t\t\t$not_installed_no_access = true;\n\t\t\t\t}\n\n\t\t\t\t$menuItemsType = $menuItemsTypes[$pageType];\n\t\t\t\tif(isset($menuItemsType->icons->default->imageUrl))\n\t\t\t\t{\n\t\t\t\t\t$image = $menuItemsType->icons->default->imageUrl;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(isset($menuItemsType->icons->componentDefault->default->imageUrl))\n\t\t\t\t\t{\n\t\t\t\t\t\t$image = $menuItemsType->icons->componentDefault->default->imageUrl;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tADD ms: 23.03.2011\n\t\t\t\tonly if $pageType == content_article\n\t\t\t\tfor featured article add an own icon\n\t\t\t\t*/\n\t\t\t\tif($pageType == 'content_article')\n\t\t\t\t{\n\t\t\t\t\tif($contentId = $model->getId($row->link))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(in_array($contentId,$featureds))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tok we will look at an extra icon\n\t\t\t\t\t\t\tonly for pageTree and pageChilds\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tif(isset($menuItemsType->icons->featured_default->imageUrl))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$image = $menuItemsType->icons->featured_default->imageUrl;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//ADD END ms: 23.03.2011\n\n\t\t\t\tif(isset($menuItemsType->icons->no_access->imageUrl))\n\t\t\t\t{\n\t\t\t\t\t$imageNoAccess = $menuItemsType->icons->no_access->imageUrl;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(isset($menuItemsType->icons->componentDefault->no_access->imageUrl))\n\t\t\t\t\t{\n\t\t\t\t\t\t$imageNoAccess = $menuItemsType->icons->componentDefault->no_access->imageUrl;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($not_installed_no_access)\n\t\t\t\t{\n\t\t\t\t\t$image = $imageNoAccess;\n\t\t\t\t\t$itemtype_no_access[] = addslashes(JText::_('COM_PAGESANDITEMS_COMPONENT_NOT_INSTALLED_NO_ACCESS'));\n\t\t\t\t\t$row->dtree_no_access = 1;\n\t\t\t\t}\n\t\t\t\t$row->dtree_image = $image;\n\t\t\t\t$row->dtree_imageNoAccess = $imageNoAccess;\n\t\t\t\t$row->pageType = $pageType;\n\n\t\t\t\t//here we check for an empty separator\n\t\t\t\tif($row->type == 'separator' )\n\t\t\t\t{\n\t\t\t\t\t$name = '';\n\t\t\t\t\tif($row->name != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//$name .= ' ('.$row->name.')';\n\t\t\t\t\t\t$name .= $row->name;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$name .= ' (empty)';\n\t\t\t\t\t}\n\t\t\t\t\t$menuName = $name;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$menuName = $row->name;\n\t\t\t\t}\n\t\t\t\t$row->dtree_menuName = $menuName;\n\t\t\t\t/*\n\t\t\t\tin Joomla 1.6 we have parent_id not parent\n\t\t\t\tbut this is fixet in models/page.php\n\t\t\t\t*/\n\t\t\t\t$menuName = addslashes($menuName);\n\n\n\t\t\t\t$title = '';\n\t\t\t\t$script .= \"d$m.add(\".$row->id;//.\" id\n\t\t\t\t$script .= \",\".$row->parent;//.\" , pid\n\t\t\t\t$script .= \",'\".($menuName).\"'\"; //, name\n\n\t\t\t\t/*\n\t\t\t\tTODO\n\t\t\t\tuser_access\n\t\t\t\tif(! ....)\n\t\t\t\t{\n\t\t\t\t\t$itemtype_no_access[] = ...\n\t\t\t\t\t$image = ...\n\t\t\t\t}\n\t\t\t\t*/\n\n\t\t\t\tif($itemtype_no_access != '' && !is_array($itemtype_no_access))\n\t\t\t\t{\n\t\t\t\t\t$title = $itemtype_no_access;\n\t\t\t\t\t$script .= \",'\";\n\t\t\t\t}\n\t\t\t\telseif($itemtype_no_access != '' && is_array($itemtype_no_access) && count($itemtype_no_access))\n\t\t\t\t{\n\t\t\t\t\t$title = implode(', ',$itemtype_no_access);\n\t\t\t\t\t$script .= \",'\";\n\t\t\t\t}\n\t\t\t\telseif($useCheckedOut && $sub_task == 'edit')\n\t\t\t\t{\n\t\t\t\t\t$title = '';\n\t\t\t\t\t$script .= \",'#\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$itemtype_no_access = '';\n\t\t\t\t\t$stringsub_task = $useCheckedOut ? '': '&sub_task=edit';\n\t\t\t\t\t//index.php?option=com_pagesanditems&view=page'.$sub_task.'&pageId='.$row->id.'&pageType='.$row->pageType.'&menutype='.$row->menutype.'\n\t\t\t\t\t$script .= \",'index.php?option=com_pagesanditems&view=page&menutype=\".$row->menutype.\"&pageId=\".$row->id.$stringsub_task.\"&pageType=\".$pageType;\n\t\t\t\t}\n\t\t\t\t$script .= \"','\".$title.\"','','\".$image.\"','\".$image;\n\t\t\t\t$script .= \"');\\n\";\n\t\t\t\t//if($this->pageId == $row->id)\n\t\t\t\tif($pageId == $row->id && $storeVars)\n\t\t\t\t{\n\t\t\t\t\t$this->pageMenuItem = $row;\n\t\t\t\t}\n\t\t\t\t//if( ($row->parent == PagesAndItemsHelper::getPageId() && $row->menutype == PagesAndItemsHelper::getCurrentMenutype()) || (!PagesAndItemsHelper::getPageId() && $row->menutype == PagesAndItemsHelper::getCurrentMenutype()) )\n\t\t\t\t// && ( ($row->parent == $pageId && $row->menutype == PagesAndItemsHelper::getCurrentMenutype()) || (!$pageId && $row->menutype == PagesAndItemsHelper::getCurrentMenutype()) ));\n\t\t\t\tif( $storeVars && ( ($row->parent == $pageId && $row->menutype == PagesAndItemsHelper::getCurrentMenutype()) || (!$pageId && $row->menutype == PagesAndItemsHelper::getCurrentMenutype()) ))\n\t\t\t\t{\n\t\t\t\t\t$this->currentMenuitems = $menuitems;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//end loop menuitems\n\t\t\t$doc->addScriptDeclaration($script);\n\t\t\t//open javascript\n\t\t\t$html .= '<script language=\"javascript\" type=\"text/javascript\">'.\"\\n\";\n\t\t\t$html .= \"<!--\\n\";\n\t\t\t$html .= \"document.write(d\".$m.\");\\n\";\n\t\t\t//if on a certain page, make tree-menu-button selected\n\t\t\tif($menutypes[$m] == PagesAndItemsHelper::getCurrentMenutype())\n\t\t\t{\n\t\t\t\t//if(PagesAndItemsHelper::getPageId() && PagesAndItemsHelper::getPageId() >1)\n\t\t\t\tif($pageId && $pageId >1)\n\t\t\t\t{\n\t\t\t\t\t$html .= \"d$m.openTo(\";\n\t\t\t\t\t$html .= $pageId; //PagesAndItemsHelper::getPageId();\n\t\t\t\t\t$html .= \", true);\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//ms: make the root selected\n\t\t\t\t\t$html .= \"d$m.s(0);\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//close javascript\n\t\t\t$html .= \"-->\\n\";\n\t\t\t$html .= '</script>'.\"\\n\";\n\t\t\t$html .= '</div>';\n\t\t}//end loops menutype\n\t\t//$html .= '</div>';\n\t\t$html .= '</td></tr></tbody></table>';\n\t\t\n\t\treturn $html;\n\t}", "protected function convertPages()\n {\n $pages = $this->mr->getManager()->createQueryBuilder(Page::class)\n ->hydrate(false)\n ->select(['title', 'channel', 'locked', 'grids'])\n ->getQuery()\n ->getIterator();\n\n foreach ($pages as $page) {\n if (!\\array_key_exists('grids', $page)) {\n continue;\n }\n\n $this->currentPage = array_intersect_key($page, array_flip(['_id', 'title', 'locked', 'channel']));\n\n $this->currentChannel = \\array_key_exists('channel', $page) ? $page['channel']['$id'] : null;\n\n foreach ($page['grids'] as $grid) {\n if (!\\array_key_exists('items', $grid)) {\n continue;\n }\n $this->filterItems($grid['items']);\n }\n }\n }", "private function generate_blogtree($posts) {\n\n\t\t\tif (is_array($posts) && count($posts) >= 1) {\n\n\t\t\t\tforeach ($posts as $key => $post) {\n\n\t\t\t\t\t$exclude = get_post_meta($post->ID, 'meta_robots', true);\n\t\t\t\t\t$template = esc_html(get_post_meta($post->ID, '_wp_page_template', true));\n\n\t\t\t\t\tif ((isset($post->post_password) && $post->post_password == '') && in_array($template, $this->excluded) != 1) {\n\n\t\t\t\t\t\t$level = $post->menu_order;\n\t\t\t\t\t\t$url = get_permalink($post->ID);\n\n\t\t\t\t\t\t$categories = wp_get_post_categories($post->ID);\n\t\t\t\t\t\t$tags = wp_get_post_tags($post->ID);\n\t\t\t\t\t\t$author = $post->post_author;\n\n\t\t\t\t\t\t$ranking = get_post_meta($post->ID, 'sitemap_priority', true) ? get_post_meta($post->ID, 'sitemap_priority', true) : 0;\n\t\t\t\t\t\t$priority = $this->get_priority($ranking, $level, $post->post_type);\n\t\t\t\t\t\t$changefreq = $this->get_page_changefreq($post->ID, $post->post_type);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->update_tree($post->ID, $post->post_modified, $url, $post->comment_count, $post->post_type, $level, $changefreq, $priority, $exclude);\n\n\t\t\t\t\t\t$this->update_categories($categories);\n\t\t\t\t\t\t$this->update_tags($tags);\n\t\t\t\t\t\t$this->update_authors($author);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Adding the categories to the sitemap tree\n\n\t\t\t\tif (is_array($this->categories) && count($this->categories) >= 1) {\n\n\t\t\t\t\tforeach ($this->categories as $key => $id) {\n\n\t\t\t\t\t\t$post = get_posts(array('category' => $id, 'orderby' => 'date', 'numberposts' => 1));\n\n\t\t\t\t\t\t$url = get_category_link($id);\n\t\t\t\t\t\t$changefreq = $this->get_page_changefreq($id, 'taxonomy');\n\t\t\t\t\t\t$priority = $this->get_priority(0, 0, 'taxonomy');\n\t\t\t\t\t\t$comments = 0;\n\t\t\t\t\t\t$level = 0;\n\n\t\t\t\t\t\t$this->update_tree($id, $post[0]->post_modified, $url, $comments, 'category', $level, $changefreq, $priority, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Adding the tags to the sitemap tree\n\n\t\t\t\tif (is_array($this->tags) && count($this->tags) >= 1) {\n\n\t\t\t\t\tforeach ($this->tags as $key => $id) {\n\n\t\t\t\t\t\t$term = get_term($id);\n\t\t\t\t\t\t$post = get_posts(array('tag' => $term->name, 'orderby' => 'date', 'numberposts' => 1));\n\n\t\t\t\t\t\t$url = get_term_link($id);\n\t\t\t\t\t\t$changefreq = $this->get_page_changefreq($id, 'tag');\n\t\t\t\t\t\t$priority = $this->get_priority(0, 0, 'tag');\n\t\t\t\t\t\t$comments = 0;\n\t\t\t\t\t\t$level = 0;\n\n\t\t\t\t\t\t$this->update_tree($id, $post[0]->post_modified, $url, $comments, 'tag', $level, $changefreq, $priority, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Adding the authors to the sitemap tree\n\n\t\t\t\tif (is_array($this->authors) && count($this->authors) >= 1) {\n\n\t\t\t\t\tforeach ($this->authors as $key => $id) {\n\n\t\t\t\t\t\t$post = get_posts(array('author' => $id, 'orderby' => 'date', 'numberposts' => 1));\n\n\t\t\t\t\t\t$url = get_author_posts_url($id);\n\t\t\t\t\t\t$changefreq = $this->get_page_changefreq($id, 'author');\n\t\t\t\t\t\t$priority = $this->get_priority(0, 0, 'author');\n\t\t\t\t\t\t$comments = 0;\n\t\t\t\t\t\t$level = 0;\n\n\t\t\t\t\t\t$this->update_tree($id, $post[0]->post_modified, $url, $comments, 'author', $level, $changefreq, $priority, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function setTreeWithPages($htmlTree)\n {\n if (empty($htmlTree)) {\n return $htmlTree;\n } \n $htmlTree = $this->container->get('pi_app_admin.string_manager')->trimUltime($htmlTree);\n if (preg_match_all('#<a data-rub=\"(?P<id_rubrique>(.*))\" >(?P<titre>(.*))</a><p class=\"pi_tree_desc\">(?P<descriptif>(.*))</p>#sU', $htmlTree, $matches_rubs)){\n foreach ($matches_rubs['id_rubrique'] as $key => $idRubrique) {\n $result_simple = preg_split('#<a data-rub=\"'.$idRubrique.'\" >(.*)</a><p class=\"pi_tree_desc\">(.*)</p>#sU', $htmlTree);\n $result_multiple = preg_split('#<a data-rub=\"'.$idRubrique.'\" >(.*)</a><p class=\"pi_tree_desc\">(.*)</p>(.*)<ul>#sU', $htmlTree); \n if (count($result_simple) == 2) {\n $allRubriquePages = $this->getPagesByRub($idRubrique);\n if (!empty($allRubriquePages))\n $htmlTree = $result_simple[0]\n . '<a data-rub=\"'.$idRubrique.'\" >'.$matches_rubs['titre'][$key].'</a><p class=\"pi_tree_desc\">'.$matches_rubs['descriptif'][$key].'</p>'\n . '<ul>'\n . $allRubriquePages\n . '</ul>'\n . $result_simple[1];\n }\n if (count($result_multiple) == 2) {\n $allRubriquePages = $this->getPagesByRub($idRubrique);\n if (!empty($allRubriquePages))\n $htmlTree = $result_multiple[0]\n . '<a data-rub=\"'.$idRubrique.'\" >'.$matches_rubs['titre'][$key].'</a><p class=\"pi_tree_desc\">'.$matches_rubs['descriptif'][$key].'</p>'\n . '<ul>'\n . $allRubriquePages\n . $result_multiple[1];\n }\n }\n }\n \n return $htmlTree;\n }", "protected function getPageTree() {\n\t\t$treeStartingPoint = intval($this->pObj->id);\n\t\t$treeStartingRecord = t3lib_BEfunc::getRecord('pages', $treeStartingPoint);\n\t\tt3lib_BEfunc::workspaceOL('pages', $treeStartingRecord);\n\t\t$depth = isset($this->pObj->MOD_SETTINGS['tx_webinfocontents_modfunc1_depth']) ? $this->pObj->MOD_SETTINGS['tx_webinfocontents_modfunc1_depth'] : 2;\n\n\t\t\t// Initialize tree object:\n\t\t$tree = t3lib_div::makeInstance('t3lib_pageTree');\n\t\t$tree->addField('nav_title', 1);\n\t\t$tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));\n\n\t\t\t// Creating top icon; the current page\n\t\t$HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align=\"top\"');\n\t\t$tree->tree[] = array(\n\t\t\t'row' => $treeStartingRecord,\n\t\t\t'HTML' => $HTML\n\t\t);\n\n\t\t\t// Create the tree from starting point:\n\t\tif ($depth > 0) {\n\t\t\t$tree->getTree($treeStartingPoint, $depth, '');\n\t\t}\n\t\treturn $tree;\n\t}", "private function getPages()\n {\n $pages = new ArrayList();\n $config = Config::inst()->get('SEO_Sitemap','objects');\n\n foreach($this->objects as $className => $value){\n\n $object = $className::get()->filter([\n 'Robots:not' => 'noindex,nofollow',\n 'SitemapHide' => 0\n ]);\n\n foreach($object as $page){\n if(!$page instanceof Page){\n $page->Link = $this->getPrefix($className, $page);\n }\n $pages->push($page);\n }\n }\n $pages->Sort('Priority DESC');\n return $pages;\n }", "public function get_tree(){\n\t\tif(DEBUG_MODE){\n\t\t\tBLog::addToLog('[SoftModules]: get_tree()');\n\t\t\t}\n\t\t$brouter=BRouter::getInstance();\n\t\t$pages=$brouter->getsoftmodules();\n\t\tif(DEBUG_MODE){\n\t\t\tBLog::addToLog('[SoftModules]: Pages: '.var_export($pages,true));\n\t\t\t}\n\t\t$this->get_tree_node($pages);\n\t\treturn $pages;\n\t\t}", "function sitemap ($link = 'com=home&target=main',$grp = 1,$parentid = 0, $selected = 0, $str) {\n\t\tglobal $config, $extra;\n\t\t$sql = \"SELECT cat.id, cat.groupid , detail.title, cat.lastdate FROM \".$config['db_prefix'].\"_news_categories cat RIGHT JOIN \".$config['db_prefix'].\"_news_categories_detail detail ON cat.id = detail.category WHERE detail.language = '\".$config['default_language'].\"' AND cat.groupid='\".$grp.\"' AND cat.parentid = '\".$parentid.\"' ORDER BY cat.oderid, cat.id \";\n\t\t$grpcat[$parentid] = sql_list($sql);\n\t\t//$temp = $link;\n\t\tif ($parentid != 0)\n\t\t\t$str\t.=\t\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\";\n\t\tfor ($i =0; $i < count($grpcat[$parentid]); $i++) { \n\t\t\t\t$value = $grpcat[$parentid][$i];\n\t\t\t\t$n=0;\n\t\t\t\tfor($m=0;$m<count($extra);$m++){\n\t\t\t\t\tif($value['id']==$extra[$m]){\n\t\t\t\t\t\t$n=1;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($n==0){\n\t\t\t\t\t\techo $str.'|--- <a href=\"'.sys_link('com=home&target=main&category='.$value['id']).'\">';\n\t\t\t\t\t\tif ($selected == $value['id']) echo '<strong>';\n\t\t\t\t\t\techo $value['title'];\n\t\t\t\t\t\tif ($selected == $value['id']) echo '</strong>';\n\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\techo \"<br />\".$str;\n\t\t\t\t\t\tif (count_child_newscat($value['id']) > 0)\n\t\t\t\t\t\t\techo \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\";\n\t\t\t\t\t\techo \"|<br />\";\n\t\t\t\t\t}\n\t\t\t\t\tif (count_child_newscat($value['id']) > 0) {\n\t\t\t\t\t\tsitemap($link,$grp,$value['id'],$selected,$str);\n\t\t\t\t\t\t//echo \"<br/>\".$str.\"|<br/>\";\n\t\t\t\t\t}\n\t\t}\n}", "static private function _assembleTagTree() {\n\t\t$tagsData = self::_retrieveTagData();\n\n\t\t// reformat the array to name => data\n\t\tforeach ($tagsData as $index => $tagData) {\n\t\t\t$tagsData[$tagData['name']] = $tagData;\n\t\t\tunset($tagsData[$index]);\n\t\t}\n\t\tforeach ($tagsData as $name => $tagData) {\n\t\t\tself::$_upTree[$name] = self::_findRootPath($name, $tagsData);\n\t\t}\n\t}", "public function create() {\n\n\t\t\t$result = array();\n\n\t\t\tif ($this->menu === true) {\n\n\t\t\t\t// if the sitemap should be based on the menu structure of the website\n\t\t\t\t\n\t\t\t\t$locations = get_nav_menu_locations();\n\t\t\t\t$this->generate_menutree($locations);\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t// if the sitemap should be based published posts and pages\n\n\t\t\t\t$query = array('post_type' => 'post', 'post_status' => 'publish', 'numberposts' => -1, 'orderby' => 'date', 'order' => 'DESC', 'post_parent' => null);\n\t\t\t\t$posts = get_posts($query);\n\n\t\t\t\t$this->generate_blogtree($posts);\n\t\t\t}\n\n\t\t\tif (class_exists('bbPress') && $this->menu === false) {\n\n\t\t\t\t// if we have the bbpress plugin installed, we're adding the forums to the sitemap tree\t\t\n\n\t\t\t\t$query = array('post_type' => 'forum', 'post_status' => 'publish', 'numberposts' => -1, 'orderby' => 'date', 'order' => 'DESC', );\n\t\t\t\t$forums = get_posts($query);\n\n\t\t\t\t$this->generate_forumtree($forums);\n\t\t\t}\n\t\t\t\n\t\t\tif (is_array($this->included) && count($this->included) >= 1) {\n\n\t\t\t\t// if we have custom post types that we want to include in the sitemap\n\n\t\t\t\tforeach ($this->included as $key => $include) {\n\n\t\t\t\t\t$query = array('post_type' => $include, 'post_status' => 'publish', 'numberposts' => -1, 'orderby' => 'date', 'order' => 'DESC', );\n\t\t\t\t\t$posts = get_posts($query);\n\n\t\t\t\t\t$this->generate_typestree($posts);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->sitemap .= '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.\"\\n\";\n\t\t\t$this->sitemap .= '<urlset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\" xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">'.\"\\n\";\n\t\t\t\n\t\t\t$this->sitemap .= \"\\t\".'<url>'.\"\\n\";\n\t\t\t$this->sitemap .= \"\\t\\t\".'<loc>'.$this->get_urlencode(site_url()).'/</loc>'.\"\\n\";\n\t\t\t$this->sitemap .= \"\\t\\t\".'<lastmod>'.$this->get_date(date('Y-m-d h:i:s')).'</lastmod>'.\"\\n\";\n\t\t\t$this->sitemap .= \"\\t\\t\".'<changefreq>'.$this->get_changefreq().'</changefreq>'.\"\\n\";\n\t\t\t$this->sitemap .= \"\\t\\t\".'<priority>1.0</priority>'.\"\\n\";\n\t\t\t$this->sitemap .= \"\\t\".'</url>'.\"\\n\";\n\t\t\t\t\t\n\t\t\tforeach ($this->tree as $key => $page) {\n\t\t\t\t\n\t\t\t\t$this->sitemap .= \"\\t\".'<url>'.\"\\n\";\n\t\t\t\t$this->sitemap .= \"\\t\\t\".'<loc>'.$this->get_urlencode($page['url']).'</loc>'.\"\\n\";\n\t\t\t\t$this->sitemap .= \"\\t\\t\".'<lastmod>'.$this->get_date($page['modified']).'</lastmod>'.\"\\n\";\n\t\t\t\t$this->sitemap .= \"\\t\\t\".'<changefreq>'.$page['changefreq'].'</changefreq>'.\"\\n\";\n\t\t\t\t$this->sitemap .= \"\\t\\t\".'<priority>'.$page['priority'].'</priority>'.\"\\n\";\n\t\t\t\t$this->sitemap .= \"\\t\".'</url>'.\"\\n\";\n\t\t\t}\n\t\t\t\n\t\t\t$this->sitemap .= '</urlset>';\n\t\t\t\n\t\t\t$assets = is_multisite() ? 'sitemaps/' : '';\n\t\t\t$folder = is_multisite() && !is_dir(ABSPATH.$assets) ? wp_mkdir_p(ABSPATH.$assets) : '';\n\t\t\t\n\t\t\t$sitemap_file = is_multisite() ? 'sitemap-'.rtrim(str_replace(array('http://', 'www.', '/'), array('', '', '.'), site_url()), '.').'.xml' : 'sitemap.xml';\n\t\t\t$robots_file = is_multisite() ? 'robots-'.rtrim(str_replace(array('http://', 'www.', '/'), array('', '', '.'), site_url()), '.').'.txt' : 'robots.txt';\n\t\t\t\n\t\t\t$file = fopen(ABSPATH.$assets.$sitemap_file, 'w');\n\t\t\tfwrite($file, $this->sitemap);\n\t\t\tfclose($file);\n\t\t\t\t\t\t\n\t\t\tif (file_exists(ABSPATH.$assets.$sitemap_file)) {\n\n\t\t\t\t$home = get_home_path();\n\t\t\t\t$robots = get_template_directory().'/robots.txt';\n\n\t\t\t\tif (file_exists($robots)) {\n\t\t\t\t\t\n\t\t\t\t\t$this->robots .= file_get_contents($robots).\"\\n\\n\";\n\t\t\t\t\t$this->robots .= 'sitemap: '.site_url().'/sitemap.xml';\n\t\t\t\t\t\n\t\t\t\t\t$file = fopen(ABSPATH.$assets.$robots_file, 'w');\n\t\t\t\t\tfwrite($file, $this->robots);\n\t\t\t\t\tfclose($file);\n\t\t\t\t}\n\n\t\t\t\tif (is_multisite() && file_exists($home.'.htaccess') && is_writable($home.'.htaccess')) {\n\t\t\t\t\t\n\t\t\t\t\t$htaccess = file_get_contents($home.'.htaccess');\n\t\t\t\t\t\n\t\t\t\t\t$htaccess = str_replace('RewriteRule ^sitemap.xml sitemap-%{SERVER_NAME}.xml [L]', '', $htaccess);\n\t\t\t\t\t$htaccess = str_replace('RewriteRule ^sitemap.xml.gz sitemap-%{SERVER_NAME}.xml.gz [L]', '', $htaccess);\n\t\t\t\t\t$htaccess = str_replace('RewriteRule ^robots.txt robots-%{SERVER_NAME}.txt [L]', '', $htaccess);\n\t\t\t\t\t\n\t\t\t\t\t$rules = strpos($htaccess, 'RewriteRule ^sitemap.xml') ? '' : 'RewriteRule ^sitemap.xml '.$assets.'sitemap-%{SERVER_NAME}.xml [L]'.\"\\n\";\n\t\t\t\t\t$rules .= strpos($htaccess, 'RewriteRule ^sitemap.xml.gz') ? '' : 'RewriteRule ^sitemap.xml.gz '.$assets.'sitemap-%{SERVER_NAME}.xml.gz [L]'.\"\\n\";\n\t\t\t\t\t$rules .= strpos($htaccess, 'RewriteRule ^robots.txt') ? '' : 'RewriteRule ^robots.txt '.$assets.'robots-%{SERVER_NAME}.txt [L]'.\"\\n\";\n\t\t\t\t\t$rules .= strlen($rules) != 0 ? \"\\n\" : '';\n\t\t\t\t\t\n\t\t\t\t\tif (strpos($htaccess, '# BEGIN WordPress')) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$htaccess = substr_replace($htaccess, $rules, strpos($htaccess, '# BEGIN WordPress'), 0);\n\t\t\t\t\t}\n\t\t\t\t\telse if (strpos($htaccess, '<IfModule mod_rewrite.c>')) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$htaccess = substr_replace($htaccess, $rules, strpos($htaccess, '<IfModule mod_rewrite.c>'), 0);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$htaccess .= $rules;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$file = fopen($home.'.htaccess', 'w');\n\t\t\t\t\tfwrite($file, $htaccess);\n\t\t\t\t\tfclose($file);\n\t\t\t\t}\n\n\t\t\t\t$this->file_size = round(filesize(ABSPATH.$assets.$sitemap_file) / 1024, 2);\n\t\t\t\t$this->modified_time = filemtime(ABSPATH.$assets.$sitemap_file);\n\t\t\t\t\n\t\t\t\t$result['value'] = array('0' => array('name'=> 'sitemap.xml', 'url'=> '/'.$assets.$sitemap_file, 'file' => ABSPATH.$assets.$sitemap_file, 'robots' => ABSPATH.$assets.$robots_file, 'pages'=> (count($this->tree) + 1), 'size'=> filesize(ABSPATH.$assets.$sitemap_file), 'date'=> $this->modified_time));\n\t\t\t\t$result['error'] = '';\n\t\t\t\t$result['feedback'] = __('Your sitemap.xml file was successfully created.', 'admin translation');\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$result['value'] = '';\n\t\t\t\t$result['error'] = $this->field;\n\t\t\t\t$result['feedback'] = __('There was an issue writing to your sitemap.xml file. Please try again.', 'admin translation');\n\t\t\t}\n\t\t\t\n\t\t\treturn $result;\n\t\t}", "public function actionSitemap () {\n\t\t$applicationStructure = Yii::app()->sitemap->getApplicationStructure();\n\n\t\t// Now lets watch what we got - it is always better to see it once:\n\t\tfunction displayStructure ( $structure ) {\n\t\t\tforeach ( $structure as $structureNode ) {\n\t\t\t\techo '<ul>';\n\t\t\t\techo \"<li>Name: {$structureNode->getName()}</li>\";\n\t\t\t\techo \"<li>Description: {$structureNode->getDescription()}</li>\";\n\t\t\t\techo \"<li>Route: {$structureNode->getRoute()}</li>\";\n\t\t\t\tif ( method_exists($structureNode->getInstance(), 'getPagesForSitemap') ) {\n\t\t\t\t\techo '<li>Pages: ';\n\t\t\t\t\tYii::app()->getController()->widget('zii.widgets.grid.CGridView',\n\t\t\t\t\t\tarray('dataProvider' => $structureNode->getInstance()->getPagesForSitemap()));\n\t\t\t\t\techo '</li>';\n\t\t\t\t}\n\t\t\t\t/*else {\n\t\t\t\t\techo '<li>Children: ';\n\t\t\t\t\tdisplayStructure($structureNode->getChildren());\n\t\t\t\t\techo '</li>';\n\t\t\t\t}*/\n\t\t\t\techo '<li>Children: ';\n\t\t\t\tdisplayStructure($structureNode->getChildren());\n\t\t\t\techo '</li>';\n\t\t\t\techo '</ul>';\n\t\t\t}\n\t\t}\n\n\t\t//CVarDumper::dump($applicationStructure, 5,true);\n\t\tdisplayStructure($applicationStructure);\n\t}", "function generate_pages(){\n\t\techo THEME.'/pages <br>';\n\t\t$location = THEME.'/pages';\n\t\t$pages = Mvc_Functions::directoryToArray ( $location , true);\n\t\tforeach($pages as $page){\n\t\t\tif(Mvc_Functions::get_extension($page) != 'twig'){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t//Determine page slug\n\t\t\t$new_loc = str_replace( $location.'/' , THEME.'/templates/', $page);\n\t\t\t$file = str_replace($location.'/', '', $page);\n\t\t\t$slug = str_replace('.twig', '', $file);\n\t\t\t$template = \"templates/$file\";\n\t\t\t\n\t\t\t\n\t\t\t// Determine the page Title\n\t\t\t$title = str_replace('/', ' | ', $slug);\n\t\t\t$title = ucwords(str_replace('-', ' ', $title));\n\t\t\t\n\t\t\techo \"NEW LOCATION: $new_loc | FILE: $file | TEMPLATE: $template | SLUG: $slug | TITLE: $title <br>\";\n\t\t\t\n\t\t\t//Copy the file to the layouts location\n\t\t\tif(!is_dir(dirname($new_loc))){\n\t\t\t\tmkdir(dirname($new_loc), 0777, true);\n\t\t\t}\n\t\t\tcopy($page, $new_loc);\n\t\t\t\n\t\t\t//Create Page Bean\n\t\t\t$page = current(R::findOrDispense('page','slug = :slug',['slug' => $slug]));\n\t\t\t$page->slug = $slug;\n\t\t\t$page->title = \"$title | Durbanville Hills\";\n\t\t\t$page->template = $template;\n\t\t\t$page->layout = \"layouts/default.twig\";\n\t\t\t\n\t\t\tR::store($page);\n\t\t}\n\t}", "private function buildPagesMap()\n {\n foreach(glob($this->pagesDir . '/*.md') as $file) {\n $fContent = file_get_contents($file);\n $ext = pathinfo($file, PATHINFO_EXTENSION);\n $fileName = ucfirst(basename($file,\".\".$ext));\n\n $split = explode(PHP_EOL, $fContent);\n $open = false;\n $json = '';\n $shiftCounter = 0;\n foreach($split as $line) {\n ++$shiftCounter;\n if(preg_match('#^}#',$line)) {\n $open = false;\n $json .= $line;\n break;\n }\n if(preg_match('#^{#',$line)) {\n $open = true;\n }\n if($open) {\n $json .= $line;\n }\n }\n for($i = 0; $i < $shiftCounter; ++$i) {\n array_shift($split);\n }\n\n $json = json_decode($json,true);\n\n $text = implode(PHP_EOL, $split);\n\n $text = $this->parsedown->text($text);\n\n $fileName = preg_replace('#( )#','_',$fileName);\n\n $this->pagesMap[$fileName] = array(\n 'meta' => $json,\n 'content' => $text\n );\n }\n }", "protected function _mapTree($dataset) {\r\n\t\t\r\n\t\t$tree = array();\r\n\t\tforeach ($dataset as $id => &$node) {\r\n\t\t\t\r\n\t\t\tif (\r\n\t\t\t\t!array_key_exists('parent_id', $node) or \r\n\t\t\t\t$node['parent_id'] === null\r\n\t\t\t) {\r\n\t\t\t\t$tree[$id] = &$node;\r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\tif(!isset($dataset[$node['parent_id']]['pages'])) {\r\n\t\t\t\t\t$dataset[$node['parent_id']]['pages'] = array();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$dataset[$node['parent_id']]['pages'][$id] = &$node;\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn $tree;\r\n\t}", "public function create_sitemap() {\n $this->load->model('Blog_model');\n\t\t$this->load->model('Report_model');\n\t\t$this->load->model('Page_model');\n\n\t\t$data = new stdClass();\n\t\t$t_start = microtime(true);\n\n $links = array();\n $where = array(\n\t\t \t'order_by' => 'date_published',\n\t\t \t'sort' => 'desc',\n\t\t \t'status' => 1\n\t\t);\n\n\t\t$pages = $this->Page_model->getPages($where);\n\t\t$page_count = count($pages->result);\n\t\tif ( $page_count > 0 ) {\n\t\t\tforeach ( $pages->result as $item ) {\n $links[] = array('url'=>base_url().$item->url);\n }\n\t\t}\n\n\t\t$reports = $this->Report_model->getReports($where);\n\t\t$report_count = count($reports->result);\n\t\tif ( $report_count > 0 ) {\n\t // Create the new sitemaps\n foreach ( $reports->result as $item ) {\n $links[] = array('url'=>base_url().'industry-reports/'.$item->url);\n }\n\t\t}\n\n\t\t$blogs = $this->Blog_model->getBlogs($where);\n\t\t$blog_count = count($blogs->result);\n\t\t$blog_links = array();\n\t\tif ( $blog_count > 0 ) {\n\t\t\tforeach ( $blogs->result as $item ) {\n\t\t\t\tif ( $item->type == 1 ) {\n\t\t\t\t\t// 1 Article\n\t\t\t\t\t$blog_links[] = array('url'=>base_url().'blog/'.$item->url);\n\t\t\t\t} else if ( $item->type == 2 ) {\n\t\t\t\t\t// 2 News\n\t\t\t\t\t$blog_links[] = array('url'=>base_url().'news/'.$item->url);\n\t\t\t\t} else if ( $item->type == 3 ) {\n\t\t\t\t\t// 3 Press-Release\n\t\t\t\t\t$blog_links[] = array('url'=>base_url().'press-release/'.$item->url);\n\t\t\t\t}\n }\n\t\t}\n\t\tsort($blog_links);\n\n\t\t$links = array_merge($links,$blog_links);\n\n $data->sitemap = $links;\n header(\"Content-Type: text/xml;charset=iso-8859-1\");\n $this->load->view(\"sitemap\",$data);\n }", "public function render_as_tree()\n {\n $renderer = new TreeMenuRenderer($this->get_tree_name());\n $this->render($renderer, 'sitemap');\n return $renderer->toHTML();\n }", "private function generate_menutree($locations) {\n\t\t\t\n\t\t\tif (is_array($locations) && count($locations) >= 1) {\n\n\t\t\t\tforeach ($locations as $menu => $key) {\n\t\t\t\t\n\t\t\t\t\t$items = wp_get_nav_menu_items($menu, $args = array());\n\t\t\t\t\t\n\t\t\t\t\tforeach ($items as $key => $page) {\n\n\t\t\t\t\t\t$data = get_page($page->object_id);\n\t\t\t\t\t\t$exclude = get_post_meta($page->object_id, 'meta_robots', true);\n\t\t\t\t\t\t$template = esc_html(get_post_meta($page->object_id, '_wp_page_template', true));\n\n\t\t\t\t\t\tif (((isset($data->post_password) && $data->post_password == '') or $page->type == 'taxonomy') && $page->type != 'custom' && in_array($template, $this->excluded) != 1) {\n\n\t\t\t\t\t\t\tif ($page->type == 'taxonomy') {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data = get_term_by('name', $page->title, $page->object);\n\t\t\t\t\t\t\t\t$exclude = get_term_meta($data->term_id, 'meta_robots', true);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// fetching the posts published under a taxonomy page\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$excludes = array();\n\t\t\t\t\t\t\t\t$taxonomy = get_taxonomy($page->object);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($taxonomy->object_type[0] != 'post') {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$arguments = array(\n\t\t\t\t\t\t\t\t\t\t$page->object \t=> $page->title,\n\t\t\t\t\t\t\t\t\t\t'post_type' \t=> $taxonomy->object_type[0],\n\t\t\t\t\t\t\t\t\t\t'post_status' \t=> 'publish',\n\t\t\t\t\t\t\t\t\t\t'numberposts' \t=> -1,\n\t\t\t\t\t\t\t\t\t\t'exclude' \t\t=> $excludes,\n\t\t\t\t\t\t\t\t\t\t'post_parent' \t=> null\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$arguments = array(\n\t\t\t\t\t\t\t\t\t\t'category' \t\t=> $page->object_id,\n\t\t\t\t\t\t\t\t\t\t'post_type' \t=> $taxonomy->object_type[0],\n\t\t\t\t\t\t\t\t\t\t'post_status' \t=> 'publish',\n\t\t\t\t\t\t\t\t\t\t'numberposts' \t=> -1,\n\t\t\t\t\t\t\t\t\t\t'exclude' \t\t=> $excludes,\n\t\t\t\t\t\t\t\t\t\t'post_parent' \t=> null\n\t\t\t\t\t\t\t\t\t);\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$posts = get_posts($arguments);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($page->menu_item_parent == '0') { $this->level = 0; } else { $this->get_parent_level($items, $page->menu_item_parent, $level = 0); }\n\t\t\t\t\t\t\t\tif (get_term_meta($data->term_id, 'sitemap_priority', true)) { $ranking = get_term_meta($data->term_id, 'sitemap_priority', true); } else { $ranking = 0; }\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$priority = $this->get_priority($ranking, $this->level, $page->type);\n\t\t\t\t\t\t\t\t$changefreq = $this->get_page_changefreq($data->term_id, 'taxonomy');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($data->taxonomy == 'post_tag') { $modified = $page->post_modified; } else { $modified = $this->get_taxonomy_date($posts); }\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->update_tree($data->term_id, $modified, $page->url, $page->comment_count, $page->type, $this->level, $changefreq, $priority, $exclude);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// adding the posts published under a taxonomy page\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (!empty($posts) && $exclude != '1') {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tforeach($posts as $key => $post) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$exclude = get_post_meta($post->ID, 'meta_robots', true);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$priority = $this->get_priority($ranking, $this->level, $page->type);\n\t\t\t\t\t\t\t\t\t\t$changefreq = $this->get_page_changefreq($post->ID, 'post');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ($post->post_password == '') {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$this->update_tree($post->ID, $post->post_modified, get_permalink($post->ID), $post->comment_count, $taxonomy->object_type[0], $this->level, $changefreq, $priority, $exclude);\n\t\t\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\t\tif ($page->menu_item_parent == '0') { $this->level = 0; } else { $this->get_parent_level($items, $page->menu_item_parent, $level = 0); }\n\t\t\t\t\t\t\t\tif (get_post_meta($page->object_id, 'sitemap_priority', true)) { $ranking = get_post_meta($page->object_id, 'sitemap_priority', true); } else { $ranking = 0; }\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$priority = $this->get_priority($ranking, $this->level, $page->type);\n\t\t\t\t\t\t\t\t$changefreq = $this->get_page_changefreq($page->object_id, 'page');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->update_tree($page->object_id, $data->post_modified, $page->url, $page->comment_count, $page->type, $this->level, $changefreq, $priority, $exclude);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function children(): Pages\n {\n if ($this->children !== null) {\n return $this->children;\n }\n\n $children = [];\n\n // Add unlisted pages for all classes in namespace:\n // Loop through filesystem as proxy for namespace structure\n $root = $this->kirby()->root('kirby') . '/src';\n\n foreach (Dir::dirs($root) as $package) {\n // Add page and subpages for each namespace package\n $children[] = $this->namespace(\n $name = ucfirst($package),\n $root . '/' . $package,\n );\n\n // Add class page and method subpages for all nested namespaces\n // (only supports one level below main, e.g. `Kirb\\Cms\\Foo\\Bar`)\n foreach (Dir::dirs($root . '/' . $package) as $subpackage) {\n $children[] = $this->namespace(\n $name . '\\\\' . ucfirst($subpackage),\n $root . '/' . $package . '/' . $subpackage\n );\n }\n }\n\n // Add listed shortlink for all pages defined in the\n // content file in the `menu` field\n $quicklinks = ReferenceQuickLinkPage::childrenFromContentField($this->menu());\n array_push($children, ...$quicklinks);\n\n // Add shortlink to overview and\n // class alias page as listed children\n $children[] = [\n 'slug' => Str::random(3),\n 'template' => 'separator',\n 'num' => 0\n ];\n $children[] = [\n 'slug' => 'all',\n 'model' => 'link',\n 'template' => 'link',\n 'num' => 1,\n 'content' => [\n 'title' => 'All classes',\n 'link' => '/docs/reference/objects'\n ]\n ];\n\n $children[] = [\n 'slug' => 'aliases',\n 'model' => 'reference-classaliases',\n 'template' => 'reference-classaliases',\n 'num' => 2,\n 'content' => [\n 'title' => 'Aliases',\n 'intro' => 'In Kirby, classes are separated in different namespaces such as `Kirby\\Cms\\` or `Kirby\\Http\\`. Aliases help to access specific classes without the need to mention their namespace.'\n ]\n ];\n\n return $this->children = Pages::factory($children, $this);\n }", "public function render_as_tree()\n {\n $redirect = new Redirect(\n array(Application::PARAM_CONTEXT => Manager::package(), Manager::PARAM_ACTION => 'xml_group_menu_feed')\n );\n\n $renderer = new TreeMenuRenderer($this->get_tree_name(), $redirect->getUrl(), $this->urlFmt);\n $this->render($renderer, 'sitemap');\n\n return $renderer->toHTML();\n }", "public function treeAction() {\n // Get page record for tree starting point. May be passed as an argument.\n try {\n $startingPoint = $this->request->getArgument('page');\n } catch (\\Exception $e) {\n $startingPoint = 1;\n }\n $pageRecord = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord(\n 'pages', $startingPoint\n );\n // Create and initialize the tree object\n /** @var $tree \\TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView */\n $tree = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Backend\\\\Tree\\\\View\\\\PageTreeView');\n $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));\n // Creating the icon for the current page and add it to the tree\n $html = \\TYPO3\\CMS\\Backend\\Utility\\IconUtility::getSpriteIconForRecord(\n 'pages', $pageRecord, array(\n 'title' => $pageRecord['title']\n )\n );\n $tree->tree[] = array(\n 'row' => $pageRecord,\n 'HTML' => $html\n );\n // Create the page tree, from the starting point, 2 levels deep\n $depth = 2;\n $tree->getTree(\n $startingPoint, $depth, ''\n );\n \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::devLog('page tree', 'examples', 0, $tree->tree);\n // Pass the tree to the view\n $this->view->assign(\n 'tree', $tree->tree\n );\n }", "private function generateNavigationPages($parent_id = 0) {\r\n $dbTablePage = new Default_Model_DbTable_Page();\r\n $pages = $dbTablePage->fetchAll(\"`parent_id`='$parent_id' AND `status`='Y' AND `menu`='Y'\", 'pos ASC');\r\n\r\n $counter = 1;\r\n $subNavPages = array();\r\n foreach ($pages as $page) {\r\n $pageNav = $this->_xml->createElement('page' . $counter);\r\n\r\n $title = $page->title;\r\n foreach ($this->_specialChars as $key => $value) {\r\n $title = str_replace($key, $value, $title);\r\n }\r\n\r\n $label = $this->_xml->createElement('label', $title);\r\n $uri = $this->_xml->createElement('uri', $page->canonical);\r\n $resource = $this->_xml->createElement('resource', 'default:page');\r\n $privilege = $this->_xml->createElement('privilege', 'index');\r\n\r\n $pageNav->appendChild($label);\r\n $pageNav->appendChild($uri);\r\n $pageNav->appendChild($resource);\r\n $pageNav->appendChild($privilege);\r\n\r\n if (count($dbTablePage->fetchAll(\"`parent_id`='\" . $page->id . \"' AND `status`='Y' AND `menu`='Y'\")) > 0) {\r\n $pageNavPages = $this->_xml->createElement('pages');\r\n\r\n $subPages = $this->generateNavigationPages($page->id);\r\n foreach ($subPages as $subPage) {\r\n $pageNavPages->appendChild($subPage);\r\n }\r\n\r\n $pageNav->appendChild($pageNavPages);\r\n }\r\n\r\n if ($parent_id == 0) {\r\n $this->_nav->appendChild($pageNav);\r\n } else {\r\n $subNavPages[] = $pageNav;\r\n }\r\n\r\n $counter++;\r\n }\r\n\r\n if ($parent_id != 0) {\r\n return $subNavPages;\r\n }\r\n }", "public function generateNavigationStructure() {\n $pages = $this->collection->getPages();\n\n $structure = [];\n\n foreach ($pages as $page) {\n $pageNav = $page->getNavigationMenu();\n $structure = $this->nestedMerge($structure, $pageNav->menu);\n }\n\n $this->setStructure($structure);\n }", "private function getChildPages($pages)\n {\n $this->html .= '<ul>';\n\n foreach($pages as $page){\n $this->html .= '<li><a href=\"'.$this->url.$page->Link().'\">'.$page->Title.'</a>';\n\n foreach($this->objects as $className => $config){\n if($config['parent_id'] == $page->ID && $config['parent_id'] !== 0){\n $pages = $className::get()->filter([\n 'Robots:not' => 'noindex,nofollow',\n 'SitemapHide' => 0\n ])->sort('Priority DESC');\n $this->getObjectPages($pages);\n }\n }\n $children = Page::get()->filter([\n 'ParentID' => $page->ID,\n 'Robots:not' => 'noindex,nofollow',\n 'SitemapHide' => 0\n ])->Sort('ID','ASC');\n\n if($children) $this->getChildPages($children);\n\n $this->html .= '</li>';\n }\n\n $this->html .= '</ul>';\n\n }", "public function hookDisplaySitemapPages()\n {\n $allPages = $this->getAllHTMLPages();\n $tree = $this->convertToTree($allPages);\n\n $this->context->smarty->assign([\n 'tree' => $tree,\n 'templatePath' => _PS_MODULE_DIR_.'/'.$this->name.'/views/templates/front/sitemap.tpl',\n ]);\n\n return $this->display(__FILE__, 'views/templates/front/sitemap.tpl');\n }", "function getNavigationTree($title='',$h=0) {\r\n\r\n\t\t\t$nav = '<div id=\"sitemap\">';\r\n\t\t\t$nav .= ($title) ? '<div class=\"mapcaption\">'.$title.'</div>' : '';\r\n\r\n\t\t\t// copy passthru values\r\n\t\t\t$passthru = $this->getPassthru();\r\n\r\n \tfor (;$h<count($this->navigation);$h++) {\r\n \t\t$top = $this->navigation[$h];\r\n \t\t\tif ( !empty($top->title) && $this->hasRight($top->right) && substr($top->title,0,1)!='^' ) {\r\n\t\t\t\t$nav.='<h3>'.$this->htmlPrepare($top->title).'</h3>';\r\n \t\tif ( is_array($top->page) ) {\r\n\t\t\t\t\t\t$nav.='<ul id=\"mapnav\">';\r\n \t\t\t for ($i=0;$i<count($top->page);$i++) {\r\n \t\t\t $entry = $top->page[$i];\r\n \t\t\t\t\t\tif ( !empty($entry->title) && $this->hasRight($entry->right) ) {\r\n\t\t\t\t\t\t\t\t$nav.='<li><a title=\"'.$this->htmlPrepare($entry->text).'\" href=\"'.$this->root.$h.'/'.$i.$passthru\r\n\t\t\t\t\t\t\t\t.(($entry->target) ? '\" target=\"'.$entry->target : '').'\"'\r\n\t\t\t\t\t\t\t\t.(($this->am[2]==$i)?' class=\"selected\">':'>').'<b>'.$this->htmlPrepare($entry->title).'</b><br />'.$this->htmlPrepare($entry->text).'</a></li>';\r\n \t \t\t \t$nav.='<ul id=\"mapsub\">';\r\n \t \t\t \t\tif ( is_array($entry->page) ) {\r\n \t \t\t \t\t\tfor ($j=0;$j<count($entry->page);$j++) {\r\n \t\t\t\t\t\t\t\t\tif ( !empty($entry->page[$j]->title) && $this->hasRight($entry->right) ) {\r\n \t \t\t \t\t\t\t $nav.='<li><a title=\"'.$this->htmlPrepare($entry->page[$j]->text).'\" href=\"'.$this->root.$h.'/'.$i.'/'.$j.$passthru\r\n\t\t\t\t\t\t\t\t\t\t\t.(($entry->page[$j]->target) ? '\" target=\"'.$entry->page[$j]->target : '').'\"'\r\n \t \t\t \t\t\t\t .(($this->am[3]==$j)?' class=\"selected\">':'>').'<b>'.$this->htmlPrepare($entry->page[$j]->title).'</b><br />'.$this->htmlPrepare($entry->page[$j]->text).'</a></li>';\r\n \t \t\t \t\t\t\t}\r\n \t \t\t \t\t\t}\r\n \t\t\t \t}\r\n \t \t\t \t$nav.='</ul>';\r\n \t\t\t\t\t\t}\r\n \t\t\t }\r\n \t \t\t\t$nav.='</ul>';\r\n \t \t\t} else {\r\n\t\t\t\t\t\t$nav.='<p><a title=\"'.$this->htmlPrepare($top->page->text).'\" href=\"'.$this->root.$h.$passthru\r\n\t\t\t\t\t\t.(($top->page->target) ? '\" target=\"'.$top->page->target : '').'\"'\r\n\t\t\t\t\t\t.(($this->am[1]==$h)?' class=\"selected\">':'>').'<b>'.$this->htmlPrepare($top->page->title).'</b><br />'.$this->htmlPrepare($top->page->text).'</a></p>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t $nav.='</div>';\r\n\r\n\t\t\treturn $nav;\r\n\r\n \t}", "public function sitemap()\n\t{\n\n\t\trequire APP . 'libs/smgen.php';\n\t\t\n\t\t$this->services = $this->serviceModel->getArticleByCategory('services');\n\n $urlPrefix = \"http:\" . URL . 'services/detail/';\n $W3C_datetime_format_php = 'Y-m-d\\Th:i:s';\n \n \t\t$data = array();\n\t\t\n if (isset($this->services))\n {\n foreach ($this->services as $page)\n {\n \t$urlPage=$urlPrefix . str_replace(' ' , '-', $page->title);\n \t$data[$page->id] = array('url'=>$urlPage,\n \t\t\t\t\t'lastmod'=>$page->modifydate);\n }\n }\n \t\t// generate Site Map\n \t\t// to generate sitemap Index = SmGen::generateSM($data,\"SMI\");\n \t\t// yo generate sitemap URL := SmGen::generateSM($data);\n \t\tSmGen::generateSM($data);\n\t}", "public function renderTree() {\n $pages = CmsPage::model()->findAll();\n $tree = $this->getTree($pages, true);\n\n echo CHtml::openTag('div', array('class' => 'page-tree'));\n echo CHtml::openTag('ul', array('class' => 'root'));\n\n foreach ($tree as $branch)\n $this->renderBranch($branch);\n\n echo '</ul>';\n echo '</div>';\n }", "function createRootPagesSitemap($url){\n\n\t//Get root pages\n\t$pages = glob(\"views/__root_pages/*.php\");\n\t// remove index.php\n\tforeach($pages as $key => $one) {\n\t if(strpos($one, 'views/__root_pages/index.php') !== false\n\t\t\t|| strpos($one, 'views/__root_pages/404.php') !== false ){\n\t unset($pages[$key]);\n\t }else{\n\t \t$pages[$key] = str_replace('views/__root_pages/', $url, $pages[$key]);\n\t\t\t$pages[$key] = str_replace('.php', '', $pages[$key]);\n\t }\n\t}\n\n\t// add homepage to root pages\n\t$url_no_slash = str_replace('/', '', $url);\n\tarray_unshift($pages , $url_no_slash);\n\t// Create root sitemap\n\tgenerateSitemap($pages, 'sitemaps/-root', $url);\n\t\n\treturn false;\n}" ]
[ "0.7356178", "0.64516544", "0.64429754", "0.64011234", "0.6367426", "0.63587064", "0.63263756", "0.6310024", "0.62921", "0.62524706", "0.6237465", "0.62369806", "0.6228037", "0.6168945", "0.613829", "0.6071662", "0.6045271", "0.5991983", "0.59904635", "0.5989722", "0.59808505", "0.5967838", "0.5943688", "0.59359425", "0.59358513", "0.5931877", "0.5924894", "0.5910714", "0.5896105", "0.589519" ]
0.66223097
1
Create tabs on the admin page
private function _createTabs() { /* This is the main tab, all others will be children of this */ $allLangs = Language::getLanguages(); $idTab = $this->_createSingleTab(0, 'Admin'.$this->className, $this->displayName, $allLangs); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createTabs()\n {\n $this->getTabs()->extend(new OutputFormat())->extend(new DashboardAction());\n }", "function HtmlTabPlugin_admin_actions()\n{\t \n\tadd_options_page('HtmlTabPlugin','HtmlTabPlugin-Text','manage_options',_FILE_,'HtmlTabPlugin_admin');//Add to Setting as sub item\n\t//add_options_page('HtmlTabPlugin','HtmlTabPlugin-Text','manage_options',_FILE_,'HtmlTabPlugin_admin');\n\t//add_object_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show bottom comment as new Item\n\t//add_utility_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show on bottom as new Item\n\t//add_menu_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show on bottom as new Item\n}", "function wpyes_tabs() {\n\t\t$settings = new Wpyes( 'wpyes_tabs' ); // Initialize the Wpyes class.\n\n\t\t$settings->add_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'tab_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_section(\n\t\t\tarray(\n\t\t\t\t'id' => 'section_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_tabs_field_1',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'text',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_tabs_field_2',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'multicheckbox',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'foo' => 'foo',\n\t\t\t\t\t'bar' => 'bar',\n\t\t\t\t\t'foo bar' => 'foo bar',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'tab_2',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_section(\n\t\t\tarray(\n\t\t\t\t'id' => 'section_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_tabs_field_3',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'file',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_tabs_field_4',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'multiselect',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'foo' => 'foo',\n\t\t\t\t\t'bar' => 'bar',\n\t\t\t\t\t'foo bar' => 'foo bar',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$settings->init(); // Run the Wpyes class.\n\t}", "protected function init_tabs() {\n\t\t$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'firstrun', 'pruneads', 'resetstats' ), $_SERVER['REQUEST_URI'] );\n\n\t\t$this->tabs->add( 'general', __( 'General', APP_TD ) );\n\t\t$this->tabs->add( 'categories', __( 'Categories', APP_TD ) );\n\t\t$this->tabs->add( 'listings', __( 'Listings', APP_TD ) );\n\t\t$this->tabs->add( 'structured_data', __( 'Structured Data', APP_TD ) );\n\t\t$this->tabs->add( 'security', __( 'Security', APP_TD ) );\n\t\t$this->tabs->add( 'advertise', __( 'Advertising', APP_TD ) );\n\t\t$this->tabs->add( 'advanced', __( 'Advanced', APP_TD ) );\n\n\t\t$this->tab_sections['general']['appearance'] = array(\n\t\t\t'title' => __( 'Appearance', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title' => __( 'Design', APP_TD ),\n\t\t\t\t\t'desc' => sprintf( __( 'Customize the look and feel of your website by visiting the <a href=\"%s\">WordPress customizer</a>.' , APP_TD), 'customize.php' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'name' => '_blank',\n\t\t\t\t\t'extra' => array(\n\t\t\t\t\t\t'style' => 'display: none;'\n\t\t\t\t\t),\n\t\t\t\t\t'tip' => '',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['general']['configuration'] = array(\n\t\t\t'title' => __( 'Social', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Feedburner URL', APP_TD ),\n\t\t\t\t\t'desc'\t => sprintf( __( '%1$s Sign up for a free <a target=\"_blank\" href=\"%2$s\">Feedburner account</a>.', APP_TD ), '<i class=\"social-ico dashicons-before feedburnerico\"></i>', 'https://feedburner.google.com' ),\n\t\t\t\t\t'type'\t => 'text',\n\t\t\t\t\t'name'\t => 'feedburner_url',\n\t\t\t\t\t'tip'\t => __( 'Automatically redirects your default RSS feed to Feedburner.', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t\t => __( 'Analytics Code', APP_TD ),\n\t\t\t\t\t'desc'\t\t => sprintf( __( '%1$sSign up for a free <a target=\"_blank\" href=\"%2$s\">Google Analytics account</a>.', APP_TD ), '<i class=\"social-ico dashicons-before googleico\"></i>', 'https://www.google.com/analytics/' ),\n\t\t\t\t\t'type'\t\t => 'textarea',\n\t\t\t\t\t'sanitize'\t => 'appthemes_clean',\n\t\t\t\t\t'name'\t\t => 'google_analytics',\n\t\t\t\t\t'extra'\t\t => array(\n\t\t\t\t\t\t'rows'\t => 10,\n\t\t\t\t\t\t'cols'\t => 50,\n\t\t\t\t\t\t'class'\t => 'large-text code'\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t\t => __( 'You can use Google Analytics or other providers as well.', APP_TD ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['general']['search_settings'] = array(\n\t\t\t'title'\t => __( 'Search', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Refine Price Slider', APP_TD ),\n\t\t\t\t\t'name'\t => 'refine_price_slider',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Use a price slider instead of input fields in the \"refine search\" widget', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['general']['extra_features'] = array(\n\t\t\t'title'\t => __( 'Extra Features', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Views Stats', APP_TD ),\n\t\t\t\t\t'name'\t => 'stats_enabled',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Tracking page views', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Open Graph', APP_TD ),\n\t\t\t\t\t'name'\t => 'open_graph_enabled',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Representing site pages in the social networks.', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['categories']['category_menu_options'] = array(\n\t\t\t'title'\t => __( 'Categories Menu', APP_TD ),\n\t\t\t'fields' => $this->categories_options( 'cat_menu' ),\n\t\t);\n\n\t\t$this->tab_sections['categories']['category_dir_options'] = array(\n\t\t\t'title'\t => __( 'Categories Page', APP_TD ),\n\t\t\t'fields' => $this->categories_options( 'cat_dir' ),\n\t\t);\n\n\t\t$this->tab_sections['categories']['search_dropdown'] = array(\n\t\t\t'title'\t => __( 'Search Categories', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Depth', APP_TD ),\n\t\t\t\t\t'type'\t => 'select',\n\t\t\t\t\t'name'\t => 'search_depth',\n\t\t\t\t\t'values' => array(\n\t\t\t\t\t\t'0'\t => __( 'Show All', APP_TD ),\n\t\t\t\t\t\t'1'\t => '1',\n\t\t\t\t\t\t'2'\t => '2',\n\t\t\t\t\t\t'3'\t => '3',\n\t\t\t\t\t\t'4'\t => '4',\n\t\t\t\t\t\t'5'\t => '5',\n\t\t\t\t\t\t'6'\t => '6',\n\t\t\t\t\t\t'7'\t => '7',\n\t\t\t\t\t\t'8'\t => '8',\n\t\t\t\t\t\t'9'\t => '9',\n\t\t\t\t\t\t'10' => '10',\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t => __( \"This sets the depth of categories shown in the category drop-down. Use 'Show All' unless you have a lot of sub-categories and do not want them all listed.\", APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Hierarchy', APP_TD ),\n\t\t\t\t\t'name'\t => 'cat_hierarchy',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Indent sub-categories within the drop-down', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Show Count', APP_TD ),\n\t\t\t\t\t'name'\t => 'cat_count',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Display the ad total next to each category in the drop-down', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Hide Empty', APP_TD ),\n\t\t\t\t\t'name'\t => 'cat_hide_empty',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Hide empty categories within the drop-down', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['general']['messages'] = array(\n\t\t\t'title'\t => __( 'Messages', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t\t => __( 'New Ad', APP_TD ),\n\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t'render' => array( 'CP_Theme_Settings_General', 'render_editor' ),\n\t\t\t\t\t'sanitize'\t => 'appthemes_clean',\n\t\t\t\t\t'name'\t\t => 'ads_form_msg',\n\t\t\t\t\t'extra'\t\t => array(\n\t\t\t\t\t\t'rows'\t => 10,\n\t\t\t\t\t\t'cols'\t => 50,\n\t\t\t\t\t\t'class'\t => 'large-text code'\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t\t => __( 'Appears at the top of the classified ads listing page. (HTML is allowed)', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t\t => __( 'Membership', APP_TD ),\n\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t'render' => array( 'CP_Theme_Settings_General', 'render_editor' ),\n\t\t\t\t\t'sanitize'\t => 'appthemes_clean',\n\t\t\t\t\t'name'\t\t => 'membership_form_msg',\n\t\t\t\t\t'extra'\t\t => array(\n\t\t\t\t\t\t'rows'\t => 10,\n\t\t\t\t\t\t'cols'\t => 50,\n\t\t\t\t\t\t'class'\t => 'large-text code'\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t\t => __( 'Appears at the top of the membership package purchase page. (HTML is allowed)', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t\t => __( 'Terms', APP_TD ),\n\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t'render' => array( 'CP_Theme_Settings_General', 'render_editor' ),\n\t\t\t\t\t'sanitize'\t => 'appthemes_clean',\n\t\t\t\t\t'name'\t\t => 'ads_tou_msg',\n\t\t\t\t\t'extra'\t\t => array(\n\t\t\t\t\t\t'rows'\t => 10,\n\t\t\t\t\t\t'cols'\t => 50,\n\t\t\t\t\t\t'class'\t => 'large-text code'\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t\t => __( 'Appears on the last step of your classified ad listing page. This is usually your legal disclaimer or rules for posting new ads. (HTML is allowed)', APP_TD ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\n\t\t$this->tab_sections['listings']['configuration'] = array(\n\t\t\t'title' => __( 'General', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Editing', APP_TD ),\n\t\t\t\t\t'name'\t => 'ad_edit',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Allow users to edit and republish their ads', APP_TD ),\n\t\t\t\t\t'tip'\t => __( 'Users can manage and edit ads in their dashboard when logged in.', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Relisting', APP_TD ),\n\t\t\t\t\t'name'\t => 'allow_relist',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Allow users to relist and pay for their expired ads', APP_TD ),\n\t\t\t\t\t'tip'\t => __( 'An email will be sent with a link to relist their ad.', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Listing Period', APP_TD ),\n\t\t\t\t\t'type'\t => 'number',\n\t\t\t\t\t'name'\t => 'prun_period',\n\t\t\t\t\t'desc'\t => __( 'Days', APP_TD ) . '<p>' . __( 'This is the number of days an ad will be listed for.', APP_TD ) . '</p>',\n\t\t\t\t\t'tip'\t => __( 'This option is overridden by ad packs if you are charging for ads and using the Fixed Price Per Ad option. ', APP_TD ),\n\t\t\t\t\t'extra'\t => array(\n\t\t\t\t\t\t'class' => 'small-text'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Parent Posting', APP_TD ),\n\t\t\t\t\t'type'\t => 'select',\n\t\t\t\t\t'name'\t => 'ad_parent_posting',\n\t\t\t\t\t'values' => array(\n\t\t\t\t\t\t'yes'\t\t => __( 'Yes', APP_TD ),\n\t\t\t\t\t\t'no'\t\t => __( 'No', APP_TD ),\n\t\t\t\t\t\t'whenEmpty'\t => __( 'When Empty', APP_TD ),\n\t\t\t\t\t),\n\t\t\t\t\t'desc'\t => __( \"Allow users to post in top-level categories\", APP_TD ),\n\t\t\t\t\t'tip'\t => __( \"If set to 'When Empty', it allows posting to top-level categories only if they have no child categories.\", APP_TD ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['listings']['adpage'] = array(\n\t\t\t'title'\t => __( 'Ad Page', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Inquiry Form', APP_TD ),\n\t\t\t\t\t'name'\t => 'ad_inquiry_form',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Require visitors to be logged in before they can contact ad owners', APP_TD ),\n\t\t\t\t\t'tip'\t => __( 'In most cases you should keep this set to no to encourage visitors to ask questions without having to create an account.', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Allow HTML', APP_TD ),\n\t\t\t\t\t'name'\t => 'allow_html',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Permit users to use HTML within their ad listings', APP_TD ),\n\t\t\t\t\t'tip'\t => __( 'Turns on the TinyMCE editor for text area fields and allows the ad owner to use html markup. Other fields do not allow html by default.', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'View Counter', APP_TD ),\n\t\t\t\t\t'name'\t => 'ad_stats_all',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( \"Show a page views counter on each ad listing and blog post\", APP_TD ),\n\t\t\t\t\t'tip'\t => __( \"This will show a 'total views' and 'today's views' at the bottom of each ad listing and blog post.\", APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Gravatar', APP_TD ),\n\t\t\t\t\t'name'\t => 'ad_gravatar_thumb',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( \"Show a picture of the user on their ad listing\", APP_TD ),\n\t\t\t\t\t'tip'\t => __( \"A placeholder image will be used if they don't have a Gravatar setup.\", APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Redirect Ads', APP_TD ),\n\t\t\t\t\t'name'\t => 'redirect_hidden_ads',\n\t\t\t\t\t'type'\t => 'select',\n\t\t\t\t\t'tip'\t => __( 'Alternate redirect URL for deleted or expired ads. By default redirected to 404 pages.', APP_TD ),\n\t\t\t\t\t'values' => array(\n\t\t\t\t\t\t'' => __( 'No Redirect', APP_TD ),\n\t\t\t\t\t\t'home' => __( 'Home page', APP_TD ),\n\t\t\t\t\t\t'category' => __( 'Category archive', APP_TD ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['listings']['moderate'] = array(\n\t\t\t'title'\t => __( 'Moderate', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Ads', APP_TD ),\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'name'\t => 'moderate_ads',\n\t\t\t\t\t'desc'\t => __( 'Manually approve and publish each new ad', APP_TD ),\n\t\t\t\t\t'tip'\t => __( 'Left unchecked, ads go live immediately without being moderated (unless it has not been paid for).', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Edited Ads', APP_TD ),\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'name'\t => 'moderate_edited_ads',\n\t\t\t\t\t'desc'\t => __( 'Manually approve and publish user edited ads', APP_TD ),\n\t\t\t\t\t'tip'\t => __( 'Left unchecked, edited ads stay live without being moderated.', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Prune Ads', APP_TD ),\n\t\t\t\t\t'name'\t => 'post_prune',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Automatically remove expired listings', APP_TD ),\n\t\t\t\t\t'tip'\t => __( 'Left unchecked, ads will remain live but marked as expired. If enabled, ads will be taken offline (not deleted). Frequency can be set via the cron job option on the advanced tab.', APP_TD ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['listings']['images'] = array(\n\t\t\t'title'\t => __( 'Ad Images', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Require Images', APP_TD ),\n\t\t\t\t\t'name'\t => 'require_images',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Require at least one image uploaded per ad', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Max Images', APP_TD ),\n\t\t\t\t\t'type'\t => 'select',\n\t\t\t\t\t'name'\t => 'num_images',\n\t\t\t\t\t'values' => array(\n\t\t\t\t\t\t'1'\t => '1',\n\t\t\t\t\t\t'2'\t => '2',\n\t\t\t\t\t\t'3'\t => '3',\n\t\t\t\t\t\t'4'\t => '4',\n\t\t\t\t\t\t'5'\t => '5',\n\t\t\t\t\t\t'6'\t => '6',\n\t\t\t\t\t\t'7'\t => '7',\n\t\t\t\t\t\t'8'\t => '8',\n\t\t\t\t\t\t'9'\t => '9',\n\t\t\t\t\t\t'10' => '10',\n\t\t\t\t\t),\n\t\t\t\t\t'desc'\t => __( 'Number of images', APP_TD ) . '<p>' . __( 'This is the number of images allowed per ad', APP_TD ) . '</p>',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Max Size', APP_TD ),\n\t\t\t\t\t'type'\t => 'select',\n\t\t\t\t\t'name'\t => 'max_image_size',\n\t\t\t\t\t'values' => array(\n\t\t\t\t\t\t'100'\t => '100KB',\n\t\t\t\t\t\t'250'\t => '250KB',\n\t\t\t\t\t\t'500'\t => '500KB',\n\t\t\t\t\t\t'1024'\t => '1MB',\n\t\t\t\t\t\t'2048'\t => '2MB',\n\t\t\t\t\t\t'5120'\t => '5MB',\n\t\t\t\t\t\t'7168'\t => '7MB',\n\t\t\t\t\t\t'10240'\t => '10MB',\n\t\t\t\t\t),\n\t\t\t\t\t'desc'\t => __( 'Maximum size per image', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => __( 'Min Width', APP_TD ),\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'name' => 'min_file_width',\n\t\t\t\t\t'desc' => __( 'Pixels', APP_TD ),\n\t\t\t\t\t'extra' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'class' => 'small-text',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => __( 'Min Height', APP_TD ),\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'name' => 'min_file_height',\n\t\t\t\t\t'desc' => __( 'Pixels', APP_TD ),\n\t\t\t\t\t'extra' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'class' => 'small-text',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['structured_data']['listing'] = array(\n\t\t\t'title' => __( 'Setup Data Schema', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title' => __( 'Listing Schema', APP_TD ),\n\t\t\t\t\t'desc' => sprintf( __( \"Select Structured Data <a target='_blank' href='%s'>type</a> to be applied to each listing.\", APP_TD ), 'http://schema.org/docs/full.html' ),\n\t\t\t\t\t'type' => 'radio',\n\t\t\t\t\t'name' => 'listing_schema',\n\t\t\t\t\t'values' => array(\n\t\t\t\t\t\t'thing' => __( 'Thing', APP_TD ) . ' <p class=\"description\">' . __( 'The most generic type of item.', APP_TD ) . '</p>',\n\t\t\t\t\t\t'offer' => '&mdash; ' . __( 'Offer', APP_TD ) . ' <p class=\"description\">' . __( 'An offer to transfer some rights to an item or to provide a service — for example, an offer to sell tickets to an event, to rent the DVD of a movie, to stream a TV show over the internet, to repair a motorcycle, or to loan a book.', APP_TD ) . '</p>',\n\t\t\t\t\t\t'product' => '&mdash; ' . __( 'Product', APP_TD ) . ' <p class=\"description\">' . __( 'Any offered product or service. For example: a pair of shoes; a concert ticket; the rental of a car; a haircut; or an episode of a TV show streamed online.', APP_TD ) . '</p>',\n\t\t\t\t\t\t'organization' => '&mdash; ' . __( 'Organization', APP_TD ) . ' <p class=\"description\">' . __( 'The most generic type of organization schema.', APP_TD ) . '</p>',\n\t\t\t\t\t\t'localbusiness' => '&mdash;&mdash; ' . __( 'Local Business', APP_TD ) . ' <p class=\"description\">' . __( 'A particular physical business or branch of an organization. Examples of LocalBusiness include a restaurant, a particular branch of a restaurant chain, a branch of a bank, a medical practice, a club, a bowling alley, etc.', APP_TD ) . '</p>' . '<hr>',\n\t\t\t\t\t\t'' => __( 'No schema', APP_TD ),\n\t\t\t\t\t),\n\t\t\t\t\t'wrap' => '<div id=\"listing_schema_chices\">%input%</divp>',\n\t\t\t\t\t'wrap_each' => '<div>%input%</div>',\n\t\t\t\t\t'tip' => '',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['security']['settings'] = array(\n\t\t\t'title' => __( 'Access', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Backend Access', APP_TD ),\n\t\t\t\t\t'desc'\t => sprintf( __( \"Restrict access by <a target='_blank' href='%s'>specific role</a>.\", APP_TD ), 'http://codex.wordpress.org/Roles_and_Capabilities' ),\n\t\t\t\t\t'type'\t => 'select',\n\t\t\t\t\t'name'\t => 'admin_security',\n\t\t\t\t\t'values' => array(\n\t\t\t\t\t\t'manage_options'\t => __( 'Admins Only', APP_TD ),\n\t\t\t\t\t\t'edit_others_posts'\t => __( 'Admins, Editors', APP_TD ),\n\t\t\t\t\t\t'publish_posts'\t\t => __( 'Admins, Editors, Authors', APP_TD ),\n\t\t\t\t\t\t'edit_posts'\t\t => __( 'Admins, Editors, Authors, Contributors', APP_TD ),\n\t\t\t\t\t\t'read'\t\t\t\t => __( 'All Access', APP_TD ),\n\t\t\t\t\t\t'disable'\t\t\t => __( 'Disable', APP_TD ),\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['security']['recaptcha'] = array(\n\t\t\t'title'\t => __( 'reCaptcha', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title' => __( 'Enable', APP_TD ),\n\t\t\t\t\t'name' => 'captcha_enable',\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'desc' => sprintf( __( \"A free <a target='_blank' href='%s'>anti-spam service</a> provided by Google\", APP_TD ), esc_url( 'https://www.google.com/recaptcha/' ) ),\n\t\t\t\t\t'tip' => __( 'Displays a verification box on your registration page to help prevent your website from spam, robots and abusive attacks.', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => __( 'Public Key', APP_TD ),\n\t\t\t\t\t'desc' => '',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'name' => 'captcha_public_key',\n\t\t\t\t\t'desc' => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => __( 'Private Key', APP_TD ),\n\t\t\t\t\t'desc' => '',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'name' => 'captcha_private_key',\n\t\t\t\t\t'tip' => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Theme', APP_TD ),\n\t\t\t\t\t'type'\t => 'select',\n\t\t\t\t\t'name'\t => 'captcha_theme',\n\t\t\t\t\t'values' => array(\n\t\t\t\t\t\t'light' => __( 'Light', APP_TD ),\n\t\t\t\t\t\t'dark' => __( 'Dark', APP_TD ),\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\n\t\t$this->tab_sections['advertise']['header'] = array(\n\t\t\t'title'\t => __( 'Header Ad (468x60)', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Enable', APP_TD ),\n\t\t\t\t\t'name'\t => 'adcode_468x60_enable',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Displayed in the header', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t\t => __( 'Code', APP_TD ),\n\t\t\t\t\t'desc'\t\t => sprintf( __( 'Supports many popular providers such as <a target=\"_blank\" href=\"%s\">Google AdSense</a> and <a target=\"_blank\" href=\"%s\">BuySellAds</a>.', APP_TD ), 'https://www.google.com/adsense/', 'https://www.buysellads.com/' ),\n\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t'render' => array( 'CP_Theme_Settings_General', 'render_editor' ),\n\t\t\t\t\t'sanitize'\t => 'appthemes_clean',\n\t\t\t\t\t'name'\t\t => 'adcode_468x60',\n\t\t\t\t\t'extra'\t\t => array(\n\t\t\t\t\t\t'rows'\t => 10,\n\t\t\t\t\t\t'cols'\t => 50,\n\t\t\t\t\t\t'class'\t => 'large-text code'\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Image', APP_TD ),\n\t\t\t\t\t'desc'\t => $this->wrap_upload( 'adcode_468x60_url', '<br />' . __( 'Enter the URL to your ad creative.', APP_TD ) ),\n\t\t\t\t\t'type'\t => 'text',\n\t\t\t\t\t'name'\t => 'adcode_468x60_url',\n\t\t\t\t\t'tip'\t => __( 'If you would rather use an image ad instead of code provided by your advertiser, use this field.', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Destination', APP_TD ),\n\t\t\t\t\t'desc'\t => __( 'The URL of your landing page.', APP_TD ),\n\t\t\t\t\t'type'\t => 'text',\n\t\t\t\t\t'name'\t => 'adcode_468x60_dest',\n\t\t\t\t\t'tip'\t => __( 'When a visitor clicks on your ad image, this is the destination they will be sent to.', APP_TD ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['advertise']['content'] = array(\n\t\t\t'title'\t => __( 'Content Ad (336x280)', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Enable', APP_TD ),\n\t\t\t\t\t'name'\t => 'adcode_336x280_enable',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Displayed on single ad, category, and search result pages', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t\t => __( 'Code', APP_TD ),\n\t\t\t\t\t'desc'\t\t => sprintf( __( 'Supports many popular providers such as <a target=\"_blank\" href=\"%s\">Google AdSense</a> and <a target=\"_blank\" href=\"%s\">BuySellAds</a>.', APP_TD ), 'https://www.google.com/adsense/', 'https://www.buysellads.com/' ),\n\t\t\t\t\t'type' => 'custom',\n\t\t\t\t\t'render' => array( 'CP_Theme_Settings_General', 'render_editor' ),\n\t\t\t\t\t'sanitize'\t => 'appthemes_clean',\n\t\t\t\t\t'name'\t\t => 'adcode_336x280',\n\t\t\t\t\t'extra'\t\t => array(\n\t\t\t\t\t\t'rows'\t => 10,\n\t\t\t\t\t\t'cols'\t => 50,\n\t\t\t\t\t\t'class'\t => 'large-text code'\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Image', APP_TD ),\n\t\t\t\t\t'desc'\t => $this->wrap_upload( 'adcode_336x280_url', '<br />' . __( 'Enter the URL to your ad creative.', APP_TD ) ),\n\t\t\t\t\t'type'\t => 'text',\n\t\t\t\t\t'name'\t => 'adcode_336x280_url',\n\t\t\t\t\t'tip'\t => __( 'If you would rather use an image ad instead of code provided by your advertiser, use this field.', APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Destination', APP_TD ),\n\t\t\t\t\t'desc'\t => __( 'The URL of your landing page.', APP_TD ),\n\t\t\t\t\t'type'\t => 'text',\n\t\t\t\t\t'name'\t => 'adcode_336x280_dest',\n\t\t\t\t\t'tip'\t => __( 'When a visitor clicks on your ad image, this is the destination they will be sent to.', APP_TD ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\n\t\t$this->tab_sections['advanced']['settings'] = array(\n\t\t\t'title'\t => __( 'Maintenance', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Prune Ads', APP_TD ),\n\t\t\t\t\t'name'\t => '_blank',\n\t\t\t\t\t'type'\t => '',\n\t\t\t\t\t'desc'\t => sprintf( __( '<a href=\"%s\">Prune expired ads</a>', APP_TD ), 'admin.php?page=app-settings&pruneads=1' ),\n\t\t\t\t\t'extra'\t => array(\n\t\t\t\t\t\t'style' => 'display: none;'\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t => __( 'Click the link to manually run a function that checks all ad expiry dates and prunes any ads that are expired. This event will run only one time per click.', APP_TD ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tif ( current_theme_supports( 'app-stats' ) ) {\n\t\t\t$this->tab_sections['advanced']['settings']['fields'][] = array(\n\t\t\t\t'title'\t => __( 'Reset Stats', APP_TD ),\n\t\t\t\t'name'\t => '_blank',\n\t\t\t\t'type'\t => '',\n\t\t\t\t'desc'\t => sprintf( __( '<a href=\"%s\">Reset stats counters</a>', APP_TD ), 'admin.php?page=app-settings&resetstats=1' ),\n\t\t\t\t'extra'\t => array(\n\t\t\t\t\t'style' => 'display: none;'\n\t\t\t\t),\n\t\t\t\t'tip'\t => __( 'Click the link to run the function that reset the stats counters for all ads and posts.', APP_TD ),\n\t\t\t);\n\t\t}\n\n\t\t$this->tab_sections['advanced']['user'] = array(\n\t\t\t'title'\t => __( 'User', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Set Password', APP_TD ),\n\t\t\t\t\t'name'\t => 'allow_registration_password',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Let the user create their own password vs a system generated one', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Disable Toolbar', APP_TD ),\n\t\t\t\t\t'name'\t => 'remove_admin_bar',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Hide the WordPress toolbar for logged in users', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Disable Embeds', APP_TD ),\n\t\t\t\t\t'name'\t => 'disable_embeds',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( \"Don't allow users to embed videos, images, or any other media\", APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Disable Login Page', APP_TD ),\n\t\t\t\t\t'name'\t => 'disable_wp_login',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Prevents users from accessing <code>wp-login.php</code> directly', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['advanced']['developer'] = array(\n\t\t\t'title'\t => __( 'Developer', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Enable Debug Mode', APP_TD ),\n\t\t\t\t\t'name'\t => 'debug_mode',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( 'Print out the <code>$wp_query->query_vars</code> array at the top of your website', APP_TD ),\n\t\t\t\t\t'tip'\t => '',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Hide Version', APP_TD ),\n\t\t\t\t\t'name'\t => 'remove_wp_generator',\n\t\t\t\t\t'type'\t => 'checkbox',\n\t\t\t\t\t'desc'\t => __( \"Remove the WordPress version meta tag from your website\", APP_TD ),\n\t\t\t\t\t'tip'\t => __( \"An added security measure so snoopers won't be able to tell what version of WordPress you're running.\", APP_TD ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Cron Schedule', APP_TD ),\n\t\t\t\t\t'type'\t => 'select',\n\t\t\t\t\t'name'\t => 'ad_expired_check_recurrance',\n\t\t\t\t\t'desc'\t => __( 'Frequency expired ads are checked for and taken offline. This is a cron job and will automatically run.', APP_TD ),\n\t\t\t\t\t'values' => array(\n\t\t\t\t\t\t'none'\t\t => __( 'None', APP_TD ),\n\t\t\t\t\t\t'hourly'\t => __( 'Hourly', APP_TD ),\n\t\t\t\t\t\t'twicedaily' => __( 'Twice Daily', APP_TD ),\n\t\t\t\t\t\t'daily'\t\t => __( 'Daily', APP_TD ),\n\t\t\t\t\t),\n\t\t\t\t\t'tip'\t => __( 'Twice daily is recommended. Hourly may cause performance issues if you have a lot of ads. Note: This feature only works if you have enabled the Prune Ads option. ', APP_TD ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$this->tab_sections['advanced']['permalinks'] = array(\n\t\t\t'title'\t => __( 'Custom URLs', APP_TD ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title'\t => __( 'Permalinks', APP_TD ),\n\t\t\t\t\t'type'\t => '',\n\t\t\t\t\t'name'\t => '_blank',\n\t\t\t\t\t'desc'\t => sprintf( __( '<a href=\"%s\">Setup permalinks</a>', APP_TD ), 'options-permalink.php' ),\n\t\t\t\t\t'extra'\t => array(\n\t\t\t\t\t\t'style' => 'display: none;'\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t}", "private function _createTab()\r\n {\r\n $response = true;\r\n\r\n // First check for parent tab\r\n $parentTabID = Tab::getIdFromClassName('AdminFieldMenu');\r\n\r\n if ($parentTabID) {\r\n $parentTab = new Tab($parentTabID);\r\n } else {\r\n $parentTab = new Tab();\r\n $parentTab->active = 1;\r\n $parentTab->name = array();\r\n $parentTab->class_name = \"AdminFieldMenu\";\r\n foreach (Language::getLanguages() as $lang){\r\n $parentTab->name[$lang['id_lang']] = \"Fieldthemes\";\r\n }\r\n $parentTab->id_parent = 0;\r\n $parentTab->module = '';\r\n $response &= $parentTab->add();\r\n }\r\n\t// Check for parent tab2\r\n\t\t\t$parentTab_2ID = Tab::getIdFromClassName('AdminFieldMenuSecond');\r\n\t\t\tif ($parentTab_2ID) {\r\n\t\t\t\t$parentTab_2 = new Tab($parentTab_2ID);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$parentTab_2 = new Tab();\r\n\t\t\t\t$parentTab_2->active = 1;\r\n\t\t\t\t$parentTab_2->name = array();\r\n\t\t\t\t$parentTab_2->class_name = \"AdminFieldMenuSecond\";\r\n\t\t\t\tforeach (Language::getLanguages() as $lang) {\r\n\t\t\t\t\t$parentTab_2->name[$lang['id_lang']] = \"FieldThemes Configure\";\r\n\t\t\t\t}\r\n\t\t\t\t$parentTab_2->id_parent = $parentTab->id;\r\n\t\t\t\t$parentTab_2->module = '';\r\n\t\t\t\t$response &= $parentTab_2->add();\r\n\t\t\t}\r\n\t\t\t// Created tab\r\n $tab = new Tab();\r\n $tab->active = 1;\r\n $tab->class_name = \"AdminFieldOneCateProductSlider\";\r\n $tab->name = array();\r\n foreach (Language::getLanguages() as $lang){\r\n $tab->name[$lang['id_lang']] = \"Configure one categories\";\r\n }\r\n $tab->id_parent = $parentTab_2->id;\r\n $tab->module = $this->name;\r\n $response &= $tab->add();\r\n\r\n return $response;\r\n }", "public function rendercreatetab()\n\t{\n\t\t$mentor_link = $this->CFG->wwwroot.'/create';\n\t\t$school_link=$this->CFG->wwwroot.'/create/listschool.php';\n\t\t$event_link = $this->CFG->wwwroot.'/create/listevent.php';\n\t\t$content = '<div class=\"card-text content\">\n\t\t<div id=\"block-createtab\" class=\"block-createtab\" data-region=\"createtab\">\n\t\t\t<ul id=\"block-createtab-view-choices\" class=\"nav nav-tabs\" role=\"tablist\">\n\t\t\t\t<li class=\"nav-item\">\n\t\t\t\t<a id=\"v1\" class=\"nav-link active\" href=\"'.$mentor_link.'\" data-tabname=\"mentors\" aria-expanded=\"true\">Mentors </a>\n\t\t\t\t</li>\n\t\t\t\t<li class=\"nav-item\">\n\t\t\t\t<a id=\"v2\" class=\"nav-link\" href=\"'.$school_link.'\" data-tabname=\"schools\" aria-expanded=\"false\">Schools</a>\n\t\t\t\t</li>\n\t\t\t\t<li class=\"nav-item\">\n\t\t\t\t<a id=\"v2\" class=\"nav-link\" href=\"'.$event_link.'\" data-tabname=\"events\" aria-expanded=\"false\">Events</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t<div class=\"tab-content content-centred tabcontentatal\">';\n\t\t$content.=$this->render_mentor_content();\n\t\t$content.='</div></div></div>'; //Close tabcotent,block-createab,card-text\n\treturn $content;\n\t}", "public function render_tabs()\n {\n // Get current page and current tab\n $current_page = $this->get_current_page_slug();\n $current_tab = $this->get_current_tab();\n\n // Output admin page tab navigation\n echo '<h2 class=\"woochimp-tabs-container nav-tab-wrapper\">';\n echo '<div id=\"icon-woochimp\" class=\"icon32 icon32-woochimp\"><br></div>';\n foreach ($this->settings as $page => $page_value) {\n if ($page != $current_page) {\n continue;\n }\n\n foreach ($page_value['children'] as $subpage => $subpage_value) {\n $class = ($subpage == $current_tab) ? ' nav-tab-active' : '';\n echo '<a class=\"nav-tab'.$class.'\" href=\"?page='.preg_replace('/_/', '-', $page).'&tab='.$subpage.'\">'.((isset($subpage_value['icon']) && !empty($subpage_value['icon'])) ? $subpage_value['icon'] . '&nbsp;' : '').$subpage_value['title'].'</a>';\n }\n }\n echo '</h2>';\n }", "public function tablist()\n {\n $this->beforeAction();\n $view = Piwik_View::factory('tablist');\n $plugins = $this->manager->setRelease($this->release)\n ->getCurrentPlugins();\n $view->pluginsName = $plugins;\n $view->debug = print_r($plugins, true);\n $this->render($view);\n }", "function bbp_tools_admin_tabs($active_tab = '')\n{\n}", "public function tabs() {\n\n\t\t$this->load->model('Instalacao_model');\n\n\t\tis_ajax();\n\t\t$data['instalacao']['registro'] = $this->Instalacao_model->getInstalacao(1);\n\n\t\t$this->load->view('instalacao/tabs', $data);\n\t\t$this->load->view('includes/js_load');\n\t}", "function prepareTabs()\n {\n $this->addElement(\n 'html', \n ResourceManager::getInstance()->get_resource_html(\n Path::getInstance()->getJavascriptPath(\n 'Chamilo\\Core\\Repository\\ContentObject\\Survey\\Page\\Question\\Select', \n true) . 'Form.js'));\n \n $this->getTabsGenerator()->add_tab(\n new DynamicFormTab(\n self::TAB_QUESTION, \n Translation::get(\n (string) StringUtilities::getInstance()->createString(self::TAB_QUESTION)->upperCamelize()), \n Theme::getInstance()->getImagePath(\n 'Chamilo\\Core\\Repository\\ContentObject\\Survey\\Page\\Question\\Select', \n 'Tab/' . self::TAB_QUESTION), \n 'build_question_form'));\n \n $this->getTabsGenerator()->add_tab(\n new DynamicFormTab(\n self::TAB_OPTION, \n Translation::get(\n (string) StringUtilities::getInstance()->createString(self::TAB_OPTION)->upperCamelize()), \n Theme::getInstance()->getImagePath(\n 'Chamilo\\Core\\Repository\\ContentObject\\Survey\\Page\\Question\\Select', \n 'Tab/' . self::TAB_OPTION), \n 'build_option_form'));\n \n $this->addDefaultTab();\n $this->addMetadataTabs();\n }", "function wpyes_help_tabs() {\n\t\t$settings = new Wpyes( 'wpyes_help_tabs' ); // Initialize the Wpyes class.\n\n\t\t$settings->add_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'tab_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_section(\n\t\t\tarray(\n\t\t\t\t'id' => 'section_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_help_tabs_field_1',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'number',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_help_tabs_field_2',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'multiselect',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'foo' => 'foo',\n\t\t\t\t\t'bar' => 'bar',\n\t\t\t\t\t'foo bar' => 'foo bar',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_help_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'my_help_tab',\n\t\t\t\t'title' => __( 'My Help Tab' ),\n\t\t\t\t'content' => '<p>' . __( 'Descriptive content that will show in My Help Tab-body goes here.' ) . '</p>',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_help_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'my_help_tab2',\n\t\t\t\t'title' => __( 'My Help Tab2' ),\n\t\t\t\t'content' => '<p>' . __( 'Descriptive content that will show in My Help Tab-body goes here 2.' ) . '</p>',\n\t\t\t)\n\t\t);\n\n\t\t$settings->init(); // Run the Wpyes class.\n\t}", "function wpyes_custom_tab_content() {\n\t\t$settings = new Wpyes( 'wpyes_custom_tab_content' ); // Initialize the Wpyes class.\n\n\t\t$settings->add_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'tab_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_section(\n\t\t\tarray(\n\t\t\t\t'id' => 'section_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_custom_tab_content_field_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_custom_tab_content_field_2',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'tab_2',\n\t\t\t\t'callback' => 'wpyes_custom_tab_2_content_chart',\n\t\t\t)\n\t\t);\n\n\t\t$settings->init(); // Run the Wpyes class.\n\t}", "public function adminTabs($tabs, $default, $page){\n \n if ( isset ( $_GET['tab'] ) ) $current = $_GET['tab']; else $current = $default;\n \n echo '<div id=\"icon-themes\" class=\"icon32\"><br></div>';\n echo '<h2 class=\"nav-tab-wrapper\">';\n \n foreach( $tabs as $tab => $name ){\n $class = ( $tab == $current ) ? ' nav-tab-active' : '';\n echo \"<a class='nav-tab$class' href='?page=$page&tab=$tab'>$name</a>\";\n \n }\n \n echo '</h2>';\n }", "public function add_help_tabs() {}", "public function admin_tabs_info( $tabs ) {\n\t\t\t$post_type = filter_input( INPUT_GET, 'post_type' );\n\t\t\t$action = filter_input( INPUT_GET, 'action' );\n\t\t\t$post = filter_input( INPUT_GET, 'post' );\n\t\t\tif ( LP_COURSE_CPT == $post_type || $action == 'edit' && LP_COURSE_CPT == get_post_type($post)) {\n\t\t\t\t$tabs[11] = array(\n\t\t\t\t\t\"link\" => \"edit.php?post_type=lp_collection\",\n\t\t\t\t\t\"name\" => __( \"Collections\", \"learnpress-collections\" ),\n\t\t\t\t\t\"id\" => \"edit-lp_collection\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $tabs;\n\t\t}", "function mailbox_add_settings_tab()\n{\n $CI = & get_instance();\n $CI->app_tabs->add_settings_tab('mailbox-settings', [\n 'name' => ''._l('mailbox_setting').'',\n 'view' => 'mailbox/mailbox_settings',\n 'position' => 36,\n ]);\n}", "public function installTab(){\n\n $tab = new Tab();\n $langs = language::getLanguages();\n foreach($langs as $lang) $tab->name[$lang['id_lang']] = 'Lunch Reserve';\n $tab->module = $this->name;\n $tab->id_parent = 0;\n $tab->class_name = 'LunchReserveAdmin';\n return $tab->save();\n\n }", "public function create_pages() {\n $categories_page = add_submenu_page( 'mixmarket_options'\n , __( 'Categories', MM_TEXTDOMAIN )\n , __( 'Categories', MM_TEXTDOMAIN )\n , 'manage_options'\n , $this->categories_page\n , array( $this, 'render_categories_page' )\n );\n //adding JS code for \"confirm deletion\" action\n\t\t\tadd_action( 'admin_print_scripts-' . $categories_page, array( $this, 'load_scripts' ) );\n\t\t}", "public function admin_tabs( $current ) {\n\n $tabs = apply_filters(\"spine_js_tabs\", $this->tabs);\n\n echo '<h2 class=\"nav-tab-wrapper\">';\n\n $page = $this->plugin_slug;\n foreach ($tabs as $tab => $arr) {\n $class = ($tab == $current) ? ' nav-tab-active' : '';\n $title = $arr['title'];\n echo \"<a class='nav-tab$class' href='?page=$page&tab=$tab'>$title</a>\";\n }\n echo '</h2>';\n }", "private function training_Tab()\n {\n\n $this->crud->addField([ // CustomHTML\n 'name' => 'content_separator',\n 'type' => 'custom_html',\n 'value' => '<br><h2>Content</h2><hr>',\n ]); \n $this->crud->addField([\n 'name' => 'tab1_title',\n 'type' => 'text',\n 'label' => 'First Tab Title',\n 'fake' => true,\n 'store_in' => 'extras',\n ]); \n $this->crud->addField([\n 'name' => 'tab1_content',\n 'type' => 'wysiwyg',\n 'label' => 'First Tab Content',\n 'fake' => true,\n 'store_in' => 'extras',\n ]); \n $this->crud->addField([\n 'name' => 'tab2_title',\n 'type' => 'text',\n 'label' => 'Second Tab Title',\n 'fake' => true,\n 'store_in' => 'extras',\n ]); \n $this->crud->addField([\n 'name' => 'tab2_content',\n 'type' => 'wysiwyg',\n 'label' => 'Second Tab Content',\n 'fake' => true,\n 'store_in' => 'extras',\n ]); \n\n\n $this->crud->addField([ // CustomHTML\n 'name' => 'metas_separator',\n 'type' => 'custom_html',\n 'value' => '<br><h2>Metas</h2><hr>',\n ]);\n\n $this->crud->addField([\n 'name' => 'meta_title',\n 'label' => 'Meta Title',\n 'fake' => true,\n 'store_in' => 'extras',\n ]);\n $this->crud->addField([\n 'name' => 'meta_description',\n 'label' => 'Meta Description',\n 'fake' => true,\n 'store_in' => 'extras',\n ]);\n $this->crud->addField([\n 'name' => 'meta_keywords',\n 'type' => 'textarea',\n 'label' => 'Meta Keywords',\n 'fake' => true,\n 'store_in' => 'extras',\n ]);\n }", "public function upload_tab_content()\n {\n $tab = isset($_GET['tab'])?$_GET['tab']:false;\n\n if (isset($this->modules[$tab]))\n {\n $module = $this->modules[$tab];\n require_once $this->_path.'/admin/tab.php';\n }\n }", "public function admin_print_tabs( $views ) {\n\n\t\t\t$current_type = '';\n\t\t\t$active_class = ' nav-tab-active';\n\t\t\t$current_tab = $this->get_active_tab();\n\n\t\t\tif ( ! empty( $_REQUEST['layout_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t\t\t$current_type = $_REQUEST['layout_type']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t\t\t$active_class = '';\n\t\t\t}\n\n\t\t\t$url_args = array(\n\t\t\t\t'post_type' => ASTRA_ADVANCED_HOOKS_POST_TYPE,\n\t\t\t\t'layout_type' => $current_tab,\n\t\t\t);\n\n\t\t\t$custom_layout_types = array(\n\t\t\t\t'header' => __( 'Header', 'astra-addon' ),\n\t\t\t\t'footer' => __( 'Footer', 'astra-addon' ),\n\t\t\t\t'hooks' => __( 'Hooks', 'astra-addon' ),\n\t\t\t\t'404-page' => __( '404 Page', 'astra-addon' ),\n\t\t\t\t'content' => __( 'Page Content', 'astra-addon' ),\n\t\t\t);\n\n\t\t\t$baseurl = add_query_arg( $url_args, admin_url( 'edit.php' ) );\n\n\t\t\t?>\n\t\t\t\t<div class=\"nav-tab-wrapper ast-custom-layout-tabs-wrapper\">\n\t\t\t\t\t<a class=\"nav-tab<?php echo esc_attr( $active_class ); ?>\" href=\"<?php echo esc_url( admin_url( 'edit.php?post_type=' . ASTRA_ADVANCED_HOOKS_POST_TYPE ) ); ?>\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo esc_html__( 'All', 'astra-addon' );\n\t\t\t\t\t\t?>\n\t\t\t\t\t</a>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $custom_layout_types as $type => $title ) {\n\t\t\t\t\t\t$type_url = esc_url( add_query_arg( 'layout_type', $type, $baseurl ) );\n\t\t\t\t\t\t$active_class = ( $current_type === $type ) ? ' nav-tab-active' : '';\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<a class=\"nav-tab<?php echo esc_attr( $active_class ); ?>\" href=\"<?php echo esc_url( $type_url ); ?>\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\techo esc_attr( $title );\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t<?php\n\n\t\t\treturn $views;\n\t\t}", "function buildTabs($load_template = array()) {\n\t\t$document = JFactory::getDocument ();\n\t\t$document->addScript ( JURI::base () . 'components/com_retinashop/retina_097115115101116115/js/tabs.js' );\n\n\t\t$html = '<div id=\"ui-tabs\">';\n\t\t$i = 1;\n\t\tforeach ( $load_template as $tab_content => $tab_title ) {\n\t\t\t$html .= '<div id=\"tab-' . $i . '\" class=\"tabs\" title=\"' . RText::_ ( $tab_title ) . '\">';\n\t\t\t$html .= $this->loadTemplate ( $tab_content );\n\t\t\t$html .= '<div class=\"clear\"></div>\n\t\t\t </div>';\n\t\t\t$i ++;\n\t\t}\n\t\t$html .= '</div>';\n\t\techo $html;\n\t}", "function bbp_get_tools_admin_tabs($active_tab = '')\n{\n}", "function ead_import_admin_navigation($tabs)\n{\n if (get_acl()->checkUserPermission('EadImporter_Index', 'index')) {\n $tabs['EAD Import'] = uri('ead-importer/index/'); \n }\n return $tabs;\n}", "public function putTabBodyLvls()\n {\n self::putSingleAction('create', 'Add a new level', true, true);\n //$cols = array(array('width' => 400, 'text' => 'Name', 'field' => 'name', 'class' => 'edit'));\n //$cols[] = array('width' => 20, 'class' => 'btn', 'action' => 'delete', 'object' => 'Level');\n self::putBlocks('lvls', 'Level', 'There are currently no levels to view');\n }", "public function installTab()\n {\n /** @var RetailcrmAdminAbstractController $controller */\n foreach (self::ADMIN_CONTROLLERS as $controller) {\n $tab = new Tab();\n $tab->id = $controller::getId();\n $tab->id_parent = $controller::getParentId();\n $tab->class_name = $controller::getClassName();\n $tab->name = $controller::getName();\n $tab->icon = $controller::getIcon();\n $tab->position = $controller::getPosition();\n $tab->active = 1;\n $tab->module = $this->name;\n\n if (!$tab->save()) {\n return false;\n }\n }\n\n return true;\n }", "public function create()\n {\n if (auth()->user()->can('add-tab')) {\n $tabs = Tab::all();\n return view('admin.tabs.create', compact('tabs'));\n } else {\n $t = 'f';\n $m = 'مهدودیت سطح دسترسی';\n $l = 'users.index';\n return view('admin.alert', compact('t', 'm', 'l'));\n }\n }", "private function pages_tab() {\n\t\t$this->pages_settings_appearance();\n\t}" ]
[ "0.7968604", "0.7180917", "0.7146472", "0.7041204", "0.69380546", "0.69367206", "0.6851732", "0.6835785", "0.6830642", "0.6772627", "0.67132473", "0.6706873", "0.67053556", "0.6701388", "0.66348594", "0.6585213", "0.65783393", "0.65730137", "0.6548578", "0.65438056", "0.6539897", "0.6519009", "0.650427", "0.6493645", "0.64859504", "0.6483723", "0.6478885", "0.6478001", "0.64626306", "0.6460506" ]
0.74277306
1
Sort projects bills by user for further calculation
private function sortBillsByUser($projects, $users = []): array { $values = []; foreach ($projects as $project) { foreach ($project->missions as $mission) { foreach ($mission->bills as $bill) { if (count($users) == 0 || (count($users) > 0 && in_array($bill->application->user->id, $users))) { $values[$bill->application->user_id]['user'] = $bill->application->user; $index = &$values[$bill->application->user_id]; // Create 'gross_amount' index and increment it isset($index['gross_amount']) ? $index['gross_amount'] += $this->calculateGrossAmount($bill) : $index['gross_amount'] = $this->calculateGrossAmount($bill); // Create 'hour_amount' index and increment it, and check for flat rates $hour_amount = $bill->rate->is_flat ? $bill->rate->hours * $bill->amount : $bill->amount; isset($index['hour_amount']) ? $index['hour_amount'] += $hour_amount : $index['hour_amount'] = $hour_amount; // Create 'operations' index and add missions references and start_at dates to it $mission_info = ['id' => $mission->id, 'reference' => $mission->reference, 'startAt' => $mission->start_at]; in_array($mission_info, $index['operations'] ?? []) ?: $index['operations'][] = $mission_info; // Create 'clients' index and add clients name to it $client_info = ['id' => $project->client->id, 'name' => $project->client->name]; in_array($client_info, $index['clients'] ?? []) ?: $index['clients'][] = $client_info; } } } } return $values; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sort_accounts($data, $filtered, $account, $accs) {\n global $year;\n $rows = filter_journal($filtered, ['account' => $account['number']]);\n if (count($rows) > 0) {\n $sums = sum_side($rows,$account['number']);\n $month = months();\n $months = [];\n for ($i=$month['start'];$i<=$month['end'];$i++) {\n $rs = filter_journal($rows,['since' => implode('-',[$year,n2($i),'01']), 'until' => implode('-',[$year,n2($i),'31'])]);\n $months[$i] = sum_side($rs,$account['number']);\n }\n $row = ['account' => $accs[$account['number']], 'rows' => $rows, 'sums' => $sums, 'months' => $months];\n //super accounts, main accounts vs. analytical ones\n if (strpos($account['number'],'-') === false) {\n if ($account['number'] < 10)\n $data['super'][] = $row;\n else\n $data['main'][] = $row;\n } else {\n $data['analytical'][] = $row;\n }\n }\n return $data;\n}", "function Seller_Listing_Win_project($user_id)\n\t{\n\t\tglobal $db;\n\t\t$sql = \"SELECT * FROM \".project_MASTER.\" AS PM\"\n\t .\" LEFT JOIN \".BID_MASTER.\" AS BM ON PM.project_id = BM.project_id\"\n\t\t\t .\" WHERE PM.project_post_to = '\".$user_id.\"' AND PM.project_status = 2\"\n\t\t\t .\" GROUP BY PM.project_id \";\n\t\t$db->query($sql);\n//\t\tprint $sql;\n\t}", "private function sortUsers($a, $b){\n return $a->getPoints() - $b->getPoints();\n }", "public function getProjectsByUser(int $userId){\n $userId = (int)$userId;\n $projects = $this->find(array(\"selection\"=>\"p.ID ID, p.creator_id, u.username creator, p.title title, p.summary summary, DATE_FORMAT(publication_date, '%d/%m/%Y à %Hh%imin') AS date_fr, tags FROM projects p INNER JOIN users u ON u.ID = p.creator_id WHERE p.creator_id=$userId\", \"order\"=>\"publication_date DESC\"));\n for ($i=0; $i < count($projects); $i++) { \n $projects[$i][\"summary\"] = $this->Parsedown->line($projects[$i][\"summary\"]);\n $projects[$i][\"tags\"] = explode(\"/\", $projects[$i][\"tags\"]);\n }\n return $projects;\n }", "public function sortBoxes() {\r\n\t\t$tmpArr = array();\r\n\r\n\t\tforeach ($this->blogRolls as $blogroll) {\r\n\t\t\t$tmpArr[$blogroll->getOrder()] = $blogroll;\r\n\t\t}\r\n\t\tksort($tmpArr);\r\n\t\t$this->blogRolls = null;\r\n\r\n\t\tforeach($tmpArr as $key => $value) {\r\n\t\t\t$this->addBlogroll($value);\r\n\t\t}\r\n\t}", "public function orderProjectListAction(Request $request)\n {\n $oAccount = $this->getDoctrine()->getManager()->getRepository('WWSCThalamusBundle:Account')->find($request->getSession()->get('account')->id);\n $aProjects = $oAccount->getProjects($request->get('order'), false, false, 'open', true);\n if ('projectLead' == $request->get('order')) {\n $userManager = $this->container->get('fos_user.user_manager');\n $this->getUser()->setSortingProjectsList(1);\n $userManager->updateUser($this->getUser());\n\n return new JsonResponse(array('dashboardMenuProject' => $this->renderView('WWSCThalamusBundle:Account:dashboard-menu-project-projectLead.html.twig', array('aProjects' => $aProjects))));\n } else {\n $userManager = $this->container->get('fos_user.user_manager');\n $this->getUser()->setSortingProjectsList(0);\n $userManager->updateUser($this->getUser());\n\n return new JsonResponse(array('dashboardMenuProject' => $this->renderView('WWSCThalamusBundle:Account:dashboard-menu-project-alphabet.html.twig', array('aProjects' => $aProjects))));\n }\n }", "private function customSortAllWorkshops()\n {\n $allWorkshops = Workshop::all()->keyBy('id');\n $user = auth()->user();\n $workshops = collect();\n\n if ($user) {\n // Add owned workshops\n $user->ownedWorkshops()->get()->each(\n function ($workshop) use ($allWorkshops, $user, $workshops) {\n $workshopToAdd = $allWorkshops->pull($workshop->id);\n $workshops->push($workshopToAdd);\n }\n );\n\n // Add workshops in your group\n $allWorkshops->each(\n function ($workshop) use ($allWorkshops, $user, $workshops) {\n if ($workshop->sharesGroupWith($user, true)) {\n $workshopToAdd = $allWorkshops->pull($workshop->id);\n $workshops->push($workshopToAdd);\n }\n }\n );\n }\n\n $allWorkshops->each(\n function ($workshop) use ($workshops) {\n $workshops->push($workshop);\n }\n );\n\n return $workshops;\n }", "public function all_bills(){\n\t\tauthenticate(array('ut7'));\n\t\t$userId = $this->session->userdata(\"userId\");\n\t\t$userTypeId = $this->session->userdata(\"userTypeId\");\n\t\t$data['userData'] = $this->login->getUserProfile($userId);\n\t\t$data['table_header_date'] = 'Date';\n\t\t$data['table_header_amount'] = 'Amount';\n\t\t$data['table_header_description'] = 'Description';\n\t\t$data['table_header_action'] = 'Action';\n\t\t$flag \t= $this->uri->segment(2);\n\t\t$com_id = $this->uri->segment(3);\n\t\tif($data['userData']['can_view_bill'] == 1){\n\t\t\t$data['table_heading'] = 'Invoices';\n\t\t\t$this->db->select('user.*,company.company_name');\n\t\t\t$this->db->from('user');\n\t\t\t$this->db->join('company','company.id=user.company_id');\n\t\t\t$this->db->where(\"user.userTypeId = 'ut4'\");\n\t $this->db->where('user.status', 1);\n\t $this->db->where('user.Isprimary', 1);\n\t $query=$this->db->get();\t\n\t $temp_ut4 = $query->result_array();\t\n\t $this->db->select('user.*');\n\t\t\t$this->db->from('user');\n\t\t\t$this->db->where(\"user.userTypeId = 'ut11'\");\n\t $this->db->where('user.status', 1);\n\t $this->db->where('user.Isprimary', 1);\n\t $query=$this->db->get();\n\t $temp_ut11_temp = $query->result_array();\n\t $temp_ut11 = array();\n\t foreach ($temp_ut11_temp as $key => $value) {\n\t \t$temp_ut11[] = $value;\n\t \t$temp_ut11[$key]['company_name'] = 'Individual'; \n\t }\n\t $data['userlist'] = array_merge($temp_ut4,$temp_ut11);\n\t\t\tif($com_id != ''){\n\t\t\t\t$company_id = base64_decode(base64_decode($com_id));\n\t\t\t\t$data['invoice'] = $this->invoice_model->getInvoice($company_id,$flag);\n\t\t\t\t$this->load->view(\"all_bills\",$data);\n\t\t\t}else{\n\t\t\t\t$this->load->view(\"user_list\",$data);\n\t\t\t}\n\t\t}else{\n\t\t\texit(\"You are not authorize to access this page\");\n\t\t}\n\t}", "function sort_items($user_id) {\n $items = get_current_list($user_id);\n sort($items);\n return $items;\n}", "function get_sorted_invoices($trusting=FALSE){\n $trusting = $trusting?'marked_paid':'paid';\n $this->db->select('invoices.*, users.firstname, users.prefname, users.surname, users.email, users.current, users.custom_email');\n $this->db->order_by('users.surname');\n $this->db->join('users', 'users.id=invoices.member_id');\n $invoices = $this->db->get('invoices')->result_array();\n foreach($invoices as $i){\n if(!isset($invoice[$i['member_id']])){\n $invoice[$i['member_id']] = array('total'=>0, 'paid'=>0);\n $invoice[$i['member_id']]['name'] = ($i['prefname']==''?$i['firstname']:$i['prefname']).' '.$i['surname'];\n $invoice[$i['member_id']]['email'] = $i['email'];\n $invoice[$i['member_id']]['custom_email'] = $i['custom_email'];\n $invoice[$i['member_id']]['current'] = $i['current'];\n }\n $invoice[$i['member_id']]['total'] += $i['amount'];\n if($i[$trusting]){\n $invoice[$i['member_id']]['paid'] += $i['amount'];\n }\n }\n return $invoice;\n\n }", "function sort_project_by_date($a,$b)\n{\n\n\tif (strtotime($a[1])==strtotime($b[1])) return 0;\n\treturn (strtotime($a[1])<strtotime($b[1]))?-1:1;\n}", "private function getRankedUsers(){\n $scoreRepo = $this->getDoctrine()->getManager()->getRepository('AppBundle:Score');\n $userManager = $this->get('fos_user.user_manager');\n $users = $userManager->findUsers();\n\n $ranks = array();\n\n // For each user\n foreach ($users as $user) {\n // get scores\n $totalPoints = 0;\n $scores = $scoreRepo->findBy(array('user' => $user));\n foreach ($scores as $score) {\n //die(var_dump($score));\n // make total\n $totalPoints += $score->getNbPoints();\n\n }\n // store in array (user, totalScore)\n $rank = array(\n 'user' => $user,\n 'nbPoints' => $totalPoints,\n );\n $ranks[] = $rank;\n }\n\n // Sort from lowest to highest\n usort($ranks, function($a, $b){\n return $a['nbPoints'] <= $b['nbPoints'];\n });\n return $ranks;\n }", "function unedtrivial_get_miniranking($unedid,$userid){\n GLOBAL $DB;\n \n $allrows = $DB->get_records_sql('SELECT u.id,u.firstname,u.lastname,SUM(n.questionscore) AS sum '\n . ' FROM {user} u'\n . ' JOIN {unedtrivial_history} n ON n.userid = u.id '\n . ' WHERE n.idunedtrivial = ? '\n . ' GROUP BY u.id,u.firstname,u.lastname'\n . ' ORDER BY sum DESC', array($unedid));\n \n $allrows = array_values($allrows); //reset array keys (0,1,2,3....)\n $pos = array_search($userid, array_column($allrows, 'id'));\n if ($pos <= 2){\n $min = 0; $max = min(4,count($allrows)-1);\n }else if ($pos >= count($allrows)-3){\n $min = max(0,count($allrows)-5); $max = count($allrows)-1;\n }else{\n $min = $pos-2; $max = $pos+2;\n }\n $selectedrows = array();\n for ($i=$min;$i<=$max;$i++){\n $selectedrows[] = $allrows[$i];\n }\n \n $table = new html_table();\n $table->head = array(get_string('leaderboardcol1', 'unedtrivial'),\n get_string('leaderboardcol2', 'unedtrivial'),\n get_string('leaderboardcol3', 'unedtrivial'));\n $i = $min;\n foreach($selectedrows as $row) { \n $i = $i + 1;\n if ($row->id == $userid){\n $table->data[] = array('<font color=\"blue\">'.$i.'</font>',\n '<font color=\"blue\">'.$row->firstname.\" \".$row->lastname.'</font>',\n '<font color=\"blue\">'.$row->sum.'</font>');\n }else{\n $table->data[] = array($i, $row->firstname.\" \".$row->lastname, $row->sum);\n }\n }\n return $table;\n}", "function cmp($a, $b) {\n\n $propertyAccessor = PropertyAccess::createPropertyAccessor();\n\n return strcmp($propertyAccessor->getValue($a,'[committer_name]'), $propertyAccessor->getValue($b,'[committer_name]'));\n }", "function sortTestimonials($a, $b)\n{\n return strcmp($a->siteTestimonialId, $b->siteTestimonialId);\n}", "public function user_column_orderby( $query ) {\n\t\n\t\tif( 'WP_User_Query' != get_class( $query ) )\n\t\t\treturn $query;\n\t\n\t\t$vars = $query->query_vars;\n\t\n\t\t//echo '<pre>'; var_dump( get_class( $query ) ); echo '</pre>'; exit; //Debug\n\t\n\t\tif ( !isset( $vars['orderby'] ) || 'has_mp_account' != $vars['orderby'] )\n\t\t\treturn $query;\n\t\n\t\t/** We store a different mp_user_id for production and sandbox environments **/\n\t\t$umeta_key = 'mp_user_id';\n\t\tif( !$this->mp->is_production() )\n\t\t\t$umeta_key .= '_sandbox';\n\t\n\t\tglobal $wpdb;\n\t\t$query->query_from .= \" LEFT JOIN $wpdb->usermeta m ON ($wpdb->users.ID = m.user_id AND m.meta_key = '$umeta_key')\";\n\t\t$query->query_orderby = \"ORDER BY m.meta_value \".$vars['order'];\n\t\n\t\treturn $query;\n\t}", "function sortByPer($a, $b) {\n \t\t\treturn $a['percentage'] + $b['percentage'];\n\t\t\t}", "function markProjectsList() {\r\n if (!in_array($this->Session->read('user_type'), array(1, 7, 2, 3))) {\r\n $this->Session->setFlash(ERR_NOT_AUTHORIZED_THIS);\r\n $this->redirect(\"/projects\");\r\n }\r\n $filters = \"\";\r\n if ($this->Session->read('user_type') == 1 || $this->Session->read('user_type') == 7) {\r\n $admin_id = $this->getAdminId();\r\n $filters = \"Project.admin_id= \" . $admin_id;\r\n } else if ($this->Session->read('user_type') == 2 || $this->Session->read('user_type') == 3) {\r\n $filters = \"Project.leader_id=\" . $this->Session->read('userid');\r\n } else {\r\n $filters.=\" 1=1 \";\r\n }\r\n $filters.=\" AND Project.published =1 AND DATEDIFF(curdate(), date_format(projectStudent.submitted_date, '%Y-%m-%d'))<=2\";\r\n $projects = $this->projectStudent->getProjectsForMarking($filters);\r\n $grpAcToDate = array();\r\n if (count($projects) > 0) {\r\n $gotData = array();\r\n $preDate = \"\";\r\n $i = 0;\r\n $currDate = date(\"Y-m-d\");\r\n $yesterday = date(\"Y-m-d\", strtotime(\"-1 DAY\"));\r\n $dayBeforeYesterday = date(\"Y-m-d\", strtotime(\"-2 DAY\"));\r\n foreach ($projects as $rec) {\r\n $dd = explode(\" \", $rec['projectStudent']['submitted_date']);\r\n $date = date(\"Y-m-d\", strtotime($dd[0]));\r\n if (strtotime($currDate) == strtotime($date)) {\r\n //Insert in today array\r\n $grpAcToDate[0][] = $rec;\r\n } else if (strtotime($yesterday) == strtotime($date)) {\r\n //Insert in today array\r\n $grpAcToDate[1][] = $rec;\r\n } else if (strtotime($dayBeforeYesterday) == strtotime($date)) {\r\n //Insert in today array\r\n $grpAcToDate[2][] = $rec;\r\n }\r\n }\r\n }\r\n $this->set(\"projects\", $grpAcToDate);\r\n }", "function _jr_pending_payment_jobs_for_user( $user_id ) {\n\n\tif ( ! jr_charge_job_listings() ) {\n\t\treturn false;\n\t}\n\n\t$undecided_jobs = array();\n\n\t### get all 'undecided' job orders ( gateway not selected )\n\n\t$args = array(\n\t\t'connected_type' => APPTHEMES_ORDER_CONNECTION,\n\t\t'connected_query' => array( 'post_status' => APPTHEMES_ORDER_PENDING ),\n\t\t'post_type' => APP_POST_TYPE,\n\t\t'post_status' => 'any',\n\t\t'nopaging' => true,\n\t\t'orderby' => 'ID',\n\t\t'connected' => 'any',\n\t\t'author' => $user_id,\n\t);\n\t$draft_order_jobs = new WP_Query( $args );\n\n\tforeach ( $draft_order_jobs->posts as $draft_order_job ) {\n\t\t$order = appthemes_get_order( $draft_order_job->p2p_from );\n\t\t$gateway = $order->get_gateway();\n\t\t$undecided_jobs[$draft_order_job->ID] = array (\n\t\t\t'status' => ( empty($gateway) ? 'undecided' : 'pending' ),\n\t\t\t'order_id' => $order->get_id(),\n\t\t);\n\t}\n\n\treturn $undecided_jobs;\n}", "public function sortByUsort() {\n usort($this->dataSort,function($a,$b){\n if($a->getTo()==$b->getFrom()){\n return -1;\n }\n elseif ($a->getFrom()==$b->getTo()) {\n return 1;\n }\n return 0;\n });\n \n return $this->dataSort;\n }", "function sortAndBalance($accountNumber)\r\n\t\t{\r\n\t\t\t// Log task, output is already being buffered before this function is called\r\n\t\t\t$this->processID = $this->Process->createProcess('Invoice / Transaction Utility', false);\r\n\t\t\t$processMessage = \"Sorting and balancing account {$accountNumber}\";\r\n\t\t\t$this->Logging->write($processMessage);\r\n\t\t\t$this->Process->updateProcess($this->processID, 0, $processMessage);\r\n\t\t\t\r\n\t\t\t// Lock the customer record\r\n\t\t\tif ($customerID === false || !$this->Customer->lock($this->customerID))\r\n\t\t\t{\r\n\t\t\t\t$this->message(\"Customer record {$accountNumber} could not be locked\");\r\n\t\t\t\t$this->Process->updateProcess($this->processID, 0, $processMessage . ': LOCKING ISSUE');\r\n\t\t\t\t$this->Process->finishProcess($this->processID, $this->Logging->getBufferedOutput());\r\n\t\t\t\t$this->_stop();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Sort the invoice & transaction chains\r\n\t\t\t$this->sortChains($accountNumber, true);\r\n\t\t\t$this->Process->updateProcess($this->processID, 40, $processMessage);\r\n\t\t\t\r\n\t\t\t// Balance the invoice & transaction chains\r\n\t\t\t$this->balanceChains($accountNumber);\r\n\t\t\t$this->Process->updateProcess($this->processID, 90, $processMessage);\r\n\t\t\t\r\n\t\t\t$this->Logging->write('Finished');\r\n\t\t\t$completedText = $this->messages ? ': MESSAGES' : ': DONE';\r\n\t\t\t$this->Process->updateProcess($this->processID, 100, $processMessage . $completedText);\r\n\t\t\t$this->Process->finishProcess($this->processID, $this->Logging->getBufferedOutput());\r\n\t\t\t$this->Customer->unlock($this->customerID);\r\n\t\t}", "public function compareAccounts($projectId, $month1, $month2) {\n\t\t$conditions = array(\n\t\t\t'FinanceOperation.project_id' => $projectId,\n\t\t);\n\t\t$conditions1 = $conditions + array(\n\t\t\t\t\"FinanceOperation.created <= '$month1-01'\",\n\t\t\t\t\"FinanceOperation.created = (SELECT MAX(o.created) FROM finance_operation o WHERE o.created <= '$month1-01' AND o.currency=FinanceOperation.currency)\",\n\t\t\t);\n\t\t$result1 = $this->find('all', array(\n\t\t\t'conditions' => $conditions1,\n\t\t\t'group' => 'FinanceOperation.created',\n\t\t\t'fields' => array('FinanceOperation.currency', 'FinanceOperation.balance_after'),\n\t\t));\n\t\t$result1 = Hash::combine($result1, '{n}.FinanceOperation.currency', '{n}.FinanceOperation.balance_after');\n\n\t\t$conditions2 = $conditions + array(\n\t\t\t\t\"FinanceOperation.created < DATE_ADD('$month2-01', INTERVAL 1 MONTH)\",\n\t\t\t\t\"FinanceOperation.created = (SELECT MAX(o.created) FROM finance_operation o WHERE o.created < DATE_ADD('$month2-01', INTERVAL 1 MONTH) AND o.currency=FinanceOperation.currency)\",\n\t\t\t);\n\t\t$result2 = $this->find('all', array(\n\t\t\t'conditions' => $conditions2,\n\t\t\t'group' => 'FinanceOperation.created',\n\t\t\t'fields' => array('FinanceOperation.currency', 'FinanceOperation.balance_after'),\n\t\t));\n\t\t$result2 = Hash::combine($result2, '{n}.FinanceOperation.currency', '{n}.FinanceOperation.balance_after');\n\n\t\t$currencyList = array('USD' => 0, 'EUR' => 0, 'RUB' => 0,);\n\t\t$return = array(array('currency', '%'));\n\t\tforeach ($currencyList as $currency => $balance) {\n\t\t\tif (isset($result1[$currency]) && isset($result2[$currency])) {\n\t\t\t\t$balance1 = (double)$result1[$currency];\n\t\t\t\t$balance2 = (double)$result2[$currency];\n\t\t\t\t$percent = 100 * ($balance2 - $balance1);\n\t\t\t\tif ($balance1 == 0) { // except division by zero\n\t\t\t\t\t$percent = $balance2 ? 100 : 0;\n\t\t\t\t} else {\n\t\t\t\t\t$percent /= $balance1;\n\t\t\t\t}\n\t\t\t\t$return[] = array($currency, intval($percent));\n\t\t\t} elseif (!isset($result1[$currency]) && isset($result2[$currency])) {\n\t\t\t\t$return[] = array($currency, 100);\n\t\t\t} elseif (isset($result1[$currency]) && !isset($result2[$currency])) {\n\t\t\t\t$return[] = array($currency, -100);\n\t\t\t} elseif (!isset($result1[$currency]) && !isset($result2[$currency])) {\n\t\t\t\t$return[] = array($currency, 0);\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "function sortCourseByBUPO(&$bupoCoursesArray, $coursesJson){\n foreach($coursesJson as $courseJson){\n $BUPO = $courseJson['entiteCommanditaire']['libelle'];\n if (!array_key_exists($BUPO, $bupoCoursesArray)) {\n // new bupo, then creat a new array and add the course\n $bupoCourses = array();\n $bupoCoursesArray[$BUPO] = $bupoCourses;\n }\n \n $bupoCoursesArray[$BUPO][$courseJson['id']] = $courseJson;\n }\n}", "function cmp_userorder($a, $b)\n{\n return strcmp($a['uname'], $b['uname']);\n}", "function sort_pois() {\n\t\tusort($this->pois, array(__CLASS__, 'compare_title'));\n\t\tdo_action('mappress_sort_pois', $this);\n\t}", "function listProjectsDropbox() {\r\n $joins = array();\r\n $isOwner = 1;\r\n $filters = \"\";\r\n $field = \"\";\r\n if ($this->Session->read('user_type') == 1 || $this->Session->read('user_type') == 7 || $this->Session->read('user_type') == 3) {\r\n $admin_id = $this->getAdminId();\r\n $filters = \"Project.admin_id= \" . $admin_id . \" AND \";\r\n } else if ($this->Session->read('user_type') == 2) {\r\n $filters = \"Project.leader_id=\" . $this->Session->read('userid') . \" AND \";\r\n } else if ($this->Session->read('user_type') == 4 || $this->Session->read('user_type') == 5) {\r\n $isOwner = 0;\r\n $joins = array(\r\n array(\r\n \"type\" => \"inner\",\r\n \"table\" => \"project_students\",\r\n \"alias\" => \"projectStudent\",\r\n \"conditions\" => \"Project.id = projectStudent.project_id AND projectStudent.user_id=\" . $this->Session->read('userid')\r\n ));\r\n $field = \"projectStudent.completed, projectStudent.id,\";\r\n }\r\n $filters .= \" (Project.published=1) \";\r\n $myProjects = $this->Project->find('all', array(\r\n \"conditions\" => $filters,\r\n \"fields\" => \"$field Project.id, Project.title, Project.admin_id, Project.created, Project.published\",\r\n \"joins\" => $joins,\r\n \"order\" => \"Project.created DESC\",\r\n \"group\" => \"Project.id\"\r\n )\r\n );\r\n $this->set(\"myProjects\", $myProjects);\r\n $this->set(\"isOwner\", $isOwner);\r\n $this->render(\"list_projects_dropbox\", \"ajax\");\r\n }", "public function getGroupSortFields() {}", "function sort_by_mandatory( $posts ) {\n // and split the tasks\n $tasks = [];\n foreach ( $posts as &$task ) {\n if ((int)$task->fields['level'] <= 0) {\n unset($task->fields['level']);\n }\n map_api_tags( $task->fields['tags'] );\n // split between mandatory and voluntary\n if ( isset( $task->fields['tags']['pakollisuus'] ) ) {\n foreach ( $task->fields['tags']['pakollisuus']['values'] as $tag ) {\n if ( $tag['slug'] == 'mandatory' ) {\n $tasks['mandatory'][] = $task;\n } else {\n $tasks['voluntary'][] = $task;\n }\n }\n } else { // all tasks are voluntary\n $tasks['voluntary'][] = $task;\n }\n }\n\n return $tasks;\n}", "public function sortingEmployee($criteria) {\n $userid = Session::get('LAD_user_id');\n $users = UsersModel::where('id',$userid)\n ->first();\n // $organization = $users->organization;\n if ($criteria == 'nameasc') {\n return DB::table('users')\n ->where('employee_of','=',$userid)\n ->join('user_occupations','users.occupation','=','user_occupations.id')\n ->orderBy('users.name','asc')\n ->select('users.*','user_occupations.name as occuname')\n ->get();\n } else if ($criteria == 'namedesc') {\n return DB::table('users')\n ->where('employee_of','=',$userid)\n ->join('user_occupations','users.occupation','=','user_occupations.id')\n ->orderBy('users.name','desc')\n ->select('users.*','user_occupations.name as occuname')\n ->get();\n } else {\n return DB::table('users')\n ->where('employee_of','=',$userid)\n ->join('user_occupations','users.occupation','=','user_occupations.id')\n ->orderBy('role','desc')\n ->select('users.*','user_occupations.name as occuname')\n ->get();\n }\n }", "function _release_sort($a, $b) {\n // This array maps fields in the release node to the sort order, where -1\n // means to sort like Drupal weights, and +1 means the bigger numbers are\n // higher in the listing.\n $fields = array(\n 'weight' => -1,\n 'version_major' => 1,\n 'rebuild' => -1,\n 'version_minor' => 1,\n 'version_patch' => 1,\n 'timestamp' => 1,\n );\n foreach ($fields as $field => $sign) {\n if (!isset($a->$field) && !isset($b->$field)) {\n continue;\n }\n if ($a->$field == $b->$field) {\n continue;\n }\n return ($a->$field < $b->$field) ? $sign : (-1 * $sign);\n }\n}" ]
[ "0.5616621", "0.54099643", "0.5385196", "0.53272146", "0.53164643", "0.5283451", "0.52310985", "0.5226012", "0.51981395", "0.51650983", "0.5161147", "0.51605445", "0.515806", "0.5149143", "0.5133753", "0.50889266", "0.5074429", "0.5073381", "0.5066748", "0.5013932", "0.50112903", "0.5005227", "0.49966648", "0.49738926", "0.49718478", "0.4952198", "0.493448", "0.49332812", "0.4908986", "0.49008983" ]
0.699311
0
Calculate the gross salary of a given bill The calculation will depends on the role of the user at the date of the mission. This ensures that the gross salary does not change if the user's role has been changed since the last calculation.
private function calculateGrossAmount(Bill $bill): float { $mission = $bill->application->mission; $role = $bill->application->user->roleAt($mission->created_at) ?: Role::findByName(Role::STUDENT); return $role->isSuperiorOrEquivalentTo(Role::STAFF) ? $bill->amount * $bill->rate->for_staff : $bill->amount * $bill->rate->for_student; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function calculateBaseSalary();", "public function salaryToDecrease()\n {\n // salary given\n $salary_given = EmployeeTransaction::all()\n ->sum('nominal');\n // end salary given\n\n //company outcome employee bonus\n $company_bonus = EmployeeBonus::where('status', 'SUDAH DIAMBIL')\n ->get()\n ->sum('bonus');\n //end company employee bonus\n \n $salary_outcome = $salary_given + $company_bonus;\n\n return $salary_outcome;\n }", "function calculateRetirement($age, $salary, $goal, $savingsPercentage){\r\n $a = $savingsPercentage / 100;\r\n $savings = $a * $salary;\r\n $employerSavings = $savings * 0.35;\r\n $totalSavings = $savings + $employerSavings;\r\n $yearsLeft = $goal/$totalSavings;\r\n $yearsLeft = round($yearsLeft);\r\n if (($yearsLeft + $age) >= 100){\r\n $goalMet = \"No\";\r\n }\r\n else{\r\n $goalMet = \"Yes\";\r\n }\r\n $a1 = array($yearsLeft, $goalMet);\r\n return $a1;\r\n}", "function game_recalc_income(&$game_user) {\n $sql = 'update users set income =\n (SELECT sum(land.payout * land_ownership.quantity)\n as income from land\n left join land_ownership\n on land_ownership.fkey_land_id = land.id and\n land_ownership.fkey_users_id = %d)\n where id = %d;';\n db_query($sql, $game_user->id, $game_user->id);\n\n $sql = 'SELECT sum(equipment.upkeep * equipment_ownership.quantity)\n as expenses from equipment\n left join equipment_ownership\n on equipment_ownership.fkey_equipment_id = equipment.id and\n equipment_ownership.fkey_users_id = %d;';\n $result = db_query($sql, $game_user->id);\n $eq = db_fetch_object($result);\n\n $sql = 'SELECT sum(staff.upkeep * staff_ownership.quantity)\n as expenses from staff\n left join staff_ownership\n on staff_ownership.fkey_staff_id = staff.id and\n staff_ownership.fkey_users_id = %d;';\n $result = db_query($sql, $game_user->id);\n $st = db_fetch_object($result);\n\n $sql = 'update users set expenses = %d where id = %d;';\n db_query($sql, $eq->expenses + $st->expenses, $game_user->id);\n\n $sql = 'select income, expenses from users\n where id = %d;';\n $result = db_query($sql, $game_user->id);\n $item = db_fetch_object($result);\n $game_user->income = $item->income;\n $game_user->expenses = $item->expenses;\n}", "public function totalRevenueForUser($user);", "public function getExternalTotalGross();", "public function updateSalaries($game_time){\n\t\t$fields = array('id', 'balance');\n\t\t$conditions = array();\n\t\t$contain = array(\n\t\t\t'Contract' => array(\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'manager_id',\n\t\t\t\t\t'active',\n\t\t\t\t\t'salary'\n\t\t\t\t),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'active' => '1'\n\t\t\t\t)\n\t\t\t),\n\t\t\t'Trainer' => array(\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'id',\n\t\t\t\t\t'manager_id'\n\t\t\t\t),\n\t\t\t\t'Forname' => array(\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'Surname' => array(\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\t$managers = $this->find('all', array('fields' => $fields, 'contain' => $contain, 'conditions' => $conditions));\n\t\tforeach($managers as $manager){\n\t\t\t$cost = 0;\n\t\t\tforeach($manager['Contract'] as $contract){\n\t\t\t\t$cost = $cost + $contract['salary'];\n\t\t\t}\n\t\t\tif($manager['Manager']['balance'] <= 0){\n\t\t\t\t$this->Contract->deleteTrainerContracts($manager['Manager']['id']);\n\t\t\t\t$this->Trainer->removeManagers($manager['Manager']['id']);\n\t\t\t\tforeach($manager['Trainer'] as $trainer){\n\t\t\t\t\t$fullname = $trainer['Forname']['name']. ' ' . $trainer['Surname']['name'];\n\t\t\t\t\t$this->Notification->cantAffordTrainer($fullname, $manager['Manager']['id'] ,$game_time);\n\t\t\t\t\t$this->Boxer->removeTrainers($trainer['id']);\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$newBalance = $manager['Manager']['balance'] - $cost;\n\t\t\t$this->id = $manager['Manager']['id'];\n\t\t\t$this->saveField('balance', $newBalance);\n\t\t}\n\t}", "public function CheckEmployeeSalary(){\n\t\tif($this->IsLoggedIn('business_admin')){\n\t\t\t\t$data = $this->GetDataForAdmin(\"Employee_details\");\n\t\t\t\t$data['business_outlet_details'] \t= $this->GetBusinessOutlets();\n\t\t\t\t$data['business_admin_employees'] = $this->BusinessAdminModel->GetBusinessAdminEmployees();\n\t\t\t\t$data['business_admin_employees']\t=$data['business_admin_employees']['res_arr'];\n\t\t\t\t\n\t\t\t\t$data['emp']=$this->BusinessAdminModel->NewCommission($data);\t\n\t\t\t\t$data['sidebar_collapsed']=\"true\";\n\t\t\t\tif(!isset($_GET) || empty($_GET))\n\t\t\t\t{\n\t\t\t\t\t//Load the default view\n\t\t\t\t\t\n\t\t\t\t\t$data['salary']=$this->BusinessAdminModel->GetSalaryTillDate($data);\n\t\t\t\t\t$data['salary']=$data['salary']['res_arr'];\n\t\t\t\t\t// $this->PrettyPrintArray(date('d'));\n\t\t\t\t\tif(date('m')==02 && date('d')==28 || date('d')==29){\n\t\t\t\t\t\tfor($i=0;$i<count($data['salary']);$i++){\n\t\t\t\t\t\t\t$data['salary'][$i]['Salary']=$data['salary'][$i]['Salary']*30;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif(date('d')==31){\n\t\t\t\t\t\tfor($i=0;$i<count($data['salary']);$i++){\n\t\t\t\t\t\t\t$data['salary'][$i]['Salary']=$data['salary'][$i]['Salary']*30;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor($i=0;$i<count($data['salary']);$i++){\n\t\t\t\t\t\t\t$data['salary'][$i]['Salary']=$data['salary'][$i]['Salary']*$data['salary'][$i]['attendance'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// $this->PrettyPrintArray($data['salary']);\n\t\t\t\t\t\n\t\t\t\t\t//advance amoutn taken cal and appending into salary aarray \n\t\t\t\t\tfor($i=0;$i<count($data['salary']);$i++){\n\t\t\t\t\t\t$data['salary'][$i]+=['amt'=>'0'];\n\t\t\t\t\t\t$data['salary'][$i]+=['comm'=>'0'];\n\t\t\t\t\t\t$data['salary'][$i]+=['HalfDay'=>'0'];\n\t\t\t\t\t\t$data['salary'][$i]+=['Leaves'=>'0'];\n\t\t\t\t\t\t$data['salary'][$i]+=['OverTime'=>'0'];\n\t\t\t\t\t\t$data['salary'][$i]+=['Net_Payout'=>'0'];\n\t\t\t\t\t}\n\t\t\t\t\t$data['advance'] = $this->BusinessAdminModel->AdvanceSalaryDetails($data);\n\t\t\t\t\t$data['advance'] = $data['advance']['res_arr'];\n\t\t\t\t\t\n\t\t\t\t\tforeach($data['salary'] as $key=>$value){\n\t\t\t\t\t\tforeach($data['advance'] as $k=>$v){\n\t\t\t\t\t\t\tif($v['employee_id']==$value['employee_id']){\n\t\t\t\t\t\t\t\t$data['salary'][$key]['amt']=$data['salary'][$key]['amt']+$v['amount'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['salary'] as $item=>$value) {\n\t\t\t\t\t\t# code...\n\t\t\t\t\t\t$comm=array();\n\t\t\t\t\t\tarray_push($comm,0);\n\t\t\t\t\t\t$data['comm']=$this->BusinessAdminModel->CommissionDetails($value['employee_id']);\n\t\t\t\t\t\t$data['comm']=$data['comm']['res_arr'];\n\t\t\t\t\t\t// $this->PrettyPrintArray($data['comm']);\n\t\t\t\t\t\tif(isset($data['comm']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($data['comm'] as $com_key=>$com_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$target=$data['comm'][$com_key]['targets'];\t\n\t\t\t\t\t\t\t\t\t$commission=array(\n\t\t\t\t\t\t\t\t\t\t'base_value'=>$com_value['base_value'],\n\t\t\t\t\t\t\t\t\t\t'emp_id'=>$com_value['emp_id'],\n\t\t\t\t\t\t\t\t\t\t'commission_type'=>$com_value['commission_type']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$comm_perc=0;\n\t\t\t\t\t\t\t\t$target1=$com_value['set_target1'];\n\t\t\t\t\t\t\t\t$target2=$com_value['set_target2'];\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$result['sales']=$this->BusinessAdminModel->CommissionBaseValueForSalary($commission);\n\t\t\t\t\t\t\t\t// $this->PrettyPrintArray($result['sales']);\n\t\t\t\t\t\t\t\tif(isset($result['sales']) && $target != 0){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$comm_perc=round(($result['sales']/$target)*100);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$comm_perc=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// echo $target1;\n\t\t\t\t\t\t\t\t// echo $target2;\n\t\t\t\t\t\t\t\t// $this->PrettyPrintArray($comm_perc);\n\t\t\t\t\t\t\t\t//calculate commission\n\t\t\t\t\t\t\t\tif($comm_perc >= $target1 && $comm_perc < $target2){\n\t\t\t\t\t\t\t\t\tif($com_value['new_base_value'] == 'Calculation on Base Target'){\n\t\t\t\t\t\t\t\t\t\t$c=($com_value['commision']*$com_value['targets'])/100;\n\t\t\t\t\t\t\t\t\t\tarray_push($comm,$c);\t\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$c=($com_value['commision']*$result['sales'])/100;\n\t\t\t\t\t\t\t\t\tarray_push($comm,$c);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if($comm_perc > $target1 && $target2 == 0){\n\t\t\t\t\t\t\t\t\tif($com_value['new_base_value'] == 'Calculation on Base Target'){\n\t\t\t\t\t\t\t\t\t\t$c=($com_value['commision']*$com_value['targets'])/100;\n\t\t\t\t\t\t\t\t\t\tarray_push($comm,$c);\t\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$c=($com_value['commision']*$result['sales'])/100;\n\t\t\t\t\t\t\t\t\tarray_push($comm,$c);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$commission=array_sum($comm);\n\t\t\t\t\t\t\t$data['salary'][$item]['comm']=$commission;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// <!-- $this->PrettyPrintArray($data['salary']); -->\n\t\t\t\t\t//start\n\t\t\t\t\t//end of loop\t\t\t\t\n\t\t\t\t\t// get half day for salary\n\t\t\t\t\t$data['halfday']=$this->BusinessAdminModel->GetHalfDayAttendanceLoad($data);\n\t\t\t\t\t$data['halfday']=$data['halfday']['res_arr'];\n\t\t\t\t\t\n\t\t\t\t\tforeach($data['salary'] as $key=>$value){\n\t\t\t\t\t\tforeach($data['halfday'] as $k=>$v){\n\t\t\t\t\t\t\tif($v['employee_id']==$value['employee_id']){\n\t\t\t\t\t\t\t\t$data['salary'][$key]['HalfDay']=($data['salary'][$key]['HalfDay']+$v['Half_Day'])*($data['salary'][$key]['employee_gross_salary']/30)/2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// $this->PrettyPrintArray($data['salary']);\n\n\t\t\t\t\t$data['holidays']=$this->BusinessAdminModel->EmssGetHolidaysLoad($data);\n\t\t\t\t\t$data['holidays']=$data['holidays']['res_arr'][0]['holiday'];\n\t\t\t\t\t$res = array(\n\t\t\t\t\t\t'holiday'=>$data['holidays'],\n\t\t\t\t\t\t'business_outlet_id' => $this->session->userdata['outlets']['current_outlet'],\n\t\t\t\t\t\t'business_admin_id' => $this->session->userdata['logged_in']['business_admin_id']\n\t\t\t\t\t);\n\t\t\t\t\t$data['weekoff']=$this->BusinessAdminModel->GetCalWeekOff($data);\n\t\t\t\t\t$data['weekoff']=$data['weekoff']['res_arr'];\n\t\t\t\t\t// $this->PrettyPrintArray($data['weekoff']);\n\t\t\t\t\t\n\t\t\t\t\t$data['attendance_details']=$this->BusinessAdminModel->GetAttendanceDetails($res);\n\t\t\t\t\t$data['attendance_details']=$data['attendance_details']['res_arr'];\n\t\t\t\t\t// $this->PrettyPrintArray($data['attendance_details']);\n\t\t\t\t\t\tfor($i=0;$i<count($data['weekoff']);$i++){\n\t\t\t\t\t\t\t\t$data['weekoff'][$i]+=['count'=>0];\n\t\t\t\t\t\t\t\tif($data['weekoff'][$i]['weekoff'] == 'null' || $data['weekoff'][$i]['weekoff'] == null || $data['weekoff'][$i]['weekoff'] == '[]'){\n\t\t\t\t\t\t\t\t\t$data['weekoff'][$i]['count']=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$temp=json_decode($data['weekoff'][$i]['weekoff']);\n\t\t\t\t\t\t\t\t\t$count=0;\n\t\t\t\t\t\t\t\t\tfor($j=0;$j < count($temp);$j++){\n\t\t\t\t\t\t\t\t\t\tif(date('Y-m-d') > $temp[$j]){\n\t\t\t\t\t\t\t\t\t\t\t$count=$count+1;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$data['weekoff'][$i]['count']=$count;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor($i=0;$i<count($data['attendance_details']);$i++){\n\t\t\t\t\t\t\t\t$data['attendance_details'][$i]+=['weekoff'=>'0'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tforeach($data['attendance_details'] as $key=>$value){\n\t\t\t\t\t\t\t\tforeach($data['weekoff'] as $k=>$v){\n\t\t\t\t\t\t\t\t\tif($value['employee_id'] == $v['employee_id']){\n\t\t\t\t\t\t\t\t\t\t$data['attendance_details'][$key]['weekoff']=$v['count'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// $this->PrettyPrintArray($data['attendance_details']);\n\t\t\t\t\t\t\t// die;\n\t\t\t\t\t\tfor($i=0;$i<count($data['attendance_details']);$i++){\n\t\t\t\t\t\t\t$data['attendance_details'][$i]['Working-Days']=$data['attendance_details'][$i]['Calender_Days']-$data['attendance_details'][$i]['weekoff'];\n\t\t\t\t\t\t\t$data['attendance_details'][$i]['Absent']=$data['attendance_details'][$i]['Absent']-$data['attendance_details'][$i]['weekoff'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// foreach($data['salary'] as $key=>$value){\n\t\t\t\t\t\t// \tif(isset($data['halfday'])){\n\t\t\t\t\t\t// \t\tforeach($data['halfday'] as $k=>$v){\n\t\t\t\t\t\t// \t\t\tif($value['employee_id'] == $v['employee_id']){\n\t\t\t\t\t\t// \t\t\t\t$data['salary'][$key]['HalfDay']=($data['salary'][$key]['employee_gross_salary'])/30*($v['Half_Day']/2);\n\t\t\t\t\t\t// \t\t\t}\n\t\t\t\t\t\t// \t\t}\n\t\t\t\t\t\t// \t}\n\t\t\t\t\t\t// \telse{\n\t\t\t\t\t\t// \t\t$data['salary'][$key]['HalfDay']=0;\t\n\t\t\t\t\t\t// \t}\t\n\t\t\t\t\t\t// }\n\t\t\t\t\t\n\t\t\t\t\t\tforeach($data['salary'] as $key=>$value){\n\t\t\t\t\t\t\tif(isset($data['attendance_details'])){\n\t\t\t\t\t\t\t\tforeach($data['attendance_details'] as $k=>$v){\n\t\t\t\t\t\t\t\t\tif($value['employee_id'] == $v['employee_id']){\n\t\t\t\t\t\t\t\t\t\t$data['salary'][$key]['Leaves']= 30 - $data['salary'][$key]['attendance'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$data['salary'][$key]['Leaves']=0;\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach($data['attendance_details'] as $key=>$value){\n\t\t\t\t\t\t\tforeach($data['salary'] as $k=>$v){\n\t\t\t\t\t\t\t\tif($value['employee_id'] == $v['employee_id']){\n\t\t\t\t\t\t\t\t\t$data['salary'][$k]['OverTime']=$data['attendance_details'][$key]['overtime'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach($data['salary'] as $key=>$value){\n\t\t\t\t\t\t\t(int)$value['Net_Payout']=(int)$value['Net_Payout']+((int)$value['Salary']+(int)$value['comm'])-((int)$value['HalfDay']+$value['Leaves'])+$value['OverTime']-($value['employee_pt']+$value['employee_income_tax']);\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->load->view('business_admin/ba_emss_cal_salary_view',$data);\n\t\t\t\t}\n\t\t\t\telse if(isset($_GET) && !empty($_GET))\n\t\t\t\t{ \t\n\t\t\t\t\t$year=$_GET['year'];\n\t\t\t\t\t$month=$_GET['month'];\n\t\t\t\t\t\n\t\t\t\t\tif((int)$month<10){\n\t\t\t\t\t\t$_GET['month']=$year.'-0'.$month;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$_GET['month']=$year.'-'.$month;\n\t\t\t\t\t}\n\t\t\t\t\t//Calculating Salary For ALL Employees \n\t\t\t\t\t\tif($_GET['expert_id']=='All'){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$res=$this->BusinessAdminModel->EmpDetails();\n\t\t\t\t\t\t\t$data=$res['res_arr'];\n\t\t\t\t\t\t\tfor($i=0;$i<count($data);$i++){\n\t\t\t\t\t\t\t\t$data[$i]+=['advance'=>0];\n\t\t\t\t\t\t\t\t$data[$i]+=['commission'=>0];\n\t\t\t\t\t\t\t\t$data[$i]+=['HalfDay'=>0];\n\t\t\t\t\t\t\t\t$data[$i]+=['Leaves'=>0];\n\t\t\t\t\t\t\t\t$data[$i]+=['OverTime'=>0];\n\t\t\t\t\t\t\t\t$data[$i]+=['Net_Payout'=>0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//main for for itrating employee \n\t\t\t\t\t\t\t\tforeach($data as $key=>$value)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$comm=array();\n\t\t\t\t\t\t\t\t\t\t\tarray_push($comm,0);\n\t\t\t\t\t\t\t\t\t\t\t$data1 = array(\n\t\t\t\t\t\t\t\t\t\t\t\t'month'=>$_GET['month'],\n\t\t\t\t\t\t\t\t\t\t\t\t'expert_id'=>$value['employee_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t'business_outlet_id' => $this->session->userdata['outlets']['current_outlet'],\n\t\t\t\t\t\t\t\t\t\t\t\t'business_admin_id' => $this->session->userdata['logged_in']['business_admin_id']\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t$adv=0;\n\t\t\t\t\t\t\t\t\t\t\t\t$check['salary']=$this->BusinessAdminModel->CheckAdvanceSalaryDefined($data1);\n\t\t\t\t\t\t\t\t\t\t\t\t$check['salary']=$check['salary']['res_arr'];\n\t\t\t\t\t\t\t\t\t\t\t\tfor($i=0;$i<count($check['salary']);$i++){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$adv=$adv+$check['salary'][$i]['amount'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$data[$key]['advance']=$adv;\n\t\t\t\t\t\t\t\t\t\t\t\t//get commssion details\n\t\t\t\t\t\t\t\t\t\t\t\t$check['commission']=$this->BusinessAdminModel->CheckCommissionDefined($data1);\n\t\t\t\t\t\t\t\t\t\t\t\t$check['commission']=$check['commission']['res_arr'];\n\t\t\t\t\t\t\t\t\t\t\t\t// print_r($check['commission']);\n\t\t\t\t\t\t\t\t\t\t\t\t//if commission is declared for that month then calculate it \t\n\t\t\t\t\t\t\t\t\t\t\t\tif(isset($check['commission']))\n\t\t\t\t\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach($check['commission'] as $com_key=>$com_value)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$target=$check['commission'][$com_key]['targets'];\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$commission=array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'base_value'=>$com_value['base_value'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'expert_id'=>$com_value['emp_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month'=>$com_value['months']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$data['commission']=$this->BusinessAdminModel->CommissionBaseValueForSalaryMonth($commission);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(isset($data['commission'])){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$data['commission']=$data['commission']['res_arr'][0]['total'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// $this->PrettyPrintArray($data['commission']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//declare value for checking \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$comm_perc=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$target1=$com_value['set_target1'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$target2=$com_value['set_target2'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if commission is set \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(isset($data['commission']) && $target!=0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$comm_perc=round(($data['commission']/$target)*100);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// $this->PrettyPrintArray($comm_perc);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$comm_perc=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//calculate commission\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($comm_perc > $target1 && $comm_perc <= $target2){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$c=($com_value['commision']*$data['commission'])/100;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// $com_value['commission']=$comm;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray_push($comm,$c);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// break;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($comm_perc > $target1 && $target2 == 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$c=($com_value['commision']*$data['commission'])/100;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// $com_value['commission']=$comm;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray_push($comm,$c);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// break;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t//commission foreach loop end;\n\t\t\t\t\t\t\t\t\t\t\t\t\t// $commission=max($comm);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$commission=array_sum($comm);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$data[$key]['commission']=$commission;\n\t\t\t\t\t\t\t\t\t\t\t\t}//if commission declared \t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$data1 = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'month_name'=>$_GET['month'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'expert_id'=>$value['employee_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'business_outlet_id' => $this->session->userdata['outlets']['current_outlet'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'business_admin_id' => $this->session->userdata['logged_in']['business_admin_id']\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t$halfday['halfday']=$this->BusinessAdminModel->GetEmpHalfDayAttendance($data1);\n\t\t\t\t\t\t\t\t\t\t\t\t$halfday['halfday']=$halfday['halfday']['res_arr'];\n\t\t\t\t\t\t\t\t\t\t\t\t$overtime['overtime']=$this->BusinessAdminModel->GetOverTimeDetails($data1);\n\t\t\t\t\t\t\t\t\t\t\t\t$overtime['overtime']=$overtime['overtime']['res_arr'];\n\t\t\t\t\t\t\t\t\t\t\t\tif(isset($overtime['overtime'])){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$data[$key]['OverTime']=$overtime['overtime'][0]['overtime'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telseif(!isset($overtime['overtime']) || empty($overtime['overtime'])){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$data[$key]['OverTime']=0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tforeach($halfday['halfday'] as $k=>$v){\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($value['employee_id'] == $v['employee_id']){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$data[$key]['HalfDay']=(int)(($value['employee_gross_salary']/30)*$v['HalfDay'])*0.5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$month_sal=explode(\"-\",$_GET['month']);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$monthq=$month_sal[1].\"-\".$month_sal[0];\n\t\t\t\t\t\t\t\t\t\t\t\t$data2 = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'month_name'=>$monthq,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'expert_id'=>$value['employee_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'business_outlet_id' => $this->session->userdata['outlets']['current_outlet'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'business_admin_id' => $this->session->userdata['logged_in']['business_admin_id']\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t$weekoff=0;\n\t\t\t\t\t\t\t\t\t\t\t\t$data['weekoff']=$this->BusinessAdminModel->GetCalWeekOffMonthSal($data2);\n\t\t\t\t\t\t\t\t\t\t\t\t// $this->PrettyPrintArray($_GET);\t\n\t\t\t\t\t\t\t\t\t\t\t\tif($data['weekoff']['success'] == 'false'){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$weekoff=0;\n\t\t\t\t\t\t\t\t\t\t\t\t}elseif($data['weekoff']['success'] == 'true'){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$count=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$data['weekoff']=$data['weekoff']['res_arr'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// $this->PrettyPrintArray($data['weekoff']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$temp=json_decode($data['weekoff'][0]['weekoff']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$temp=array_filter($temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$getdate=$_GET['month'].\"-01\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$d1=strtotime($getdate);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor($j=0;$j < count($temp);$j++){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// if(date('Y-m-d') > $temp[$j]){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$d2=strtotime($temp[$j]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(date(\"m\",$d1) == date(\"m\",$d2)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$count=$count+1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$weekoff=$count;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\t\t\t\t\t\t// $this->PrettyPrintArray($data['weekoff'][0]['count']);\n\t\t\t\t\t\t\t\t\t\t\t\t// die;\t\n\t\t\t\t\t\t\t\t\t\t\t\t$data['holidays']=$this->BusinessAdminModel->EmssGetHolidaysMonth($data1);\n\t\t\t\t\t\t\t\t\t\t\t\t$data['holidays']=$data['holidays']['res_arr'][0]['holiday'];\n\t\t\t\t\t\t\t\t\t\t\t\t$data1 = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'month_name'=>$_GET['month'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'expert_id'=>$value['employee_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'holiday'=>$data['holidays'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'weekoff'=>$weekoff,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'business_outlet_id' => $this->session->userdata['outlets']['current_outlet'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'business_admin_id' => $this->session->userdata['logged_in']['business_admin_id']\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t// print_r($data1);\t\n\t\t\t\t\t\t\t\t\t\t\t\t$data['absent']=$this->BusinessAdminModel->CalAbsentMonthSal($data1);\n\t\t\t\t\t\t\t\t\t\t\t\t$data['absent']=$data['absent']['res_arr'];\n\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($data['absent'])){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$data['absent']=$data['absent'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$leave=$data['absent'][0]['Leave'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$data[$key]['Leaves']=(int)($value['employee_gross_salary']/30)*$leave;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$data['absent']=0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$data[$key]['Net_Payout']=($value['employee_gross_salary']+$data[$key]['commission']+$data[$key]['OverTime'])-($data[$key]['Leaves']+$data[$key]['HalfDay']+$data[$key]['advance'])-($data[$key]['employee_pt']+$data[$key]['employee_income_tax']);\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//employee foreach\n\t\t\t\t\t\t\t\tunset($data['weekoff'],$data['holidays'],$data['absent'],$data['commission']);\t\t\n\t\t\t\t\t\t\t\t\t// $this->PrettyPrintArray($data);\n\t\t\t\t\t\t\t\t\t// exit;\n\t\t\t\t\t\t\t\tif($res['success']=='true'){\t\n\t\t\t\t\t\t\t\t\theader(\"Content-type: application/json\");\n\t\t\t\t\t\t\t\t\tprint(json_encode($data, JSON_PRETTY_PRINT));\n\t\t\t\t\t\t\t\t\tdie;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\treturn $this->ReturnJsonArray(true,false,'Database Error');\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdie;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\t//ALL EMPLOYEE COMMISSION CALCULATION ENDS HERE\n\t\t\t\t\t\t//if end of all expert\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->LogoutUrl(base_url().\"BusinessAdmin/\");\n\t\t}\t\n\t}", "function calc_AdjustedGrossIncome($wages,$taxableInterest){\n $adjustedIncome = $wages + $taxableInterest;\nreturn $adjusted;\n}", "private function get_average_salary($user_type)\n { \n $response_data = $this->getAPIResponse();\n $response = json_decode($response_data['data']);\n $records = $this->toArray($response);\n $split = $this->getSplittedUsers($records);\n $average = '';\n if($user_type=='engineers')\n {\n //Getting average for Engineers\n $total_sum_eng = array_sum(array_column($split['engineers'], 'salary'));\n $total_engineers = count($split['engineers']);\n $averageEngineers = $total_sum_eng/$total_engineers;\n $average = sprintf (\"%.2f\", $averageEngineers);\n }\n else if($user_type=='internals')\n {\n //Getting average for Internals\n $total_sum_int = array_sum(array_column($split['internal'], 'salary'));\n $total_internals = count($split['internal']);\n $averageInternals = $total_sum_int/$total_internals;\n $average = sprintf (\"%.2f\", $averageInternals);\n }\n return $average; \n }", "public function getSalary()\n {\n }", "protected function calcPayableProfit(){\n return round($this->getPayableWage() * $this->payableWageRate, 2);\n }", "public function getSal()\n {\n return $this->sal;\n }", "private function get_total_current_monthly_billed($user_id)\n\t{\n\n\t}", "public function obtenerSaldo()\n {\n $saldo = $this->costo;\n\n foreach ($this->cobrosConsulta as $pago) {\n $saldo -= $pago->getAbono();\n }\n\n return $saldo;\n }", "function getSalaryAmount($totalDays):int{\n $this ->workingDays = $totalDays - $this->totalLeaveTaken;\n $salary = $this->workingDays*$this->workingHoursPerDay*$this->hourlyRate;\n\n return $salary;\n }", "public function getGrossIncome() {\r\n return $this->grossIncome;\r\n }", "public function getGross(): float\n {\n return $this->gross;\n }", "public function earnings(User $user) {\n\n // Get users templates\n $templates = $user->templates()->get();\n\n // Init lifetime earning\n $lifetime_earnings = 0;\n\n // Init grand total\n $grand_total = 0;\n\n // Init paid earnings\n $paid_earnings = 0;\n\n // Init commision rate\n $commission_rate = $this->nonexclusive_commission;\n\n // Iterate through templates\n foreach($templates as $template) {\n\n // Init earnings per template\n $order_amount_per_template = 0;\n\n // Get orders\n $orders = $template->orders()->get();\n\n // Iterate through orders\n foreach($orders as $order) {\n\n // Calculate total earnings\n // for single template\n $order_amount_per_template += ( $order->payment_gross - $order->tax );\n \n }\n\n // Get commision rate for\n // exclusive templates\n if($template->exclusive) {\n\n // Get base exclusive commission rate\n $commission_rate = $this->base_exclusive_commission;\n\n $commission = Commission::where('amount', '<=', $order_amount_per_template)->orderBy('amount', 'DESC')->first();\n\n // Adjust commission rate\n // according to order volume\n if($commission) $commission_rate = $commission->percentage;\n\n }\n\n // Calculate lifetime earnings \n // with commision rate\n $lifetime_earnings += $order_amount_per_template * $commission_rate / 100;\n \n // Running grand total\n $grand_total += $order_amount_per_template;\n\n }\n\n $payouts = $user->payouts()->processed()->get();\n\n foreach($payouts as $payout) {\n\n $paid_earnings += $payout->amount;\n\n }\n \n return [\n\n 'lifetime' => $lifetime_earnings,\n\n 'paid' => $paid_earnings,\n\n 'pending' => $lifetime_earnings - $paid_earnings,\n\n 'grand_total' => $grand_total,\n\n 'commission' => $grand_total - $lifetime_earnings\n\n ];\n\n }", "public function calculate_total_amount()\n {\n $this->interest= ($this->principal*$this->interest_rate)/100;\n $this->total_interest = $this->year*$this->interest;\n $this->total_amount=$this->total_interest+$this->principal;\n //return $total_amount;\n }", "function get_salary_get(){\n $account_id = $this->checkApplicationTokenAuth();\n $where = array('account_id' => $account_id);\n $select = array(\n 'total_price',\n 'not_received_price'\n );\n $salary = $this->salary_model->findOne($where,$select);\n $this->response(RestSuccess(!empty($salary)?removeNullOfObject($salary):'',SUCCESS_CODE));\n }", "public function calculateRates()\n {\n if($this->loan) {\n\n if( ($this->invest_rate !== 0) ) {\n\n // Calculate variables\n $invest_fee = ($this->amount_invested * ($this->invest_rate/100)) * $this->loan->tenor->month;\n $amount_total = $this->amount_invested + $invest_fee;\n\n // Update loan object\n $this->invest_fee = $invest_fee;\n $this->amount_total = $amount_total;\n if($this->save()) { return true; }\n }\n }\n \n return false;\n }", "public function determine_prime()\n {\n $this->prime = $this->salaire_brut * 5 / 100;\n\n //Set the seniority bonus to 1 year if the employee has been at the firm for less than one year.\n if($this->duree->y < 1)\n {\n $this->duree->y = 1;\n }\n\n // Calculate the 2% bonus\n $this->anciennete = $this->salaire_brut * ($this->duree->y * 2 / 100);\n\n // Calculate the total salary after bonuses\n $this->salaire_plus_primes = $this->salaire_brut + $this->prime + $this->anciennete;\n\n // Display the result\n echo \"Employee Name: \" . $this->prenom . \" \" . $this->nom . \"<br>Gross salary before bonuses: \"\n . $this->salaire_brut . \"<br>5% Bonus: \" . $this->prime . \"<br>Seniority Bonus: \"\n . $this->anciennete . \"<br>Total Salary after Bonuses: \" . $this->salaire_plus_primes . \"<br><br>\";\n }", "public function ajaxSalaryAmount($uId) {\n $query = $this->db->query(\"SELECT total FROM set_salary WHERE employ_user_id='$uId'\");\n foreach ($query->result_array() as $row) {\n $salary = $row['total'];\n }\n return $salary;\n }", "public function load_salary(){\t\n\t\t$sal = array('10000' => '10000', '20000' => '20000', '30000' => '30000', '40000' => '40000', '50000' => '50000', '60000' => '60000', '70000' => '70000', '80000' => '80000','90000' => '90000', '100000' => '100000');\t\t\n\t\treturn $sal;\n\t}", "function woo_irpf_surcharge() {\n\n\t$user = wp_get_current_user();\n\t\t\n\tif ( in_array( IRPF_ROLE, (array) $user->roles ) ) {\n\t\tWC()->cart->add_fee( 'Surcharge', IRPF_SURCHARGE, true, '' );\n\t}\n \n}", "public function calculate_final_grade()\n {\n //Formal Assesmnets and Unit Awards\n }", "function salary_dates_calc($month, $year) {\r\n $days_in_month=cal_days_in_month(CAL_GREGORIAN,$month,$year);\r\n $date = $month.\"/\".$days_in_month.\"/\".$year;\r\n $timestamp = strtotime($date);\r\n $weekday = date('l', $timestamp);\r\n\r\n //Add the second column = salary payment dates\r\n if ($weekday === \"Saturday\") {\r\n $mm = ($month == 12) ? ($month - 11) : ++$month;\r\n $yy = ($month == 12) ? ++$year : $year;\r\n return strtotime($mm.\"/02/\".$yy);\r\n } elseif ($weekday === \"Sunday\") {\r\n $mm = ($month == 12) ? ($month - 11) : ++$month;\r\n $yy = ($month == 12) ? ++$year : $year;\r\n return strtotime($mm.\"/01/\".$yy);\r\n } else {\r\n return strtotime($date);\r\n }\r\n}", "public function totalearning($id){\n\t\t$totalcomission = $this->totalcomissionpm($id)+$this->totalcomissionbtc($id);\n\t\t$totalamoun = $this->totalprofitbymemberid($id);\t\n\t\treturn $totalearning = ($totalamoun+$totalcomission);\t\n\n\t}", "public function calculateInstallments($loan, $duration){\n\n $rate=InterestRate::where('rate','!=',null)->first();\n\n $monthlyInstallment=(($loan*$rate->rate/100)+$loan)/$duration;\n\n return $monthlyInstallment;\n }" ]
[ "0.5891384", "0.57899207", "0.57067853", "0.54067725", "0.5350116", "0.5313137", "0.5271076", "0.5262497", "0.52618927", "0.52527755", "0.52463377", "0.52327055", "0.515547", "0.5155162", "0.5090477", "0.50760293", "0.50683826", "0.50531137", "0.5019261", "0.4984981", "0.49829826", "0.49725688", "0.4969753", "0.49553055", "0.4948699", "0.49411687", "0.4938382", "0.49223828", "0.49201646", "0.49106824" ]
0.6375348
0
Calculate social contributions deduction amounts This will calculate the deduction details of every social contribution as well as the total deduction amounts for the employee and the employer.
private function calculateDeductions(float $gross_amount): array { $deductions = []; $total_employee = 0; $total_employer = 0; foreach (SocialContribution::all() as $social_contribution) { $employee_deduction = 0; $employer_deduction = 0; $deductions['details'][] = [ 'socialContribution' => $social_contribution->name, 'base' => $base_amount = $gross_amount * $social_contribution->base_rate, 'employeeRate' => $social_contribution->student_rate, 'employerRate' => $social_contribution->employer_rate, 'employeeAmount' => $employee_deduction = $base_amount * ($social_contribution->student_rate / 100), 'employerAmount' => $employer_deduction = $base_amount * ($social_contribution->employer_rate / 100), ]; $total_employee += $employee_deduction; $total_employer += $employer_deduction; } return array_merge($deductions, ['total_employee' => $total_employee, 'total_employer' => $total_employer]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function each_charity_amount($campaign_id,$charity_percentage) \n {\n $amount = $this->total_donation_amount($campaign_id); \n $each_charity_amount = ($amount * $charity_percentage/100) - ($amount * $charity_percentage/100) * 0.05; \n return $each_charity_amount; \n }", "public function getDecoctionAmt();", "public function calculate_total_amount()\n {\n $this->interest= ($this->principal*$this->interest_rate)/100;\n $this->total_interest = $this->year*$this->interest;\n $this->total_amount=$this->total_interest+$this->principal;\n //return $total_amount;\n }", "public function getTotal(){\n\t\t$additionalFees = $this->additionalFees;\n\t\t$totalFee = 0;\n\t\tforeach($additionalFees as $fee){\n\t\t\tif($fee['CONSTRAINTS']['part'] !== false){\n\t\t\t\t$totalFee += $fee['VALUE'];\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t$garmentTotal = $this->garmentTotal;\n\t\treturn $garmentTotal + $totalFee + $this->SET_UP_FEE + ($this->printJob == null ? 0 : $this->printJob->COST);\t\t\n\t}", "public function index(Request $date)\n {\n \n \n $useractions = \\App\\UserAction::latest()->limit(10)->get(); \n $incomes = Income::latest()->limit(30)->get(); \n $expenses = Expense::latest()->limit(30)->get(); \n $today = date('Y-m-d');\n;\n $format = 'Y-m-d';\n \n $from = $date->query('d',Carbon::now());\n $d_date = date($format, strtotime($from));;\n \n\n $exp_q = Expense::with('branch') -> where('entry_date',$d_date);\n $inc_q = Income::with('branch') -> where('entry_date',$d_date);\n $yourIncome = Income::latest()->limit(30)->get()->where('branch_id',Auth::user()->id); \n $yourExpense =Expense::latest()->limit(30)->get()->where('branch_id',Auth::user()->id); \n //Branch specific values for calculation\n $branchIncome = Income::all() -> where('entry_date',$d_date) ->where('branch_id',Auth::user()->id);\n $branchExpense = Expense::all()-> where('entry_date',$d_date) ->where('branch_id',Auth::user()->id);\n $branchIncomeTotal = $branchIncome->sum('amount');\n $branchExpenseTotal = $branchExpense->sum('amount');\n $branchProfit = $branchIncomeTotal - $branchExpenseTotal;\n // end of specific calculation\n\n $yourIncomeTotal = $yourIncome->sum('amount');\n $yourExpenseTotal = $yourExpense->sum('amount');\n\n $yourProfit = $yourIncomeTotal - $yourExpenseTotal;\n\n $exp_total = $exp_q->sum('amount');\n $inc_total = $inc_q->sum('amount');\n\n $exp_group = $exp_q->orderBy('amount', 'desc')->get()->groupBy('branch_id');\n $inc_group = $inc_q->orderBy('amount', 'desc')->get()->groupBy('branch_id');\n\n $profit = $inc_total - $exp_total;\n\n $exp_summary = [];\n\n foreach($exp_group as $exp){\n foreach($exp as $line){\n if(! isset($exp_summary[$line->branch->name])){\n $exp_summary[$line->branch->name] = [\n 'name' => $line->branch->name,\n 'amount' => 0,\n ];\n }\n $exp_summary[$line->branch->name]['amount'] += $line->amount;\n }\n }\n\n $inc_summary = [];\n foreach($inc_group as $income){\n foreach($income as $line){\n if(! isset($inc_summary[$line->branch->name])){\n $inc_summary[$line->branch->name] = [\n 'name' => $line->branch->name,\n 'amount' => 0,\n ];\n }\n $inc_summary[$line->branch->name]['amount'] += $line->amount;\n }\n }\n \n\n return view('home', compact( 'useractions', 'incomes', 'expenses', 'exp_summary',\n 'inc_summary',\n 'exp_total','yourIncome','yourExpense','yourIncomeTotal','yourExpenseTotal','yourProfit',\n 'inc_total','today',\n 'branchIncome','branchExpense','branchIncomeTotal','branchExpenseTotal','branchProfit',\n 'profit','from','d_date'));\n }", "private function _applyManualCalculations(&$dataTotal, $depDataTotal, $fields)\n {\n if (is_array($depDataTotal) && !empty($depDataTotal)) {\n @extract($depDataTotal);\n }\n # Extract the array values and create variables out of them\n if (is_array($dataTotal) && !empty($dataTotal)) {\n @extract($dataTotal);\n }\n //\techo $avgPosition;\n //\techo $impressions\n \n foreach ($fields as $field) {\n switch ($field) {\n case 'ctr':\n if ($impressions > 0) {\n // var_dump($clicks,$impressions);\n\n $dataTotal['ctr'] = round(($clicks/$impressions)*100, 2);\n } else {\n $dataTotal['ctr'] = '0';\n }\n\n break;\n case 'avgCPC':\n if ($clicks > 0) {\n $dataTotal['avgCPC'] = round(($cost/1000000)/$clicks, 2);\n } else {\n $dataTotal['avgCPC'] = '0.00';\n }\n\n break;\n case 'cost':\n if ($cost) {\n $dataTotal['cost'] = round($cost/1000000, 2);\n } else {\n $dataTotal['cost'] = 0;\n }\n\n break;\n case 'costAllConv':\n if ($totalConvValue) {\n $dataTotal['costAllConv'] = round(($cost/$totalConvValue)/1000000, 2);\n } else {\n $dataTotal['costAllConv'] = '0.00';\n }\n\n break;\n case 'convRate':\n\n if ($clicks) {\n $dataTotal['convRate'] = round(($totalConvValue/$clicks)*100, 2);\n } else {\n $dataTotal['convRate'] = '0';\n }\n\n break;\n\n case 'avgPosition':\n if ($impressions) {\n $dataTotal['avgPosition'] = round(($avgPosition/$impressions), 1);\n } else {\n $dataTotal['avgPosition'] = '0';\n }\n break;\n \n case 'costConv':\n \n \n if ($costConv) {\n //var_dump($dataTotal['conversions']);\n $dataTotal['costConv'] = round(($cost/$dataTotal['conversions'])/1000000, 2);\n \n } else {\n \n $dataTotal['costConv'] = '0';\n }\n break;\n\n case 'totalConvValue':\n if ($totalConvValue) {\n $dataTotal['totalConvValue'] = $totalConvValue;\n //round(($totalConvValue/$convertedClicks),1);\n } else {\n $dataTotal['totalConvValue'] = '0';\n }\n break;\n case 'valueConv' :\n if ($valueConv) {\n $dataTotal['valueConv'] = round($totalConvValue/$conversions, 2);\n //round(($totalConvValue/$convertedClicks),1);\n } else {\n $dataTotal['valueConv'] = '0';\n }\n }\n }\n /*\tif(in_array($field,array_keys($dataTotal))){\n echo $manualColumns[$field]['formula'];\n eval($manualColumns[$field]['formula']);\n }*/\n\n\n\n //echo '<pre>';print_r($dataTotal);\n\n\n return $dataTotal;\n }", "public function eurosDolares(){\n return $this->numero*1.22393;\n }", "public function calculateDiscount(): float\n {\n $discount = $this->checkCustomerDiscount(); //get the chosen discount\n //set the variable to group or customer to know where the percentage comes from\n $groupOrCustumor = \"\";\n if (!empty($this->calculation)){\n if ($this->calculation[0] === 'customer'){\n $groupOrCustumor = 'Customer';\n } else {\n $groupOrCustumor = 'Group';\n }\n $this->calculation = []; //empty calculation again so we don't get errors\n }\n $price = $this->product->getProductprice(); //get the price\n $quantityDisc = ($price/100) * $this->quantity; //the value of the quantity discount to substract\n $price = $price - $quantityDisc; //result of price minus quantity discount\n //if the customer and the group have a variable discount\n if ($discount[2]) {\n $percentage = ($price / 100) * $this->discount;\n $total = $price - $percentage;\n array_push($this->calculation, 'Quantity discount: ' . $this->quantity . '%', $groupOrCustumor . ': ' . $this->discount . '%'); //push the price calculation\n //if the group has a variable discount and the customer has a fixed discount\n } elseif ($discount[1] == true && $this->customer->getFixedDiscounts() != null) {\n $total = $price - ($this->customer->getFixedDiscounts()) * 100;\n $percentage = ($total / 100) * $this->discount;\n $total = $total - $percentage;\n array_push($this->calculation, 'Quantity discount: ' . $this->quantity . '%', 'Customer: €' . $this->customer->getFixedDiscounts(), 'Group: ' . $this->discount . '%'); //push the price calculation\n //if the group has a fixed discount and the customer a variable discount\n } elseif ($discount[1] == false && $this->customer->getVarDiscount() != null) {\n $total = $price - $discount[0];\n $percentage = ($total / 100) * $this->customer->getVarDiscount();\n $total -= $percentage;\n array_push($this->calculation, 'Quantity discount: ' . $this->quantity . '%', 'Group: €' . $discount[0]/100, 'Customer: ' . $this->customer->getVarDiscount() . '%'); //push the price calculation\n //else the group and the customer have a fixed discount\n } else {\n $total = $price - $discount[0];\n $total -= $this->customer->getFixedDiscounts();\n array_push($this->calculation, 'Quantity discount: ' . $this->quantity . '%', 'Group: €' . $discount[0]/100, 'Customer: €' . $this->customer->getFixedDiscounts()); //push the price calculation\n }\n //if the total price is negative change total price to zero\n if ($total < 0) {\n $total = 0;\n }\n //change the total price from cents to euro's\n $total = $total / 100;\n return $total;\n }", "public function calcula_personalizado() {\n return $this->personalizado->calcula_total($this->modelo, $this->quantidade);\n }", "public function processMembershipFee($amount) {\n if(is_object($this->hsbxl_member)) {\n $social = $this->hsbxl_member->get('field_social_tariff')->getValue()[0]['value'] ? TRUE : FALSE;\n\n // create a membership, deduct the regime price of the amount. Repeat.\n while($amount > 0) {\n\n if($this->statement->get('field_booking_repeat_membership')->getValue()[0]['value'] == 'Donate'\n && $i > 0) {\n $sale_data = [\n 'type' => 'sale',\n 'name' => 'donation',\n 'field_booking_amount' => $amount,\n 'field_booking_date' => $this->statement->get('field_booking_date')->getValue()[0]['value'],\n //'field_booking' => $this->statement,\n 'field_booking_tags' => $this->getDonationTag(),\n 'uid' => 1\n ];\n $sale = BookingEntity::create($sale_data);\n $sale->save();\n\n // Save the statement with the donation sale added.\n $statement = BookingEntity::load($this->statement->id());\n $statement->field_booking[] = $sale;\n $statement->field_booking_status = 'completed';\n $statement->save();\n break;\n }\n\n $next_membership = $this->getNextMembership();\n $regime = $this->detectMembershipRegime($amount, $social);\n $first_name = $this->hsbxl_member->get('field_first_name')->getValue()[0]['value'];\n $last_name = $this->hsbxl_member->get('field_last_name')->getValue()[0]['value'];\n\n if(!$regime) {\n // we don't have enough for a minimum membership fee,\n // but we have rest amount, donate it.\n if($amount > 0) {\n $sale_data = [\n 'type' => 'sale',\n 'name' => 'donation',\n 'field_booking_amount' => $amount,\n 'field_booking_date' => $this->statement->get('field_booking_date')->getValue()[0]['value'],\n //'field_booking' => $this->statement,\n 'field_booking_tags' => $this->getDonationTag(),\n 'uid' => 1\n ];\n $sale = BookingEntity::create($sale_data);\n $sale->save();\n\n // Save the statement with the donation sale added.\n $statement = BookingEntity::load($this->statement->id());\n $statement->field_booking[] = $sale;\n $statement->field_booking_status = 'completed';\n $statement->save();\n\n $amount = 0;\n break;\n }\n }\n\n $sale_data = [\n 'type' => 'sale',\n 'name' => 'Membership ' . $next_membership['month'] . '-' . $next_membership['year'],\n 'field_booking_amount' => $regime['minimum_price'],\n 'field_booking_date' => $this->statement->get('field_booking_date')->getValue()[0]['value'],\n //'field_booking' => $this->statement,\n 'field_booking_tags' => $this->getMembershipTag(),\n 'uid' => 1\n ];\n\n $sale = BookingEntity::create($sale_data);\n $sale->save();\n\n $amount = $amount - $regime['minimum_price'];\n\n // Save the statement with the membership sale added.\n $statement = BookingEntity::load($this->statement->id());\n $statement->field_booking[] = $sale;\n if($amount == 0) {\n $statement->field_booking_status = 'completed';\n }\n $statement->save();\n\n $membershipdata = [\n 'field_membership_member' => $this->hsbxl_member,\n 'type' => 'membership',\n 'name' => 'membership ' . $first_name . ' ' . $last_name . ': ' . $next_membership['month'] . '/' . $next_membership['year'],\n 'field_sale' => $sale,\n 'field_year' => $next_membership['year'],\n 'field_month' => $next_membership['month'],\n 'field_membership_payment_regime' => $regime,\n 'uid' => 1,\n ];\n\n $membership = Membership::create($membershipdata);\n $membership->save();\n $i++;\n }\n }\n\n // Return the amount of membership months generated.\n return $i;\n }", "function total_donation_amount($campaign_id) \n { \n $sql = \"SELECT amount FROM payment WHERE campaign_id = ? \"; \n\t $query = $this->db->query($sql,$campaign_id); \n\t if($query->num_rows())\n\t { \n\t foreach($query->result_array() as $r) \n\t { \n\t\t $amount[] = $r['amount']; \n\t\t }\n\t\t return array_sum($amount); \n\t}\n }", "public function sumOfContribution($member_id){\n\n \t $stmt = $this->conn->prepare(\"SELECT SUM(amount_credited) AS sumOfAmount FROM member_account WHERE member_id = '$member_id'\");\n $stmt->execute();\n $sum = $stmt->fetch(PDO::FETCH_ASSOC);\n return $sum['sumOfAmount'];\n\n }", "public function cashAmount()\n\t\t\t\t{\n\t\t\t\t\t$sql = \"SELECT `selldate`, `customerid`, `payment_taka`, `token` FROM `sell` WHERE `token` = 's_Cash'\n UNION \n SELECT `recievedate`, `cusotmer_id`, `amounts`, `bycashcheque` FROM `recevecollection` WHERE `bycashcheque` = 'rac_Cash' \n UNION \n SELECT `pay_date`, `sup_id`, `amnts`, `status` FROM `supplierpayment` WHERE `status`='pts_Cash' \n UNION \n SELECT `expiredate`, `customerid`, `amount`, `fromtable` FROM `cheque` WHERE `approve`='1' \n UNION \n SELECT `expendituredate`, `accountsid`, `amount`, `token` FROM `expenditure` \n UNION \n SELECT `payment_date`, `employeeid`,`amount_pay`, `token` FROM `e_payment_salery` \n UNION \n SELECT `purchasedate`, `supplier`, `payment_taka`, `token` FROM `purchase` where `token` = 'p_Cash' \";\n $data = $this->joinQuery($sql)->fetchAll();\n $opening_balance = $this->joinQuery(\"SELECT `opening_balance` FROM `charts_accounts` WHERE `chart_name`='Cash'\")->fetch(PDO::FETCH_ASSOC);\n $sum = $opening_balance['opening_balance'];\n \n foreach ($data as $val) \n {\t\t\n \t\t$tkn = trim($val['token']);\n \t $amounts = $val['payment_taka'];\n if ($tkn == \"pts_Cash\") \n {\n $sum -= $amounts;\n }\n if ($tkn == \"rac_Cash\") \n {\n $sum += $amounts;\n }\n else if ($tkn == \"s_Cash\") \n {\n $sum += $amounts;\n }\n else if ($tkn== \"p_Cash\") \n {\n $sum -= $amounts;\n }\n else if ($tkn == \"add\") \n {\n $sum += $amounts;\n } \n else if (substr($tkn, 0,7) == \"expense\") \n {\n $sum -= $amounts;\n }\n else if (substr($tkn, 0,5) == \"stuff\") \n {\n $sum -= $amounts;\n }\n \n else if ($tkn == \"minus\") \n {\n $sum -= $amounts;\n }\n else if ($tkn == \"salerypayment\") \n {\n $sum -= $amounts;\n }\n }\n\n return $sum;\n\n\n\t\t\t\t}", "function getFoodRecordsEvaluation($d, $desiredTargetPercentage) {\n $maxFoodRecords = 100;\n $now = time();\n \n $query = \"SELECT foodid,amount FROM \" . F_Table::getClassTable(H_FoodRecord::CLASS_NAME) .\n \" WHERE userid=\".$d->user->id.\" AND foodid>0\".\n \" ORDER BY time DESC LIMIT $maxFoodRecords\";\n \n $foodRecords = F_Table::doQuery($query, null, F_Table::LOADMETHOD_OBJECT_LIST);\n \n $computeResult = array();\n $cnt = 0;\n \n $amountMultipliers = array(1.0, 0.5, 0.25, 1.5, 2.0, 5.0);\n if ($desiredTargetPercentage > 80.0) {\n $objFparam_pow_over = 1.57;\n $objFparam_pow_under = 1.25; \n }\n else {\n $objFparam_pow_over = 1.38;\n $objFparam_pow_under = 1.25;\n }\n \n $testedRecords = array();\n \n foreach ($foodRecords as $foodRecord) {\n if ($foodRecord->amount < 0.1) continue;\n if ($foodRecord->foodid < 1) continue;\n if (isset($testedRecords[$foodRecord->foodid])) {\n continue;\n }\n \n // compute contribute\n $testedRecords[$foodRecord->foodid] = 1;\n \n if (isset($d->foodInfos[$foodRecord->foodid])) {\n $foodInfo = $d->foodInfos[$foodRecord->foodid]; \n }\n else {\n $loadedFoodInfo = H_FoodInfo::load($foodRecord->foodid);\n if ($loadedFoodInfo) {\n $d->foodInfos[$foodRecord->foodid] = $loadedFoodInfo;\n $foodInfo = $loadedFoodInfo;\n }\n else {\n $foodInfo = null;\n }\n }\n if (!$foodInfo) continue;\n \n $testAmounts = array();\n \n if ($foodInfo->unit_size < 0.01) {\n if ($foodInfo->serving_size > 0.01) {\n foreach ($amountMultipliers as $temptativeMultiplier) {\n $testAmounts[] = $foodInfo->serving_size * $temptativeMultiplier;\n } \n }\n else {\n foreach ($amountMultipliers as $temptativeMultiplier) {\n $testAmounts[] = $foodRecord->amount * $temptativeMultiplier;\n }\n }\n }\n else {\n // use unit size for test amounts\n $currentUnitAmount = (int)(round($foodRecord->amount / $foodInfo->unit_size, 0));\n $testAmounts[] = $foodInfo->unit_size * $currentUnitAmount;\n $step = $currentUnitAmount / 10.0;\n for ($i = $step; $i < 2 * $currentUnitAmount; $i += $step) {\n $iVal = $foodInfo->unit_size * (int)$i;\n if ($iVal > 0.0 && !in_array($iVal, $testAmounts)) {\n $testAmounts[] = $iVal;\n }\n }\n }\n \n foreach ($testAmounts as $temptativeAmount)\n {\n if ($temptativeAmount < 1.0) continue;\n \n $objFunc = 0.0;\n \n foreach ($d->activeRegime->data->components as $componentId => $componentSpecification) {\n $foodComponent = $d->foodComponents[$componentId];\n $propertyName = $foodComponent->info_property;\n $foodQt = $temptativeAmount * $foodInfo->$propertyName / 100.0;\n\n $totalComponent = $foodQt + $d->foodRecordsComponents[$componentId];\n $totalComponentPc = 100.0 * $totalComponent / $d->targetComponents[$componentId];\n\n if ($totalComponentPc >= $desiredTargetPercentage) {\n // overeat\n $objFunc += pow($totalComponentPc - $desiredTargetPercentage, $objFparam_pow_over);\n }\n else {\n // undereat\n $objFunc += pow(($desiredTargetPercentage - $totalComponentPc), $objFparam_pow_under);\n }\n }\n\n $key = (int)$objFunc;\n while (strlen($key) < 10) $key = \"0\".$key;\n $key = $key . \".000\" . ($cnt++) ;\n $computeResult[$key] = array($objFunc, $foodInfo, $temptativeAmount);\n }\n }\n \n ksort($computeResult);\n return $computeResult;\n}", "function per_nb_share_amt($donation_amount,$keep_amt,$charity_amount) \n { \n \n //--- Say we Take Donation amount = 100$,Keep Amount = 60$,Charity Amount = 40$ --- // \t\n\t\n $nacho_share_percentage = 5; \n\t \n\t /* ------ Nacho's Share Percent on Campaign and Charity --------- */\n\t \n\t // ----This Gives 3% ----- //\n\t $nacho_percent_on_campaign = (5 * $keep_amt) / 100; /* ---- Nacho Percent * Keep_amount/Donation_amount ----*/\n\t \n\t\n // ----This Gives 2% ----- // \n\t$nacho_percent_on_charity = (5 * $charity_amount) / 100; /* ---- Nacho Percent * Charity_amount/Donation_amount ----*/ \n\n\t /* ------ Nacho's Share Amount on Campaign and Charity --------- */ \n\t \n\t $nacho_amount_on_campaign = ($nacho_percent_on_campaign/100) * $donation_amount; //--- But here gives 1.8$ , well it should gives 3$ ----//\n\t $nacho_amount_on_charity = ($nacho_percent_on_charity/100) * $donation_amount; //--- But here gives 0.8$ , well it should gives 2$ ----// \n \n\t $nacho_amount = $nacho_amount_on_campaign + $nacho_amount_on_charity;\n\t return $nacho_amount; \n\t \n\t \n\t \t \n \n }", "public function sdo_cto_bonus()\n {\n $sdo_members = ActiveSdo::all();\n\n $qualified_members = array();\n\n $sales = 100000; //set default to 100k for testing\n\n $cto_pool = (5/100)*$sales; //5% sdo cto bonus\n\n $total_shares = 0;\n $shares = 0;\n\n foreach($sdo_members as $member)\n {\n $members_5k = 0;\n $root = Referral::where('user_id', $member->user_id)->first();\n\n $children = $root->getImmediateDescendants();\n\n if(count($children) >= 5)\n {\n foreach ($children as $child)\n {\n $wallet = Wallet::where('user_id', $child->user_id)->first();\n if($wallet && $wallet->pv >= 5000)\n {\n $members_5k++;\n $qualified_members[] = $child;\n } \n }\n\n if($members_5k/5 > 0)\n {\n $shares = floor($members_5k/5);\n\n $qualified_members[] = $root;\n // 'user_id' => $member->user_id,\n // 'shares' => $shares\n // ];\n\n // $active_sdo = ActiveSdo::where('user_id', $member->user_id)->first();\n // $active_sdo->cto_unit_share = $shares;\n // $active_sdo->save();\n }\n }\n\n $total_shares = $total_shares + $shares;\n }\n\n if($total_shares > 0) $cto_value_per_unit = number_format(($cto_pool/$total_shares), 2, '.', '');\n else $cto_value_per_unit = 0;\n\n if(count($qualified_members) > 0)\n {\n $i = 0;\n foreach ($qualified_members as $qmember)\n {\n // $qualified_sdo = ActiveSdo::where('user_id', $qmember[$i++]['user_id'])->first();\n // $qualified_sdo->cto_unit_share = $qmember[$i++]['shares'];\n // $qualified_sdo->cto_value_share= $qmember[$i++]['shares'] * $cto_value_per_unit;\n // $qualified_sdo->save();\n // echo '<br>';\n // echo '<pre>';\n // print_r($qmember);\n // echo '</pre>';\n echo $qmember[$i++]['user_id'];\n }\n }\n \n }", "function calcularSaldo($projeto_id) {\r\n\t$database = JFactory::getDBO();\r\n\t\r\n\t$sqlReceita = \"SELECT SUM(receitas.valor_receita) as totalReceitas\r\n\t\t\tFROM `j17_contproj_receitas` AS receitas, `j17_contproj_rubricasdeprojetos` AS rubricas, `j17_contproj_projetos` AS projetos\r\n\t\t\tWHERE projetos.id = rubricas.projeto_id\r\n\t\t\tAND rubricas.id = receitas.rubricasdeprojetos_id\r\n\t\t\tAND projetos.id = '\".$projeto_id.\"'\";\r\n\t$database->setQuery($sqlReceita);\r\n\t$resultado = $database->loadObjectList();\r\n\r\n\tforeach ($resultado as $res) \r\n\t\t$valorReceita = $res->totalReceitas;\r\n\t\t\r\n\t$sqlDespesa = \"SELECT SUM(despesas.valor_despesa) as totalDespesas\r\n\t\t\t\t\tFROM `j17_contproj_despesas` AS despesas, `j17_contproj_rubricasdeprojetos` AS rubricas, `j17_contproj_projetos` AS projetos\r\n\t\t\t\t\tWHERE projetos.id = rubricas.projeto_id\r\n\t\t\t\t\tAND rubricas.id = despesas.rubricasdeprojetos_id\r\n\t\t\t\t\tAND projetos.id = '\".$projeto_id.\"'\";\r\n\t$database->setQuery($sqlDespesa);\r\n\t$resultado2 = $database->loadObjectList();\t\r\n\r\n\tforeach ($resultado2 as $res2) \r\n\t\t$valorDespesa = $res2->totalDespesas;\r\n\t\r\n\t$saldo = $valorReceita - $valorDespesa;\r\n\t\r\n\treturn $saldo;\t\r\n}", "public function getCostPerMember()\n\t{\n\t\tinclude(\"Connection.php\");\n\t\t$memberCostSql = \"SELECT (SUM(Uitgave.Prijs)/Uitgavenlijst.AantalDeelnemers) AS PrijsPerPersoon\n\t\t\t\t\t\tFROM Uitgave, Uitgavenlijst\n\t\t\t\t\t\tWHERE Uitgave.LijstID = \".$link->real_escape_string($this->ListID).\"\n\t\t\t\t\t\tAND Uitgave.LijstID = Uitgavenlijst.LijstID;\";\n\t\tif($result = $link->query($memberCostSql))\n\t\t{\n\t\t\treturn($result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('Whoops, de prijs per persoon kan niet getoond worden');\n\t\t}\n\t\tmysqli_close($link);\n\t}", "public function calculate_final_grade()\n {\n //Formal Assesmnets and Unit Awards\n }", "public function index()\n {\n $cloth_amount=0;\n $food_amount=0;\n $treatment_amount=0;\n $payments_cloth = \\DB::table('payment')->where('type','cloth')->get();\n foreach ($payments_cloth as $cloth) {\n $cloth_amount+= $cloth->amount;\n }\n $payments_food = \\DB::table('payment')->where('type','food')->get();\n foreach ($payments_food as $food) {\n $food_amount+= $food->amount;\n }\n $payments_treatment = \\DB::table('payment')->where('type','treatment')->get();\n foreach ($payments_treatment as $treatment) {\n $treatment_amount+= $treatment->amount;\n }\n\n// return $cloth_amount;\n $number_of_cases=customers::where('type',0)->count();\n $number_of_sponsors=customers::where('type',1)->count();\n $highest_donations=\\DB::select(\"SELECT `from_id` ,SUM(amount) as sumtion FROM payment where `type`='donation' GROUP BY `from_id` order by `sumtion` desc \"); \n foreach ($highest_donations as $key => $highest_donation) {\n $highest_donation->name= customers::find($highest_donation->from_id)->name;\n } \n \n $highest_clothes=\\DB::select(\"SELECT `from_id` ,SUM(amount) as sumtion FROM payment where `type`='cloth' GROUP BY `from_id` order by `sumtion` desc \"); \n foreach ($highest_clothes as $key => $highest_cloth) {\n $highest_cloth->name= customers::find($highest_cloth->from_id)->name;\n }\n\n $highest_foods=\\DB::select(\"SELECT `from_id` ,SUM(amount) as sumtion FROM payment where `type`='food' GROUP BY `from_id` order by `sumtion` desc \"); \n foreach ($highest_foods as $key => $highest_food) {\n $highest_food->name= customers::find($highest_food->from_id)->name;\n }\n\n\n $highest_treatments=\\DB::select(\"SELECT `from_id` ,SUM(amount) as sumtion FROM payment where `type`='treatment' GROUP BY `from_id` order by `sumtion` desc \"); \n foreach ($highest_treatments as $key => $highest_treatment) {\n $highest_treatment->name= customers::find($highest_treatment->from_id)->name;\n }\n\n\n// return $highest_donations;\n $highest_wishlists=\\DB::select('SELECT `to` ,COUNT(*) as count FROM likes GROUP BY `to` order by `count` desc'); \n foreach ($highest_wishlists as $key => $highest_wishlist) {\n $highest_wishlist->customer = customers::find($highest_wishlist->to);\n }\n return view('home')->with('highest_clothes',$highest_clothes)->with('highest_foods',$highest_foods)->with('highest_treatments',$highest_treatments)->with('highest_donations',$highest_donations)->with('treatment_amount',$treatment_amount)->with('food_amount',$food_amount)->with('cloth_amount',$cloth_amount)->with('highest_wishlists', $highest_wishlists)->with('number_of_cases', $number_of_cases)->with('number_of_sponsors', $number_of_sponsors);\n }", "private function calculateTotalsAndUtilisation()\n\t{\n\t\tforeach ($this->project_table_data as $project_id => $weekly_data) {\n\t\t\t$allocated = 0;\n\t\t\t$required = 0;\n\t\t\tforeach ($weekly_data as $week => $data) {\n\t\t\t\tif ($week != \"totals\") {\n\t\t\t\t\t$allocated += $data['allocated'];\n\t\t\t\t\t$required += $data['required'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$utilisation = 0;\n\t\t\tif ($required == 0) {\n\t\t\t\t$utilisation = \"N/A\";\n\t\t\t} else {\n\t\t\t\t$utilisation = round($allocated/$required * 100, 1); //this represents a percentage value\n\t\t\t}\n\t\t\t$this->project_table_data[$project_id]['totals'] = array(\n\t\t\t\t\t'allocated' => $allocated,\n\t\t\t\t\t'required' => $required,\n\t\t\t\t\t'utilisation' => $utilisation\n\t\t\t\t);\n\t\t\t\n\t\t\t$this->total_allocated += $allocated;\n\t\t}\n\n\t\t$this->calculateTotalAvailable();\n\t\t$this->calculateTotalUtilisation();\n\t}", "public function salaryToDecrease()\n {\n // salary given\n $salary_given = EmployeeTransaction::all()\n ->sum('nominal');\n // end salary given\n\n //company outcome employee bonus\n $company_bonus = EmployeeBonus::where('status', 'SUDAH DIAMBIL')\n ->get()\n ->sum('bonus');\n //end company employee bonus\n \n $salary_outcome = $salary_given + $company_bonus;\n\n return $salary_outcome;\n }", "public static function getAllDebtByPerson($person_id) {\n /**\n * Obtenemos el total adeuda para la persona a la fecha\n */\n $date = date('Y-m-d H:i:s');\n\n $conn = Yii::app()->db;\n $command = $conn->createCommand();\n $command->text = \" SELECT SUM(value) FROM \" . Fee::model()->tableName() . \" WHERE begin_date < :pay_date\";\n $total_fee = $command->queryScalar(array(\":pay_date\" => $date));\n\n $location_ids = self::getLocationIdsByPerson($person_id);\n\n // se suman todas las cuotas de todas las parcelas\n $total_fee = count($location_ids) * $total_fee;\n\n $total_payed = self::getSumAllFeePayed($location_ids, $date);\n\n return $total_fee - $total_payed;\n }", "function getSum($internal = null) {\n\t\t\t\n\t\t\tif(!isset($this->params['requested'])) return;\n\t\t\t\n\t\t\t//Get current active registration\n\t\t\t$registration = $this->requestAction('registrations');\n\t\t\t//Get current active event\n\t\t\t$event = $this->requestAction('events');\n\t\t\t$pricePerPerson = $this->Session->read('Event.price_per_person');\n\t\t\t\t\n\t\t\tif($internal === null) { //normal use case unchanged so that it can be called in the same way as before from person element\n\t\t\t\t\n\t\t\t\tif($this->Session->check('Registration.Person') && $this->Session->check('Event.price_per_person')) {\n\t\t\t\t\t$amountWithReductionCode = 0;\n\t\t\t\t\tforeach ($registration['Person'] as $person){\n\t\t\t\t\t\tif (isset($person['reduction_code_id']) && $person['reduction_code_id'] > 0)\n\t\t\t\t\t\t\t$amountWithReductionCode++;\n\t\t\t\t\t}\n\t\t\t\t\t$amountOfPeople = (sizeof($registration['Person'])) - $amountWithReductionCode;\n\t\t\t\t\t//TODO refactor shouldnt we use price from event that we requested above?\n\t\t\t\t\treturn $this->Invoice->calculatePrice($pricePerPerson, $amountOfPeople);\n\t\t\t\t} else {\n\t\t\t\t\t// We get here when we are in receipt view basicly\n\t\t\t\t\t$latestInvoice = $this->Invoice->getLatest($registration['Registration']['id']);\n\t\t\t\t\treturn $latestInvoice['Invoice']['price'];\n\t\t\t\t}\n\t\t\t} elseif($internal) {\n\t\t\t\t\n\t\t\t\t$sum = 0;\n\t\t\t\t\n\t\t\t\t//return only sum of all the internal people (people that has a role where is_external is false/null/0)\n\t\t\t\tforeach($registration['Person'] as $person) {\n\t\t\t\t\tif(isset($person['role_id'])) {\n\t\t\t\t\t\t$isExternal = $this->Invoice->Registration->Person->Role->field('is_external', array('id' => $person['role_id']));\n\t\t\t\t\t\tif(!$isExternal) {\n\t\t\t\t\t\t\t$sum += $pricePerPerson;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $sum;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$sum = 0;\n\t\t\t\t\n\t\t\t\t//return only sum of all the external people (people that has a role where is_external is true/1)\n\t\t\t\tforeach($registration['Person'] as $person) {\n\t\t\t\t\t$isExternal = $this->Invoice->Registration->Person->Role->field('is_external', array('id' => $person['role_id']));\n\t\t\t\t\tif($isExternal) {\n\t\t\t\t\t\t$sum += $pricePerPerson;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $sum;\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "public function dueFromCustomer()\n {\n return number()->sum(\n $this->items->gross(),\n $this->deals->total()\n );\n }", "function getTotalRevenue() {\n\n $total = 0;\n foreach ($this->getPayments() as $oPayment)\n $total += $oPayment->getAmountPaid();\n\n return $total;\n\n }", "public static function calculate_deposit( $property_uid = 0 , $booking_total = 0 , $days_in_booking = 0)\n\t{\n\t\tif ( $property_uid == 0 ) {\n\t\t\tFlight::halt(204, \"Property uid not set\");\n\t\t\t}\n\t\n\t\t$deposit_value = 0.0;\n\t\t$cleaning_fee = 0.0;\n\t\t$security_deposit = 0.0;\n\t\t\n\t\t$cmf_temp_data_security_fee_found = (bool)get_showtime(\"cmf_temp_data_security_fee_found\");\n\t\t\n\t\tif (!$cmf_temp_data_security_fee_found) {\n\t\t\t$call_self = new call_self( );\n\t\t\t$elements = array(\n\t\t\t\t\"method\"=>\"GET\",\n\t\t\t\t\"request\"=>\"cmf/property/securitydeposit/\".$property_uid,\n\t\t\t\t\"data\"=>array(),\n\t\t\t\t\"headers\" => array ( Flight::get('channel_header' ).\": \".Flight::get('channel_name') , \"X-JOMRES-proxy-id: \".Flight::get('user_id') )\n\t\t\t\t);\n\t\t\t\n\t\t\t$response = json_decode(stripslashes($call_self->call($elements)));\n\t\t\t\n\t\t\tif (isset($response->data->response) && $response->data->response > 0 ) {\n\t\t\t\t$security_deposit = (float)$response->data->response;\n\t\t\t}\n\t\t\tset_showtime(\"cmf_temp_data_security_fee_found\" , true );\n\t\t\tset_showtime(\"cmf_temp_data_security_fee\" , $security_deposit );\n\t\t} else {\n\t\t\t$security_deposit = (float)get_showtime(\"cmf_temp_data_security_fee\");\n\t\t}\n\t\t\n\t\n\t\t$cmf_temp_data_cleaning_fee_found = (bool)get_showtime(\"cmf_temp_data_cleaning_fee_found\");\n\t\t\n\t\tif (!$cmf_temp_data_cleaning_fee_found) {\n\t\t\t$call_self = new call_self( );\n\t\t\t$elements = array(\n\t\t\t\t\"method\"=>\"GET\",\n\t\t\t\t\"request\"=>\"cmf/property/cleaningfee/\".$property_uid,\n\t\t\t\t\"data\"=>array(),\n\t\t\t\t\"headers\" => array ( Flight::get('channel_header' ).\": \".Flight::get('channel_name') , \"X-JOMRES-proxy-id: \".Flight::get('user_id') )\n\t\t\t\t);\n\t\t\t\t\t\n\t\t\t$response = json_decode(stripslashes($call_self->call($elements)));\n\n\t\t\tif (isset($response->data->response) && $response->data->response > 0 ) {\n\t\t\t\t$cleaning_fee = (float)$response->data->response;\n\t\t\t}\n\t\t\tset_showtime(\"cmf_temp_data_cleaning_fee_found\" , true );\n\t\t\tset_showtime(\"cmf_temp_data_cleaning_fee\" , $cleaning_fee );\n\t\t} else {\n\t\t\t$cleaning_fee = (float)get_showtime(\"cmf_temp_data_cleaning_fee\");\n\t\t}\n\t\t\n\t\t$cmf_temp_data_deposit_type_found = (bool)get_showtime(\"cmf_temp_data_deposit_type_found\");\n\t\t\n\t\tif (!$cmf_temp_data_deposit_type_found) {\n\t\t\t$call_self = new call_self( );\n\t\t\t$elements = array(\n\t\t\t\t\"method\"=>\"GET\",\n\t\t\t\t\"request\"=>\"cmf/property/deposit/type/\".$property_uid,\n\t\t\t\t\"data\"=>array(),\n\t\t\t\t\"headers\" => array ( Flight::get('channel_header' ).\": \".Flight::get('channel_name') , \"X-JOMRES-proxy-id: \".Flight::get('user_id') )\n\t\t\t\t);\n\t\t\t\n\t\t\t$response = json_decode(stripslashes($call_self->call($elements)));\n\n\t\t\tif (!isset($response->data->response)) {\n\t\t\t\tFlight::halt(204, \"Cannot determine deposit setting for property\");\n\t\t\t}\n\t\t\t\n\t\t\tset_showtime(\"cmf_temp_data_deposit_type_found\" , true );\n\t\t\tset_showtime(\"cmf_temp_data_deposit_type\" , $response->data->response );\n\t\t\t$deposit_type = $response->data->response;\n\t\t} else {\n\t\t\t$deposit_type = get_showtime(\"cmf_temp_data_deposit_type\");\n\t\t}\n\t\t\n\t\t\n\t\t$mrConfig = getPropertySpecificSettings($property_uid);\n\t\t\n\n\t\t// The booking_total should be the exclusive of vat price, so there's no need to find ex-vat prices\n\t\t\n\t\tswitch ($deposit_type) {\n\t\t\tcase 1: // No deposit\n\t\t\t\t$desposit_value = 0.0;\n\t\t\t\tbreak;\n\t\t\tcase 2: // Percentage of total price (without cleaning)\n\t\t\t\t\t$percentage_value = (float)$mrConfig['depositValue'];\n\t\t\t\t\t$deposit_value = ($booking_total / 100 ) * $percentage_value;\n\t\t\t\tbreak;\n\t\t\tcase 3: // Percentage of total price (including cleaning)\n\t\t\t\t\t$percentage_value = (float)$mrConfig['depositValue'];\n\t\t\t\t\t$deposit_value = ($booking_total / 100 ) * $percentage_value;\n\t\t\t\t\t$cleaning_fee = 0;\n\t\t\t\tbreak;\n\t\t\tcase 4: // Fixed amount per day // Not supported in Jomres Core, so we will fall back to using fixed amount instead\n\t\t\tcase 5: // Flat amount per stay\n\t\t\t\t\t$deposit_value = (float)$mrConfig['depositValue'];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tFlight::halt(204, \"Cannot calculate deposit based on deposit settings\");\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$deposit_response = array (\n\t\t\t\"deposit_type\" => $deposit_type,\n\t\t\t\"deposit\" => $deposit_value,\n\t\t\t\"cleaning\" => $cleaning_fee,\n\t\t\t\"security\" => $security_deposit\n\t\t\t\n\t\t);\n\n\t\treturn $deposit_response;\n\t}", "public function getBalanceServiceFeeAmount($school_id){\n // calculate balance service fee amount\n $balanceServiceFeeAmount = 0;\n $schoolPayments = $this->schoolPayment::where('school_id',$school_id)->first();\n $schoolFeeDetails = $this->schoolFeeDetail::where('school_id',$school_id)->first();\n $paidMonths = $schoolPayments->paid_months;\n $pendingMonths = $schoolPayments->pending_months;\n\n $start = $schoolFeeDetails->payment_start_month;\n $end = $schoolFeeDetails->payment_end_month;\n\n $start = $start=='' ? time() : strtotime($start);\n $end = $end=='' ? time() : strtotime($end); \n $months = array();\n \n $currentMonth = date('m-Y'); \n for ($i = $start; $i <= $end; $i = $this->getNextMonth($i)) {\n if(date('m-Y', $i) == $currentMonth) break;\n $months[] = date('m-Y', $i); \n } \n $totalStudents = $schoolFeeDetails->student_strength;\n $monthlyFees = $schoolFeeDetails->monthly_fees;\n $pendingMonthsExplode = explode(\",\", $pendingMonths);\n $pendingMonthsCount = 0;\n foreach ($months as $month) {\n if(in_array($month, $pendingMonthsExplode)){\n $pendingMonthsCount++;\n }\n }\n $balanceServiceFeeAmount = $totalStudents * $monthlyFees * $pendingMonthsCount; \n\n return $balanceServiceFeeAmount; \n }", "function getResultResource_all_calculations()\n{\n\t$paying_amount=array();\n\t//Paying Amount: Following query is for paying amount\n\t$sql_paying_amount=\" SELECT id,dues as paying_amount,std_status,`status` \n\t\t\tFROM campus_schedule \n\t\t\tWHERE std_status=2\";\n\t/////////////////////PAYING AMOUNT QUERY END\n\t$result_paying_amount = mysql_query($sql_paying_amount);\n\twhile($row_paying_amount=mysql_fetch_array($result_paying_amount))\n\t{\n\t\t$paying_amount[$row_paying_amount['id']]=$row_paying_amount['paying_amount'];\n\t}\n\t////////////////////////////////////////////////////////////// PAYING AMOUNT - END\n\t\n\t\n\t\n\t///////////////////////////////////////////////////////////// Dead Regular student - START\n\t//'First Date = ' . date('Y-m-01') . '<br />';\n //'Last Date = ' . date('Y-m-t') . '<br />';\n\techo \"<br>\";\n\techo \"<br>\";\n\techo \"<br>\";\n\techo \"<label><b>Server From/To Date</b></label>\";\n\t$systemdate = systemDate();\n\techo $fromDate = date('Y-m-01');\n\techo \"<br>\";\n\techo $toDate = date('Y-m-t');\n\techo \"<br>\";\t\n\techo \"<label><b>CCMS From/To Date</b></label>\";\t\n\techo $fromDate_ccms = date('Y-m-01', strtotime($systemdate));echo \"<br>\";\n\techo $toDate_ccms = date('Y-m-t', strtotime($systemdate));echo \"<br>\";\n\t$sql_DEAD_Reg=\" SELECT id,SUM(dues) as DEAD_Reg_amount,std_status_old,std_status,`status` \n\t\t\tFROM campus_schedule \n\t\t\tWHERE std_status_old=2 AND std_status=3 AND \n\t\t\tDATE(campus_schedule.confirm_dead_date)>='\".$fromDate_ccms.\"' and DATE(campus_schedule.confirm_dead_date)<= '\".$toDate_ccms.\"' \";\n\t$result_DEAD_Reg = mysql_query($sql_DEAD_Reg);\n\twhile($row_DEAD_Reg=mysql_fetch_array($result_DEAD_Reg))\n\t{\n\t\t$DEAD_Reg=$row_DEAD_Reg['DEAD_Reg_amount'];\n\t}\n\t////////////////////////////////////////////////////////////// Dead Regular student - END\n\t\n\t\n\t\n\t/////////////////////////////////////////////// Total Recurr Received amount of Current Month - START\n\t$amount=array();\n\t$recieved=array();\n\t$recieved_with_tran_id=array();\n\t$signups =array();\n\t\n\t//Transacted with 0\n\t$recieved_with_zero=array();\n\t$recieved_with_zero_tran_id=array();\n\t\n\t\n\t$sql_Total_Recurr_Rec=\" SELECT campus_schedule.id,campus_schedule.duedate as due_date,\n\tday(campus_schedule.duedate) AS dayz,month(campus_schedule.duedate) AS month,\n\tcampus_schedule.dues as amount,campus_schedule.studentID,campus_schedule.courseID,campus_schedule.classType,campus_schedule.`status`,\n\tcampus_schedule.std_status,campus_schedule.std_status_old,campus_schedule.startTime,\n\tcampus_schedule.agentId,\n\tcampus_transaction.id as tran_id,campus_transaction.transactionID,campus_transaction.date as date_rec_cam_tran,campus_transaction.studentID,\n\tcampus_transaction.amount as amounttran,campus_transaction.operator as tran_op,campus_transaction.courseID as tran_cid,campus_transaction.classType as tran_ctid,\n\tcampus_transaction.dateRecieved as maxdate_rec,campus_transaction.startTime,campus_transaction.schedule_id,campus_transaction.comments,campus_transaction.teacherID,\n\tcampus_transaction.method,campus_transaction.method_array,campus_transaction.LeadId,campus_transaction.main_LeadId,\n\tcampus_transaction.sender_name,campus_transaction.email, \n\tcampus_transaction.currency_array,campus_transaction.amount_gbp as amounttran_gbp, \n\tcampus_transaction.amount_original as amounttran_original \n\tFROM campus_schedule \n\tINNER JOIN campus_transaction \n\tON campus_schedule.studentID=campus_transaction.studentID and campus_schedule.id=campus_transaction.schedule_id \n\tand campus_schedule.`status` =1 and \n\tcampus_transaction.date BETWEEN '\".$fromDate_ccms.\"' AND '\".$toDate_ccms.\"' and campus_transaction.date!='' \";\n\t\n\t$result_Total_Recurr_Rec = mysql_query($sql_Total_Recurr_Rec) or trigger_error(mysql_error());\n\twhile($row_Total_Recurr_Rec=mysql_fetch_array($result_Total_Recurr_Rec))\n\t{\n\t\t$signup_check=1;\n\t\t$countresult=$row_Total_Recurr_Rec['amount'];\n\t\t$countmonthsql=\"select amount as amounttran_not_main,date,dateRecieved,operator,id FROM campus_transaction where date BETWEEN '\".$fromDate_ccms.\"' AND '\".$toDate_ccms.\"' and studentID=\".$row_Total_Recurr_Rec['studentID'].\" and schedule_id=\".$row_Total_Recurr_Rec['id'].\" and id=\".$row_Total_Recurr_Rec['tran_id'].\" \"; \n\t\t$countmonthesult=mysql_query($countmonthsql);\n\t\t$countmonthesult=mysql_fetch_assoc($countmonthesult);\n\t\t$amount[$row_Total_Recurr_Rec['id']]=$countresult;\n\t\t//DUE DATE(Signup DATE) - Month and Year\n\t\t$duedate_month = date('m', strtotime(nl2br($row_Total_Recurr_Rec['due_date'])));\n\t\t$duedate_year = date('Y', strtotime(nl2br($row_Total_Recurr_Rec['due_date'])));\n\t\t\n\t\t//DUE DATE(Signup DATE) - Month and Year\n\t\t$dateRec_month = date('m', strtotime(nl2br($countmonthesult['dateRecieved'])));\n\t\t$dateRec_year = date('Y', strtotime(nl2br($countmonthesult['dateRecieved'])));\n\t\tif(($row_Total_Recurr_Rec['due_date']>=$fromDate_ccms && $row_Total_Recurr_Rec['due_date']<=$toDate_ccms) && $row_Total_Recurr_Rec['due_date']==$countmonthesult['date']/*(Got required result by this-[date=due_date(receive date=signup date)])*/ && !empty($countresult) && ($duedate_month==$dateRec_month && $duedate_year==$dateRec_year))\n\t\t{\n\t\t\t$signups[$row_Total_Recurr_Rec['id']]=$row_Total_Recurr_Rec['amount'];\n\t\t\t$signup_check=0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//$signup_check==1;\n\t\t}\n\n\t\tif(!empty($countresult) && ($countmonthesult['date']>=$fromDate_ccms && $countmonthesult['date']<=$toDate_ccms) && $signup_check==1)\n\t\t{\n\t\t\t$recieved[$row_Total_Recurr_Rec['tran_id']]=$row_Total_Recurr_Rec['amounttran'];\n\t\t\t$recieved_with_tran_id[$row_Total_Recurr_Rec['tran_id']]=$row_Total_Recurr_Rec['amounttran'];\n\t\t}\n\t\t\n\t\t//RECEIVED WITH ZERO 0\n\t\tif(!empty($countresult) && ($countmonthesult['date']>=$fromDate_ccms && $countmonthesult['date']<=$toDate_ccms) && $signup_check==1)\n\t\t{\n\t\t\tif($row_Total_Recurr_Rec['amounttran']==0)\n\t\t\t{\n\t\t\t\t$recieved_with_zero[$row_Total_Recurr_Rec['tran_id']]=$row_Total_Recurr_Rec['amount'];\n\t\t\t\t$recieved_with_zero_tran_id[$row_Total_Recurr_Rec['tran_id']]=$row_Total_Recurr_Rec['amount'];\n\t\t\t}\n\t\t}\n\t\n\t}\n\t$recurr = nl2br( array_sum($recieved));\n\t$SU = nl2br( array_sum($signups)); \n\t\n\t$recurr_with_zero = nl2br( array_sum($recieved_with_zero));\n\t\n\t//$total_income_in_this_month_overall = $recurr + $SU; \n\t//////////////////////////////////////////////// Total Recurr Received amount of Current Month - END\n\n\t//LAHORE SIGNUP AMOPUNT|||||||||||||||||||||||**************????????????????????????????????????\n\t///////////////////////////////////////////////////////////// LAHORE SIGNUP- START\n\t$sql_Lahore_SU=\"SELECT id,SUM(dues) as SU_lhr_amount,status \n\tFROM campus_schedule \n\tWHERE agentId=565 and status=1 and \n\tcampus_schedule.duedate>='\".$fromDate_ccms.\"' and campus_schedule.duedate<= '\".$toDate_ccms.\"' \";\n\t$result_Lahore_SU = mysql_query($sql_Lahore_SU);\n\twhile($row_Lahore_SU=mysql_fetch_array($result_Lahore_SU))\n\t{\n\t\t$SU_lhr=$row_Lahore_SU['SU_lhr_amount'];\n\t}\n\t///////////////////////////////////////////////////////////// LAHORE SIGNUP - END\n\t\n\t///////////////////////////////////////////////////////////// Total income in this month - START\n\t$SU_rwp = $SU - $SU_lhr;\n\t$total_income_in_this_month_overall = ($recurr + $SU_rwp); \n\t///////////////////////////////////////////////////////////// Total income in this month - END\n\t\n\t\n\t///////////////////////////////////////////////////////////// Total PENDING TILL DATE - START\n\t$curr_mon_sub_one = date('n')-1;echo \"<br>\";\n\t\n\t$curr_mon_sub_one = date('n', strtotime($systemdate . \"-1 months\"));echo \"<br>\";\n\t$fromDate_pre = date('Y').\"-\".$curr_mon_sub_one.\"-\".date('01');echo \"<br>\";\n\t\n\t$fromDate_ccms = date('Y-m-01', strtotime($systemdate));\n\t$toDate = date('Y-m-t');\n\t//CCMS From/To Date</b></label>\"\n\t//$fromDate_pre_ccms=\t\t\t\t//USE ccms date AS PREVIOUS MONTH LATER\n\t//echo $fromDate_ccms = date('Y-m-01', strtotime($systemdate));echo \"<br>\";\n\t$toDate_ccms = date('Y-m-t', strtotime($systemdate));\n\t\n\t$fromDate=date('d',strtotime($fromDate_pre));\n\t//echo \"<br>\";\n\t$fromMonth=date('n',strtotime($fromDate_pre));\n\t//echo \"<br>\";\n\t$fromYear=date('Y',strtotime($fromDate_pre));\n\t//echo \"<br>\";\n\t\n\t$fromdaysss=date('t',strtotime($fromDate_pre));\n\t//echo \"<br>\";\n\t//echo \"<br>\";\n\t\n\t$toDate_current_day_ccms = date('d', strtotime($systemdate));\n\t$toDate_current_day=date('d');//NOT USE DURING THIS TIME\n\t$toDate_day=date('d',strtotime($toDate_ccms));\n\t//echo \"<br>\";\n\t$toMonth_month=date('n',strtotime($toDate_ccms));\n\t//echo \"<br>\";\n\t$toYear_year=date('Y',strtotime($toDate_ccms));\n\t//echo \"<br>\";\n\t//echo \"<br>\";\n\t\n\t//Current year and the current month is NOT JAN\n\t//echo \"pre mon\";\n\t$curr_mon_sub_one = date('n', strtotime($systemdate . \"-1 months\"));\n\t//echo \"<br>\";\n\t//Current year and the current month is JAN\n\t//echo \"if curr month is JAN and pre mon will be DEC(12) not 0-with pre year ***\";\n\tif($curr_mon_sub_one==0)\n\t{\n\t\t$curr_mon_sub_one=12;\n\t\t//echo \"<br>\";\n\t}\n\n\t//echo \"curr mon\";\n\t$curr_mon = date('n',strtotime($systemdate));\n\t//echo \"<br>\";\n\t\n\t//Current year and the current month is NOT DEC\n\t//echo \"next mon-without next year condition\";\n\t$curr_mon_add_one = date('n', strtotime($systemdate . \"+1 months\"));\n\t//echo \"<br>\";\n\t//echo \"<br>\";\n\t//echo \"<br>\";\n\t\n\t$curr_year_minus_one = date('Y')-1;\n\t//echo \"<br>\";\n\t//Current year and the current month is DEC\n\t//echo \"if curr month is DEC and next mon will be JAN(1) not 13-with next year ***\";\n\tif($curr_mon_add_one==13)\n\t{\n\t\t$curr_mon_add_one=1;\n\t\t//echo \"<br>\";\n\t}\n\t//echo \"<br>\";\n\tif($fromDate_ccms < $toDate_ccms && $fromMonth==$curr_mon_sub_one && $toMonth_month==$curr_mon)\n\t{\n\t\n\t//Query for Previous month pending\n\t$sql_pre_till_date_pend=\" Select capmus_users.id as users_id,capmus_users.LeadId,\n\t\t\t\t\tcampus_schedule.id,\n\t\t\t\t\tcampus_schedule.duedate as due_date,\n\t\t\t\t\tcampus_schedule.paydate as pay_date,\n\t\t\t\t\tday(campus_schedule.duedate) AS dayz,\n\t\t\t\t\tmonth(campus_schedule.duedate) AS month,\n\t\t\t\t\tyear(campus_schedule.duedate) AS year,\n\t\t\t\t\tday(campus_schedule.paydate) AS paydayz,\n\t\t\t\t\tcampus_schedule.dues as amount,\n\t\t\t\t\tcampus_schedule.studentID,\n\t\t\t\t\tcampus_schedule.courseID,\n\t\t\t\t\tcampus_schedule.classType,\n\t\t\t\t\tcampus_schedule.startTime,\n\n\n\t\t\t\t\tcampus_schedule.`status` \n\t\t\t\t\tFROM capmus_users \n\t\t\t\t\tINNER JOIN campus_schedule \n\t\t\t\t\tON capmus_users.id=campus_schedule.teacherID and campus_schedule.teacherID!=0 and \n\t\t\t\t\tcampus_schedule.`status` =1 and campus_schedule.std_status=2 and \n\t\t\t\t\tday(campus_schedule.paydate) BETWEEN \".$fromDate.\" AND \".$fromdaysss.\" \n\t\t\t\t\torder by paydayz DESC\";\n\t\t\t\t\t\n\t\t\t\t\t//Query for current month till date pending e.g(1st - 15th OR 20th OR 22nd etc)\n\t\t\t\t\t$sql_till_date_pend=\" Select capmus_users.id as users_id,capmus_users.LeadId,\n\t\t\t\t\tcampus_schedule.id,\n\t\t\t\t\tcampus_schedule.duedate as due_date,\n\t\t\t\t\tcampus_schedule.paydate as pay_date,\n\t\t\t\t\tday(campus_schedule.duedate) AS dayz,\n\t\t\t\t\tmonth(campus_schedule.duedate) AS month,\n\t\t\t\t\tyear(campus_schedule.duedate) AS year,\n\t\t\t\t\tday(campus_schedule.paydate) AS paydayz,\n\t\t\t\t\tcampus_schedule.dues as amount,\n\t\t\t\t\tcampus_schedule.studentID,\n\t\t\t\t\tcampus_schedule.courseID,\n\t\t\t\t\tcampus_schedule.classType,\n\t\t\t\t\tcampus_schedule.startTime,\n\n\t\t\t\t\tcampus_schedule.`status` \n\t\t\t\t\tFROM capmus_users \n\t\t\t\t\tINNER JOIN campus_schedule \n\t\t\t\t\tON capmus_users.id=campus_schedule.teacherID and campus_schedule.teacherID!=0 and \n\t\t\t\t\tcampus_schedule.`status` =1 and campus_schedule.std_status=2 and \n\t\t\t\t\t(day(campus_schedule.paydate) BETWEEN 1 AND \".$toDate_current_day_ccms.\") \n\t\t\t\t\torder by paydayz DESC\";\n\t\t\t\t\t\n\t\t\t\t\t//Query for current month pending(1st - 30th/31st)\n\t\t\t\t\t$sql_curr_till_date_pend=\" Select capmus_users.id as users_id,capmus_users.LeadId,\n\t\t\t\t\tcampus_schedule.id,\n\t\t\t\t\tcampus_schedule.duedate as due_date,\n\t\t\t\t\tcampus_schedule.paydate as pay_date,\n\t\t\t\t\tday(campus_schedule.duedate) AS dayz,\n\t\t\t\t\tmonth(campus_schedule.duedate) AS month,\n\t\t\t\t\tyear(campus_schedule.duedate) AS year,\n\t\t\t\t\tday(campus_schedule.paydate) AS paydayz,\n\t\t\t\t\tcampus_schedule.dues as amount,\n\t\t\t\t\tcampus_schedule.studentID,\n\t\t\t\t\tcampus_schedule.courseID,\n\t\t\t\t\tcampus_schedule.classType,\n\t\t\t\t\tcampus_schedule.startTime,\n\n\t\t\t\t\tcampus_schedule.`status` \n\t\t\t\t\tFROM capmus_users \n\t\t\t\t\tINNER JOIN campus_schedule \n\t\t\t\t\tON capmus_users.id=campus_schedule.teacherID and campus_schedule.teacherID!=0 and \n\t\t\t\t\tcampus_schedule.`status` =1 and campus_schedule.std_status=2 and \n\t\t\t\t\t(day(campus_schedule.paydate) BETWEEN 1 AND \".$toDate_day.\") \n\t\t\t\t\torder by paydayz DESC\";\n\t}\n\n\t//PREVIOUS MONTH\n//*******************************************************************************************************************************************************************//\n//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Following is related to the PREVIOUS MONTH DUES CALCULATIONS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n//echo \"<div align='center' style='color:red; font-size:16px'>PREVIOUS MONTH PENDINGS</div>\";\n$amount_pre_till_date_pend=array();\n$recieved_pre_till_date_pend=array();\n$pending_pre_till_date_pend =array();\n\n$pending_pre_till_date_pend_2nd_array =array();\n\n$signups_pre_till_date_pend =array();\n$discount_pre_till_date_pend =array();\n\n\t$result_pre_till_date_pend = mysql_query($sql_pre_till_date_pend) or trigger_error(mysql_error()); \n\twhile($row_pre_till_date_pend = mysql_fetch_array($result_pre_till_date_pend)){ \n\n\n\t$countresult_pre_till_date_pend=$row_pre_till_date_pend['amount'];\n\n\t$date_subtracted = date('n') - 1;\n\t$date_subtracted = date('n', strtotime($systemdate . \"-1 months\"));//NOW ccms date is used\n\tif($date_subtracted==0)\n\t{\n\t\t$date_subtracted=12;\n\t}\n\t$countmonthsql_pre_till_date_pend=\"select amount as amounttran, discount_tran FROM campus_transaction where month(dateRecieved)='\".$date_subtracted.\"' and year(dateRecieved)='\".date('Y').\"' and studentID=\".$row_pre_till_date_pend['studentID'].\" and schedule_id=\".$row_pre_till_date_pend['id'].\"\"; \n\tif($fromMonth==1 && $toMonth==1)\t//NEWLY ADDED 10-01-2014\n\t{\n\t\t//$countmonthsql_pre.= \" and year(dateRecieved)='\".$curr_year_minus_one.\"' \";\n\t}\n\n\t\n\t$countmonthesult_pre_till_date_pend=mysql_query($countmonthsql_pre_till_date_pend) or die(mysql_error());\n\t$countmonthesult_pre_till_date_pend=mysql_fetch_assoc($countmonthesult_pre_till_date_pend);\n\n\n\t$maxdate_rec_pre=\"SELECT MAX(dateRecieved) as maxdate_rec,MAX(date) as date_rec_cam_tran FROM campus_transaction where studentID=\".$row_pre_till_date_pend['studentID'].\" and year(dateRecieved)='\".date('Y').\"' and schedule_id=\".$row_pre_till_date_pend['id'].\"\"; \n\t$maxdate_rec_result_pre=mysql_query($maxdate_rec_pre) or die(mysql_error());\n\t$maxdate_rec_result_pre=mysql_fetch_assoc($maxdate_rec_result_pre);\n\n\t$amount_pre_till_date_pend[$row_pre_till_date_pend['id']]=$countresult_pre_till_date_pend;\n\t$recieved_pre_till_date_pend[$row_pre_till_date_pend['id']]=$countmonthesult_pre_till_date_pend['amounttran'];\n\t$pending_pre_till_date_pend[$row_pre_till_date_pend['id']]=$countresult_pre_till_date_pend-$countmonthesult_pre_till_date_pend['amounttran']-$countmonthesult_pre_till_date_pend['discount_tran'];\n\t//echo \"<br>\";\n\tif(($pending_pre_till_date_pend[$row_pre_till_date_pend['id']]<0) || ($pending_pre_till_date_pend[$row_pre_till_date_pend['id']]>0 && $pending_pre_till_date_pend[$row_pre_till_date_pend['id']]<=9))\n\t{\n\t\t$pending_pre_till_date_pend[$row_pre_till_date_pend['id']]=0;\n\t}\n\telse\n\t{\n\t\t$pending_pre_till_date_pend[$row_pre_till_date_pend['id']];\n\t}\n\t$discount_pre_till_date_pend[$row_pre_till_date_pend['id']] = $countmonthesult_pre_till_date_pend['discount_tran'];\n\n\t\tif($row_pre_till_date_pend['month']==date('n') && $row_pre_till_date_pend['year']==date('Y'))\n\t\t{\n\t\t$signups_pre_till_date_pend[$row_pre_till_date_pend['id']]=$countresult_pre_till_date_pend;\n\t\t}\n\t\tif(($pending_pre_till_date_pend[$row_pre_till_date_pend['id']] >= 10) && ($signups_pre_till_date_pend[$row_pre_till_date_pend['id']]==''))\n\t\t{\n\t\t$pending_pre_till_date_pend_2nd_array[$row_pre_till_date_pend['id']]=$pending_pre_till_date_pend[$row_pre_till_date_pend['id']];\n\t\t$pending_pre_till_date_pend[$row_pre_till_date_pend['id']]; \n\t\t}\n\t}\n$pre_month_pending = array_sum($pending_pre_till_date_pend_2nd_array);\n\n\n\n//CURRENT MONTH\n//*******************************************************************************************************************************************************************//\n//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Following is related to the CURRENT MONTH DUES CALCULATIONS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n//echo \"<div align='center' style='color:red; font-size:16px'>CURRENT MONTH PENDINGS</div>\";\n\n\n$amount_till_date_pend=array();\n$recieved_till_date_pend=array();\n$pending_till_date_pend =array();\n$signups_till_date_pend =array();\n$discount_till_date_pend =array();\n\n\t$unique_array_id=1;\n\t$result_till_date_pend = mysql_query($sql_till_date_pend) or trigger_error(mysql_error()); \n\twhile($row_till_date_pend = mysql_fetch_array($result_till_date_pend)){ \n\t\n\t$countresult_till_date_pend=$row_till_date_pend['amount'];\n\t$amount_till_date_pend[$row_till_date_pend['id']]=$countresult_till_date_pend;\n\n\t\t$countmonthsql_till_date_pend=\"select amount as amounttran,discount_tran FROM campus_transaction where month(dateRecieved)>='\".date('n').\"' and year(dateRecieved)='\".date('Y').\"' and studentID=\".$row_till_date_pend['studentID'].\" and schedule_id=\".$row_till_date_pend['id'].\"\"; \n\t\t$countmonthesult_till_date_pend=mysql_query($countmonthsql_till_date_pend) or die(mysql_error());\n\t\t$countmonthesult_till_date_pend=mysql_fetch_assoc($countmonthesult_till_date_pend);\n\n\t\t$amount_till_date_pend[$row_till_date_pend['id']]=$countresult_till_date_pend;\n\t\t$recieved_till_date_pend[$row_till_date_pend['id']]=$countmonthesult_till_date_pend['amounttran'];\n\t\t$pending_till_date_pend[$unique_array_id]=$countresult_till_date_pend-$countmonthesult_till_date_pend['amounttran']-$countmonthesult_till_date_pend['discount_tran'];\n\t\tif($pending_till_date_pend[$unique_array_id]<0 || $pending_till_date_pend[$unique_array_id]<10)\n\t\t{\n\t\t$pending_till_date_pend[$unique_array_id]=0;\n\t\t}\n\t\t$discount_till_date_pend[$row_till_date_pend['id']] = $countmonthesult_till_date_pend['discount_tran'];\n\n\n\t\t/////////////CALCULATING REC DATE//////////////// NEWLY ADDED\n\n\t\t$maxdate_rec=\"SELECT MAX(dateRecieved) as maxdate_rec,MAX(date) as date_rec_cam_tran FROM campus_transaction where studentID=\".$row_till_date_pend['studentID'].\" and year(dateRecieved)='\".date('Y').\"' and schedule_id=\".$row_till_date_pend['id'].\"\"; \n\t\t$maxdate_rec_result=mysql_query($maxdate_rec) or die(mysql_error());\n\t\t$maxdate_rec_result=mysql_fetch_assoc($maxdate_rec_result);\n\n\n\t\tif($row_till_date_pend['month']==date('n') && $row_till_date_pend['year']==date('Y'))\n\t\t{\n\t\t$signups_till_date_pend[$row_till_date_pend['id']]=$countresult_till_date_pend;\n\t\t}\n\t\t\n\t\t\n\t\tif($pending_till_date_pend[$unique_array_id] >=10 && ($signups_till_date_pend[$row['id']]==''))\n\t\t{\n\t\t$pending_till_date_pend[$unique_array_id]; \n\t\t}\n\t\t$unique_array_id = $unique_array_id + 1;\n\t}\n\n$current_month_pending = array_sum($pending_till_date_pend);\n\n\n\n\n//echo \"<div align='center' style='color:red; font-size:16px'>WHOLE CURRENT MONTH PENDINGS(1-30)</div>\";\n\n\n$amount_curr_till_date_pend=array();\n$recieved_curr_till_date_pend=array();\n$pending_curr_till_date_pend =array();\n$signups_curr_till_date_pend =array();\n$discount_curr_till_date_pend =array();\n\n\t$unique_array_id=1;\n\t$result_curr_till_date_pend = mysql_query($sql_curr_till_date_pend) or trigger_error(mysql_error()); \n\twhile($row_curr_till_date_pend = mysql_fetch_array($result_curr_till_date_pend)){ \n\t\n\t$countresult_curr_till_date_pend=$row_curr_till_date_pend['amount'];\n\t$amount_curr_till_date_pend[$row_curr_till_date_pend['id']]=$countresult_curr_till_date_pend;\n\n\t\t$countmonthsql_curr_till_date_pend=\"select amount as amounttran,discount_tran FROM campus_transaction where month(dateRecieved)>='\".date('n').\"' and year(dateRecieved)='\".date('Y').\"' and studentID=\".$row_curr_till_date_pend['studentID'].\" and schedule_id=\".$row_curr_till_date_pend['id'].\"\"; \n\t\t$countmonthesult_curr_till_date_pend=mysql_query($countmonthsql_curr_till_date_pend) or die(mysql_error());\n\t\t$countmonthesult_curr_till_date_pend=mysql_fetch_assoc($countmonthesult_curr_till_date_pend);\n\n\t\t$amount_curr_till_date_pend[$row_curr_till_date_pend['id']]=$countresult_curr_till_date_pend;\n\t\t$recieved_curr_till_date_pend[$row_curr_till_date_pend['id']]=$countmonthesult_curr_till_date_pend['amounttran'];\n\t\t$pending_curr_till_date_pend[$unique_array_id]=$countresult_curr_till_date_pend-$countmonthesult_curr_till_date_pend['amounttran']-$countmonthesult_curr_till_date_pend['discount_tran'];\n\t\tif($pending_curr_till_date_pend[$unique_array_id]<0 || $pending_curr_till_date_pend[$unique_array_id]<10)\n\t\t{\n\t\t$pending_curr_till_date_pend[$unique_array_id]=0;\n\t\t}\n\t\t$discount_curr_till_date_pend[$row_curr_till_date_pend['id']] = $countmonthesult_curr_till_date_pend['discount_tran'];\n\n\n\t\t/////////////CALCULATING REC DATE//////////////// NEWLY ADDED\n\n\t\t$maxdate_rec=\"SELECT MAX(dateRecieved) as maxdate_rec,MAX(date) as date_rec_cam_tran FROM campus_transaction where studentID=\".$row_curr_till_date_pend['studentID'].\" and year(dateRecieved)='\".date('Y').\"' and schedule_id=\".$row_curr_till_date_pend['id'].\"\"; \n\t\t$maxdate_rec_result=mysql_query($maxdate_rec) or die(mysql_error());\n\t\t$maxdate_rec_result=mysql_fetch_assoc($maxdate_rec_result);\n\n\n\t\tif($row_curr_till_date_pend['month']==date('n') && $row_curr_till_date_pend['year']==date('Y'))\n\t\t{\n\t\t$signups_curr_till_date_pend[$row_curr_till_date_pend['id']]=$countresult_curr_till_date_pend;\n\t\t}\n\t\t\n\t\t\n\t\tif($pending_curr_till_date_pend[$unique_array_id] >=10 && ($signups_curr_till_date_pend[$row['id']]==''))\n\t\t{\n\t\t$pending_curr_till_date_pend[$unique_array_id]; \n\t\t}\n\t\t$unique_array_id = $unique_array_id + 1;\n\t}\n\n$current_curr_month_pending = array_sum($pending_curr_till_date_pend);\n\n\t\n\t\n\t///////////////////////////////////////////////////////////// Total PENDING TILL DATE - END\t\n\t\n\t\n\t\n\t///////////////////////////////////////////////////////////// Per Day SIGNUP - START\n\t\n\t$fromDate_ccms = date('Y-m-01', strtotime($systemdate));\n\t$toDate_ccms = date('Y-m-t', strtotime($systemdate));\n\t$fromDate = strtotime($fromDate_ccms);\n\t$toDate = strtotime($toDate_ccms);\n\t$per_day_signup_DAYS = $toDate - $fromDate;\n\t//echo \"<br>\";\n\t$per_day_signup_DAYS = floor($per_day_signup_DAYS/(60*60*24));echo \"<br>\";\n\t\n\t////////////////////////////////////////////////////////////// Per Day SIGNUP - END\n\t\n\t\n\t\n\t///////////////////////////////////////////////////////////// Freeze students amount - START\n\t//'First Date = ' . date('Y-m-01') . '<br />';\n //'Last Date = ' . date('Y-m-t') . '<br />';\n\t$fromDate_ccms = date('Y-m-01', strtotime($systemdate));\n\t$toDate_ccms = date('Y-m-t', strtotime($systemdate));\n\t$sql_freeze=\" SELECT id,SUM(dues) as freeze_amount,std_status_old,std_status,`status` \n\t\t\tFROM campus_schedule \n\t\t\tWHERE std_status_old=2 AND std_status=4 AND \n\t\t\tcampus_schedule.freeze_date>='\".$fromDate_ccms.\"' and campus_schedule.freeze_date<= '\".$toDate_ccms.\"' \";\n\t$result_freeze = mysql_query($sql_freeze);\n\twhile($row_freeze=mysql_fetch_array($result_freeze))\n\t{\n\t\t$freeze_amount=$row_freeze['freeze_amount'];\n\t}\n\t////////////////////////////////////////////////////////////// Freeze students amount - END\n\t\n\t\n\t\n\t\n\t\n\t\n\t//3rd table QUERIES\t\t\t//COUNTING TODAYS Trial/Signup/Dead Reg/Freeze/Trial Dead\n\t///////////////////////////////////////////////////////////// trial day,count- START\n $systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_trial_day=\"SELECT capmus_users.id,capmus_users.firstName,capmus_users.lastName,capmus_users.LeadId,capmus_users.main_LeadId,count(campus_schedule.id) as sch_id_trial_day,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM capmus_users \n\tINNER JOIN campus_schedule \n\tON capmus_users.main_LeadId=506 \n\tand campus_schedule.dateBooked>='\".$todays_date.\"' and campus_schedule.dateBooked<='\".$todays_date.\"' \n\tand capmus_users.id=campus_schedule.teacherID and campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t$result_trial_day = mysql_query($sql_trial_day);\n\twhile($row_trial_day=mysql_fetch_array($result_trial_day))\n\t{\n\t\t$trial_day=$row_trial_day['sch_id_trial_day'];\n\t}\n\t////////////////////////////////////////////////////////////// trial day,count- END\n\t///////////////////////////////////////////////////////////// trial night,count- START\n $systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_trial_night=\"SELECT capmus_users.id,capmus_users.firstName,capmus_users.lastName,capmus_users.LeadId,capmus_users.main_LeadId,count(campus_schedule.id) as sch_id_trial_night,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM capmus_users \n\tINNER JOIN campus_schedule \n\tON capmus_users.main_LeadId!=506 and campus_schedule.agentId!=565 \n\tand campus_schedule.dateBooked>='\".$todays_date.\"' and campus_schedule.dateBooked<='\".$todays_date.\"' \n\tand capmus_users.id=campus_schedule.teacherID and campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t$result_trial_night = mysql_query($sql_trial_night);\n\twhile($row_trial_night=mysql_fetch_array($result_trial_night))\n\t{\n\t\t$trial_night=$row_trial_night['sch_id_trial_night'];\n\t}\n\t////////////////////////////////////////////////////////////// trial night,count- END\n\t///////////////////////////////////////////////////////////// trial YCC LAHORE,count- START\n $systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_trial_ycc_lhr=\"SELECT count(campus_schedule.id) as sch_id_trial_ycc_lhr,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM campus_schedule \n\tWHERE campus_schedule.agentId=565 \n\tand campus_schedule.dateBooked>='\".$todays_date.\"' and campus_schedule.dateBooked<='\".$todays_date.\"' \n\tand campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t$result_trial_ycc_lhr = mysql_query($sql_trial_ycc_lhr);\n\twhile($row_trial_ycc_lhr=mysql_fetch_array($result_trial_ycc_lhr))\n\t{\n\t\t$trial_ycc_lhr=$row_trial_ycc_lhr['sch_id_trial_ycc_lhr'];\n\t}\n\t////////////////////////////////////////////////////////////// trial YCC LAHORE,count- END\n\t\n\t\n\t///////////////////////////////////////////////////////////// signup day,count- START\n $systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_signup_day=\"SELECT capmus_users.id,capmus_users.firstName,capmus_users.lastName,capmus_users.LeadId,capmus_users.main_LeadId,count(campus_schedule.id) as sch_id_signup_day,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM capmus_users \n\tINNER JOIN campus_schedule \n\tON capmus_users.main_LeadId=506 \n\tand campus_schedule.duedate>='\".$todays_date.\"' and campus_schedule.duedate<='\".$todays_date.\"' \n\tand capmus_users.id=campus_schedule.teacherID and campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t\n\t$result_signup_day = mysql_query($sql_signup_day);\n\twhile($row_signup_day=mysql_fetch_array($result_signup_day))\n\t{\n\t\t$signup_day=$row_signup_day['sch_id_signup_day'];\n\t}\n\t////////////////////////////////////////////////////////////// signup day,count- END\n\t///////////////////////////////////////////////////////////// signup night,count- START\n $systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_signup_night=\"SELECT capmus_users.id,capmus_users.firstName,capmus_users.lastName,capmus_users.LeadId,capmus_users.main_LeadId,count(campus_schedule.id) as sch_id_signup_night,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM capmus_users \n\tINNER JOIN campus_schedule \n\tON capmus_users.main_LeadId!=506 and campus_schedule.agentId!=565 \n\tand campus_schedule.duedate>='\".$todays_date.\"' and campus_schedule.duedate<='\".$todays_date.\"' \n\tand capmus_users.id=campus_schedule.teacherID and campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t$result_signup_night = mysql_query($sql_signup_night);\n\twhile($row_signup_night=mysql_fetch_array($result_signup_night))\n\t{\n\t\t$signup_night=$row_signup_night['sch_id_signup_night'];\n\t}\n\t////////////////////////////////////////////////////////////// signup night,count- END\n\t///////////////////////////////////////////////////////////// signup YCC LAHORE,count- START\n $systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_signup_ycc_lhr=\"SELECT count(campus_schedule.id) as sch_id_signup_ycc_lhr,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM campus_schedule \n\tWHERE campus_schedule.agentId=565 \n\tand campus_schedule.duedate>='\".$todays_date.\"' and campus_schedule.duedate<='\".$todays_date.\"' \n\tand campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t$result_signup_ycc_lhr = mysql_query($sql_signup_ycc_lhr);\n\twhile($row_signup_ycc_lhr=mysql_fetch_array($result_signup_ycc_lhr))\n\t{\n\t\t$signup_ycc_lhr=$row_signup_ycc_lhr['sch_id_signup_ycc_lhr'];\n\t}\n\t////////////////////////////////////////////////////////////// signup YCC LAHORE,count- END\n\t\n\t\n\t///////////////////////////////////////////////////////////// Dead Regular day,count - START\n\t$systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_DEAD_Reg_cnt_day=\"SELECT capmus_users.id,capmus_users.firstName,capmus_users.lastName,capmus_users.LeadId,capmus_users.main_LeadId,count(campus_schedule.id) as sch_id_dead_reg_cnt_day,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM capmus_users \n\tINNER JOIN campus_schedule \n\tON capmus_users.main_LeadId=506 and campus_schedule.std_status_old=2 AND campus_schedule.std_status=3 \n\tand DATE(campus_schedule.confirm_dead_date)>='\".$todays_date.\"' and DATE(campus_schedule.confirm_dead_date)<='\".$todays_date.\"' \n\tand capmus_users.id=campus_schedule.teacherID and campus_schedule.status=1 and campus_schedule.teacherID!=0\";\n\t$result_DEAD_Reg_cnt_day = mysql_query($sql_DEAD_Reg_cnt_day);\n\twhile($row_DEAD_Reg_cnt_day=mysql_fetch_array($result_DEAD_Reg_cnt_day))\n\t{\n\t\t$DEAD_Reg_cnt_day=$row_DEAD_Reg_cnt_day['sch_id_dead_reg_cnt_day'];\n\t}\n\t////////////////////////////////////////////////////////////// Dead Regular day,count - END\n\t///////////////////////////////////////////////////////////// Dead Regular night,count - START\n\t$systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_DEAD_Reg_cnt_night=\"SELECT capmus_users.id,capmus_users.firstName,capmus_users.lastName,capmus_users.LeadId,capmus_users.main_LeadId,count(campus_schedule.id) as sch_id_dead_reg_cnt_night,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM capmus_users \n\tINNER JOIN campus_schedule \n\tON capmus_users.main_LeadId!=506 and campus_schedule.agentId!=565 \n\tand campus_schedule.std_status_old=2 AND campus_schedule.std_status=3 \n\tand DATE(campus_schedule.confirm_dead_date)>='\".$todays_date.\"' and DATE(campus_schedule.confirm_dead_date)<='\".$todays_date.\"' \n\tand capmus_users.id=campus_schedule.teacherID and campus_schedule.status=1 and campus_schedule.teacherID!=0\";\n\t$result_DEAD_Reg_cnt_night = mysql_query($sql_DEAD_Reg_cnt_night);\n\twhile($row_DEAD_Reg_cnt_night=mysql_fetch_array($result_DEAD_Reg_cnt_night))\n\t{\n\t\t$DEAD_Reg_cnt_night=$row_DEAD_Reg_cnt_night['sch_id_dead_reg_cnt_night'];\n\t}\n\t////////////////////////////////////////////////////////////// Dead Regular night,count - END\n\t///////////////////////////////////////////////////////////// Dead Regular ycc lahore,count - START\n\t$systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_DEAD_Reg_cnt_ycc_lhr=\"SELECT count(campus_schedule.id) as sch_id_DEAD_Reg_cnt_ycc_lhr,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM campus_schedule \n\tWHERE campus_schedule.agentId=565 \n\tand campus_schedule.std_status_old=2 AND campus_schedule.std_status=3 \n\tand DATE(campus_schedule.confirm_dead_date)>='\".$todays_date.\"' and DATE(campus_schedule.confirm_dead_date)<='\".$todays_date.\"' \n\tand campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t$result_DEAD_Reg_cnt_ycc_lhr = mysql_query($sql_DEAD_Reg_cnt_ycc_lhr);\n\twhile($row_DEAD_Reg_cnt_ycc_lhr=mysql_fetch_array($result_DEAD_Reg_cnt_ycc_lhr))\n\t{\n\t\t$DEAD_Reg_cnt_ycc_lhr=$row_DEAD_Reg_cnt_ycc_lhr['sch_id_DEAD_Reg_cnt_ycc_lhr'];\n\t}\n\t////////////////////////////////////////////////////////////// Dead Regular ycc lahore,count - END\n\t\n\t\n\t///////////////////////////////////////////////////////////// FREEZE day,count- START\n $systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_freeze_day=\"SELECT capmus_users.id,capmus_users.firstName,capmus_users.lastName,capmus_users.LeadId,capmus_users.main_LeadId,count(campus_schedule.id) as sch_id_freeze_day,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM capmus_users \n\tINNER JOIN campus_schedule \n\tON capmus_users.main_LeadId=506 \n\tand campus_schedule.freeze_date>='\".$todays_date.\"' and campus_schedule.freeze_date<='\".$todays_date.\"' \n\tand capmus_users.id=campus_schedule.teacherID and campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t$result_freeze_day = mysql_query($sql_freeze_day);\n\twhile($row_freeze_day=mysql_fetch_array($result_freeze_day))\n\t{\n\t\t$freeze_day=$row_freeze_day['sch_id_freeze_day'];\n\t}\n\t////////////////////////////////////////////////////////////// FREEZE day,count- END\n\t///////////////////////////////////////////////////////////// FREEZE night,count- START\n $systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_freeze_night=\"SELECT capmus_users.id,capmus_users.firstName,capmus_users.lastName,capmus_users.LeadId,capmus_users.main_LeadId,count(campus_schedule.id) as sch_id_freeze_night,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM capmus_users \n\tINNER JOIN campus_schedule \n\tON capmus_users.main_LeadId!=506 and campus_schedule.agentId!=565 \n\tand campus_schedule.freeze_date>='\".$todays_date.\"' and campus_schedule.freeze_date<='\".$todays_date.\"' \n\tand capmus_users.id=campus_schedule.teacherID and campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t$result_freeze_night = mysql_query($sql_freeze_night);\n\twhile($row_freeze_night=mysql_fetch_array($result_freeze_night))\n\t{\n\t\t$freeze_night=$row_freeze_night['sch_id_freeze_night'];\n\t}\n\t////////////////////////////////////////////////////////////// FREEZE night,count- END\n\t///////////////////////////////////////////////////////////// FREEZE YCC LAHORE,count- START\n $systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_freeze_ycc_lhr=\"SELECT count(campus_schedule.id) as sch_id_freeze_ycc_lhr,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM campus_schedule \n\tWHERE campus_schedule.agentId=565 \n\tand campus_schedule.freeze_date>='\".$todays_date.\"' and campus_schedule.freeze_date<='\".$todays_date.\"' \n\tand campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t$result_freeze_ycc_lhr = mysql_query($sql_freeze_ycc_lhr);\n\twhile($row_freeze_ycc_lhr=mysql_fetch_array($result_freeze_ycc_lhr))\n\t{\n\t\t$freeze_ycc_lhr=$row_freeze_ycc_lhr['sch_id_freeze_ycc_lhr'];\n\t}\n\t////////////////////////////////////////////////////////////// FREEZE YCC LAHORE,count- END\n\t\n\t\n\t///////////////////////////////////////////////////////////// Dead Trial day,count - START\n\t$systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_DEAD_Trl_cnt_day=\"SELECT capmus_users.id,capmus_users.firstName,capmus_users.lastName,capmus_users.LeadId,capmus_users.main_LeadId,count(campus_schedule.id) as sch_id_dead_trl_cnt_day,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM capmus_users \n\tINNER JOIN campus_schedule \n\tON capmus_users.main_LeadId=506 and campus_schedule.std_status_old=1 AND campus_schedule.std_status=3 \n\tand DATE(campus_schedule.confirm_dead_date)>='\".$todays_date.\"' and DATE(campus_schedule.confirm_dead_date)<='\".$todays_date.\"' \n\tand capmus_users.id=campus_schedule.teacherID and campus_schedule.status=1 and campus_schedule.teacherID!=0\";\n\t$result_DEAD_Trl_cnt_day = mysql_query($sql_DEAD_Trl_cnt_day);\n\twhile($row_DEAD_Trl_cnt_day=mysql_fetch_array($result_DEAD_Trl_cnt_day))\n\t{\n\t\t$DEAD_Trl_cnt_day=$row_DEAD_Trl_cnt_day['sch_id_dead_trl_cnt_day'];\n\t}\n\t////////////////////////////////////////////////////////////// Dead Trial day,count - END\n\t///////////////////////////////////////////////////////////// Dead Trial night,count - START\n\t$systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_DEAD_Trl_cnt_night=\"SELECT capmus_users.id,capmus_users.firstName,capmus_users.lastName,capmus_users.LeadId,capmus_users.main_LeadId,count(campus_schedule.id) as sch_id_dead_trl_cnt_night,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM capmus_users \n\tINNER JOIN campus_schedule \n\tON capmus_users.main_LeadId!=506 and campus_schedule.agentId!=565 \n\tand campus_schedule.std_status_old=1 AND campus_schedule.std_status=3 \n\tand DATE(campus_schedule.confirm_dead_date)>='\".$todays_date.\"' and DATE(campus_schedule.confirm_dead_date)<='\".$todays_date.\"' \n\tand capmus_users.id=campus_schedule.teacherID and campus_schedule.status=1 and campus_schedule.teacherID!=0\";\n\t$result_DEAD_Trl_cnt_night = mysql_query($sql_DEAD_Trl_cnt_night);\n\twhile($row_DEAD_Trl_cnt_night=mysql_fetch_array($result_DEAD_Trl_cnt_night))\n\t{\n\t\t$DEAD_Trl_cnt_night=$row_DEAD_Trl_cnt_night['sch_id_dead_trl_cnt_night'];\n\t}\n\t////////////////////////////////////////////////////////////// Dead Trial night,count - END\n\t///////////////////////////////////////////////////////////// Dead Trial ycc lahore,count - START\n\t$systemdate = systemDate();\n\t$todays_date = $systemdate;\t\n\t$sql_DEAD_Trl_cnt_ycc_lhr=\"SELECT count(campus_schedule.id) as sch_id_DEAD_Trl_cnt_ycc_lhr,campus_schedule.dead_date,campus_schedule.std_status_old,campus_schedule.std_status,campus_schedule.studentID,campus_schedule.status,campus_schedule.dues,campus_schedule.dateBooked,campus_schedule.duedate,campus_schedule.comments_dead,campus_schedule.courseID,campus_schedule.teacherID,campus_schedule.teacherID_old,campus_schedule.confirm_dead_date,campus_schedule.freeze_date,campus_schedule.comments,campus_schedule.dead_reason,campus_schedule.comments_freeze \n\tFROM campus_schedule \n\tWHERE campus_schedule.agentId=565 \n\tand campus_schedule.std_status_old=1 AND campus_schedule.std_status=3 \n\tand DATE(campus_schedule.confirm_dead_date)>='\".$todays_date.\"' and DATE(campus_schedule.confirm_dead_date)<='\".$todays_date.\"' \n\tand campus_schedule.status=1 and campus_schedule.teacherID!=0\"; \n\t$result_DEAD_Trl_cnt_ycc_lhr = mysql_query($sql_DEAD_Trl_cnt_ycc_lhr);\n\twhile($row_DEAD_Trl_cnt_ycc_lhr=mysql_fetch_array($result_DEAD_Trl_cnt_ycc_lhr))\n\t{\n\t\t$DEAD_Trl_cnt_ycc_lhr=$row_DEAD_Trl_cnt_ycc_lhr['sch_id_DEAD_Trl_cnt_ycc_lhr'];\n\t}\n\t////////////////////////////////////////////////////////////// Dead Trial ycc lahore,count - END\n\n\t\n\t///////////////////////////////////////////////////////////// Dead Amount - START\n\t$systemdate = systemDate();\n\t$todays_date = $systemdate;\n\t$sql_DEAD_Amt=\" SELECT id,SUM(dues) as DEAD_Amt,std_status_old,std_status,`status` \n\t\t\tFROM campus_schedule \n\t\t\tWHERE std_status_old=2 AND std_status=3 AND \n\t\t\tDATE(campus_schedule.confirm_dead_date)>='\".$todays_date.\"' and DATE(campus_schedule.confirm_dead_date)<= '\".$todays_date.\"' \";\n\t$result_DEAD_Amt = mysql_query($sql_DEAD_Amt);\n\twhile($row_DEAD_Amt=mysql_fetch_array($result_DEAD_Amt))\n\t{\n\t\t$DEAD_Amt=$row_DEAD_Amt['DEAD_Amt'];\n\t}\n\t////////////////////////////////////////////////////////////// Dead Amount - END\n\t///////////////////////////////////////////////////////////// Signup Amount - START\n\t//std_status_old=1 AND std_status=2\n\t//Cannot check on above condition AS\n\t//old status as 1(Trial) and cirrent status as 2(Regular) BECASUE\n\t//What if that same signup GOT DEAD THE SAME DAY\n\t$systemdate = systemDate();\n\t$todays_date = $systemdate;\n\t$sql_Signup_Amt=\" SELECT id,SUM(dues) as Signup_Amt,std_status_old,std_status,`status` \n\t\t\tFROM campus_schedule \n\t\t\tWHERE \n\t\t\tcampus_schedule.duedate>='\".$todays_date.\"' and campus_schedule.duedate<= '\".$todays_date.\"' \";\n\t$result_Signup_Amt = mysql_query($sql_Signup_Amt);\n\twhile($row_Signup_Amt=mysql_fetch_array($result_Signup_Amt))\n\t{\n\t\t$Signup_Amt=$row_Signup_Amt['Signup_Amt'];\n\t}\n\t////////////////////////////////////////////////////////////// Signup Amount - END\n\t/////////////////////////////////////////////// TODAY's Recurr Received amount - START\n\t$todays_date = $systemdate;\n\t$amount_today=array();\n\t$recieved_today=array();\n\t$recieved_with_tran_id_today=array();\n\t$signups_today =array();\n\t\n\t$sql_today_Recurr_Rec=\" SELECT campus_schedule.id,campus_schedule.duedate as due_date,\n\tday(campus_schedule.duedate) AS dayz,month(campus_schedule.duedate) AS month,\n\tcampus_schedule.dues as amount,campus_schedule.studentID,campus_schedule.courseID,campus_schedule.classType,campus_schedule.`status`,\n\tcampus_schedule.std_status,campus_schedule.std_status_old,campus_schedule.startTime,\n\tcampus_schedule.agentId,\n\tcampus_transaction.id as tran_id,campus_transaction.transactionID,campus_transaction.date as date_rec_cam_tran,campus_transaction.studentID,\n\tcampus_transaction.amount as amounttran,campus_transaction.operator as tran_op,campus_transaction.courseID as tran_cid,campus_transaction.classType as tran_ctid,\n\tcampus_transaction.dateRecieved as maxdate_rec,campus_transaction.startTime,campus_transaction.schedule_id,campus_transaction.comments,campus_transaction.teacherID,\n\tcampus_transaction.method,campus_transaction.method_array,campus_transaction.LeadId,campus_transaction.main_LeadId,\n\tcampus_transaction.sender_name,campus_transaction.email, \n\tcampus_transaction.currency_array,campus_transaction.amount_gbp as amounttran_gbp, \n\tcampus_transaction.amount_original as amounttran_original \n\tFROM campus_schedule \n\tINNER JOIN campus_transaction \n\tON campus_schedule.studentID=campus_transaction.studentID and campus_schedule.id=campus_transaction.schedule_id \n\tand campus_schedule.`status` =1 and \n\tcampus_transaction.date BETWEEN '\".$todays_date.\"' AND '\".$todays_date.\"' and campus_transaction.date!='' \";\n\t\n\t$result_today_Recurr_Rec = mysql_query($sql_today_Recurr_Rec) or trigger_error(mysql_error());\n\twhile($row_today_Recurr_Rec=mysql_fetch_array($result_today_Recurr_Rec))\n\t{\n\t\t$signup_check=1;\n\t\t$countresult_today=$row_today_Recurr_Rec['amount'];\n\t\t$countmonthsql_today=\"select amount as amounttran_not_main,date,dateRecieved,operator,id FROM campus_transaction where date BETWEEN '\".$todays_date.\"' AND '\".$todays_date.\"' and studentID=\".$row_today_Recurr_Rec['studentID'].\" and schedule_id=\".$row_today_Recurr_Rec['id'].\" and id=\".$row_today_Recurr_Rec['tran_id'].\" \"; \n\t\t$countmonthesult_today=mysql_query($countmonthsql_today);\n\t\t$countmonthesult_today=mysql_fetch_assoc($countmonthesult_today);\n\t\t$amount[$row_today_Recurr_Rec['id']]=$countresult_today;\n\t\t//DUE DATE(Signup DATE) - Month and Year\n\t\t$duedate_month = date('m', strtotime(nl2br($row_today_Recurr_Rec['due_date'])));\n\t\t$duedate_year = date('Y', strtotime(nl2br($row_today_Recurr_Rec['due_date'])));\n\t\t\n\t\t//DUE DATE(Signup DATE) - Month and Year\n\t\t$dateRec_month = date('m', strtotime(nl2br($countmonthesult_today['dateRecieved'])));\n\t\t$dateRec_year = date('Y', strtotime(nl2br($countmonthesult_today['dateRecieved'])));\n\t\tif(($row_today_Recurr_Rec['due_date']>=$todays_date && $row_today_Recurr_Rec['due_date']<=$todays_date) && $row_today_Recurr_Rec['due_date']==$countmonthesult_today['date']/*(Got required result by this-[date=due_date(receive date=signup date)])*/ && !empty($countresult_today) && ($duedate_month==$dateRec_month && $duedate_year==$dateRec_year))\n\t\t{\n\t\t\t$signups_today[$row_today_Recurr_Rec['id']]=$row_today_Recurr_Rec['amount'];\n\t\t\t$signup_check=0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//$signup_check==1;\n\t\t}\n\n\t\tif(!empty($countresult_today) && ($countmonthesult_today['date']>=$todays_date && $countmonthesult['date']<=$todays_date) && $signup_check==1)\n\t\t{\n\t\t\t$recieved_today[$row_today_Recurr_Rec['tran_id']]=$row_today_Recurr_Rec['amounttran'];\n\t\t\t$recieved_with_tran_id_today[$row_today_Recurr_Rec['tran_id']]=$row_today_Recurr_Rec['amounttran'];\n\t\t}\n\t\t\n\t\t\n\t}\n\t$recurr_today = nl2br( array_sum($recieved_today));\n\t$SU_today = nl2br( array_sum($signups_today)); \n\n\n\t//////////////////////////////////////////////// TODAY's Recurr Received amount - END\n\t\n\t\n\t\n\t//1st table for the BUSINESS SHEET start - \n\t$paying_amount_variable = array_sum($paying_amount);\n\t///////////////////////////////////// PAYING AMOUNT, result - end\n\t\n\t///////////////////////////////////// Dead Regular student, result - start\n\t$DEAD_Reg;\n\t(($DEAD_Reg / $paying_amount_variable)*100) ;\n\t\n\t///////////////////////////////////// Dead Regular student, result - end\n\t\n\t///////////////////////////////////// Total Recurr Received amount of Current Month, result - start\n\t$recurr;\n\t$SU_rwp = ceil($SU_rwp);\n\t//Total SU minus Total Dead, GREEN/RED\n\t$total_SU_minus_total_DEAD = $SU_rwp - $DEAD_Reg;\n\tif($total_SU_minus_total_DEAD<0)\n\t$SU_lhr = ceil($SU_lhr);\n\t///////////////////////////////////// Total Recurr Received amount of Current Month, result - end\n\t\n\t///////////////////////////////////// Total income in this month, result - start\n\t$total_income_in_this_month_overall = ceil($total_income_in_this_month_overall);\n\t///////////////////////////////////// Total income in this month, result - end\n\t\n\t///////////////////////////////////// Total pending till date, result - start\n\t$pre_month_pending .\"(PRE) + \". $current_month_pending .\"(1st - to date)\";\n\t$current_curr_month_pending.\"(1st - 30th)\";\n\t///////////////////////////////////// Total pending till date, result - end\n\t\n\t\n\t\n\t//2nd Table - FOr overall calculations - \n\t//a) Total Recurr b) Advance c) Zero paid d) freeze amt e) Dead regular amt\n\t///////////////////////////////////// Total DEAD REGULAR - PERCENTAGE %, result - start\n$total_recurr_curr_month = ($paying_amount_variable - ($SU_rwp+$SU_lhr));\n\n$advance = $total_recurr_curr_month - $current_curr_month_pending;\n\n$zero_paid = $recurr_with_zero;\n\n$recurr = $recurr;\n\n$receivable = $current_curr_month_pending;\n\n$freeze_amount = $freeze_amount;\n\n$DEAD_Reg = $DEAD_Reg;\n\techo \"\\nPLEASE WAIT 6 SECONDS MORE\\n\";\n\tsleep(1);\n\tsleep(1);\n\tsleep(1);\n\tsleep(1);\n\tsleep(1);\n\tsleep(1);\n\t\n\t///////////////////////////////////// Total pending till date, result - end\n\nif($curr_datetime==$systemdatetime)\n{\n/*fwrite(STDOUT, \"Enter username:\\n\");\n$name = fgets(STDIN);\nfwrite(STDOUT, \"Enter password:\\n\");\necho $pass = fgets(STDIN);*/\n/*if($name==\"Junaid\")\n{\n\techo \"1st Condition Successful\";\n}\nelse\n{\n\techo \"1st Condition Failed\";\n\texit(0);\n}*/\necho \"1st Condition Successful\\n\";\nsleep(1);\nsleep(1);\nsleep(1);\nsleep(1);\n\n\t\n$total_recurr=$total_recurr_curr_month;\n$advance=$advance;\n$zero_paid = $zero_paid;\n$recurr = $recurr;\n$receivable = $receivable;\n$freeze_amount = $freeze_amount;\n$DEAD_Reg = $DEAD_Reg;\n$pre_month_pending = $pre_month_pending;\n\n//Adding Hours in DATE TIME format using strtotime\necho \"\\nCCMS DATETIME\\n\";\necho $systemdatetime = systemDateTime();\n$systemdatetime = strtotime($systemdatetime) + 18000; // Add 5 hour\n$systemdatetime = date('Y-m-d H:i:s', $systemdatetime); // Back to string\necho $systemdatetime;\necho \"\\nCURRENT DATETIME\\n\";\necho $curr_datetime = date('Y-m-d H:i:s');\n$curr_datetime = strtotime($curr_datetime) + 18000; // Add 5 hour\n$curr_datetime = date('Y-m-d H:i:s', $curr_datetime); // Back to string\necho $curr_datetime;\necho \"\\n\";\n\n//echo $systemdate = systemDate();\n\n//http://www.webeditorsnotes.com/2012/04/six-steps-to-make-wamp-run-automatically-on-system-start-up-2/\n\t$sql = \"INSERT INTO `campus_business` (`total_recurr`, `advance` , `zero_paid` , `recurr_received` , `receivable` , `freeze` , `dead_regular`, `pre_month_pending` ,`operator` , `ccms_datetime` , `curr_datetime` ) VALUES( '$total_recurr','$advance' , '$zero_paid' , '$recurr' , '$receivable' , '$freeze_amount' , '$DEAD_Reg' , '$pre_month_pending' , '159' , '\".$systemdatetime.\"' , '\".$curr_datetime.\"' ) \"; \n\tmysql_query($sql) or die(mysql_error()); \n\treturn 1;\n}\t\n//}\nreturn 0;\n}", "public function calcSum()\n {\n return array_sum($this->outcome);\n }" ]
[ "0.59210795", "0.5631738", "0.54314625", "0.5370547", "0.53203785", "0.5252028", "0.5246895", "0.51990646", "0.5179281", "0.51682806", "0.5148162", "0.51198655", "0.51024574", "0.50549257", "0.5054512", "0.50438213", "0.50394696", "0.50085163", "0.50022733", "0.4994824", "0.4975887", "0.49661183", "0.4949864", "0.49444205", "0.48973942", "0.48972324", "0.48943698", "0.48919672", "0.48911375", "0.48857585" ]
0.60829884
0
Calculate the net amount of a given bill This deducts from user's gross amount the total amount of deductions.
private function calculateNetAmount(float $gross_amount, float $deduction): float { return $gross_amount - $deduction; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function calculateNet()\n {\n if (isset($this->vatRate[$this->country])) {\n $this->net = round($this->gross / (1 + $this->vatRate[$this->country]), 2);\n $this->vat = $this->gross - $this->net;\n } else {\n $this->vat = 0;\n $this->net = $this->gross;\n }\n }", "function calc_money($net_price,$total,$reduce_balance,$reduce_amount,$service_rate,$tax_rate)\n {\n $total_after = 0;\n //gia phong chua bao gom tax and charge\n if($net_price==0)\n {\n $total_after = $total * (1-$reduce_balance/100);\n $total_after = $total_after - $reduce_amount;\n $total_after = $total_after * (1+$service_rate/100);\n $total_after = $total_after * (1+$tax_rate/100);\n }\n else//da bao gom tax va charge => chia nguoc lai, tru tiep giam gia, roi nhan lai tax va rate\n {\n $total_after = $total / (1+$tax_rate/100);\n $total_after = $total_after / (1+$service_rate/100);\n $total_after = $total_after * (1-$reduce_balance/100);\n $total_after = $total_after - $reduce_amount;\n $total_after = $total_after * (1+$service_rate/100);\n $total_after = $total_after * (1+$tax_rate/100);\n }\n return $total_after;\n }", "private function calculateGrossAmount(Bill $bill): float\n {\n $mission = $bill->application->mission;\n $role = $bill->application->user->roleAt($mission->created_at) ?: Role::findByName(Role::STUDENT);\n\n return $role->isSuperiorOrEquivalentTo(Role::STAFF)\n ? $bill->amount * $bill->rate->for_staff\n : $bill->amount * $bill->rate->for_student;\n }", "public function getnetProfit()\n\t{\n\t\t$query = $this->db->select('sum(order_total) as total_purchase')\n\t\t->get('transaction_details');\n\n\t\t$result = $query->row_array();\n\n\t\t$TotalExpenses = $this->admin->getTotalExpenses();\n\n\t\t$net_profit = $result['total_purchase']-$TotalExpenses;\n\n\t\tif (!empty($net_profit))\n\t\t{\n\t\t\treturn $net_profit;\n\t\t}else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getNet_amount()\n {\n return $this->net_amount;\n }", "public function getTotalNet() :string {\n\t\treturn \\bcsub(\n\t\t\t$this->bcAddMultiple( array_merge(\n\t\t\t\t\\array_map( fn( $VO ) => $VO->amount_net, $this->charges ),\n\t\t\t\t\\array_map( fn( $VO ) => $VO->amount_net, $this->refunds ),\n\t\t\t\t\\array_map( fn( $VO ) => $VO->amount_net, $this->adjustments ),\n\t\t\t) ),\n\t\t\t$this->bcAddMultiple( array_map( fn( $VO ) => $VO->amount, $this->gateway_fees ) ),\n\t\t\t2\n\t\t);\n\t}", "public function getNetTotal($user_id = null)\n\t{\n\t\t$subtotal = 0;\n\t\tforeach ($this->getCartitems($user_id) as $cartitem) {\n\t\t\t$subtotal += $cartitem->getNetTotal();\n\t\t}\n\n\t\treturn $subtotal;\n\t}", "private function calculateFinalAmount(float $net_amount, float $subscription_fee): float\n {\n return $net_amount - $subscription_fee;\n }", "public function getNetAmount()\n {\n return $this->net_amount;\n }", "public function getNetTotal(): float\n {\n $value = $this->lineItems->reduce(static function (float $value, LineItem $item): float {\n return $value + $item->getNetTotal();\n }, -$this->discount);\n\n return round($value < 0 ? 0 : $value, 2);\n }", "public function getNetBalance(){\r\n\t\t$summary = new Summary();\r\n\t\treturn $summary->getNetBalance();\r\n\t}", "public function getDecoctionAmt();", "public function obtenerTotalNeto()\n {\n $totalneto = (int) self::obtenerTotalFijo() + self::obtenerTotalDinamico();\n return $totalneto;\n }", "function computeAmount( $basket) \n\t{\n\n\t\t$current_edition = getOneAssocArray( 'select * from global_editions where edition_id = \"'.$GLOBALS['appshore_data']['my_company']['edition_id'].'\"' );\n\t\t$new_edition = getOneAssocArray( 'select * from global_editions where edition_id = \"'.$basket['edition_id'].'\"' );\n\n\t\t$amount = 0;\n\t\t\n\t\t// we calculate the prorata update within the current period for the new users\n\t\tif( $new_edition['users_quota'] > $current_edition['users_quota'] )\n\t\t{\n\t\t\t$amount = $new_edition['price']-$current_edition['price'];\n\t\t\t$now = strtotime(\"now\");\n\t\t\t$due = strtotime($GLOBALS['appshore_data']['my_company']['due_date']);\n\t\t\tif( $due > $now )\n\t\t\t\t$amount *= ((($due-$now)/(3600*24))/30/$new_edition['period']);\n\t\t\telse\n\t\t\t\t$amount = 0;\n\t\t}\n\n\t\t// add the amount for the new period\n\t\tif( $new_edition['period'] != 0 )\n\t\t\t$amount += $new_edition['price'];\t\n\t\t\n\t\treturn round($amount);\n\t}", "public function netTotal(): float;", "public function getExternalTotalGross();", "public function getTotal(){\n\t\t$additionalFees = $this->additionalFees;\n\t\t$totalFee = 0;\n\t\tforeach($additionalFees as $fee){\n\t\t\tif($fee['CONSTRAINTS']['part'] !== false){\n\t\t\t\t$totalFee += $fee['VALUE'];\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t$garmentTotal = $this->garmentTotal;\n\t\treturn $garmentTotal + $totalFee + $this->SET_UP_FEE + ($this->printJob == null ? 0 : $this->printJob->COST);\t\t\n\t}", "public function userShippingDiscountTotal()\r\n {\r\n $discount = 0;\r\n \r\n foreach ($this->coupons as $coupon)\r\n {\r\n if (\\Shop\\Models\\Coupons::givesShippingDiscount( $coupon )) \r\n {\r\n $discount = $discount + $coupon['amount'];\r\n } \r\n }\r\n \r\n return (float) $discount;\r\n }", "function calculate_bill($units) {\r\n $unit_cost_first = 3.00;\r\n $unit_cost_second = 4.00;\r\n $unit_cost_third = 5.00;\r\n $unit_cost_fourth = 6.00;\r\n\r\n if($units < 100) {\r\n $bill = $units * $unit_cost_first;\r\n }\r\n else if($units >= 100 && $units <= 200) {\r\n $bill = $units * $unit_cost_second;\r\n }\r\n else if($units >= 200 && $units <= 300) {\r\n \r\n\t $bill = $units * $unit_cost_third;\r\n }\r\n else {\r\n $bill = $units * $unit_cost_fourth;\r\n }\r\n return number_format((float)$bill, 2, '.', '');\r\n}", "public function userDiscountTotal($exclude_shipping=false)\r\n {\r\n $totalDiscount = 0;\r\n \r\n foreach ($this->coupons as $coupon)\r\n {\r\n if ($exclude_shipping && \\Shop\\Models\\Coupons::givesShippingDiscount( $coupon )) \r\n {\r\n continue; \t\r\n }\r\n $totalDiscount = $totalDiscount + $coupon['amount'];\r\n }\r\n \r\n if(!empty($this->discounts)) {\r\n \tforeach ($this->discounts as $discount)\r\n \t{\r\n \t\t$totalDiscount = $totalDiscount + $discount['amount'];\r\n \t}\r\n }\r\n \r\n \r\n return (float) $totalDiscount;\r\n }", "public function testCalcPaymentCostInNetto()\n {\n modConfig::getInstance()->setConfigParam( 'blPaymentVatOnTop', true );\n\n // deleting discounts\n foreach ( $this->aDiscounts as $oDiscount ) {\n $oDiscount->delete();\n }\n\n // choosing first payment which is active and has costs\n $oBasket = new oxbasket();\n $oBasket->addToBasket( $this->oArticle->getId(), 2 );\n $oBasket->addToBasket( $this->oVariant->getId(), 3 );\n $oBasket->calculateBasket( false );\n $oBasket->setPayment( 'oxidcashondel' );\n\n $oPayCost = $oBasket->UNITcalcPaymentCost( false, false );\n\n $this->assertEquals( 8.93, $oPayCost->getBruttoPrice() );\n $this->assertEquals( 7.5, $oPayCost->getNettoPrice() );\n $this->assertEquals( 19, $oPayCost->getVat() );\n }", "public function amount(){\n switch ($this->status){\n\n case 'pendent'; case 'payed' : return $this->amount;\n case 'parcial'; case 'overdue' : return (\n $this->amount - $this->sumOfPayments()\n );\n\n }\n }", "function updateTotalAmount($bill)\r\n{\r\n $account = getFinanceAccount($bill->owner_id,2);\r\n\t$account->total_amount = $account->total_amount + $bill->amount - $bill->commission_fee;\r\n\t$account->total_price_amount += $bill->item_price * $bill->number - $bill->commission_fee;\r\n\t$account->save();\r\n\treturn $account;\r\n}", "public function test_net_total()\n\t{\n\t\t$basket = new Model_Basket;\n\n\t\t$item = $this->get_item();\n\t\t$basket->add_item($item, 6);\n\n\t\t$this->assertSame($basket->net_total(), 29.94);\n\t}", "public function getSubtotal($user_id = null)\n\t{\n\t\t$net_total = 0;\n\t\tforeach ($this->getCartitems($user_id) as $cartitem) {\n\t\t\t$net_total += $cartitem->getNetTotal();\n\t\t}\n\n\t\t// plus fees\n\t\t$net_total += $this->_fee;\n\n\t\treturn $net_total;\n\t}", "public function getTotalNet()\n {\n return $this->TotalNet;\n }", "public function calculate_total_amount()\n {\n $this->interest= ($this->principal*$this->interest_rate)/100;\n $this->total_interest = $this->year*$this->interest;\n $this->total_amount=$this->total_interest+$this->principal;\n //return $total_amount;\n }", "public function getBalance(): float\n {\n $value = Transaction::where('user_id', $this->user->getId())->sum('value');\n return number_format($value, 2);\n }", "function USDbill ($subtotal , $tax , $shoseDiscount , $jacketDiscount , $total)\r\n{\r\n\t//subtotal \r\n\t\techo \"Subtotal : $\".$subtotal;\r\n\t\techo \"<br>\";\r\n\t//taxes\r\n\t\techo \"Taxes : $\".$tax;\r\n\t\techo \"<br>\";\r\n\t//Discounts\r\n\tif ($shoseDiscount > 0 || $jacketDiscount > 0)\r\n\t{\r\n\t\techo \"Discounts:\";\r\n\t\techo \"<br>\";\r\n\t\tif ($shoseDiscount > 0)\r\n\t\t{\t \r\n\t\t\techo \"\t&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 10% off shoes: -$\".$shoseDiscount;\r\n\t\t\techo \"<br>\";\r\n\t\t}\r\n\t\tif ($jacketDiscount > 0)\r\n\t\t{\r\n\t\t\techo \"\t&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp \t50% off jacket: -$\".$jacketDiscount;\r\n\t\t\techo \"<br>\";\r\n\t\t}\r\n\t}\r\n\r\n\t// Total\r\n\t\techo \"Total: $\".$total;\r\n\t\techo \"<br>\";\r\n\r\n}", "public function getTotalAmount();" ]
[ "0.70139223", "0.6734413", "0.66992205", "0.65243423", "0.64649665", "0.63768893", "0.6370776", "0.63576514", "0.6325833", "0.6265608", "0.62079084", "0.6112669", "0.6106761", "0.61016786", "0.6064674", "0.6062679", "0.59619904", "0.5957038", "0.5932511", "0.5929018", "0.5916235", "0.5891553", "0.58741635", "0.5870042", "0.58677167", "0.58498055", "0.5842328", "0.5831192", "0.5831081", "0.58280236" ]
0.7172082
0
Calculate the final amount to be paid to the user This deducts from user's net salary the eventual subscription fee.
private function calculateFinalAmount(float $net_amount, float $subscription_fee): float { return $net_amount - $subscription_fee; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function calculate_total_amount()\n {\n $this->interest= ($this->principal*$this->interest_rate)/100;\n $this->total_interest = $this->year*$this->interest;\n $this->total_amount=$this->total_interest+$this->principal;\n //return $total_amount;\n }", "public function calculate_total_paid(){\r\n $this->total_paid = 0;\r\n foreach($this->payments as $payment){\r\n $this->total_paid += $payment->getAmount();\r\n }\r\n return $this->total_paid;\r\n }", "public function update_user_coins_final_balance($user_id,$final_gift_coins){\n\t\t\n\t\t $sql_123=\"update users set gift_coins=gift_coins+'$final_gift_coins' where id='$user_id'\";\n\t\t\t\t\tmysqli_query($this->_con, $sql_123);\n\t\t\t\t\t\n\t\t\n\t}", "protected function calcPayableProfit(){\n return round($this->getPayableWage() * $this->payableWageRate, 2);\n }", "public function getTotal(){\n\t\t$additionalFees = $this->additionalFees;\n\t\t$totalFee = 0;\n\t\tforeach($additionalFees as $fee){\n\t\t\tif($fee['CONSTRAINTS']['part'] !== false){\n\t\t\t\t$totalFee += $fee['VALUE'];\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t$garmentTotal = $this->garmentTotal;\n\t\treturn $garmentTotal + $totalFee + $this->SET_UP_FEE + ($this->printJob == null ? 0 : $this->printJob->COST);\t\t\n\t}", "public function salaryToDecrease()\n {\n // salary given\n $salary_given = EmployeeTransaction::all()\n ->sum('nominal');\n // end salary given\n\n //company outcome employee bonus\n $company_bonus = EmployeeBonus::where('status', 'SUDAH DIAMBIL')\n ->get()\n ->sum('bonus');\n //end company employee bonus\n \n $salary_outcome = $salary_given + $company_bonus;\n\n return $salary_outcome;\n }", "public function totalEarned() {\n $total = 0;\n\n foreach ($this->all() as $record)\n if ($record->transactionType == 'Return' || $record->transactionType == 'Sale')\n $total += $record->amount;\n\n return $total;\n }", "public function calculate_final_grade()\n {\n //Formal Assesmnets and Unit Awards\n }", "public function totalValue()\n {\n $orders = $this->user->orders;\n\n $sum = 0;\n foreach ($orders as $order) {\n $sum += $order->total_price;\n }\n\n return $sum;\n }", "protected function LiveSubTotal()\n {\n if ($this->hasDonation()) {\n $order = $this->Order();\n return $order->SubTotal();\n } else {\n return 0;\n }\n }", "public function getPaidTotal(): float\n {\n return $this->paidTotal;\n }", "public function getAmountPaid();", "public function userShippingDiscountTotal()\r\n {\r\n $discount = 0;\r\n \r\n foreach ($this->coupons as $coupon)\r\n {\r\n if (\\Shop\\Models\\Coupons::givesShippingDiscount( $coupon )) \r\n {\r\n $discount = $discount + $coupon['amount'];\r\n } \r\n }\r\n \r\n return (float) $discount;\r\n }", "public function discountTotal()\r\n {\r\n $discount = 0;\r\n \r\n $discount = $this->userDiscountTotal();\r\n \r\n $discount = $discount + $this->autoDiscountTotal();\r\n \r\n return (float) $discount;\r\n }", "public function getFee()\n {\n $count_this_week = Aggregator::getCount($this->user_id, $this->operation);\n $amount_this_week = Aggregator::getAmount($this->user_id, $this->operation);\n\n $max_free_count_week =\n static::$fee_rules[$this->user_type][$this->operation]['max_free_count_week'] ?? 0;\n $max_free_amount_week =\n static::$fee_rules[$this->user_type][$this->operation]['max_free_amount_week'] ?? 0;\n\n if ($count_this_week > $max_free_count_week) {\n $fee_rate = static::$fee_rules[$this->user_type][$this->operation]['standard_percent'];\n $fee_amount = Converter::convert($this->amount, $this->currency, 'EUR');\n } else {\n if ($amount_this_week < $max_free_amount_week) {\n $fee_rate = 0;\n $fee_amount = 0;\n } else {\n $fee_rate = static::$fee_rules[$this->user_type][$this->operation]['standard_percent'];\n $fee_amount = min(\n $amount_this_week - $max_free_amount_week,\n Converter::convert($this->amount, $this->currency, 'EUR')\n );\n }\n }\n\n # Preliminary fee in EUR\n $fee = $fee_amount * $fee_rate / 100;\n\n # Adjust for minimum fee, if applicable\n if (isset(static::$fee_rules[$this->user_type][$this->operation]['min_fee']))\n {\n $fee = max($fee, static::$fee_rules[$this->user_type][$this->operation]['min_fee']);\n }\n\n # Adjust for maximum fee, if applicable\n if (isset(static::$fee_rules[$this->user_type][$this->operation]['max_fee']))\n {\n $fee = min($fee, static::$fee_rules[$this->user_type][$this->operation]['max_fee']);\n }\n\n # Converto to transaction's currency\n $fee = Converter::convert($fee, 'EUR', $this->currency);\n\n # Hack for calculations and conversion rounding error\n # 3.00000000001 would round up (ceil) to 3.01 without that\n $fee -= 0.000001;\n\n # Round up to the lowest currency denomination\n $denomination = Converter::getDenomination($this->currency);\n $fee = ceil($fee / $denomination) * $denomination;\n\n return $fee;\n }", "public function todayTotalWithdrawal()\n {\n return 7000;\n }", "public function update_gift_coins_final_balance($user_id,$final_gift_coins){\n\t\t\n\t\t $sql_123=\"update users set gift_coins='$final_gift_coins' where id='$user_id'\";\n\t\t\t\t\tmysqli_query($this->_con, $sql_123);\n\t\t\t\t\t\n\t\t\n\t}", "public static function getTotalEndingBalance($user_id,$transaction_type = null){\n $query = UserTransaction::read();\n $query->select(\"sum(ending_balance) as total\")->andWhere(\"user_id={$user_id}\");\n if($transaction_type != null){\n $query->andWhere(\"transaction_type = '{$transaction_type}'\");\n }\n $data = $query->execute()->fetch();\n\n $total = isset($data['total']) ? intval($data['total']) : 0;\n\n return $total;\n }", "function computeAmount( $basket) \n\t{\n\n\t\t$current_edition = getOneAssocArray( 'select * from global_editions where edition_id = \"'.$GLOBALS['appshore_data']['my_company']['edition_id'].'\"' );\n\t\t$new_edition = getOneAssocArray( 'select * from global_editions where edition_id = \"'.$basket['edition_id'].'\"' );\n\n\t\t$amount = 0;\n\t\t\n\t\t// we calculate the prorata update within the current period for the new users\n\t\tif( $new_edition['users_quota'] > $current_edition['users_quota'] )\n\t\t{\n\t\t\t$amount = $new_edition['price']-$current_edition['price'];\n\t\t\t$now = strtotime(\"now\");\n\t\t\t$due = strtotime($GLOBALS['appshore_data']['my_company']['due_date']);\n\t\t\tif( $due > $now )\n\t\t\t\t$amount *= ((($due-$now)/(3600*24))/30/$new_edition['period']);\n\t\t\telse\n\t\t\t\t$amount = 0;\n\t\t}\n\n\t\t// add the amount for the new period\n\t\tif( $new_edition['period'] != 0 )\n\t\t\t$amount += $new_edition['price'];\t\n\t\t\n\t\treturn round($amount);\n\t}", "public function getTotalAmount();", "function add_user_earning($user_id,$amount_to_add){\r\n\r\n $user_wallet_balance = get_user_meta($user_id, 'user_wallet_balance',true);\r\n\r\n if (!is_numeric($user_wallet_balance) and !is_int($user_wallet_balance)){\r\n $user_wallet_balance = 0;\r\n }\r\n\r\n $new_balance = $user_wallet_balance + $amount_to_add; \r\n $new_balance = number_format($new_balance,0);\r\n \r\n update_user_meta($user_id, 'user_wallet_balance', $new_balance);\r\n\r\n}", "public function userDiscountTotal($exclude_shipping=false)\r\n {\r\n $totalDiscount = 0;\r\n \r\n foreach ($this->coupons as $coupon)\r\n {\r\n if ($exclude_shipping && \\Shop\\Models\\Coupons::givesShippingDiscount( $coupon )) \r\n {\r\n continue; \t\r\n }\r\n $totalDiscount = $totalDiscount + $coupon['amount'];\r\n }\r\n \r\n if(!empty($this->discounts)) {\r\n \tforeach ($this->discounts as $discount)\r\n \t{\r\n \t\t$totalDiscount = $totalDiscount + $discount['amount'];\r\n \t}\r\n }\r\n \r\n \r\n return (float) $totalDiscount;\r\n }", "public function get_referral_amount($user_type)\n {\n if($user_type == 'Driver') {\n return $this->driver_referral_amount;\n }\n return $this->rider_referral_amount;\n }", "private function total_payment_count(){\n $payment = $this->Payment_model->total_payment();\n\n //Employee Salary\n $sallary = $this->Salary_model->total_sallary();\n\n return $payment->amount + $sallary->amount;\n }", "function calc_money($net_price,$total,$reduce_balance,$reduce_amount,$service_rate,$tax_rate)\n {\n $total_after = 0;\n //gia phong chua bao gom tax and charge\n if($net_price==0)\n {\n $total_after = $total * (1-$reduce_balance/100);\n $total_after = $total_after - $reduce_amount;\n $total_after = $total_after * (1+$service_rate/100);\n $total_after = $total_after * (1+$tax_rate/100);\n }\n else//da bao gom tax va charge => chia nguoc lai, tru tiep giam gia, roi nhan lai tax va rate\n {\n $total_after = $total / (1+$tax_rate/100);\n $total_after = $total_after / (1+$service_rate/100);\n $total_after = $total_after * (1-$reduce_balance/100);\n $total_after = $total_after - $reduce_amount;\n $total_after = $total_after * (1+$service_rate/100);\n $total_after = $total_after * (1+$tax_rate/100);\n }\n return $total_after;\n }", "public function getAmountRefunded();", "function get_total_interest(&$total_interest_balanace, $interest_rate, $total_interest, $payment) {\n\n $interest = $total_interest_balanace * $interest_rate;\n $principal = $payment - $interest;\n $total_interest_balanace = $total_interest_balanace - $principal;\n $total_interest = $interest + $total_interest;\n echo number_format($total_interest, 2);\n return $total_interest;\n }", "function getSalaryAmount($totalDays):int{\n $this ->workingDays = $totalDays - $this->totalLeaveTaken;\n $salary = $this->workingDays*$this->workingHoursPerDay*$this->hourlyRate;\n\n return $salary;\n }", "function getSum($internal = null) {\n\t\t\t\n\t\t\tif(!isset($this->params['requested'])) return;\n\t\t\t\n\t\t\t//Get current active registration\n\t\t\t$registration = $this->requestAction('registrations');\n\t\t\t//Get current active event\n\t\t\t$event = $this->requestAction('events');\n\t\t\t$pricePerPerson = $this->Session->read('Event.price_per_person');\n\t\t\t\t\n\t\t\tif($internal === null) { //normal use case unchanged so that it can be called in the same way as before from person element\n\t\t\t\t\n\t\t\t\tif($this->Session->check('Registration.Person') && $this->Session->check('Event.price_per_person')) {\n\t\t\t\t\t$amountWithReductionCode = 0;\n\t\t\t\t\tforeach ($registration['Person'] as $person){\n\t\t\t\t\t\tif (isset($person['reduction_code_id']) && $person['reduction_code_id'] > 0)\n\t\t\t\t\t\t\t$amountWithReductionCode++;\n\t\t\t\t\t}\n\t\t\t\t\t$amountOfPeople = (sizeof($registration['Person'])) - $amountWithReductionCode;\n\t\t\t\t\t//TODO refactor shouldnt we use price from event that we requested above?\n\t\t\t\t\treturn $this->Invoice->calculatePrice($pricePerPerson, $amountOfPeople);\n\t\t\t\t} else {\n\t\t\t\t\t// We get here when we are in receipt view basicly\n\t\t\t\t\t$latestInvoice = $this->Invoice->getLatest($registration['Registration']['id']);\n\t\t\t\t\treturn $latestInvoice['Invoice']['price'];\n\t\t\t\t}\n\t\t\t} elseif($internal) {\n\t\t\t\t\n\t\t\t\t$sum = 0;\n\t\t\t\t\n\t\t\t\t//return only sum of all the internal people (people that has a role where is_external is false/null/0)\n\t\t\t\tforeach($registration['Person'] as $person) {\n\t\t\t\t\tif(isset($person['role_id'])) {\n\t\t\t\t\t\t$isExternal = $this->Invoice->Registration->Person->Role->field('is_external', array('id' => $person['role_id']));\n\t\t\t\t\t\tif(!$isExternal) {\n\t\t\t\t\t\t\t$sum += $pricePerPerson;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $sum;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$sum = 0;\n\t\t\t\t\n\t\t\t\t//return only sum of all the external people (people that has a role where is_external is true/1)\n\t\t\t\tforeach($registration['Person'] as $person) {\n\t\t\t\t\t$isExternal = $this->Invoice->Registration->Person->Role->field('is_external', array('id' => $person['role_id']));\n\t\t\t\t\tif($isExternal) {\n\t\t\t\t\t\t$sum += $pricePerPerson;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $sum;\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "public function getSubtotal($user_id = null)\n\t{\n\t\t$net_total = 0;\n\t\tforeach ($this->getCartitems($user_id) as $cartitem) {\n\t\t\t$net_total += $cartitem->getNetTotal();\n\t\t}\n\n\t\t// plus fees\n\t\t$net_total += $this->_fee;\n\n\t\treturn $net_total;\n\t}" ]
[ "0.6505499", "0.6258037", "0.6071742", "0.6010185", "0.6004292", "0.5941603", "0.5922671", "0.59132785", "0.5886524", "0.5849817", "0.5810029", "0.57842493", "0.5765143", "0.57632947", "0.5755137", "0.5752749", "0.5726579", "0.5707587", "0.56989384", "0.5689997", "0.5662033", "0.56612486", "0.56473064", "0.558828", "0.5577736", "0.5564359", "0.5557718", "0.5554694", "0.5550213", "0.55490476" ]
0.72526056
0
i_html_attribs() glues html attribs for tags makes basic checks, like empty string parameters: $data array ['alt'] string element id ['title'] string element id ['style'] string tag style ['class'] string tag class ['name'] string name attribute ['add'] string concat additional parametrs ['src'] string for input ['id'] string id attribute return: string html part
function i_html_basic_attribs(&$data){ $res = ''; $keys = array_keys($data); $values = array_values($data); $ci = count($keys); for( $i = 0; $i < $ci; $i++ ){ $key = $keys[$i]; $value = $values[$i]; switch( $key ){ case 'title': if( $value !== '' ){ $value = htmlescape($value); $res .= ' title="' . $value . '" '; } break; case 'alt': if( $value !== '' ){ $value = htmlescape($value); $res .= ' alt="' . $value . '" '; } break; case 'class': if( $value !== '' ){ $res .= ' class="' . $value . '" '; } break; case 'style': if( $value !== '' ){ $res .= ' style="' . $value . '" '; } break; case 'src': if( $value !== '' ){ $res .= ' src="' . $value . '" '; } break; case 'name': if( $value !== '' ){ $res .= ' name="' . $value . '" '; } break; case 'id': if( $value !== '' ){ $res .= ' id="' . $value . '" '; } break; case 'value': if( $value !== '' ){ $res .= ' value="' . $value . '" '; } break; case 'add': if( $value !== '' ){ $res .= $value . ' '; } break; default: break; } } return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function htmlAttr($string);", "protected function _htmlAttribs($attribs) {\n\t\t$xhtml = '';\n\n\t\tforeach((array) $attribs as $key => $val) {\n\t\t\t$key = $this->_escape($key);\n\n\t\t\tif (('on' == substr($key, 0, 2)) || ('constraints' == $key)) {\n\t\t\t\t// Don't escape event attributes; _do_ substitute double quotes with singles\n\t\t\t\tif (! is_scalar($val)) {\n\t\t\t\t\t// non-scalar data should be cast to JSON first\n\t\t\t\t\t$val = json_encode($val);\n\t\t\t\t}\n\n\t\t\t\t// Escapa aspas simples dentro dos valores de atributos de eventos\n\t\t\t\t// Criará um html, onde os valores dos atributos tem\n\t\t\t\t// aspas simples ao redor, e escapa as aspas simples ou aspas duplas não escapadas.\n\t\t\t\t$val = str_replace('\\'', '&#39;', $val);\n\t\t\t} else {\n\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t$val = implode(' ', $val);\n\t\t\t\t}\n\t\t\t\t$val = $this->_escape($val);\n\t\t\t}\n\n\t\t\tif ('id' == $key) {\n\t\t\t\t$val = $this->_normalizeId($val);\n\t\t\t}\n\n\t\t\tif (strpos($val, '\"') !== false) {\n\t\t\t\t$xhtml .= \" $key='$val'\";\n\t\t\t} else {\n\t\t\t\t$xhtml .= \" $key=\\\"$val\\\"\";\n\t\t\t}\n\n\t\t}\n\n\t\treturn $xhtml;\n\t}", "protected function htmlAttributes() {\n\t\t$html = '';\n\t\tif (!empty($this->e_id)) {\n\t\t\t$html .= ' id=\"'.htmlspecialchars($this->htmlGetID()).'\"';\n\t\t}\n\t\tif (!empty($this->e_style)) {\n\t\t\t$html .= ' style=\"'.htmlspecialchars($this->htmlGetStyle()).'\"';\n\t\t}\n\t\tif (!empty($this->e_title)) {\n\t\t\t$html .= ' title=\"'.htmlspecialchars($this->htmlGetTitle()).'\"';\n\t\t}\n\t\tif (!empty($this->e_classes)) {\n\t\t\t$html .= ' class=\"'.htmlspecialchars($this->htmlGetClass()).'\"';\n\t\t}\n\t\treturn $html;\n\t}", "function html_attr(array $attr): string\n{\n $att_string = '';\n foreach ($attr as $att_name => $att_value) {\n if ($att_name === 'readonly' || $att_name === 'required') {\n $att_string .= $att_name;\n } else {\n $att_string .= \"$att_name=\\\"$att_value\\\" \";\n }\n }\n\n return $att_string;\n}", "private function get_attributes() {\n\t\t$this->html = null;\n\t\n\t\tif(is_array($this->attributes)) {\n\t\t\tforeach ($this->attributes as $key=>$val) {\n\t\t\t\t$this->html .= ' '.$key.'=\"'.$val.'\"';\n\t\t\t}\n\t\t} else {\n\t\t\t$this->html .= ' '.$this->attributes;\n\t\t}\n\t\n\t\treturn $this->html;\n\t}", "function auxin_make_html_attributes( $attrs = array() ){\n\n if( ! is_array( $attrs ) ){\n auxin_error( sprintf( __( 'Input value for \"%s\" function should be array.', 'phlox' ), __FUNCTION__ ) );\n return '';\n }\n\n $attributes_string = '';\n\n foreach ( $attrs as $attr => $value ) {\n $value = is_array( $value ) ? join( ' ', array_unique( $value ) ) : $value;\n $attributes_string .= sprintf( '%s=\"%s\" ', $attr, esc_attr( trim( $value ) ) );\n }\n\n return $attributes_string;\n}", "function z_set_inner_html_by_atribute($attr_name,$attr_value,$html,$exactly,$frame)\n\t{\n\t\tif ($this->call(\"$this->prefix.SetInnerHtmlByAttribute?attr_name=\".urlencode($attr_name).\"&attr_value=\".urlencode($attr_value).\"&html=\".urlencode($html).\"&exactly=\".urlencode($exactly).\"&frame=\".urlencode($frame))==\"true\")\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function getHtml() {\n $noCloseArray = array(\"img\", \"input\");\n\n $outputHTML = '<' . $this->tag . ' ';\n foreach ($this->attribArray as $attrib => $value) {\n $outputHTML .= $attrib . '=\"' . $value . '\" ';\n }\n if (in_array($this->tag, $noCloseArray)) {\n $outputHTML .= $this->additionalString . ' />';\n } else {\n $outputHTML .= $this->additionalString . ' >';\n $outputHTML .= $this->contents;\n $outputHTML .= '</' . $this->tag . '>';\n }\n return $outputHTML;\n }", "function html_tag ($tag, $args) {\n $content = isset($args[0]) ? $args[0] : '';\n $attributes = !empty($args[1]) ? $args[1] : array();\n $no_closing = isset($args[2]) ? $args[2] : false;\n\n $tag_string = \"<$tag\";\n\n if (is_string($attributes)) {\n $attributes = array('class' => $attributes);\n }\n\n \n\n foreach ($attributes as $key => $value) {\n $tag_string .= \" $key=\\\"$value\\\"\";\n }\n\n $tag_string .= \">{$content}\";\n\n if (!$no_closing) {\n $tag_string .= \"</$tag>\";\n }\n\n return $tag_string;\n }", "public function getSampleHtmlValidTagsWithAttributes()\n {\n return array(\n 'normal html, single tag, single attribute' => array(\n 'valueInput' => '<span class=\"test\">test this</span>',\n 'outputValue' => array(\n array('class=\"test\"')\n ),\n ),\n 'normal html, single tag, double attribute' => array(\n 'valueInput' => '<span class=\"test\" style=\"float: right;\">test this</span>',\n 'outputValue' => array(\n array('class=\"test\"', 'style=\"float: right;\"')\n ),\n ),\n 'normal html, nested tags, several attributes attribute' => array(\n 'valueInput' => '<div class=\"outerDiv\"><input type=\"text\" name=\"mightyInput\" /><span class=\"test\" style=\"float: right;\">test this</span></div>',\n 'outputValue' => array(\n array('class=\"outerDiv\"'),\n array('type=\"text\"', 'name=\"mightyInput\"'),\n array('class=\"test\"', 'style=\"float: right;\"'),\n ),\n ),\n );\n }", "public static function renderAttributes($htmlOptions = array()) {\n static $specialAttributes = array(\n 'autofocus' => 1,\n 'autoplay' => 1,\n 'controls' => 1,\n 'declare' => 1,\n 'default' => 1,\n 'disabled' => 1,\n 'ismap' => 1,\n 'loop' => 1,\n 'muted' => 1,\n 'playsinline' => 1,\n 'webkit-playsinline' => 1,\n 'nohref' => 1,\n 'noresize' => 1,\n 'novalidate' => 1,\n 'open' => 1,\n 'reversed' => 1,\n 'scoped' => 1,\n 'seamless' => 1,\n 'selected' => 1,\n 'typemustmatch' => 1,\n 'lazyload' => 1,\n ), $specialAttributesNoValue = array(\n 'defer' => 1,\n 'async' => 1\n );\n\n if ($htmlOptions === array()) return '';\n\n $html = '';\n if (isset($htmlOptions['encode'])) {\n $raw = !$htmlOptions['encode'];\n unset($htmlOptions['encode']);\n } else\n $raw = false;\n\n foreach ($htmlOptions as $name => $value) {\n if (isset($specialAttributes[$name])) {\n if ($value) {\n $html .= ' ' . $name;\n if (self::$renderSpecialAttributesValue) $html .= '=\"' . $name . '\"';\n }\n } else if (isset($specialAttributesNoValue[$name])) {\n $html .= ' ' . $name;\n } else if ($value !== null) $html .= ' ' . $name . '=\"' . ($raw ? $value : self::encode($value)) . '\"';\n }\n\n return $html;\n }", "public static function renderAttributes($htmlOptions)\n\t{\n\t\tstatic $specialAttributes=array(\n\t\t\t'async'=>1,\n\t\t\t'autofocus'=>1,\n\t\t\t'autoplay'=>1,\n\t\t\t'checked'=>1,\n\t\t\t'controls'=>1,\n\t\t\t'declare'=>1,\n\t\t\t'default'=>1,\n\t\t\t'defer'=>1,\n\t\t\t'disabled'=>1,\n\t\t\t'formnovalidate'=>1,\n\t\t\t'hidden'=>1,\n\t\t\t'ismap'=>1,\n\t\t\t'loop'=>1,\n\t\t\t'multiple'=>1,\n\t\t\t'muted'=>1,\n\t\t\t'nohref'=>1,\n\t\t\t'noresize'=>1,\n\t\t\t'novalidate'=>1,\n\t\t\t'open'=>1,\n\t\t\t'readonly'=>1,\n\t\t\t'required'=>1,\n\t\t\t'reversed'=>1,\n\t\t\t'scoped'=>1,\n\t\t\t'seamless'=>1,\n\t\t\t'selected'=>1,\n\t\t\t'typemustmatch'=>1,\n\t\t);\n\n\t\tif($htmlOptions===array())\n\t\t\treturn '';\n\n\t\t$html='';\n\t\tif(isset($htmlOptions['encode']))\n\t\t{\n\t\t\t$raw=!$htmlOptions['encode'];\n\t\t\tunset($htmlOptions['encode']);\n\t\t}\n\t\telse\n\t\t\t$raw=false;\n\n\t\tforeach($htmlOptions as $name=>$value)\n\t\t{\n\t\t\tif(isset($specialAttributes[$name]))\n\t\t\t{\n\t\t\t\tif($value)\n\t\t\t\t{\n\t\t\t\t\t$html .= ' ' . $name;\n\t\t\t\t\tif(self::$renderSpecialAttributesValue)\n\t\t\t\t\t\t$html .= '=\"' . $name . '\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($value!==null)\n\t\t\t\t$html .= ' ' . $name . '=\"' . ($raw ? $value : self::encode($value)) . '\"';\n\t\t}\n\n\t\treturn $html;\n\t}", "private function _attributes() {\n\t\t\t$return = array();\n\t\t\t$onsubmit = false;\n\t\t\tforeach($this->attributes as $key => $value):\n\t\t\t\tif($key === 'data' && is_array($value)) foreach($value as $k => $v) $return[] = 'data-'.$k.'=\"'.htmlentities(\n\t\t\t\t\t\t\t\tis_array($v)\n\t\t\t\t\t\t\t\t\t?join(';',$v)\n\t\t\t\t\t\t\t\t\t:$v,ENT_QUOTES,'UTF-8',false).'\"';\n\t\t\t\telse $return[] = $key.'=\"'.htmlentities(\n\t\t\t\t\t\t\tis_array($value)\n\t\t\t\t\t\t\t\t?join(' ',$value)\n\t\t\t\t\t\t\t\t:$value,ENT_QUOTES,'UTF-8',false).'\"';\n\t\t\t\tif($key === 'onsubmit') $onsubmit = true;\n\t\t\tendforeach;\n\t\t\tif($this->tag === 'form' && !$onsubmit && in_array(USER_BROWSER,array('ie','ie6'))) $return[] = 'onsubmit=\";var d=document.documentElement;if(d.onsubmit){return d.onsubmit(event);}else{return Event.fire(d,\\'submit\\',event);}\"';\n\t\t\treturn ((count($return))\n\t\t\t\t?' '.join(' ',$return)\n\t\t\t\t:false);\n\t\t}", "public function imgAttributes() {\r\n $html =& $this->emailText;\r\n $replace = array (\r\n '<img style=\"vertical-align: baseline;' =>'<img align=\"bottom\" hspace=\"4\" vspace=\"4\" style=\"vertical-align: baseline;',\r\n '<img style=\"vertical-align: middle;' => '<img align=\"middle\" hspace=\"4\" vspace=\"4\" style=\"vertical-align: middle;',\r\n '<img style=\"vertical-align: top;' => '<img align=\"top\" hspace=\"4\" vspace=\"4\" style=\"vertical-align: top;',\r\n '<img style=\"vertical-align: bottom;' => '<img align=\"bottom\" hspace=\"4\" vspace=\"4\" style=\"vertical-align: bottom;',\r\n '<img style=\"vertical-align: text-top;' =>'<img align=\"top\" hspace=\"4\" vspace=\"4\" style=\"vertical-align: text-top;',\r\n '<img style=\"vertical-align: text-bottom;' => '<img align=\"bottom\" hspace=\"4\" vspace=\"4\" style=\"vertical-align: text-bottom;',\r\n '<img style=\"float: left;' => '<img align=\"left\" hspace=\"4\" vspace=\"4\" style=\"float: left;',\r\n '<img style=\"float: right;' => '<img align=\"right\" hspace=\"4\" vspace=\"4\" style=\"float: right;',\r\n );\r\n $html = $this->strReplaceAssoc($replace, $html);\r\n\r\n }", "public function getAttributesTag()\n {\n $html = '';\n foreach ($this->attributes as $attr => $value)\n $html .= \" $attr=\\\"$value\\\"\";\n return ltrim($html); // RETIRA PRIMEIRO ESPAÇO ANTES DE RETORNAR\n }", "public function setAttributes($data)\n\t{\n\t\t$doc = $this->getDom();\n\t\t$manifest = $this->getManifest();\n\n\t\t// wrapper (not realy exist)\n\t\t$wrapper = '#' . $this->getAnchor($this->id);\n\n\t\t// find available nodes by manifest from data\n\t\t$attrs = $manifest['attrs'];\n\t\t$attrs[$wrapper] = array(\n\t\t\t//\n\t\t);\n\n\t\t// find attrs in style key\n\t\tif (isset($manifest['style']['nodes']))\n\t\t{\n\t\t\tforeach ($manifest['style']['nodes'] as $selector => $item)\n\t\t\t{\n\t\t\t\tif (isset($item['additional']) && is_array($item['additional']))\n\t\t\t\t{\n\t\t\t\t\tforeach ($item['additional'] as $itemAdditional)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tisset($itemAdditional['attrs']) &&\n\t\t\t\t\t\t\tis_array($itemAdditional['attrs'])\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($itemAdditional['attrs'] as $attr)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!isset($attrs[$selector]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$attrs[$selector] = array();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$attrs[$selector][] = $attr;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ($attrs as $selector => $item)\n\t\t{\n\t\t\tif (isset($data[$selector]))\n\t\t\t{\n\t\t\t\t// not multi\n\t\t\t\tif (!isset($item[0]))\n\t\t\t\t{\n\t\t\t\t\t$item = array($item);\n\t\t\t\t}\n\t\t\t\t// prepare attrs (and group attrs)\n\t\t\t\t$attrItems = array();\n\t\t\t\tforeach ($item as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (\n\t\t\t\t\t\tisset($val['attrs']) &&\n\t\t\t\t\t\tis_array($val['attrs'])\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($val['attrs'] as $groupAttr)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$item[] = $groupAttr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($item[$key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach ($item as $val)\n\t\t\t\t{\n\t\t\t\t\tif (\n\t\t\t\t\t\tisset($val['attribute']) &&\n\t\t\t\t\t\tisset($data[$selector][$val['attribute']])\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\t$attrItems[$val['attribute']] = $data[$selector][$val['attribute']];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// set attrs to the block\n\t\t\t\tif ($selector == $wrapper)\n\t\t\t\t{\n\t\t\t\t\t$resultList = array(\n\t\t\t\t\t\tarray_pop($doc->getChildNodesArray())\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// or by selector\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$resultList = $doc->querySelectorAll($selector);\n\t\t\t\t}\n\t\t\t\tforeach ($resultList as $resultNode)\n\t\t\t\t{\n\t\t\t\t\tforeach ($attrItems as $code => $val)\n\t\t\t\t\t{\n\t\t\t\t\t\t$resultNode->setAttribute(\n\t\t\t\t\t\t\t\\htmlspecialcharsbx($code),\n\t\t\t\t\t\t\tis_array($val)\n\t\t\t\t\t\t\t? json_encode($val)\n\t\t\t\t\t\t\t: $val\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// save rebuild html as text\n\t\t$this->saveContent($doc->saveHTML());\n\t}", "public function tag($attr = array()) {\n if ($this->options['inline-size'] && !$this->options['srcset-only']) { //if srcset-only, then no inline-size possible\n return html::img($this->thumbs['1x']->result->url(), array_merge(array(\n 'alt' => isset($this->options['alt']) ? $this->options['alt'] : $this->sourcePath->name(),\n 'width' => $this->thumbs['1x']->result->width(),\n 'height' => $this->thumbs['1x']->result->height(),\n 'class' => isset($this->options['class']) ? $this->options['class'] : null,\n 'srcset' => $this->srcset_string(),\n ), $attr));\n\n }else if($this->options['srcset-only']){\n return $this->srcset_string();\n\n }else{\n return html::img($this->thumbs['1x']->result->url(), array_merge(array(\n 'alt' => isset($this->options['alt']) ? $this->options['alt'] : $this->sourcePath->name(),\n 'class' => isset($this->options['class']) ? $this->options['class'] : null,\n 'srcset' => $this->srcset_string(),\n ), $attr));\n }\n\n\n }", "function tag($tag, $attributes='', $contents=null) {\n\tstatic $selfclosing = array(\n\t\t'br', 'hr', 'img', 'meta', 'link', 'img', 'input', 'html', 'param', 'embed', 'enclosure', 'area',\n\t\t);\n\t\t\n\tstatic $requiredattributes = array(\n\t 'applet'\t\t=> array('height' => '1', 'width' => '1'),\n\t 'area'\t\t=> array('alt' => 'clickable area'),\n\t 'basefont'\t=> array('size' => '12px'),\n\t 'bdo'\t\t=> array('dir' => ''),\n\t 'img'\t\t=> array('src' => '', 'alt' => 'image'),\n\t 'form'\t\t=> array('action' => '', 'method' => 'post'),\n\t 'map'\t\t=> array('name' => 'map'),\n\t 'meta'\t\t=> array('content' => ''),\n\t 'optgroup'\t=> array('label' => '-'),\n\t 'param'\t\t=> array('name' => 'param'),\n\t 'textarea'\t=> array('cols' => '1', 'rows' => '1'),\n\t 'script'\t\t=> array('type' => 'text/javascript'),\n\t 'style'\t\t=> array('type' => 'text/css'),\n\t );\n\t\n\tstatic $newline = array(\n\t\t'body', 'br', 'head', 'hr', 'div', 'link', 'meta', 'p', 'pre',\n\t\t'fieldset', 'form', 'optgroup', 'select',\n\t\t'dl', 'dt', 'ol', 'ul', 'li',\n\t\t'table', 'tbody', 'thead', 'tr',\n\t\t);\n\t\n\t$tag = strtolower($tag);\n\t$result = '';\n\t\n\tif ($attributes == '/')\t{ \t// this is an explicit close request\n\t\t$close = true;\n\t\t$contents = null;\n\t} else {\n\t\t$close = false;\n\t\t$result = '<'.$tag;\n\t\t$attributes = strtoarray($attributes);\n\t\t\n\t\t// get the XHTML required attributes for this tag\n\t\t$required = array();\n\t\tif (array_key_exists($tag, $requiredattributes)) $required = $requiredattributes[$tag];\n\t\t\n\t\t$attributes = array_merge($required, $attributes);\n\t\t\n\t\tforeach ($attributes as $name => $value) {\n\t\t\tif (get('absolute-references') && in_array($name, array('src', 'href')) && !str_begins($value, 'http')) {\n\t\t\t\t$value = page('fullHost').$value;\n\t\t\t}\n\t\t\t//$value = str_replace('&#39;', '&quote;', $value); // clean up any quotes\n\t\t\tif (($value != '') || ($tag == 'option')) append($result, $name.'=\"'.$value.'\"', ' ');\n\t\t}\n\t\t\t\t\n\t\tif (in_array($tag, $selfclosing)) $result .= ' /';\n\t\t$result .= '>';\n\t\t\n\t}\n\t\n\tif (in_array($tag, $newline)) $result .= \"\\n\";\n\t\n\tif (!in_array($tag, $selfclosing)) {\n\t\tif ($contents !== null) {\n\t\t\t$result .= $contents;\n\t\t\t$close = true;\n\t\t}\n\t\t\n\t\tif ($close) {\n\t\t\t$result .= '</'.$tag.'>';\n\t\t\tif (in_array($tag, $newline)) $result .= \"\\n\";\n\t\t}\n\t}\n\t\n\treturn $result;\n}", "public function attrib_src($data) {\n return $this->process($data, function(\\SimpleXMLElement $obj) : string {\n return (string) $obj->attributes()['src'];\n });\n }", "public function getHtmlAttributesAssigned(): array;", "public function buildAttrsHTML($attrs) {\n $table = '';\n\n $table = $table . '<table>' . \"\\n\";\n $table = $table . '<caption>Attributes</caption>' . \"\\n\";\n $table = $table . '<thead>' . \"\\n\";\n $table = $table . '<tr>' . \"\\n\";\n $table = $table . '<th scope=\"col\">Ability</th>' . \"\\n\";\n $table = $table . '<th scope=\"col\">Score</th>' . \"\\n\";\n $table = $table . '<th scope=\"col\">Mod</th>' . \"\\n\";\n $table = $table . '</tr>' . \"\\n\";\n $table = $table . '</thead>' . \"\\n\";\n $table = $table . '<tbody>' . \"\\n\";\n $table = $table . '<tr>' . \"\\n\";\n $table = $table . '<td>STR</td><td class=\"str\">' . $attrs['str'] . '</td><td class=\"str_mod\">' . $attrs['strMod'] . '</td>' . \"\\n\";\n $table = $table . '</tr>' . \"\\n\";\n $table = $table . '<tr>' . \"\\n\";\n $table = $table . '<td>CON</td><td class=\"con\">' . $attrs['con'] . '</td><td class=\"con_mod\">' . $attrs['conMod'] . '</td>' . \"\\n\";\n $table = $table . '</tr>' . \"\\n\";\n $table = $table . '<tr>' . \"\\n\";\n $table = $table . '<td>DEX</td><td class=\"dex\">' . $attrs['dex'] . '</td><td class=\"dex_mod\">' . $attrs['dexMod'] . '</td>' . \"\\n\";\n $table = $table . '</tr>' . \"\\n\";\n $table = $table . '<tr>' . \"\\n\";\n $table = $table . '<td>INT</td><td class=\"intel\">' . $attrs['intel'] . '</td><td class=\"intel_mod\">' . $attrs['intelMod'] . '</td>' . \"\\n\";\n $table = $table . '</tr>' . \"\\n\";\n $table = $table . '<tr>' . \"\\n\";\n $table = $table . '<td>WIS</td><td class=\"wis\">' . $attrs['wis'] . '</td><td class=\"wis_mod\">' . $attrs['wisMod'] . '</td>' . \"\\n\";\n $table = $table . '</tr>' . \"\\n\";\n $table = $table . '<tr>' . \"\\n\";\n $table = $table . '<td>CHA</td><td class=\"cha\">' . $attrs['cha'] . '</td><td class=\"cha_mod\">' . $attrs['chaMod'] . '</td>' . \"\\n\";\n $table = $table . '</tr>' . \"\\n\";\n $table = $table . '</tbody>' . \"\\n\";\n $table = $table . '</table>';\n\n $html = '';\n\n $html = $html . '<section class=\"attributes\">' . \"\\n\";\n $html = $html . '<h5>Attributes</h5>' . \"\\n\";\n $html = $html . '<div class=\"char-table\">' . \"\\n\";\n $html = $html . $table . \"\\n\";\n $html = $html . '</div>' . \"\\n\";\n $html = $html . '</section> <!-- end .attributes -->';\n\n return $html;\n }", "private function build_html_tag_attributes() {\n\t\t$attributes = [];\n\n\t\tif ( function_exists( 'is_rtl' ) && is_rtl() ) {\n\t\t\t$attributes['dir'] = 'rtl';\n\t\t}\n\n\t\t$lang = get_bloginfo( 'language' );\n\t\tif ( $lang ) {\n\t\t\t$attributes['lang'] = $lang;\n\t\t}\n\n\t\t$this->add_data_by_key( 'html_tag_attributes', $attributes );\n\t}", "public function attrib_alt($data) {\n return $this->process($data, function(\\SimpleXMLElement $obj) : string {\n return (string) $obj->attributes()['alt'];\n });\n }", "function auxin_dom_attributes( $dom_name = '' ){\n if( empty( $dom_name ) ){\n auxin_error( sprintf( __('Please specify a unique dom name for %s', 'phlox' ), __FUNCTION__ ) );\n return;\n }\n $attributes = apply_filters( \"auxin_{$dom_name}_attributes\", array() );\n\n $attrs_string = ' ';\n foreach ( $attributes as $attribute => $attribute_value) {\n $attrs_string .= sprintf( ' %s=\"%s\"', esc_attr( $attribute ), esc_attr( $attribute_value ) );\n }\n echo $attrs_string;\n}", "private function _html_attributes($attributes) {\n\t\t\t$attr_string = '';\n\t\t\tforeach ($attributes as $name => $value) {\n\t\t\t\t$attr_string .= $name . '=\"' . esc_html($value) . '\" ';\n\t\t\t}\n\n\t\t\treturn $attr_string;\n\t\t}", "function image_tag()\n{\n\tstatic $_defaults = array(\n\t\t'src' => ''\n\t\t, 'alt' => ''\n\t\t, 'border' => 0\n\t\t, 'allowed' => array('Common','alt','height','width','longdesc'\n\t\t\t,'src','usemap','ismap','name','align','border','hspace','vspace'\n\t\t)\n\t);\n\tstatic $_simple = array('src');\n\t$p = func_get_args();\n\t$p = parse_arguments($p, $_simple, $_defaults);\n\tif (empty($p['alt']))\n\t\t$p['alt'] = $p['src'];\n\t$attlist = get_attlist($p);\n\t$output = \"<img $attlist />\";\n\n\treturn $output;\n}", "abstract public function getHTML($name, $label, $value, $attributes, $styles);", "function initByAttribs($attribs){\n\t\tforeach($attribs as $a => $b){\n\t\t\tswitch($a){\n\t\t\t\tcase 'id':\n\t\t\t\tcase 'name':\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->setElement($a, $b, 'attrib');\n\t\t\t}\n\t\t}\n\t}", "function html_attrs(array $attributes)\n {\n $string = '';\n\n foreach ($attributes as $name => $value) {\n $string .= \" {$name}={$value}\";\n }\n\n return $string;\n }", "public function getAttributes($args='') {\n\n $attr = array();\n // get named arguments (key=\"value\"), ex: width=\"100\"\n // value must be quoted in argument string.\n $val = \"([\\\"'`])(?:[^\\\\\\\\\\\"'`]|\\\\\\\\.)*\\g{-1}\";\n $pattern = \"/(\\w+)\\s*=\\s*($val)/\";\n preg_match_all($pattern, $args, $matches, PREG_SET_ORDER);\n foreach ($matches as $match) {\n $attr[$match[1]] = substr($match[2],1,-1); // drop quates from value string\n $args = str_replace($match[0], '', $args); // remove parsed substring\n }\n // get flags or non-named arguments, ex: showdate, no-showfooter\n $tokens = preg_split('/\\s+/', $args);\n foreach ($tokens as $token) {\n // get width and height\n $matches = array();\n if (preg_match('/(\\d+(%|em|pt|px)?)\\s*([,xX]\\s*(\\d+(%|em|pt|px)?))?/',$token,$matches)) {\n if ($matches[4]) {\n // width and height was given\n $attr['width'] = $matches[1];\n if (!$matches[2]) $attr['width'].= 'px';\n $attr['height'] = $matches[4];\n if (!$matches[5]) $attr['height'].= 'px';\n continue;\n } elseif ($matches[2]) {\n // only height was given\n $attr['height'] = $matches[1];\n if (!$matches[2]) $attr['height'].= 'px';\n continue;\n }\n }\n // get other flags\n //if (preg_match('/[^A-Za-z0-9_-]/',$token)) continue;\n if (preg_match('/^no(?:_|-).+/',$token)) {\n $attr[substr($token,3)] = false; // drop \"no-\" prefix from key\n } elseif (preg_match('/^!.+/',$token)) {\n $attr[substr($token,1)] = false; // drop \"!\" prefix from key\n } else {\n $attr[$token] = true;\n }\n }\n return $attr;\n }" ]
[ "0.6783835", "0.6513049", "0.6509351", "0.6108282", "0.60604376", "0.6049201", "0.6000666", "0.5942583", "0.5931217", "0.58649725", "0.5857524", "0.5830469", "0.58222824", "0.5792169", "0.576144", "0.57213646", "0.57176614", "0.56907856", "0.5675725", "0.5673956", "0.5666556", "0.5645562", "0.56381345", "0.5629203", "0.559111", "0.55796045", "0.55778795", "0.5569403", "0.55557925", "0.5518668" ]
0.7696344
0
i_html_basic_attribs i_html_field_file() draw file upload element parameters: &$params array params ['id'] string html id ['name'] string element name ['multiple'] mixed enable hml5 multi select, upload for files return: $data mixed(string) html dependancies: See html5 info for atribute multiple Warning for multiple upload name must be an array for post name[] multiple support FF 3.6+, GHrome 8+, Opera 10.62+, Safari 5+
function i_html_field_file(&$params){ // http://www.mysite.com/upload.php // = '<form action="' . $action . '" method="post" enctype="multipart/form-data"> $id = ( isset($params['id']) ) ? ' id="' . $params['id'] . '"' : ''; $name = ( isset($params['name']) ) ? ' name="' . $params['name'] . '"' : ''; $multi = ( isset($params['multiple']) && $params['multiple'] ) ? ' multiple="multiple"' : ''; $class = ( isset($params['class']) ) ? ' class="' . $params['class'] . '"' : ''; $style = empty($params['style']) ? '' : ' style="' . $params['style'] . '"'; $buf = '<input type="file"' . $id . $name . $multi . $class . $style . '>'; if( isset($params['obj_js_file']) && $params['obj_js_file'] ) $buf .= '<div id="res"></div>'; return $buf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function theme_filefield_widget_file($element) {\r\n $output = '';\r\n\r\n $output .= '<div class=\"filefield-upload clear-block\">';\r\n\r\n if (isset($element['#field_prefix'])) {\r\n $output .= $element['#field_prefix'];\r\n }\r\n\r\n _form_set_class($element, array('form-file'));\r\n $output .= '<input type=\"file\" name=\"'. $element['#name'] .'\"'. ($element['#attributes'] ? ' '. drupal_attributes($element['#attributes']) : '') .' id=\"'. $element['#id'] .'\" size=\"'. $element['#size'] .\"\\\" />\\n\";\r\n\r\n if (isset($element['#field_suffix'])) {\r\n $output .= $element['#field_suffix'];\r\n }\r\n\r\n $output .= '</div>';\r\n\r\n return theme('form_element', $element, $output);\r\n}", "function file($attributes = array()){\r\n $col = \"6\"; //default col\r\n $label=\"\";\r\n extract($attributes);\r\n $html = $this->divbegin($col) . $this->label($field,$label);\r\n $html .='<input type=\"file\" name=\"'.$field.'\"/>';\r\n $html .= $this->inputend($field);\r\n return $html;\r\n }", "function form_file($title, $name, $size, $description = NULL, $required = FALSE) {\n return theme('form_element', $title, '<input type=\"file\" class=\"'. _form_get_class('form-file', $required, _form_get_error($name)) .'\" name=\"edit['. $name .']\" id=\"edit-'. form_clean_id($name) .'\" size=\"'. $size .\"\\\" />\\n\", $description, 'edit-'. $name, $required, _form_get_error($name));\n}", "function coworker_file($variables) {\n _form_set_class($variables['element'], array('input-file'));\n // Set a reasonably low default size:\n $variables['element']['#attributes']['size'] = '22';\n return theme_file($variables);\n}", "function theme_filefield_widget($element) {\r\n $element['#id'] .= '-upload'; // Link the label to the upload field.\r\n return theme('form_element', $element, $element['#children']);\r\n}", "function draw_upload_input_element($name, $size, $maxlength, $id = ''){\n\t$r = '<input name=\"'.$name.'\" type=\"file\"';\n\tif($id != ''){\n\t\t$r .= ' id=\"'.$id.'\" ';\n\t}\n\t$r .= ' size=\"'.$size.'\" maxlength=\"'.$maxlength.'\">';\n\treturn $r;\n}", "function listmaker_fileupload( $table , $id , $ext_array=null ){\r\n\r\n\t#\r\n\t# no file to upload\r\n\tif(! sizeof($_FILES) ){\r\n\t\t;//\r\n\t\r\n\t#\r\n\t# some input[] found\r\n\t} else foreach ($_FILES as $column => $r) {\r\n\t\t\r\n\t\t#\r\n\t\t# its a single input\r\n\t\tif( $_REQUEST['ArrayInput_'.$column]!=1 ){\r\n\t\t\tlistmaker_fileupload_solo( $table, $column, $id, $ext_array );\r\n\r\n\t\t#\r\n\t\t# its an ArrayInput\r\n\t\t} else {\r\n\t\t\tlistmaker_fileupload_multi( $table, $column, $id, $ext_array );\r\n\t\t}\r\n\t}\r\n\r\n}", "static function file($name, $attributes = null) {\n if(empty($attributes)) {\n $attributes = array();\n } // if\n \n $attributes['type'] = 'file';\n $attributes['name'] = $name;\n \n $label = isset($attributes['label']) ? $attributes['label'] : null;\n if($label) {\n unset($attributes['label']);\n \n if(empty($attributes['id'])) {\n $attributes['id'] = self::uniqueId('file');\n } // if\n \n return self::label($label, $attributes['id'], (isset($attributes['required']) && $attributes['required']), array('class' => 'main_label')) . self::openTag('input', $attributes);\n } else {\n return self::openTag('input', $attributes);\n } // if\n }", "public function file($name = null, $value = null, $attributes = null) {\n\t\t$this->attributes = $attributes;\n\t\n\t\t$this->result = null;\n\t\t$this->result .= '<input type=\"file\" name=\"'.$name.'\" value=\"'.$value.'\"';\n\t\t$this->result .= $this->get_attributes();\n\t\t$this->result .= '/>';\n\t\n\t\treturn $this->result;\n\t}", "function file($args)\n {\n $args['type'] = 'file';\n $args['value'] = $args['value_unformatted'];\n $row = $args['row'];\n\n if($args['onlyUpload'] == 1)\n {\n $element .= $this->input($args);\n }\n else\n {\n $element = \"<a href=\\\"/auto/\" . $args['table']. \"/\" . $args['value_unformatted']. \"\\\" title=\\\"\" . $row->{$args['field'] . 'Heading'} . \"\\\">\" . $row->{$args['field'] . 'Heading'} . \"</a><br />\";\n $element .= $this->input($args);\n $element .= \"<br>Size: \" . $row->{$args['field'] . 'Size'} . \" kb, Type: \" . $row->{$args['field'] . 'Type'};\n }\n\n return $element;\n }", "function theme_file_upload_combo($variables) {\n $element = $variables['element'];\n $output = '';\n\n $output .= drupal_render($element['items']);\n $output .= \" \"; // This space forces our fields to have a little room in between.\n $output .= drupal_render($element['items_file']);\n $output .= \" \"; // This space forces our fields to have a little room in between.\n $output .= drupal_render($element['file_path']);\n\n return $output;\n}", "public static function file_upload( $attr, $post_id, $type, $form_id, $obj ) {\n $allowed_ext = '';\n $extensions = wpuf_allowed_extensions();\n\n if ( is_array( $attr['extension'] ) ) {\n foreach ($attr['extension'] as $ext) {\n $allowed_ext .= $extensions[$ext]['ext'] . ',';\n }\n } else {\n $allowed_ext = '*';\n }\n\n $uploaded_items = $post_id ? $obj->get_meta( $post_id, $attr['name'], $type, false ) : array();\n ?>\n\n <div class=\"wpuf-fields\">\n <div id=\"wpuf-<?php echo $attr['name']; ?>-upload-container\">\n <div class=\"wpuf-attachment-upload-filelist\" data-type=\"file\" data-required=\"<?php echo $attr['required']; ?>\">\n <a id=\"wpuf-<?php echo $attr['name']; ?>-pickfiles\" class=\"button file-selector <?php echo ' wpuf_'.$attr['name'].'_'.$form_id; ?>\" href=\"#\"><?php _e( 'Select File(s)', 'wpuf' ); ?></a>\n\n <ul class=\"wpuf-attachment-list thumbnails\">\n <?php\n if ( $uploaded_items ) {\n foreach ($uploaded_items as $attach_id) {\n echo WPUF_Upload::attach_html( $attach_id, $attr['name'] );\n\n if ( is_admin() ) {\n printf( '<a href=\"%s\">%s</a>', wp_get_attachment_url( $attach_id ), __( 'Download File', 'wpuf' ) );\n }\n }\n }\n ?>\n </ul>\n </div>\n </div><!-- .container -->\n\n <span class=\"wpuf-help\"><?php echo stripslashes( $attr['help'] ); ?></span>\n\n </div> <!-- .wpuf-fields -->\n\n <script type=\"text/javascript\">\n jQuery(function($) {\n new WPUF_Uploader('wpuf-<?php echo $attr['name']; ?>-pickfiles', 'wpuf-<?php echo $attr['name']; ?>-upload-container', <?php echo $attr['count']; ?>, '<?php echo $attr['name']; ?>', '<?php echo $allowed_ext; ?>', <?php echo $attr['max_size'] ?>);\n });\n </script>\n <?php\n }", "public function form($field)\r\n {\r\n global $_W;\r\n $cdn_url = $_W['cdn_url'];\r\n $files = [];\r\n $item = \"\";\r\n if (is_array($field->node_field_default_value) && count($field->node_field_default_value) > 0) {\r\n foreach ($field->node_field_default_value as $v) {\r\n $files[] = File::get(['file_id' => $v]);\r\n }\r\n }\r\n foreach ($files as $k => $f) {\r\n if (!$f) {\r\n unset($files[$k]);\r\n continue;\r\n } else {\r\n $url = render_file($f);\r\n }\r\n if (strpos($f[\"filemime\"], \"image\") === false) {\r\n $f->url = \"\";\r\n }\r\n $item .= \"<li class=\\\"state-complete\\\"><p class=\\\"title\\\">$f->filename</p><p class=\\\"imgWrap\\\"><img src=\\\"$url\\\"></p>\r\n<p class=\\\"progress\\\"><span style=\\\"display: none; width: 0px;\\\"></span></p><span class=\\\"success\\\"><input type=\\\"hidden\\\" value=\\\"$f->file_id\\\" name=\\\"$field->form_group[$field->node_field_name]$field->multiple\\\"></span></li>\r\n\t \";\r\n }\r\n $form_str = \"\";\r\n if (!defined(\"WEB_UPLOADER\")) {\r\n //load css && js\r\n $form_str .= \"<script type=\\\"text/javascript\\\" src=\\\"{$cdn_url}statics/plugins/webuploader/webuploader.min.js\\\"></script>\";\r\n $form_str .= \"<script type=\\\"text/javascript\\\" src=\\\"{$cdn_url}statics/plugins/webuploader/md5.js\\\"></script>\";\r\n $form_str .= \"<script type=\\\"text/javascript\\\" src=\\\"{$cdn_url}statics/plugins/webuploader/upload.js\\\"></script>\";\r\n $form_str .= \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"{$cdn_url}statics/plugins/webuploader/upload.css\\\" />\";\r\n\r\n $form_str .= \" <script type='text/javascript'>\";\r\n $form_str .= \" prepare_upload();\";\r\n $form_str .= \" \";\r\n $form_str .= \" </script>\";\r\n define(\"WEB_UPLOADER\", 1);\r\n }\r\n $queue = \"<ul class=\\\"filelist {$field->node_field_name}_file_list\\\">$item</ul>\";\r\n $form_str .= \"<div class='uploader' name='$field->form_group[$field->node_field_name]$field->multiple' id=\\\"uploader_$field->node_field_name\\\">\";\r\n $form_str .= \" <div class=\\\"queueList\\\">\" . $queue;\r\n $form_str .= \" <div id=\\\"dndArea$field->node_field_name\\\" class=\\\"placeholder\\\">\";\r\n $form_str .= \" <div id=\\\"filePicker$field->node_field_name\\\"></div>\";\r\n $form_str .= \" <span class='ui info'>或将文件拖到这里,限<span class=\\\"text-danger\\\">$field->node_field_is_multiple</span>个文件, 支持格式 <span class=\\\"text-info\\\">$field->node_field_data_source_config</span></span>\";\r\n $form_str .= \" </div>\";\r\n $form_str .= \" </div>\";\r\n $form_str .= \" <div class=\\\"statusBar\\\" style=\\\"display:none;\\\">\";\r\n $form_str .= \" <div class=\\\"progress\\\">\";\r\n $form_str .= \" <span class=\\\"text\\\">0%</span>\";\r\n $form_str .= \" <span class=\\\"percentage\\\"></span>\";\r\n $form_str .= \" </div><div class=\\\"info\\\"></div>\";\r\n $form_str .= \" <div class=\\\"btns\\\">\";\r\n $form_str .= \" <div id=\\\"filePicker2$field->node_field_name\\\"></div><div class=\\\"uploadBtn\\\">开始上传</div>\";\r\n $form_str .= \" </div>\";\r\n $form_str .= \" </div>\";\r\n $form_str .= \" </div>\";\r\n $form_str .= \" <script type='text/javascript'>\";\r\n $form_str .= \" $(document).ready(function(){ init_upload('$field->node_field_name','$field->node_field_data_source_config',$field->node_field_is_multiple)});\";\r\n //$form_str .= \" $(document).ready(function(){ init_upload('$this->node_field_name','$this->node_field_data_source_config',$this->node_field_is_multiple)});\";\r\n $form_str .= \" </script>\";\r\n return $form_str;\r\n }", "function acf_file_input( $attrs = array() ) {\n\techo acf_get_file_input( $attrs );\n}", "public function formFile($name, $attribs = null)\n {\n\t\t# Begin\n\t\t$xhtml = parent::formFile($name, $attribs);\n\t\t\n\t\t# Prepare\n\t\t$max_file_size = filesize_from_human(ini_get('upload_max_filesize').'B');\n\t\t$max_file_size_text = $this->view->locale()->translate(\n\t\t\t'file-upload-size',\n\t\t\t$this->view->locale()->filesize(\n\t\t\t\tfilesize_from_human(\n\t\t\t\t\tini_get('upload_max_filesize').'B'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\t# Append\t\t\t\t\t\n\t\t$xhtml .= '<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"'.$max_file_size.'\" />'.\n\t\t\t'<span class=\"max_file_size_text\">'.$max_file_size_text.'</span>';\n\t\t\t\n\t\t# Return\n return $xhtml;\n }", "function theme_filefield_widget_item($element) {\r\n $element['upload']['#field_suffix'] = drupal_render($element['filefield_upload']);\r\n $element['upload']['#theme'] = 'filefield_widget_file';\r\n\r\n $output = '';\r\n $output .= '<div class=\"filefield-element clear-block\">';\r\n\r\n if ($element['fid']['#value'] != 0) {\r\n $output .= '<div class=\"widget-preview\">';\r\n $output .= drupal_render($element['preview']);\r\n $output .= '</div>';\r\n }\r\n\r\n $output .= '<div class=\"widget-edit\">';\r\n $output .= drupal_render($element);\r\n $output .= '</div>';\r\n $output .= '</div>';\r\n\r\n return $output;\r\n}", "function files(){\n $n = func_num_args();\n $a = func_get_args();\n //files(str tagname)\n if($n==1){\n return $_FILES[$a[0]];\n }\n //files(str tagname,int/str index)\n elseif($n==2){\n return $_FILES[$a[0]][$a[1]];\n }\n //files(str tagname,int/str index,int/str index)\n elseif($n==3){\n return $_FILES[$a[0]][$a[1]][$a[2]];\n }\n else{\n return error(\"Invalid Parameters\");\n }\n}", "public function createUploadForm() {\n \n global $REX, $I18N, $PERMALL;\n\n $rex_file_category = '';\n if(!$rex_file_category)\n {\n $rex_file_category = rex_session('media[rex_file_category]', 'int');\n }\n\n $output = '';\n $script_page_header = '';\n $uploadPath = \"index.php?page=\".$this->myself.\"&subpage=upload&upload_folder=\".$this->folder.\"&faceless=1\";\n \n if($this->sync_cat){\n // include cat sync select\n $cats_sel = new rex_select;\n $cats_sel->setStyle('class=\"inp100\"');\n $cats_sel->setSize(1);\n $cats_sel->setName('rex_file_category');\n $cats_sel->setId('rex_file_category_'.$this->time);\n $cats_sel->addOption($I18N->msg('pool_kats_no'),\"0\");\n\n $mediacat_ids = array();\n $rootCat = 0;\n $PERMALL = TRUE;\n if ($rootCats = OOMediaCategory::getRootCategories())\n {\n foreach( $rootCats as $rootCat) {\n rex_mediapool_addMediacatOptionsWPerm( $cats_sel, $rootCat, $mediacat_ids);\n }\n }\n $cats_sel->setSelected($rex_file_category);\n }\n \n \n if($this->markup){\n $output .='\n <div class=\"rex-form\">\n <fieldset class=\"rex-form-col-1\">\n <legend>Multiupload</legend>\n <div class=\"rex-form-wrapper\">'.\"\\n\";\n \n if($this->sync_cat){\n $output .='\n <div class=\"rex-form-row\">\n <p class=\"rex-form-text\">\n <label for=\"rex_file_category\">'.$I18N->msg('pool_file_category').'</label>\n '.$cats_sel->get().'\n </p>\n </div>'.\"\\n\";\n }\n \n $output .='\n <div class=\"rex-form-row\">\n <label>Upload:</label>'.\"\\n\";\n }\n $output .='\n <div id=\"multiupload'.$this->time.'\" class=\"'.($this->markup ? 'behave_normal' : 'styleless').'\"> \n <noscript> \n <p>JavaScript muss aktiviert sein.</p>\n </noscript> \n </div>';\n \n if($this->markup){\n $output .='\n </div>';\n if(!$this->clear_uploadlist_automatically) {\n $output .= '<div class=\"rex-form-row\">\n <p class=\"rex-form-text\">\n <label>Aktionen</label>\n <a href=\"javascript:void(0)\" onclick=\"clearUploadList();\">Abgeschlossene / fehlerhafte aus der Liste entfernen</a>\n </p>\n </div>'.\"\\n\";\n }\n }\n\n $script_page_header .= '\n <script>\n \n function rex_multiupload_createUploader'.$this->time.'(){ \n var uploader = new qq.FileUploader({\n element: document.getElementById(\"multiupload'.$this->time.'\"),\n action: \"'.$uploadPath.'\",\n mediaPoolSelector: \"rex_file_category_'.$this->time.'\",\n sizeLimit: 0, // max size \n minSizeLimit: 0, // min size';\n \n \n $script_page_header .= '\n onSubmit: function(id,filename) {'.\"\\n\";\n if($this->clear_uploadlist_automatically)\n {\n $script_page_header .= '\n clearUploadList();';\n }\n \n if($this->onSubmitCallback){\n $script_page_header .= '\n \n if(typeof '.$this->onSubmitCallback.' == \"function\") { \n // user callback function\n '.$this->onSubmitCallback.'(filename);\n }';\n }\n $script_page_header .= '\n },\n ';\n \n \n $script_page_header .= '\n onUpload: function(id,fileName, xhr) {'.\"\\n\";\n \n if($this->onUploadCallback){\n $script_page_header .= '\n \n if(typeof '.$this->onUploadCallback.' == \"function\") { \n // user callback function\n '.$this->onUploadCallback.'(fileName, xhr);\n }';\n }\n $script_page_header .= '\n \n \n },\n ';\n \n $script_page_header .= '\n onProgress: function(id,fileName, loaded, total) {'.\"\\n\";\n \n if($this->onProgressCallback){\n $script_page_header .= '\n \n if(typeof '.$this->onProgressCallback.' == \"function\") { \n // user callback function\n '.$this->onProgressCallback.'(fileName, loaded, total);\n }';\n }\n $script_page_header .= '\n \n \n },\n ';\n \n $script_page_header .= '\n onComplete: function(id,filename,json) {'.\"\\n\";\n if($this->clear_file_after_finish)\n {\n $script_page_header .= ' \n window.setTimeout(function(){\n clearUploadListSuccess();\n }, 5000);';\n }\n \n if($this->onCompleteCallback){\n $script_page_header .= '\n \n if(typeof '.$this->onCompleteCallback.' == \"function\" && json.success) { \n // user callback function\n '.$this->onCompleteCallback.'(json);\n }';\n }\n $script_page_header .= '\n \n \n },\n ';\n \n $script_page_header .= '\n onCancel: function(id,filename) {'.\"\\n\";\n \n if($this->onCancelCallback){\n $script_page_header .= '\n \n if(typeof '.$this->onCancelCallback.' == \"function\") { \n // user callback function\n '.$this->onCancelCallback.'(filename);\n }';\n }\n $script_page_header .= '\n \n \n },\n ';\n \n \n \n \n \n if($this->upload_simultaneously && is_numeric($this->upload_simultaneously)){\n $script_page_header .= ' \n maxConnections: '.$this->upload_simultaneously.',';\n }\n\n $script_page_header .= '\n debug: '.($this->javascript_debug ? \"true\" : \"false\").'\n }); \n }\n \n jQuery(document).ready(function(){\n rex_multiupload_createUploader'.$this->time.'();\n });\n </script>'.\"\\n\";\n \n if($this->markup){ \n if($this->showFootnote){\n $output .= \n '<div class=\"rex-form-row edit_panel\">\n <label>Dateien editieren</label>\n <ul class=\"qq-upload-list edit_uploads\">\n\n </ul>\n </p>\n </div>'.\"\\n\";\n }\n }\n\n if($this->markup){ \n if($this->showFootnote){\n $output .= \n '<div class=\"rex-form-row\">\n <p class=\"rex-form-file\">\n <span class=\"rex-form-notice\">\n Mehrfachauswahl mit STRG(WIN) oder CMD(MAC).<br />\n Die Dateien werden automatisch in die ausgewählte Kategorie sychronisiert.\n Ein Wechsel der Medienkategorie greift immer vor Auswahl einer Datei. \n Findet ein Upload bereits statt, kann für diese Datei die Kategorie nicht mehr verändert werden.\n </span>\n </p>\n </div>'.\"\\n\";\n }\n $output .= ' \n </div>\n </fieldset>\n </div>'.\"\\n\";\n }\n \n \n // Register EXTENSION POINT\n $header_func = 'return str_replace(\"<!-- ###MULTIUPLOAD_EP_REPLACE### -->\",\\''.$script_page_header.'\\'.\"<!-- ###MULTIUPLOAD_EP_REPLACE### -->\",$params[\"subject\"]);'; \n rex_register_extension('OUTPUT_FILTER', create_function('$params',$header_func));\n \n // TIME FOR OUTPUT\n return $output;\n }", "function filefield_widget_process($element, $edit, &$form_state, $form) {\r\n // The widget is being presented, so apply the JavaScript.\r\n drupal_add_js(drupal_get_path('module', 'filefield') .'/filefield.js');\r\n\r\n $item = $element['#value'];\r\n $field_name = $element['#field_name'];\r\n $delta = $element['#delta'];\r\n $element['#theme'] = 'filefield_widget_item';\r\n\r\n $field = $form['#field_info'][$field_name];\r\n\r\n // Title is not necessary for each individual field.\r\n if ($field['multiple'] > 0) {\r\n unset($element['#title']);\r\n }\r\n\r\n // Set up the buttons first since we need to check if they were clicked.\r\n $element['filefield_upload'] = array(\r\n '#type' => 'submit',\r\n '#value' => t('Upload'),\r\n '#submit' => array('node_form_submit_build_node'),\r\n '#ahah' => array( // with JavaScript\r\n 'path' => 'filefield/ahah/'. $element['#type_name'] .'/'. $element['#field_name'] .'/'. $element['#delta'],\r\n 'wrapper' => $element['#id'] .'-ahah-wrapper',\r\n 'method' => 'replace',\r\n 'effect' => 'fade',\r\n ),\r\n '#field_name' => $element['#field_name'],\r\n '#delta' => $element['#delta'],\r\n '#type_name' => $element['#type_name'],\r\n '#upload_validators' => $element['#upload_validators'],\r\n '#weight' => 100,\r\n '#post' => $element['#post'],\r\n );\r\n $element['filefield_remove'] = array(\r\n // With default CCK edit forms, $element['#parents'] is array($element['#field_name'], $element['#delta']).\r\n // However, if some module (for example, flexifield) places our widget deeper in the tree, we want to\r\n // use that information in constructing the button name.\r\n '#name' => implode('_', $element['#parents']) .'_filefield_remove',\r\n '#type' => 'submit',\r\n '#value' => t('Remove'),\r\n '#submit' => array('node_form_submit_build_node'),\r\n '#ahah' => array( // with JavaScript\r\n 'path' => 'filefield/ahah/'. $element['#type_name'] .'/'. $element['#field_name'] .'/'. $element['#delta'],\r\n 'wrapper' => $element['#id'] .'-ahah-wrapper',\r\n 'method' => 'replace',\r\n 'effect' => 'fade',\r\n ),\r\n '#field_name' => $element['#field_name'],\r\n '#delta' => $element['#delta'],\r\n '#weight' => 101,\r\n '#post' => $element['#post'],\r\n );\r\n\r\n // Because the output of this field changes depending on the button clicked,\r\n // we need to ask FAPI immediately if the remove button was clicked.\r\n // It's not good that we call this private function, but\r\n // $form_state['clicked_button'] is only available after this #process\r\n // callback is finished.\r\n if (_form_button_was_clicked($element['filefield_remove'])) {\r\n // Delete the file if it is currently unused. Note that field_file_delete()\r\n // does a reference check in addition to our basic status check.\r\n if (isset($edit['fid'])) {\r\n $removed_file = field_file_load($edit['fid']);\r\n if ($removed_file['status'] == 0) {\r\n field_file_delete($removed_file);\r\n }\r\n }\r\n $item = array('fid' => 0, 'list' => $field['list_default'], 'data' => array('description' => ''));\r\n }\r\n\r\n // Set access on the buttons.\r\n $element['filefield_upload']['#access'] = empty($item['fid']);\r\n $element['filefield_remove']['#access'] = !empty($item['fid']);\r\n\r\n // Add progress bar support to the upload if possible.\r\n $progress_indicator = isset($field['widget']['progress_indicator']) ? $field['widget']['progress_indicator'] : 'bar';\r\n if ($progress_indicator != 'throbber' && $implementation = filefield_progress_implementation()) {\r\n $upload_progress_key = md5(mt_rand());\r\n\r\n if ($implementation == 'uploadprogress') {\r\n $element['UPLOAD_IDENTIFIER'] = array(\r\n '#type' => 'hidden',\r\n '#value' => $upload_progress_key,\r\n '#attributes' => array('class' => 'filefield-progress'),\r\n );\r\n }\r\n elseif ($implementation == 'apc') {\r\n $element['APC_UPLOAD_PROGRESS'] = array(\r\n '#type' => 'hidden',\r\n '#value' => $upload_progress_key,\r\n '#attributes' => array('class' => 'filefield-progress'),\r\n );\r\n }\r\n\r\n // Add the upload progress callback.\r\n $element['filefield_upload']['#ahah']['progress']['type'] = 'bar';\r\n $element['filefield_upload']['#ahah']['progress']['path'] = 'filefield/progress/' . $upload_progress_key;\r\n }\r\n\r\n // Set the FID.\r\n $element['fid'] = array(\r\n '#type' => 'hidden',\r\n '#value' => $item['fid'],\r\n );\r\n\r\n if ($item['fid'] != 0) {\r\n $element['preview'] = array(\r\n '#type' => 'markup',\r\n '#value' => theme('filefield_widget_preview', $item),\r\n );\r\n }\r\n\r\n // Grant access to temporary files.\r\n if ($item['fid'] && isset($item['status']) && $item['status'] == 0 && variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) {\r\n $_SESSION['filefield_access'][] = $item['fid'];\r\n }\r\n\r\n // placeholder.. will be serialized into the data column. this is a place for widgets\r\n // to put additional data.\r\n $element['data'] = array(\r\n '#tree' => 'true',\r\n '#access' => !empty($item['fid']),\r\n );\r\n\r\n if (!empty($field['description_field'])) {\r\n $element['data']['description'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Description'),\r\n '#value' => isset($item['data']['description']) ? $item['data']['description'] : '',\r\n '#type' => variable_get('filefield_description_type', 'textfield'),\r\n '#maxlength' => variable_get('filefield_description_length', 128),\r\n );\r\n }\r\n\r\n if (!empty($field['list_field'])) {\r\n $element['list'] = array(\r\n '#type' => empty($item['fid']) ? 'hidden' : 'checkbox',\r\n '#title' => t('List'),\r\n '#value' => isset($item['list']) && !empty($item['fid']) ? $item['list'] : $field['list_default'],\r\n '#attributes' => array('class' => 'filefield-list'),\r\n );\r\n }\r\n else {\r\n $element['list'] = array(\r\n '#type' => 'hidden',\r\n '#value' => '1',\r\n );\r\n }\r\n\r\n foreach ($element['#upload_validators'] as $callback => $arguments) {\r\n $help_func = $callback .'_help';\r\n if (function_exists($help_func)) {\r\n $desc[] = call_user_func_array($help_func, $arguments);\r\n }\r\n }\r\n $element['upload'] = array(\r\n '#name' => 'files['. $element['#field_name'] .'_'. $element['#delta'] .']',\r\n '#type' => 'file',\r\n '#description' => implode('<br />', $desc),\r\n '#size' => 22,\r\n '#attributes' => array(\r\n 'accept' => implode(',', array_filter(explode(' ', $field['widget']['file_extensions']))),\r\n ),\r\n '#access' => empty($item['fid']),\r\n );\r\n\r\n $element['#attributes']['id'] = $element['#id'] .'-ahah-wrapper';\r\n $element['#prefix'] = '<div '. drupal_attributes($element['#attributes']) .'>';\r\n $element['#suffix'] = '</div>';\r\n\r\n return $element;\r\n}", "function simple_base_menu_file_html() {\n ?>\n <div class=\"wrap\">\n \t<h2>Simple File Uploader</h2>\n <?php \n\t\t\tif (isset($_GET[\"load_file\"])):\n\t\t\t\tif ($_GET[\"load_file\"] == \"ok\"):\n\t\t\t\t\t?><div class=\"updated below-h2\" id=\"message\"><p>File Uploaded!</p></div><?php\n\t\t\t\telse:\n\t\t\t\t\t?><div class=\"error below-h2\" id=\"message\"><p>File not uploaded.</p></div><?php\n\t\t\t\tendif;\n\t\t\tendif;\n\t\t\t\n\t\t\tif (isset($_GET[\"err\"])) {\n\t\t\t\t?><div class=\"error below-h2\" id=\"message\"><p>Error. Detail: <?php echo $_GET[\"err\"]; ?>.</p></div><?php\n\t\t\t}\n\t\t?>\n \n \n \n <form id=\"form_file\" method=\"post\" action=\"<?php echo admin_url( 'admin.php' ); ?>\" enctype=\"multipart/form-data\">\n <input type=\"hidden\" name=\"action\" value=\"process_file\" />\n <table class=\"form-table\">\n <tr valign=\"top\">\n \t<th scope=\"row\">\n <div class=\"uploader\">\n <input id=\"file_upload_button\" class=\"button\" name=\"file_upload_button\" type=\"text\" value=\"Seleccionar archivo\" />\n </div>\n\t\t\t\t\t</th>\n </tr>\n <tr valign=\"top\"> \n <td>Actual selected: <span id=\"file_upload_text\" ></span></td>\n </tr>\n <tr valign=\"top\">\n <td scope=\"row\">Last uploaded file: <?php echo esc_attr( get_option('last_uploaded_file') ); //Getting last saved file from options ?>\n <input id=\"file_upload\" name=\"last_uploaded_file\" type=\"hidden\" value=\"<?php echo esc_attr( get_option('last_uploaded_file') ); ?>\" /></td>\n </tr>\n </table> \n <?php submit_button(); ?>\n </form>\n </div> \n \n\t<script>\n // Uploading files\n var file_frame;\n jQuery('#file_upload_button').live('click', function( event ){\n event.preventDefault();\n // If the media frame already exists, reopen it.\n if ( file_frame ) {\n file_frame.open();\n return;\n }\n // Create the media frame.\n file_frame = wp.media.frames.file_frame = wp.media({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//frame: 'post',\n title: jQuery( this ).data( 'uploader_title' ),\n button: {\n text: jQuery( this ).data( 'uploader_button_text' ),\n },\n multiple: false // Set to true to allow multiple files to be selected\n });\n \n // When an image is selected, run a callback.\n file_frame.on( 'select', function() {\t\t \n var selection = file_frame.state().get('selection');\n selection.map( function( attachment ) {\t\t\t \n attachment = attachment.toJSON();\n //alert(JSON.stringify(attachment));\n // Do something with attachment.id and/or attachment.url here\n\t\t\t\t\n\t\t\t\tvar ext = attachment.url.split('.').pop();\n\t\t\t\tif (ext == 'xls' || ext == 'xlsx') {\n \tjQuery('#file_upload').val(attachment.url);\n \tjQuery('#file_upload_text').html(attachment.url);\n\t\t\t\t} else {\n\t\t\t\t\talert('El archivo selecionado no tiene formato xls o xlsx');\n\t\t\t\t}\n });\n }); \n // Finally, open the modal\n file_frame.open();\n }); \n\t\n\t\n\tjQuery(document).ready(function(e) {\n\t\tjQuery('#submit_form_file').click( function (e) {\n\t\t\tvar url_file = jQuery('#file_upload_text').html();\n\t\t\tvar id_campaign = jQuery('#campaign_id').val();\n\t\t\tif (id_campaign != \"0\") {\n\t\t\t\tif (url_file != \"\") {\n\t\t\t\t\t//FILE EXTENSION CHECK\n\t\t\t\t\tvar ext = url_file.split('.').pop();\n\t\t\t\t\tif (ext == 'xls' || ext == 'xlsx') {\n\t\t\t\t\t\tjQuery('#form_file').submit();\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert('El archivo selecionado no tiene formato xls o xlsx');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\talert('Seleccione un archivo');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\talert('Seleccione una campaņa');\n\t\t\t}\n\t\t});\n });\n\t\n </script>\n <?php\n}", "public static function file($name = 'file', $extras = []){\n\t\t$extras = array_merge($extras, ['multiple' => '']);\n\t\t$html = self::input('file', $name.'[]', '', $extras);\n\t\treturn $html;\n\t}", "public function addFileUpload($type, $name, $value = '', $label = '', $attr = '', $fileUpload_config = '')\n {\n $this->has_file = true;\n $attr = $this->getAttributes($attr); // returns linearised attributes (with ID)\n $array_values = $this->getID($name, $attr); // if $attr contains no ID, field ID will be $name.\n $attr = $array_values['attributs']; // if $attr contains an ID, we remove it.\n $attr = $this->addElementClass($name, $attr);\n $value = $this->getValue($name, $value);\n\n /* adding plugin */\n\n if (!isset($fileUpload_config['xml'])) {\n $fileUpload_config['xml'] = 'default';\n }\n if (!isset($fileUpload_config['uploader'])) {\n $fileUpload_config['uploader'] = 'defaultFileUpload.php';\n }\n if (!isset($fileUpload_config['btn-text'])) {\n $fileUpload_config['btn-text'] = 'Select files...';\n }\n if (!isset($fileUpload_config['max-number-of-files'])) {\n $fileUpload_config['max-number-of-files'] = 1;\n }\n if (!defined('PLUGINS_DIR')) {\n include_once dirname(__FILE__) . '/plugins-path.php';\n }\n\n /* remove [] from name if array of files */\n\n if (preg_match('`\\[\\]`', $name)) {\n $uploaderId = preg_replace('`\\[\\]`', '', $name);\n } else {\n $uploaderId = $name;\n }\n $xml_replacements = array('%uploader%' => $fileUpload_config['uploader'], '%max-number-of-files%' => $fileUpload_config['max-number-of-files'], '%PLUGINS_DIR%' => PLUGINS_DIR, '%file-input%' => $name, '%uploader-id%' => $uploaderId);\n $this->addPlugin('fileupload', '#' . $this->form_ID, $fileUpload_config['xml'], $xml_replacements);\n if (!empty($this->options['elementsWrapper'])) {\n $this->html .= $this->elements_start_wrapper . \" \\n\";\n }\n if (!empty($label)) {\n $this->html .= '<label for=\"' . $name . '\"' . $this->getLabelClass() . '>';\n if (in_array($name, array_keys($this->error_fields))) {\n $this->html .= '<span class=\"text-danger\">' . $this->getRequired($label, $attr) . '</span>';\n } else {\n $this->html .=$this->getRequired($label, $attr);\n }\n if ($this->options['wrapElementsIntoLabels'] === false) {\n $this->html .= '</label>';\n }\n $this->html .= \" \\n\";\n }\n $this->html .= $this->getElementCol('start', $label);\n if (isset($this->input_wrapper[$name])) {\n $this->html .= $this->defineWrapper($this->input_wrapper[$name], 'start');\n }\n $this->html .= $this->getHtmlElementContent($name, 'before');\n\n /* getting html_code from xml */\n\n $xml = simplexml_load_file(dirname(__FILE__) . '/plugins-config/fileupload.xml');\n $html_code = $xml->$fileUpload_config['xml']->html_code;\n $search = array('`%input_name%`', '`%btn-text%`');\n $replace = array($name, $fileUpload_config['btn-text']);\n $this->html .= preg_replace($search, $replace, $html_code);\n $this->html .= $this->getHtmlElementContent($name, 'after');\n if (isset($this->input_wrapper[$name])) {\n $this->html .= $this->defineWrapper($this->input_wrapper[$name], 'end');\n }\n $this->html .= $this->getElementCol('end');\n if (!empty($label) && $this->options['wrapElementsIntoLabels'] === true) {\n $this->html .= '</label>' . \" \\n\";\n }\n if (!empty($this->options['elementsWrapper'])) {\n $this->html .= $this->elements_end_wrapper . \" \\n\";\n }\n $this->registerField($name);\n }", "function filefield_widget_value($element, $edit = FALSE) {\r\n if (!$edit) {\r\n $file = field_file_load($element['#default_value']['fid']);\r\n $item = $element['#default_value'];\r\n }\r\n else {\r\n $item = $edit;\r\n $field = content_fields($element['#field_name'], $element['#type_name']);\r\n\r\n // Uploads take priority over value of fid text field.\r\n if ($fid = filefield_save_upload($element)) {\r\n $item['fid'] = $fid;\r\n }\r\n // Check for #filefield_value_callback values.\r\n // Because FAPI does not allow multiple #value_callback values like it does\r\n // for #element_validate and #process, this fills the missing functionality\r\n // to allow FileField to be extended purely through FAPI.\r\n elseif (isset($element['#filefield_value_callback'])) {\r\n foreach ($element['#filefield_value_callback'] as $callback) {\r\n $callback($element, $item);\r\n }\r\n }\r\n\r\n // Load file if the FID has changed so that it can be saved by CCK.\r\n $file = field_file_load($item['fid']);\r\n\r\n // If the file entry doesn't exist, don't save anything.\r\n if (empty($file)) {\r\n $item = array();\r\n }\r\n\r\n // Checkboxes loose their value when empty.\r\n // If the list field is present make sure its unchecked value is saved.\r\n if (!empty($field['list_field']) && empty($edit['list'])) {\r\n $item['list'] = 0;\r\n }\r\n }\r\n // Merge file and item data so it is available to all widgets.\r\n if (isset($item['data']) && isset($file['data'])) {\r\n $file['data'] = array_merge($item['data'], $file['data']);\r\n }\r\n $item = array_merge($item, $file);\r\n\r\n return $item;\r\n}", "function upload_file( $settings, $value ) {\n\t\t\tob_start();\n\t\t\t?>\n\n\t\t\t<div class=\"select_fa_icon_bb_param_block\">\n\t\t\t\t<input name=\"<?php echo esc_attr( $settings['param_name'] ); ?>\" class=\"wpb_vc_param_value wpb-textinput <?php echo esc_attr( $settings['param_name'] ) . ' ' . esc_attr( $settings['type'] ); ?>_field\" id=\"<?php echo esc_attr( $settings['param_name'] ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $value ); ?>\" />\n\t\t\t\t<input type=\"button\" onclick=\"WidgetsUploader.fileUploader.openFileFrame( '<?php echo esc_attr( $settings['param_name'] ); ?>' );\" class=\"upload-brochure-file button button-secondary\" value=\"<?php _ex( 'Upload file', 'backend', 'vc-elements-pt' ); ?>\" />\n\t\t\t</div>\n\n\t\t\t<?php\n\t\t\treturn ob_get_clean();\n\t\t}", "function ft_file_get_uploaded_files_hook($params)\n{\n global $g_table_prefix;\n\n $form_id = $params[\"form_id\"];\n $field_ids = (isset($params[\"field_ids\"]) && is_array($params[\"field_ids\"])) ? $params[\"field_ids\"] : array();\n\n $module_field_type_id = ft_get_field_type_id_by_identifier(\"file\");\n\n $data = array();\n foreach ($field_ids as $field_id)\n {\n $field_type_id = ft_get_field_type_id_by_field_id($field_id);\n if ($field_type_id != $module_field_type_id)\n continue;\n\n $result = ft_get_field_col_by_field_id($form_id, field_id);\n $col_name = $result[$field_id];\n if (empty($col_name))\n continue;\n\n $query = mysql_query(\"SELECT submission_id, $col_name FROM {$g_table_prefix}form_{$form_id}\");\n if (!$query)\n continue;\n\n\n $field_settings = ft_get_field_settings($field_id);\n while ($row = mysql_fetch_assoc($query))\n {\n // here, nothing's been uploaded in the field\n if (empty($row[$col_name]))\n continue;\n\n $data[] = array(\n \"submission_id\" => $row[\"submission_id\"],\n \"field_id\" => $field_id,\n \"field_type_id\" => $module_field_type_id,\n \"folder_path\" => $field_settings[\"folder_path\"],\n \"folder_url\" => $field_settings[\"folder_url\"],\n \"filename\" => $row[$col_name]\n );\n }\n }\n\n return array(\n \"uploaded_files\" => $data\n );\n}", "public static function file($name, array $attributes = NULL)\n\t{\n\t\t$inner = ($label = Form::intercept($attributes, 'label')) ? Form::label($name, $label) : '';\n\n\t\t// Keep inputted text in case of error\n\t\tif ($value === NULL and isset($_POST[$name]))\n\t\t{\n\t\t\t$value = $_POST[$name];\n\t\t}\n\n\t\t$attributes['id'] = $name;\n\t\t$inner .= parent::file($name, $attributes);\n\n\t\treturn Form::wrap(\n\t\t\t$inner,\n\t\t\t$name,\n\t\t\t'file'\n\t\t);\n\t}", "function acf_get_file_input( $attrs = array() ) {\n\t$field_key = isset( $attrs['key'] ) && is_string( $attrs['key'] ) ? $attrs['key'] : '';\n\t$nonce_field = '';\n\n\t/**\n\t * If we don't have a field key (most likely because this was called by a third-party field),\n\t * we have to try to guess the field key based on the field name.\n\t */\n\tif ( '' === $field_key ) {\n\t\t$parts = explode( '[', $attrs['name'] );\n\t\tif ( is_array( $parts ) && ! empty( $parts[1] ) ) {\n\t\t\t// Remove the trailing `]`.\n\t\t\t$field_key = substr( end( $parts ), 0, -1 );\n\t\t}\n\t}\n\n\t/**\n\t * We only output the nonce if we have a field key, as it's possible to render\n\t * the file input without a real field. But, basic uploaders that don't have any\n\t * custom logic will likely fail to upload anyway if they don't have a field key.\n\t */\n\tif ( '' !== $field_key ) {\n\t\t$nonce_attrs = array(\n\t\t\t'name' => 'acf[' . $field_key . '_file_nonce]',\n\t\t\t'value' => wp_create_nonce( 'acf/file_uploader_nonce/' . $field_key ),\n\t\t);\n\t\t$nonce_field = sprintf(\n\t\t\t'<input type=\"hidden\" %s />',\n\t\t\tacf_esc_attrs( $nonce_attrs )\n\t\t);\n\t}\n\n\treturn sprintf(\n\t\t'<input type=\"file\" %1$s />%2$s',\n\t\tacf_esc_attrs( $attrs ),\n\t\t$nonce_field\n\t);\n}", "public function multifile($filedata) { // $_FILES['files'];\n if (count($filedata) == 0)\n return FALSE;\n $files = array();\n $all_files = $filedata['name'];\n $i = 0;\n foreach ($all_files as $filename) {\n $files[++$i]['name'] = $filename;\n $files[$i]['type'] = current($filedata['type']);\n next($filedata['type']);\n $files[$i]['tmp_name'] = current($filedata['tmp_name']);\n next($filedata['tmp_name']);\n $files[$i]['error'] = current($filedata['error']);\n next($filedata['error']);\n $files[$i]['size'] = current($filedata['size']);\n next($filedata['size']);\n }\n return $files;\n }", "function generate($element_id){\n\t\t$html_form = '<input type=\"file\" id=\"' . $element_id . '\" name=\"' . $element_id . '\" ';\n\t\tif(count($this->attributes)){\n\t\t\tforeach($this->attributes as $inside_key => $inside_value){\n\t\t\t\tif($inside_key != 'id')\n\t\t\t\t\t$html_form .= $inside_key . '=\"' . $inside_value . '\" ';\n\t\t\t}\n\t\t}\n\t\t$html_form .= '/>';\n\n\t\t// return elements html\n\t\treturn $html_form;\n\t}", "public function addFormFileUpload($title = '', $name = '', $mimeTypes = 'jpg, png, gif', $maxSize = '2048kb') {\n//$this->addDebug(DEBUG_FUNCTION_TRACE, '$title=' . $title . ', $name=' . $name . ', $mimeTypes=' . $mimeTypes . ', $maxSize=' . $maxSize);\n $tags[] = 'name=\"' . $name . '\"';\n $tags[] = 'type=\"file\"';\n\n\n $validations = '';\n if (!($mimeTypes == '' || $mimeTypes == null)) {\n $tags[] = 'data-validation-allowing=\"' . $mimeTypes . '\"';\n $validations .= 'mime';\n }\n if (!($maxSize == '' || $maxSize == null)) {\n if (strlen($validations) > 0) {\n $validations .= ' ';\n }\n $validations .= 'size';\n $tags[] = 'data-validation-max-size=\"' . $maxSize . '\"';\n }\n\n $tags[] = 'data-validation=\"' . $validations . '\"';\n $this->addForm($title, 'input', $tags);\n }" ]
[ "0.7336792", "0.7332652", "0.6873215", "0.6734392", "0.67142415", "0.6668399", "0.65692073", "0.65205157", "0.6426854", "0.64188755", "0.63752913", "0.63724834", "0.63451433", "0.6299215", "0.62709045", "0.6231314", "0.62197876", "0.62142986", "0.6204529", "0.6095352", "0.6082911", "0.60773116", "0.6056965", "0.60518044", "0.60454047", "0.60427237", "0.60395265", "0.60361165", "0.60287356", "0.60122687" ]
0.8352688
0
Renders the exception panel for the given token.
public function showAction($token) { if (null === $this->profiler) { throw new NotFoundHttpException('The profiler must be enabled.'); } $this->profiler->disable(); $exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException(); $template = $this->getTemplate(); if (!$this->twig->getLoader()->exists($template)) { $handler = new ExceptionHandler($this->debug, $this->twig->getCharset()); return new Response($handler->getContent($exception), 200, array('Content-Type' => 'text/html')); } $code = $exception->getStatusCode(); return new Response($this->twig->render( $template, array( 'status_code' => $code, 'status_text' => Response::$statusTexts[$code], 'exception' => $exception, 'logger' => null, 'currentContent' => '', ) ), 200, array('Content-Type' => 'text/html')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cssAction($token)\n {\n if (null === $this->profiler) {\n throw new NotFoundHttpException('The profiler must be enabled.');\n }\n\n $this->profiler->disable();\n\n $exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException();\n $template = $this->getTemplate();\n\n if (!$this->templateExists($template)) {\n $handler = new ExceptionHandler($this->debug, $this->twig->getCharset());\n\n return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css'));\n }\n\n return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, array('Content-Type' => 'text/css'));\n }", "public static function makeExceptionCont(){\n\t\tif(isset($_SESSION[\"exception\"]) && !empty($_SESSION[\"exception\"])){\n\t\t\techo sprintf(\"<div id=\\\"exception\\\">%s</div>\", $_SESSION[\"exception\"]->__toString());\n\t\t}\n\t}", "public function displayException(){\n echo $this->exp_error;\n }", "public function render(Exception $ex): void;", "public function error(): void\n {\n //Build and render view\n $this->data['title'] = 'Ошибка :: Доступ запрещён';\n $this->view->addPart('common' . DS . 'header');\n $this->view->addPart('deny');\n $this->view->addPart('common' . DS . 'footer');\n $this->view->render($this->data);\n }", "public function render()\n {\n return view('exception.invalid_data');\n }", "public function panelLogAction($token, Request $request)\n {\n\n $this->loadServices();\n\n $queryManager = $this->container->get('beauty_log.query_manager');\n $queryManager->handleQueries($request, $token);\n $engine = $queryManager->getEngineServiceId();\n\n if (null !== $engine) {\n $queryManager->setEngine($this->container->get('beauty_log.' . $engine));\n }\n\n $this->profilerManager->loadProfiles($queryManager);\n\n\n $this->profiler = $this->profilerManager->getProfiler();\n if (null === $this->profiler) {\n throw new NotFoundHttpException('The profiler must be enabled.');\n }\n\n $profile = $this->profilerManager->getProfile();\n if (!$profile) {\n return new Response($this->twig->render('WebProfilerBundle:Profiler:info.html.twig', array('about' => 'no_token', 'token' => $token)), 200, array('Content-Type' => 'text/html'));\n }\n\n if (!$this->profilerManager->hasCollector()) {\n throw new NotFoundHttpException(sprintf('Panel \"%s\" is not available for token \"%s\".', $this->profilerManager->getPanel(), $token));\n }\n\n return new Response(\n $this->twig->render(\"BeautyLogBundle:Collector:logger.html.twig\",\n array(\n 'token' => $token,\n 'profile' => $profile,\n 'collector' => $this->profilerManager->getCollector(),\n 'panel' => $this->profilerManager->getPanel(),\n 'request' => $request,\n 'templates' => $this->getTemplateManager()->getTemplates($profile),\n 'is_ajax' => $request->isXmlHttpRequest(),\n 'counted_data' => $this->profilerManager->getCountedData(),\n 'query_manager' => $queryManager,\n 'engine_data' => $this->profilerManager->getData(),\n )\n ),\n 200,\n array('Content-Type' => 'text/html')\n );\n }", "public function errorExceptionAction()\n {\n $product = false;\n if(!$product){\n throw new \\Exception('Something went wrong!');\n }\n return $this->render('AppBundle:Lucky:number.html.twig', array(\n ));\n }", "public function render($request, Exception $exception)\n {\n //\n }", "public function display(Exception $exception);", "public function display(Exception $exception);", "public function render($request, Exception $e);", "public function errorAction()\n {\n return $this->render('SurveyBundle:Survey:error.html.twig');\n }", "function showErr()\n {\n if ($this->Err){\n ?>\n <div class=\"err\" align=center>\n <h2><?=$this->Msg->show_text('MSG_ERR', TblSysTxt);?></h2>\n <?=$this->Err;?>\n </div>\n <?\n }\n }", "public function render($request, Exception $e)\n {\n /*if ($e instanceof ModelNotFoundException) {\n $e = new NotFoundHttpException($e->getMessage(), $e);\n }\n\n if(Request::isMethod('post')){\n if ( !Input::get('_token')) {\n //throw new Illuminate\\Session\\TokenMismatchException;\n Flash::toastInfo('Token match exeption.');\n return redirect()->route('login')->with('flash', Flash::all());\n }\n }\n\n if ($e instanceof TokenMismatchException) {\n Flash::toastInfo('Token match exeption.');\n return redirect()->route('login')->with('flash', Flash::all());\n }*/\n\n if($e instanceof TokenResponseException){\n switch ($e->getCode()){\n case 500:\n $message = \"Internal server error\";\n break;\n case 400:\n $message = \"Page not found.\";\n break;\n default:\n $message = \"Unknown error ocurrent.\";\n }\n if($request->ajax()){\n $response['status'] = 'error';\n $response['message']= $message;\n return response()->json($response);\n }else {\n Flash::toastError($message);\n return redirect()->back()->with('flash', Flash::all());\n }\n }\n if ($e instanceof NotFoundHttpException){\n if($request->ajax()){\n\n }else{\n View::share(['routename'=> 'NotFound','flash'=>$request]);\n }\n }\n if ($e instanceof TokenMismatchException) {\n if($request->ajax()){\n $response['status'] = 'error';\n $response['message']= 'Token error.';\n return response()->json($response);\n }else {\n Flash::toastError('Unknown error.');\n return redirect('/')->with('flash', Flash::all());\n }\n }\n if($e instanceof MethodNotAllowedHttpException){\n $message = $e->getMessage();\n Flash::toastError($message);\n return redirect()->back()->with('flash', Flash::all());\n }\n return parent::render($request, $e);\n }", "private function _drawFancyError(Exception $ex) \n {\n if ($this->_htmlMode !== true)\n {\n return \"\\n===== Error: \" . $ex->getMessage() . \"\\n\". $ex->getTraceAsString() . \"\\n========== \\n\\n\";\n }\n $html = '<div class=\"fancyErrorWrapper\">';\n $html .= '<div class=\"title\" onclick=\"$(this).next().toggle();\">' . $ex->getMessage() . '</div>';\n $html .= '<div class=\"trace\" style=\"display:none;\">';\n foreach(explode(\"\\n\", $ex->getTraceAsString()) as $index => $row)\n {\n $html .= '<div class=\"item' . ($index % 2 === 0 ? '' : 'Alter') . '\">' . $row . '</div>';\n }\n $html .= '</div>';\n $html .= '</div>';\n return $html;\n }", "protected function displayFailure($msg){\n\t\t$back_trace = array('Inicio', 'Movimientos', 'Envios');\n\t\t\n\t\t$start_date = $this->_mRequest->getProperty('start_date');\n\t\t$end_date = $this->_mRequest->getProperty('end_date');\n\t\t\n\t\tPage::display(array('module_title' => INVENTORY_TITLE, 'main_menu' => 'main_menu_inventory_html.tpl',\n\t\t\t\t'back_trace' => $back_trace, 'second_menu' => 'movements_menu_html.tpl',\n\t\t\t\t'content' => 'document_menu_html.tpl', 'document_name' => 'Envio',\n\t\t\t\t'create_link' => 'index.php?cmd=create_shipment', 'get_link' => 'index.php?cmd=get_shipment',\n\t\t\t\t'search_link' => 'index.php?cmd=search_shipment&page=1', 'notify' => '1',\n\t\t\t\t'type' => 'error', 'message' => $msg, 'start_date' => $start_date, 'end_date' => $end_date),\n\t\t\t\t'site_html.tpl');\n\t}", "protected function redirectToShowTokenizationError()\n {\n $this->redirectToShowError('Cannot process your request, please contact the administrator.');\n }", "private function renderAccessDenied()\n {\n \\Yii::$app->getSession()->setFlash('AccessDenied', 'Access denied');\n\n return $this->render('@app/modules/account/views/denied/access-denied');\n }", "public function render( $request, Exception $exception ) {\n\t\treturn parent::render( $request, $exception );\n\t}", "public function render(\\Exception $exception)\n {\n if ($exception instanceof ModelNotFoundException || $exception instanceof PageNotFoundException) {\n return view('errors/error',[\n 'errorCode' => $exception->getCode(),\n 'errorMessage' => $exception->getMessage()\n ]);\n }\n if ($exception instanceof \\Exception) {\n return view('errors/error',[\n 'errorCode' => $exception->getCode(),\n 'errorMessage' => $exception->getMessage()\n ]);\n }\n }", "public function render($request, Exception $exception) :Response\n {\n if ($exception instanceof UnauthorizedHttpException) {\n $preException = $exception->getPrevious();\n if ($preException instanceof\n TokenExpiredException) {\n return response()->json([\n 'data' => null,\n 'status' => false,\n 'err_' => [\n 'message' => 'Token Expired',\n 'code' =>1\n ]\n ]\n );\n }\n else if ($preException instanceof\n TokenInvalidException) {\n return response()->json([\n 'data' => null,\n 'status' => false,\n 'err_' => [\n 'message' => 'Token Invalid',\n 'code' => 1\n ]\n ]\n );\n } else if ($preException instanceof\n TokenBlacklistedException) {\n return response()->json([\n 'data' => null,\n 'status' => false,\n 'err_' => [\n 'message' => 'Token Blacklisted',\n 'code' => 1\n ]\n ]\n );\n}\nif ($exception->getMessage() === 'Token not provided') {\n return response()->json([\n 'data' => null,\n 'status' => false,\n 'err_' => [\n 'message' => 'Token not provided',\n 'code' => 1\n ]\n ]\n);\n}else if( $exception->getMessage() === 'User not found'){\n return response()->json([\n 'data' => null,\n 'status' => false,\n 'err_' => [\n 'message' => 'User Not Found',\n 'code' => 1\n ]\n ]\n);\n}\n}\nreturn parent::render($request, $exception);\n}", "public function display_access_token_error() {\n $this->display_admin_notice( \"Access token missing from response, please try again!\", \"error\" );\n }", "protected function _render(Zend_Markup_Token $token)\n {\n $return = '';\n\n $this->_token = $token;\n\n // if this tag has children, execute them\n if ($token->hasChildren()) {\n foreach ($token->getChildren() as $child) {\n $return .= $this->_execute($child);\n }\n }\n\n return $return;\n }", "public function render($request, Exception $exception)\n {\n if ($exception instanceof ValidationException) {\n $errors = collect($exception->errors())->reduce(function ($acc, $item) {\n return array_merge($acc, array_values($item));\n }, []);\n $exception = new HttpResponseException($errors, $exception->status);\n } else if ($exception instanceof ExpiredException) {\n $exception = new HttpResponseException(['Token Expired Exception'], 403);\n } else if ($exception instanceof \\UnexpectedValueException) {\n $exception = new HttpResponseException(['Unexpected Value Exception'], 403);\n } else if ($exception instanceof AuthenticationException) {\n $exception = new HttpResponseException(['not authenticated'], 403);\n }\n\n return parent::render($request, $exception);\n }", "function displayError($key) {\n\tif(isset($_SESSION['errors'][$key])) { ?>\n\t\t<span id=\"<?= $key . \"Error\" ?>\" class=\"error\"><?= $_SESSION['errors'][$key] ?></span>\n\t<?php }\n}", "public function display_token_url_call_error() {\n $this->display_admin_notice( \"Call to token URL failed, please try again!\", \"error\" );\n }", "public function displayException($exception) {\n $file = $exception->getFile();\n $line = $exception->getLine();\n if (X3_DEBUG) {\n $trace = $exception->getTrace();\n array_unshift($trace, array('file' => $file, 'line' => $line, 'class' => $exception->getMessage()));\n echo '<h1>' . get_class($exception) . \"[\" . $exception->getCode() . \"]</h1>\\n\";\n foreach ($trace as $debug) {\n $file = $debug['file'];\n $line = $debug['line'];\n $message = $debug['class'];\n $filename = pathinfo($file, PATHINFO_BASENAME);\n echo \"<p>$message (<b>$filename</b>:$line)</p>\\n\";\n if (is_file($file)) {\n $lines = file($file);\n $total = count($lines);\n $width = strlen((string) ($line + self::ERROR_OUTPUT_RADIUS)) * 10;\n for ($i = $line - self::ERROR_OUTPUT_RADIUS; $i < $line + self::ERROR_OUTPUT_RADIUS; $i++) {\n if (array_key_exists($i, $lines)) {\n $lines[$i] = htmlspecialchars($lines[$i]);\n echo \"<div style=\\\"margin:0 0 0 40px;background-color:\" . (($i == $line - 1) ? '#FCBFBF' : '#F28A8A') . \";border-left:2px solid #D11212\\\"><div style=\\\"float:left;width:{$width}px;background:#FFEDED;border-right:1px solid #D11212;color:#c1c1c1\\\">\" . ($i + 1) . \"</div><div>&nbsp;{$lines[$i]}</div></div>\\n\";\n }\n }\n }\n }\n } else {\n echo '<h1>' . get_class($exception) . \"</h1>\\n\";\n echo '<p>' . $exception->getMessage() . '</p>';\n }\n $message = $exception->getMessage();\n X3::log(\"PHP Exception $message, $file, $line\");\n exit;\n }", "public function render($request, Exception $exception)\n {\n return parent::render($request, $exception);\n }", "public function actionError()\n\t{\n\t\t$this->renderPartial('error');\n\t}" ]
[ "0.62105197", "0.6158631", "0.60133344", "0.5641821", "0.55947226", "0.5584859", "0.553996", "0.5511476", "0.5499988", "0.5498999", "0.5498999", "0.540649", "0.53647155", "0.536436", "0.5327206", "0.53244376", "0.5322482", "0.53076166", "0.5297654", "0.52215165", "0.5220487", "0.5220181", "0.5202297", "0.51693785", "0.512511", "0.5112267", "0.51019126", "0.5100405", "0.50992084", "0.5077505" ]
0.6244448
0
Renders the exception panel stylesheet for the given token.
public function cssAction($token) { if (null === $this->profiler) { throw new NotFoundHttpException('The profiler must be enabled.'); } $this->profiler->disable(); $exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException(); $template = $this->getTemplate(); if (!$this->templateExists($template)) { $handler = new ExceptionHandler($this->debug, $this->twig->getCharset()); return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css')); } return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, array('Content-Type' => 'text/css')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function makeExceptionCont(){\n\t\tif(isset($_SESSION[\"exception\"]) && !empty($_SESSION[\"exception\"])){\n\t\t\techo sprintf(\"<div id=\\\"exception\\\">%s</div>\", $_SESSION[\"exception\"]->__toString());\n\t\t}\n\t}", "public function showAction($token)\n {\n if (null === $this->profiler) {\n throw new NotFoundHttpException('The profiler must be enabled.');\n }\n\n $this->profiler->disable();\n\n $exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException();\n $template = $this->getTemplate();\n\n if (!$this->twig->getLoader()->exists($template)) {\n $handler = new ExceptionHandler($this->debug, $this->twig->getCharset());\n\n return new Response($handler->getContent($exception), 200, array('Content-Type' => 'text/html'));\n }\n\n $code = $exception->getStatusCode();\n\n return new Response($this->twig->render(\n $template,\n array(\n 'status_code' => $code,\n 'status_text' => Response::$statusTexts[$code],\n 'exception' => $exception,\n 'logger' => null,\n 'currentContent' => '',\n )\n ), 200, array('Content-Type' => 'text/html'));\n }", "public function render(Exception $ex): void;", "public function render($request, Exception $exception)\n {\n //\n }", "public function render( $request, Exception $exception ) {\n\t\treturn parent::render( $request, $exception );\n\t}", "public function error(): void\n {\n //Build and render view\n $this->data['title'] = 'Ошибка :: Доступ запрещён';\n $this->view->addPart('common' . DS . 'header');\n $this->view->addPart('deny');\n $this->view->addPart('common' . DS . 'footer');\n $this->view->render($this->data);\n }", "public function render($request, Exception $exception)\n {\n return parent::render($request, $exception);\n }", "public function initCursedPage()\r\r\n {\r\r\n $this->layout = 'invalid_token.tpl';\r\r\n }", "protected function redirectToShowTokenizationError()\n {\n $this->redirectToShowError('Cannot process your request, please contact the administrator.');\n }", "public function render($request, Exception $e);", "public function render($request, Exception $exception)\n {\n return parent::render($request, $exception);\n }", "public function render($request, Exception $exception)\n {\n return parent::render($request, $exception);\n }", "public function render($request, Exception $exception)\n {\n return parent::render($request, $exception);\n }", "public function render($request, Exception $exception)\n {\n return parent::render($request, $exception);\n }", "function error($content){\r\n return '<span class=\"error\" style=\"color: #ff0000;\">' . $content . '</span>';\r\n}", "public function displayException(){\n echo $this->exp_error;\n }", "protected function _render(Zend_Markup_Token $token)\n {\n $return = '';\n\n $this->_token = $token;\n\n // if this tag has children, execute them\n if ($token->hasChildren()) {\n foreach ($token->getChildren() as $child) {\n $return .= $this->_execute($child);\n }\n }\n\n return $return;\n }", "public function run()\n {\n $block = ob_get_clean();\n if ($this->renderInPlace) {\n throw new \\Exception(\"not implemented yet ! \");\n }\n $block = trim($block);\n $cssBlockPattern = '|^<style[^>]*>(?P<blockContent>.+?)</style>$|is';\n if (preg_match($cssBlockPattern, $block, $matches)) {\n $block = $matches['blockContent'];\n }\n $this->view->registerCss($block, $this->options, $this->key);\n }", "public function render($request, Exception $e)\n {\n /*if ($e instanceof ModelNotFoundException) {\n $e = new NotFoundHttpException($e->getMessage(), $e);\n }\n\n if(Request::isMethod('post')){\n if ( !Input::get('_token')) {\n //throw new Illuminate\\Session\\TokenMismatchException;\n Flash::toastInfo('Token match exeption.');\n return redirect()->route('login')->with('flash', Flash::all());\n }\n }\n\n if ($e instanceof TokenMismatchException) {\n Flash::toastInfo('Token match exeption.');\n return redirect()->route('login')->with('flash', Flash::all());\n }*/\n\n if($e instanceof TokenResponseException){\n switch ($e->getCode()){\n case 500:\n $message = \"Internal server error\";\n break;\n case 400:\n $message = \"Page not found.\";\n break;\n default:\n $message = \"Unknown error ocurrent.\";\n }\n if($request->ajax()){\n $response['status'] = 'error';\n $response['message']= $message;\n return response()->json($response);\n }else {\n Flash::toastError($message);\n return redirect()->back()->with('flash', Flash::all());\n }\n }\n if ($e instanceof NotFoundHttpException){\n if($request->ajax()){\n\n }else{\n View::share(['routename'=> 'NotFound','flash'=>$request]);\n }\n }\n if ($e instanceof TokenMismatchException) {\n if($request->ajax()){\n $response['status'] = 'error';\n $response['message']= 'Token error.';\n return response()->json($response);\n }else {\n Flash::toastError('Unknown error.');\n return redirect('/')->with('flash', Flash::all());\n }\n }\n if($e instanceof MethodNotAllowedHttpException){\n $message = $e->getMessage();\n Flash::toastError($message);\n return redirect()->back()->with('flash', Flash::all());\n }\n return parent::render($request, $e);\n }", "public function errorExceptionAction()\n {\n $product = false;\n if(!$product){\n throw new \\Exception('Something went wrong!');\n }\n return $this->render('AppBundle:Lucky:number.html.twig', array(\n ));\n }", "public function render($request, Exception $exception) :Response\n {\n if ($exception instanceof UnauthorizedHttpException) {\n $preException = $exception->getPrevious();\n if ($preException instanceof\n TokenExpiredException) {\n return response()->json([\n 'data' => null,\n 'status' => false,\n 'err_' => [\n 'message' => 'Token Expired',\n 'code' =>1\n ]\n ]\n );\n }\n else if ($preException instanceof\n TokenInvalidException) {\n return response()->json([\n 'data' => null,\n 'status' => false,\n 'err_' => [\n 'message' => 'Token Invalid',\n 'code' => 1\n ]\n ]\n );\n } else if ($preException instanceof\n TokenBlacklistedException) {\n return response()->json([\n 'data' => null,\n 'status' => false,\n 'err_' => [\n 'message' => 'Token Blacklisted',\n 'code' => 1\n ]\n ]\n );\n}\nif ($exception->getMessage() === 'Token not provided') {\n return response()->json([\n 'data' => null,\n 'status' => false,\n 'err_' => [\n 'message' => 'Token not provided',\n 'code' => 1\n ]\n ]\n);\n}else if( $exception->getMessage() === 'User not found'){\n return response()->json([\n 'data' => null,\n 'status' => false,\n 'err_' => [\n 'message' => 'User Not Found',\n 'code' => 1\n ]\n ]\n);\n}\n}\nreturn parent::render($request, $exception);\n}", "public function styleAction()\n\t{\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t//Récupère le nom de la personne qui accède à l'administration\n\t\t$user = $this->container->get('security.context')->getToken()->getUser();\n\t\t//on vérifie le role\n\t\t$validRole = new ControleDataSecureController();\n\t\t$role = $validRole->getValidRoles($user);\n\t\t//Affiche la liste des styles\n\t\t$style = $em->getRepository('MyAppGlobalBundle:Styles_hebergements')->getListStyleHebergement();\n\t\t//Préparation de la view dashboard_style_html.twig\n\t\treturn $this->render('MyAppAdminBundle:Hebergement:dashboard_style.html.twig',\n\t\t\t\tarray(\n\t\t\t\t\t\t'annee' \t\t\t\t\t\t=> date('Y'),\n\t\t\t\t\t\t'name_admin' \t\t\t\t\t=> $user->getUsername(),\n\t\t\t\t\t\t'pointeur' \t\t\t\t\t\t=> 'pointeur',\n\t\t\t\t\t\t'styheb' \t\t\t\t\t\t=> \"menu_hebergement\",\n\t\t\t\t\t\t'style' \t\t\t\t\t\t=> $style,\n\t\t\t\t\t\t'role'\t\t\t\t\t\t\t=> $role,\n\t\t\t\t));\n\t}", "public function errorAction()\n {\n return $this->render('SurveyBundle:Survey:error.html.twig');\n }", "static public function setStyle()\r\n\t{\r\n\t\t$css\t= <<<CSS\r\n#dunerrors .debugitem {\r\n\tbackground-color: #F5F5F5;\r\n\tborder: 1px dashed rgba(0, 0, 0, 0.1);\r\n\tborder-radius: 4px 4px 4px 4px;\r\n\tbox-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset;\r\n\tcolor: #888888;\r\n\tfont-size: 11px;\r\n\tpadding: 2px 10px;\r\n}\r\n\r\n#dunerrors .debugitem {\r\n\tcolor: #000000;\r\n\tmargin: 5px;\r\n}\r\n\r\n#dunerrors h4 {\r\n\tborder-bottom: 1px solid #000000;\r\n\tfont-weight: bold;\r\n\tmargin: 0;\r\n\tpadding: 3px 0;\r\n}\r\n\r\n#dunerrors h4 span {\r\n\tfloat: right;\r\n}\r\n\r\n#dunerrors .code1 h4, #dunerrors .code2 h4, #dunerrors .code4 h4, #dunerrors .code16 h4, #dunerrors .code32 h4, #dunerrors .code64 h4, #dunerrors .code128 h4, #dunerrors .code256 h4, #dunerrors .code512 h4, #dunerrors .code2048 h4 {\r\n\tcolor: #FF0000;\r\n\tborder-color: #FF0000;\r\n}\r\n\r\n#dunerrors .line {\r\n\tmargin-left: 30px;\r\n}\r\n\t\r\n\t\r\nCSS;\r\n\t\tdunloader( 'document', true )->addStyleDeclaration( $css );\r\n\t}", "public function render($request, Exception $e)\n {\n if ($e instanceof TokenMismatchException){\n $data = [\n 'msg' => 'CSRF Token 错误, 请刷新页面',\n 'code' => '00003',\n 'token' => $request->session()->token()\n ];\n // todo 检查当前用户 token 错误原因\n // \n \n return response($data, 403)->withCookie(cookie('XSRF-TOKEN', $request->session()->token()));\n }\n\n if ($e->getMessage() == 'insufficient_permission') {\n if (!uid()) {\n $data = [\n 'msg' => '登录过期',\n 'code' => '00001'\n ];\n }else{\n $data = [\n 'msg' => '无权限访问',\n 'code' => '00002'\n ];\n }\n \n return response($data, 403);\n }\n\n return parent::render($request, $e);\n }", "public function render_soft_error(Exception $ex){\r\n\t\t$this->_js = array();\r\n\t\t$this->_css = array();\r\n\t\t$this->_exception = $ex;\r\n\t\t\r\n\t\t// set up HTTP status header\r\n\t\tif(!headers_sent() && $ex instanceof ServerException){\r\n\t\t\tstatic $msgs = array(\r\n\t\t\t\t100 => 'Continue',\r\n\t\t\t\t101 => 'Switching Protocols',\r\n\t\t\t\t200 => 'OK',\r\n\t\t\t\t201 => 'Created',\r\n\t\t\t\t202 => 'Accepted',\r\n\t\t\t\t203 => 'Non-Authoritative Information',\r\n\t\t\t\t204 => 'No Content',\r\n\t\t\t\t205 => 'Reset Content',\r\n\t\t\t\t206 => 'Partial Content',\r\n\t\t\t\t300 => 'Multiple Choices',\r\n\t\t\t\t301 => 'Moved Permanently',\r\n\t\t\t\t302 => 'Found', // 1.1\r\n\t\t\t\t303 => 'See Other',\r\n\t\t\t\t304 => 'Not Modified',\r\n\t\t\t\t305 => 'Use Proxy',\r\n\t\t\t\t307 => 'Temporary Redirect',\r\n\t\t\t\t400 => 'Bad Request',\r\n\t\t\t\t401 => 'Unauthorized',\r\n\t\t\t\t402 => 'Payment Required',\r\n\t\t\t\t403 => 'Forbidden',\r\n\t\t\t\t404 => 'Not Found',\r\n\t\t\t\t405 => 'Method Not Allowed',\r\n\t\t\t\t406 => 'Not Acceptable',\r\n\t\t\t\t407 => 'Proxy Authentication Required',\r\n\t\t\t\t408 => 'Request Timeout',\r\n\t\t\t\t409 => 'Conflict',\r\n\t\t\t\t410 => 'Gone',\r\n\t\t\t\t411 => 'Length Required',\r\n\t\t\t\t412 => 'Precondition Failed',\r\n\t\t\t\t413 => 'Request Entity Too Large',\r\n\t\t\t\t414 => 'Request-URI Too Long',\r\n\t\t\t\t415 => 'Unsupported Media Type',\r\n\t\t\t\t416 => 'Requested Range Not Satisfiable',\r\n\t\t\t\t417 => 'Expectation Failed',\r\n\t\t\t\t500 => 'Internal Server Error',\r\n\t\t\t\t501 => 'Not Implemented',\r\n\t\t\t\t502 => 'Bad Gateway',\r\n\t\t\t\t503 => 'Service Unavailable',\r\n\t\t\t\t504 => 'Gateway Timeout',\r\n\t\t\t\t505 => 'HTTP Version Not Supported',\r\n\t\t\t\t509 => 'Bandwidth Limit Exceeded',\r\n\t\t\t);\r\n\t\t\t$code = $ex->getCode();\r\n\t\t\t$mesg = $msgs[isset($msgs[$code]) ? $code : 500];\r\n\t\t\theader(\"HTTP/1.1 $code $mesg\", true, $code);\r\n\t\t}\r\n\t\t\r\n\t\techo $this->render();\r\n\t}", "public function render($request, \\Exception $e)\n {\n }", "private function _drawFancyError(Exception $ex) \n {\n if ($this->_htmlMode !== true)\n {\n return \"\\n===== Error: \" . $ex->getMessage() . \"\\n\". $ex->getTraceAsString() . \"\\n========== \\n\\n\";\n }\n $html = '<div class=\"fancyErrorWrapper\">';\n $html .= '<div class=\"title\" onclick=\"$(this).next().toggle();\">' . $ex->getMessage() . '</div>';\n $html .= '<div class=\"trace\" style=\"display:none;\">';\n foreach(explode(\"\\n\", $ex->getTraceAsString()) as $index => $row)\n {\n $html .= '<div class=\"item' . ($index % 2 === 0 ? '' : 'Alter') . '\">' . $row . '</div>';\n }\n $html .= '</div>';\n $html .= '</div>';\n return $html;\n }", "public function render($request, Exception $exception)\n {\n if ($exception instanceof ValidationException) {\n $errors = collect($exception->errors())->reduce(function ($acc, $item) {\n return array_merge($acc, array_values($item));\n }, []);\n $exception = new HttpResponseException($errors, $exception->status);\n } else if ($exception instanceof ExpiredException) {\n $exception = new HttpResponseException(['Token Expired Exception'], 403);\n } else if ($exception instanceof \\UnexpectedValueException) {\n $exception = new HttpResponseException(['Unexpected Value Exception'], 403);\n } else if ($exception instanceof AuthenticationException) {\n $exception = new HttpResponseException(['not authenticated'], 403);\n }\n\n return parent::render($request, $exception);\n }", "public function render($request, Throwable $exception) {\n\t\treturn parent::render($request, $exception);\n\t}" ]
[ "0.5311182", "0.51338446", "0.51138765", "0.49863765", "0.4921763", "0.48931065", "0.48849997", "0.4884262", "0.4879682", "0.47886503", "0.47588176", "0.47588176", "0.47588176", "0.47588176", "0.47318426", "0.46876103", "0.46690986", "0.46554288", "0.45726126", "0.45624587", "0.45596975", "0.45521057", "0.45210555", "0.45164755", "0.44983232", "0.44980708", "0.44963378", "0.4479994", "0.44679898", "0.44601965" ]
0.72461915
0
if we are doing selfcrossing, we will need two exactly same plants
function cross_plants( $arr_plants, $int_number_of_offspring ) { if ( count( $arr_plants ) == 1 ) { $arr_plants[ 1 ] = $arr_plants[ 0 ]; } // if we have multiple parents, then we will need to know how many plants we are going to pick // from each pair of the parents, so calculate $tmp_int_number_of_cross = count( $arr_plants ) * ( count( $arr_plants ) - 1 ) / 2; $tmp_int_plants_per_recombination = floor( $int_number_of_offspring / $tmp_int_number_of_cross ); // number of plants picked from each pair of parents $tmp_int_plants_remained = $int_number_of_offspring - $tmp_int_plants_per_recombination * $tmp_int_number_of_cross; $tmp_arr_next_generation = array(); for ( $i = 0; $i < count( $arr_plants ) - 1; ++$i ) { for ( $j = $i + 1; $j < count( $arr_plants ); ++$j ) { if ( $i == count( $arr_plants ) - 2 && $j == count( $arr_plants ) - 1 ) { $tmp_arr_next_generation = array_merge( $tmp_arr_next_generation, Simulation::combine_plants( $arr_plants[$i], $arr_plants[$j], $tmp_int_plants_per_recombination + $tmp_int_plants_remained ) ); } else { $tmp_arr_next_generation = array_merge( $tmp_arr_next_generation, Simulation::combine_plants( $arr_plants[$i], $arr_plants[$j], $tmp_int_plants_per_recombination ) ); } } } return $tmp_arr_next_generation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkifsameloc(){\n\t\tif($this->world->checklocation($this->posx, $this->posy + 1) && $this->world->checklocation($this->posx, $this->posy - 1)){\n\t\t\t\tif(rand(2,1) == 1){\n\t\t\t\t\t$this->posy++;\n\t\t\t\t} else {\n\t\t\t\t\t$this->posy++;\n\t\t\t\t}\n\t\t\t} elseif($this->world->checklocation($this->posx, $this->posy + 1)){\n\t\t\t\t$this->posy--;\n\t\t\t} else {\n\t\t\t\t$this->posy++;\n\t\t\t}\n\t\t//$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ERROR STATE AT \" . $this->world->nest[$this->type]->posx . \"-\" . $this->world->nest[$this->type]->posy);\n\t\t//uncomment to check when this function is firing, and on what object.\n\t}", "function checkForCollision()\n {\n $prev = null;\n\n foreach ($this->carts as $cart) {\n if ($prev) {\n if (!$cart->out && !$prev->out && $cart->ordinal($this->width) == $prev->ordinal($this->width)) {\n return $cart->x . ',' . $cart->y;\n }\n }\n $prev = $cart;\n }\n\n return null;\n }", "public function crossOver()\n\t{\n\n\t\t//ambil parent yang nilai fitesnya lebih tinggi\n\t\t//kawin silangkan parent yang terbaik\n\t\t//replace parent yang nilai fitnesnya jelek dengan child hasil kawin silang\n\t\t//sehingga total kromosom masih tetap sama dengan jumlah kromosom awal\n\t}", "private function generer_point_pop() {\n $t=0;\n while ($t<10) {\n $x = $this->x_depart + self::DECALAGE_X[0][$t];\n $y = $this->y_depart + self::DECALAGE_Y[0][$t];\n if ($this->secteurs[$y][$x]->getSecteurType() == 0) {\n $this->secteurs[$y][$x]->setSecteurType(99);\n $this->asteroidesPop();\n $t=10;\n \t}\n $t++;\n }\n // recherche du point de pop des autres joueurs\n $nb_niv = intval(TAILLE_MAP_COTE/(2*COEF_POPULATION)); // nb de niveaux de pop à générer\n $z=1;\n for ($niv=1;$niv<=$nb_niv;$niv++) {\n \t\t$s=1;\n \t\twhile ($s<=(8*$niv)) {\n \t\t\t$this->x_pos=$this->x_depart + (COEF_POPULATION*self::DECALAGE_X[$niv][$s]) + rand(-1,1);\n \t\t\t$this->y_pos=$this->y_depart + (COEF_POPULATION*self::DECALAGE_Y[$niv][$s]) + rand(-1,1);\n \t\t\t$t=0;\n \t\t\twhile ($t<10) {\n $x = $this->x_pos + self::DECALAGE_X[0][$t];\n $y = $this->y_pos + self::DECALAGE_Y[0][$t];\n if ($this->secteurs[$y][$x]->getSecteurType() == 0) {\n $this->secteurs[$y][$x]->setSecteurType(99);\n $this->secteurs[$y][$x]->setSecteurOrdre($z);\n $this->asteroidesPop();\n \t\t\t\t\t$t=10;\n \t\t\t\t\t$z++;\n \t\t\t\t}\n \t\t\t\t$t++;\n \t\t\t}\n \t\t\t$s++;\n \t\t}\n \t}\n\n }", "public function joinWithDisasterAreas();", "function checkIfIsZoneHell($pNbBuilding, $Building) {\n $altarRegionY = Utils::getSinglePostValueInt(REGIONY);\n if($Building->RegionY > $altarRegionY + 1 || $Building->RegionY < $altarRegionY - 1){\n return $pNbBuilding;\n }\n\n for($i = $Building->Y; $i < ($Building->Y + $Building->Height); $i++){\n for($j = 0; $j < 4; $j++){\n for($k = 0; $k < 4 - $j; $k++){\n $posY = Utils::getSinglePostValueInt(Y) - $k;\n\n $regionY = $altarRegionY;\n\n if($posY < -1) {\n $regionY = $altarRegionY - 1;\n $posY += 12;\n }\n\n if(\n (Utils::getSinglePostValueInt(REGIONX) + 1) == $Building->RegionX &&\n $regionY == $Building->RegionY &&\n $j == $Building->X &&\n $posY == $i\n ) {\n return $pNbBuilding + 1;\n }\n\n $posY = Utils::getSinglePostValueInt(Y) + $k;\n\n if($posY > 12) {\n $regionY = $altarRegionY - 1;\n $posY -= 13;\n }\n\n if(\n (Utils::getSinglePostValueInt(REGIONX) + 1) == $Building->RegionX &&\n $regionY == $Building->RegionY &&\n $j == $Building->X &&\n $posY == $i\n ) {\n return $pNbBuilding + 1;\n }\n\n\n }\n }\n }\n\n return $pNbBuilding;\n}", "private function generateAdultsPaxes() {\n foreach ($this->paxes as $key=> $pax) {\n if ($pax->getType() == 'AD') {\n unset($this->paxes[$key]);\n }\n }\n $this->paxes = array_values($this->paxes);\n for ($a = 0; $a < $this->adults; $a++) {\n $adult = new Pax();\n $adult->setType(\"AD\");\n $this->paxes[] = $adult;\n }\n }", "private function createNewChecklistPoint(){\n $takenIds = $this->select(\"SELECT `checklistPointId` FROM `checklistpoints` ORDER BY `checklistPointId`\"); \n $freeTry = 1;\n while($row = $takenIds->fetch_object()){\n if($row->checklistPointId != $freeTry){\n $freeId = $freeTry;\n }else{ $freeTry++; }\n }\n isset($freeId) ? $freeId : $freeId = $freeTry++;\n $this->properties['id'] = $freeId;\n }", "public function createPlanets() {\n\t\t$numPlanets = rand(0,15);\n\t\tif ($this->inhabitable && $numPlanets==0) $numPlanets=2;\n\t\t$sortedPlanets = array();\n\t\tfor ($i=0;$i<$numPlanets;$i++) {\n\t\t\t// Step 2: For each planet, place it at some random distance from the star\n\t\t\t$d = rand(10,(125000/$this->radius));\t// $d is a multiplier of the star's radius. 125K represents a shade less than 2 light-years.\n\t\t\t$this->children[$i] = new Heliosphere($this->dbconn);\n\t\t\t$this->children[$i]->setObjectType(3);\n\t\t\t$this->children[$i]->setStarID($this->starID);\n\t\t\t$this->children[$i]->setParentID($this->hoID);\n\t\t\t$this->children[$i]->setPlayerID(-1);\t// Nobody owns newly created planets\n\t\t\t$au = 1.00*$d*$this->radius;\n\t\t\tif ($au < 0.0001 || $au > 125000) $au = rand(1,1250000)/100;\n\t\t\t$this->children[$i]->setApogee($au);\n\t\t\t$this->children[$i]->setPerigee($au);\t// For early versions of the game, we'll only worry about circular orbits.\n\t\t\t$this->children[$i]->setRandomName('S'.$this->starID.'P'.$i);\n\t\t\t$sortedPlanets[$au]=$i;\n\t\t}\n\t\t// Step 3: Sort the planets by distance\n\t\tksort($sortedPlanets);\n\t\t$lastd = 0;\n\t\tforeach ($sortedPlanets as $d=>$i) {\n\t\t\t// Step 4: If any planets are too close together, move them\n\t\t\t// Minimum distance is 0.25 AU.\n\t\t\tif ($d-$lastd < 0.25) {\n\t\t\t\t$newd = $d;\n\t\t\t\tif ($lastd > $newd) $newd = $lastd + 0.1;\t// Avoid cumulative errors\n\t\t\t\t$newd += 0.3;\n\t\t\t\t$this->children[$i]->setApogee($newd);\n\t\t\t\t$this->children[$i]->setPerigee($newd);\t\n\t\t\t\t$lastd = $newd;\n\t\t\t} else\n\t\t\t\t$lastd = $d;\n\t\t}\n\t\t// Re-sort\n\t\tunset($sortedPlanets);\n\t\t$sortedPlanets = array();\n\t\tfor ($i=0;$i<$numPlanets;$i++) {\n\t\t\t$sortedPlanets[$this->children[$i]->getApogee()] = $i;\n\t\t}\n\t\tksort($sortedPlanets);\n\t\t// Step 5: If this is a habitable star, and no planets exist within the habitable zone, create one.\n\t\tif ($this->inhabitable) {\n\t\t\tforeach ($sortedPlanets as $d=>$i) {\n\t\t\t\tif ($d > ($this->radius*$this->goldilocksMax)) {\n\t\t\t\t\t$this->createHabitablePlanet($numPlanets);\n\t\t\t\t\t$sortedPlanets[($this->children[$numPlanets]->getApogee())] = $numPlanets;\n\t\t\t\t\t// print \"Creating Habitable Planet for Star {$this->starID} at \".$this->children[$numPlanets]->getApogee().\"<BR />\";\n\t\t\t\t\t$numPlanets++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (($d >= ($this->goldilocksMin*$this->radius)) && ($d <= ($this->goldilocksMax*$this->radius))) {\n\t\t\t\t\t$this->children[$i]->setHabitable(true);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Step 6: Determine the planet type based on its distance from the star.\n\t\t// Step 7: Determine the planet radius based on its distance and its type. (Earth's average radius is 6371km)\n\t\t// TODO: Step 8: Set the planet's temperature based on its distance and its type.\n\t\tforeach ($sortedPlanets as $d=>$i) {\n\t\t\tif ($this->children[$i]->isHabitable()) {\n\t\t\t\t$o = rand(1,100);\n\t\t\t\tif ($o < 5) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('WAT');\n\t\t\t\t} elseif ($o < 25) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('ICE');\n\t\t\t\t} else {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('ROK');\t\t\t\n\t\t\t\t}\n\t\t\t\t$this->children[$i]->setRadius(rand(4400,20000));\n\t\t\t} elseif ($d < $this->goldilocksMin) {\n\t\t\t\t$o = rand(1,100);\n\t\t\t\tif ($o < 5) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('WAT');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(2500,6000));\n\t\t\t\t} elseif ($o < 15) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('CRY');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(500,4000));\n\t\t\t\t} elseif ($o < 25) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('LAV');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(1500,5000));\n\t\t\t\t} else {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('ROK');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(3500,10000));\n\t\t\t\t}\n\t\t\t} elseif ($d < 5000) {\n\t\t\t\t$o = rand(1,100);\n\t\t\t\tif ($o < 3) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('CRY');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(4400,20000));\n\t\t\t\t} elseif ($o < 15) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('ROK');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(9000,40000));\n\t\t\t\t} elseif ($o < 20) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('ICE');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(4400,20000));\n\t\t\t\t} else {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('GAS');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(35000,100000));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$o = rand(1,1000);\n\t\t\t\tif ($o < 5) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('CRY');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(100,2000));\n\t\t\t\t} elseif ($o < 100) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('ROK');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(2000,20000));\n\t\t\t\t} elseif ($o < 550) {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('GAS');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(15000,50000));\n\t\t\t\t} else {\n\t\t\t\t\t$this->children[$i]->setSurfaceType('ICE');\n\t\t\t\t\t$this->children[$i]->setRadius(rand(500,5000));\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Step 8: Determine the planet period based on distance\n\t\t\t$dir = rand(1,100);\n\t\t\tif ($dir < 25) $sign = -1; else $sign = 1;\n\t\t\tif (!$this->children[$i]->isHabitable())\n\t\t\t\t$this->children[$i]->setPeriod($sign*($d/rand(50,500)));\n\t\t\telse\n\t\t\t\t$this->children[$i]->setPeriod($sign*(5/rand(1,20)));\n\t\t\t$this->children[$i]->setTheta(rand(0,3600)/10);\n//\t\t\tif ($this->children[$i]->getRadius()>0 && $this->children[$i]->getApogee()>0)\n\t\t\t\t$this->children[$i]->save();\n/*\t\t\telseif ($this->children[$i]->isHabitable()) {\n\t\t\t\techo \"Forcing apogee and radius.<BR />\";\n\t\t\t\t$this->children[$i]->setRadius(6321);\n\t\t\t\t$this->children[$i]->setApogee($this->radius*$this->goldilocksMin*1.1);\n\t\t\t\t$this->children[$i]->setPerigee($this->radius*$this->goldilocksMin*1.1);\n\t\t\t\t$this->children[$i]->save();\n\t\t\t}\n*/\t\t}\n\t\t// Step 9: Create moons, using a similar process.\n\t}", "public function losowy(){\n $losowy=rand(0,1);\n if($losowy==0){\n $this->kolejg=1; $this->koljep=0;\n }\n else{\n $this->kolejp=1; $this->kolejg=0;\n }\n }", "function createTrophy()\r\n {\r\n \r\n }", "public function g_target_potential_clashes_set_C (Player $x_player) {\n\n //properties\n $x_forecast_pointers = array();\n $x_found_target = FALSE;\n $x_selection_pointers = array();\n $x_piece_pointer = 0;\n $x_temp_branch = 2;\n $x_temp_target = array();\n \n //populate current players positions and status to temp array\n for($x_counter = 1;$x_counter <= 4; $x_counter++)\n {\n \n if(!$x_player->p_pieces[$x_counter]->m_get_status()) \n {\n //this piece is out of play - set up a dummy which will never get hit\n \n $x_forecast_pointers[$x_counter] = array($x_counter,999,FALSE);\n \n \n } \n \n else\n \n {\n //otherwise, put in a forecast of where it would land based on the dice roll\n \n $x_forecast_pointers[$x_counter] = array($x_counter, $x_player->p_pieces[$x_counter]->m_get_location() * $this->g_dievalue, FALSE);\n }\n }\n\n\n //now for each potential location see if there is a match in the opponent's pieces\n \n $x_temp_opp = $this->g_return_other_player();\n \n for($x_counter_o = 1;$x_counter_o <= 4; $x_counter_o++)\n {\n \n if(!$x_temp_opp->p_pieces[$x_counter_o]->m_get_status()) \n { \n //opp position is out of play and should be ignored - dummy value\n $this->g_logmove(\"Ignoring target piece \".$x_counter_o.\" as it is out of play.\");\n \n $x_temp_opp_location = 888;\n }\n \n else\n \n {\n //hold the location of a potential target piece to hit\n $x_temp_opp_location = $x_temp_opp->p_pieces[$x_counter_o]->m_get_location();\n }\n\n for($x_counter_p=1;$x_counter_p<=4;$x_counter_p++)\n {\n //check that the locations match and that the opponents piece is not at the start, or inactive:\n \n if($x_forecast_pointers[$x_counter_p][1] == $x_temp_opp_location && $x_temp_opp_location != 1 && $x_temp_opp_location != 888) \n \n {\n //we have a potential target\n $x_forecast_pointers[$x_counter_p][2] = TRUE;\n \n $this->g_logmove( \"<font color=green>Player \" . $x_temp_opp->p_get_playerid() . \"'s marker \".$x_counter_o. \" at location \".$x_temp_opp->p_pieces[$x_counter_o]->m_get_location().\" is a target of piece \".$x_counter_p.\"</font>\");\n \n break; //we only need to know this once \n \n } \n \n } //move on to next player piece\n\n } //move on to next opponent piece\n \n\n //clear the array of player's pieces that are not a likely hit\n $x_test_count_flag = FALSE;\n\n for($x_counter_test=1;$x_counter_test<=4;$x_counter_test++)\n {\n if($x_forecast_pointers[$x_counter_test][2] == TRUE) \n {\n //found at least one\n $x_test_count_flag = TRUE;\n \n } \n \n else \n \n {\n unset($x_forecast_pointers[$x_counter_test]);\n }\n }\n\n\n //got at least one potential target\n if($x_test_count_flag) \n {\n\n //now we have an array of only the possible markers to select to target\n $x_forecast_pointers = array_values($x_forecast_pointers);\n\n $x_temp_target = array_rand($x_forecast_pointers,1);\n\n //the piece we choose to move\n $x_piece_pointer = $x_forecast_pointers[$x_temp_target][0];\n\n\n $this->g_logmove( \"<font color=green>Player \" . $x_player->p_get_playerid() . \" has \".sizeof($x_forecast_pointers).\" targets to consider and chose to move piece \".$x_piece_pointer.\"</font>\");\n\n $this->g_marker_move($x_player, $x_piece_pointer);\n\n $x_found_target = TRUE;\n\n return $x_found_target; \n } \n\n else\n\n {\n $this->g_logmove( \"<font color=black>Player \" . $x_player->p_get_playerid() . \" could not find a clash target so is going to find a pointer at random to move.</font>\");\n \n //toss up between on or off board\n $x_offboard_flag = FALSE;\n \n $x_onboard_flag = FALSE;\n \n for($x_counter=1;$x_counter<=4;$x_counter++)\n {\n //loop and see if there is a mix of on-board or off-board marker; do a coin toss if there is\n if($x_player->p_pieces[$x_counter]->m_get_location() == 1 && $x_player->p_pieces[$x_counter]->m_get_status()) \n {\n $x_offboard_flag = TRUE;\n } \n \n if($x_player->p_pieces[$x_counter]->m_get_location() > 1 && $x_player->p_pieces[$x_counter]->m_get_status()) \n {\n $x_onboard_flag = TRUE;\n } \n \n }\n \n if($x_onboard_flag) \n {\n \n if($x_offboard_flag) \n {\n \n //choice is a wonderful thing - 1 is onboard, 2 is offboard\n $x_temp_branch = RAND(1,2);\n \n } else\n \n $x_temp_branch = 1;\n\n }\n \n if($x_temp_branch == 1)\n {\n \n $x_piece_pointer = 0;\n \n $this->g_logmove( \"<font color=black>Finding a piece on the board.</font>\");\n \n $x_piece_pointer = $this->g_find_to_move_in_play($x_player);\n\n if($x_piece_pointer != 0) \n {\n //found one... move it \n\n $this->g_marker_move($x_player, $x_piece_pointer);\n\n $x_found_target = TRUE;\n \n } \n \n else\n \n {\n \n //didn't find one, have to force to go down the SET D path.\n \n $x_temp_branch = 0;\n \n $x_found_target = FALSE;\n }\n }\n \n if($x_temp_branch == 0) \n {\n \n $x_found_target = FALSE; \n \n $this->g_logmove( \"<font color=black>Finding a piece OFF the board using SET D.</font>\");\n }\n \n return $x_found_target;\n }\n\n \n}", "function checkIfIsZoneHeaven($pNbBuilding, $Building) {\n $altarRegionY = Utils::getSinglePostValueInt(REGIONY);\n if($Building->RegionY > $altarRegionY + 1 || $Building->RegionY < $altarRegionY - 1){\n return $pNbBuilding;\n }\n\n for($i = $Building->Y; $i < ($Building->Y + $Building->Height); $i++){\n for($j = 0; $j < 4; $j++){\n for($k = 0; $k < 4 - $j; $k++){\n $posY = Utils::getSinglePostValueInt(Y) - $k;\n\n $regionY = $altarRegionY;\n\n if($posY < -1) {\n $regionY = $altarRegionY - 1;\n $posY += 12;\n }\n\n if(\n (Utils::getSinglePostValueInt(REGIONX) - 1) == $Building->RegionX &&\n $regionY == $Building->RegionY &&\n 11 - $j == ($Building->X + $Building->Width) &&\n $posY == $i\n ) {\n return $pNbBuilding + 1;\n }\n\n $posY = Utils::getSinglePostValueInt(Y) + $k;\n\n if($posY > 12) {\n $regionY = $altarRegionY - 1;\n $posY -= 13;\n }\n\n\n\n if(\n (Utils::getSinglePostValueInt(REGIONX) - 1) == $Building->RegionX &&\n $regionY == $Building->RegionY &&\n 11 - $j == $Building->X &&\n $posY == $i\n ) {\n return $pNbBuilding + 1;\n }\n\n\n }\n }\n }\n\n return $pNbBuilding;\n}", "public function eliminateDiagonals2_4()\n {\n $cs = $this->m_collection_size;\n $y_limit = $this->m_y_max - $cs -1;\n $x_limit = $this->m_x_max - $cs -1;\n for ($y=0; $y<=$y_limit; $y++)\n {\n for ($x=0; $x<=$x_limit; $x++)\n {\n $first = $this->m_gdata[$y][$x];\n $second = $this->m_gdata[$y+$cs][$x+$cs]; \n if ($first > $second)\n {\n $this->m_2_4_dcollections[$y+1][$x+1] = $this->NOT_A_CANDIDATE;\n }\n if ($first < $second)\n {\n $this->m_2_4_dcollections[$y][$x] = $this->NOT_A_CANDIDATE;\n }\n if ($first == $second)\n {\n // Keep them both as possible candidate if already\n // set as such. Otherwise, also do nothing.\n // or...\n // Declare first as NOT A CANDIDATE\n $this->m_2_4_dcollections[$y][$x] = $this->NOT_A_CANDIDATE;\n }\n }\n }\n }", "function same($a, $b) {\r\n\t\treturn ($this->arc->expandPName ( $a ) == $this->arc->expandPName ( $b ));\r\n\t}", "private function step_super_stickies()\n {\n }", "protected function drink()\n {\n /** @var Animal[]|\\ArrayObject $combined */\n $combined = new \\ArrayObject();\n foreach ($this->males as $male) {\n $combined->append($male);\n }\n foreach ($this->females as $female) {\n $combined->append($female);\n }\n\n $combined->uasort(\n function () {\n return rand(-1, 1);\n }\n );\n\n foreach ($combined as $animal) {\n if ($this->water >= $animal->getSpecies()->getMonthlyWaterConsumption()) {\n $this->water -= $animal->getSpecies()->getMonthlyWaterConsumption();\n //First animal not to reach condition above will finish off the water,\n //but not enough to sustain them, considered a dehydration month\n } else {\n $this->water = 0;\n $animal->incrementDehydrationMonths();\n }\n }\n }", "public function eliminateDiagonals3_1()\n {\n $cs = $this->m_collection_size;\n // start from bottom row..\n for ($y=$this->m_y_max-1; $y>=$cs; $y--)\n {\n // .. proceed across... then got up a row...\n for ($x=0; $x<=$this->m_x_max-$cs-1; $x++)\n { \n $first = $this->m_gdata[$y][$x];\n $sy = $y - $cs;\n $sx = $x + $cs;\n $second = $this->m_gdata[$sy][$sx];\n if ($first > $second)\n {\n $this->m_3_1_dcollections[$y-1][$x+1] = $this->NOT_A_CANDIDATE;\n }\n if ($first < $second)\n {\n $this->m_3_1_dcollections[$y][$x] = $this->NOT_A_CANDIDATE;\n }\n if ($first == $second)\n {\n // Keep them both as possible candidate if already\n // set as such. Otherwise, also do nothing.\n // or...\n // pick the first as NOT A CANDIDATE\n $this->m_3_1_dcollections[$y][$x] = $this->NOT_A_CANDIDATE;\n \n }\n }\n }\n return true; // success\n }", "public function testEquatingOfDeepStationsRecursedParent()\n {\n // make survey structure\n $srvy_A = new File_Therion_Survey(\"A\");\n $srvy_AB = new File_Therion_Survey(\"AB\");\n $srvy_AC = new File_Therion_Survey(\"AC\");\n $srvy_AB1 = new File_Therion_Survey(\"AB1\");\n $srvy_AB2 = new File_Therion_Survey(\"AB2\");\n $srvy_AB2a = new File_Therion_Survey(\"AB2a\");\n $srvy_A->addSurvey($srvy_AB);\n $srvy_A->addSurvey($srvy_AC);\n $srvy_AB->addSurvey($srvy_AB1);\n $srvy_AB2->addSurvey($srvy_AB2a);\n $srvy_AB->addSurvey($srvy_AB2);\n \n // prepare centreline data\n $stn_1_1 = new File_Therion_Station(\"1.1\");\n $stn_1_2 = new File_Therion_Station(\"1.2\");\n $stn_2_1 = new File_Therion_Station(\"2.1\");\n $stn_2_2 = new File_Therion_Station(\"2.2\");\n $srvy_AB1->addCentreline(new File_Therion_Centreline());\n $srvy_AB2a->addCentreline(new File_Therion_Centreline());\n $srvy_AB1->getCentrelines()[0]->addShot(\n new File_Therion_Shot($stn_1_1, $stn_1_2)\n );\n $srvy_AB2a->getCentrelines()[0]->addShot(\n new File_Therion_Shot($stn_2_1, $stn_2_2)\n );\n $stn_1_2->addEquate($stn_2_2);\n \n // FOR DEBUGGING: Print survey lines\n //foreach($srvy_A->toLines() as $l) {\n // print \"DBG: \".$l->toString();\n //}\n \n // test it\n $this->assertEquals(\"\", $stn_1_2->toEquateString()); // not referencable\n $this->assertEquals(\"\", $stn_2_2->toEquateString()); // not referencable\n $this->assertEquals(0, count($srvy_A->getEquates(-1))); // can be referenced deeper down (AB)\n $this->assertEquals(0, count($srvy_AC->getEquates(-1))); // not referenceable\n $this->assertEquals(1, count($srvy_AB->getEquates(-1))); // equate in child srvy (recursed from AB2a)\n $this->assertEquals(0, count($srvy_AB1->getEquates(-1))); // not referenceable here, only @parent\n $this->assertEquals(0, count($srvy_AB2->getEquates(-1))); // not referenceable here, only @parent\n $this->assertEquals(0, count($srvy_AB2a->getEquates(-1))); // not referenceable here, only @parent\n \n // test line representation of those equates\n $lines = File_Therion_Line::filterNonEmpty($srvy_A->toLines());\n $this->assertEquals( // investigate output slice of lines\n array(\n \"\\tsurvey AB\",\n \"\\t\\tequate 1.2@AB1 [email protected]\",\n \"\\t\\tsurvey AB1\",\n ),\n array(\n rtrim($lines[1]->toString()),\n rtrim($lines[2]->toString()),\n rtrim($lines[3]->toString())\n )\n );\n }", "public function uniqueJewels($point){\n $jewels = array_filter($this->jewel_slots, function($jewel) {\n if (!empty($jewel['slot'])) {\n return $jewel['slot']['frameType'] == 3;\n }\n return false;\n });\n\n if(count($jewels)) {\n\n foreach($jewels as $jewel){\n //filter point if its in Radius \n if (!in_array($point->id, $this->pointsInRadius($jewel))) {\n continue;\n }\n\n // Transform % Energy Shield to Armour 200% / Energised Armour jewel\n if(\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), 'Energised Armour')) {\n for ($i=0; $i < count($point->stats); $i++) { \n $point->stats[$i] = str_replace('Energy Shield', 'Armour', $point->stats[$i]);\n }\n }\n\n // Transform % Life to Mana 200% / Healthy Mind jewel\n if(\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), 'Healthy Mind')) {\n for ($i=0; $i < count($point->stats); $i++) { \n $point->stats[$i] = str_replace('Life', 'Mana', $point->stats[$i]);\n }\n }\n\n // Transform % Life to Energy Shield / Energy From Within jewel\n if(\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), 'Energy From Within')) {\n for ($i=0; $i < count($point->stats); $i++) { \n $point->stats[$i] = str_replace('Life', 'Energy Shield', $point->stats[$i]);\n }\n }\n \n // Transform Strength to Intelligence / Brute Force Solution jewel\n if(\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), 'Brute Force')) {\n $point->stats = $this->replaceMod($point->stats, 'Brute');\n }\n\n // Transform Strength to Dexterity / Fluid Force Solution jewel\n if(\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), 'Fluid Motion')) {\n $point->stats = $this->replaceMod($point->stats, 'Fluid');\n }\n\n // Transform Intelligence to Dexterity / Careful Planning jewel\n if(\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), 'Careful Planning')) {\n $point->stats = $this->replaceMod($point->stats, 'Careful');\n }\n\n // Transform Intelligence to Strength / Efficient Training jewel\n if(\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), 'Efficient Training')) {\n $point->stats = $this->replaceMod($point->stats, 'Efficient');\n }\n \n // Transform Dexterity to Intelligence / Fertile Mind jewel\n if(\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), 'Fertile Mind')) {\n $point->stats = $this->replaceMod($point->stats, 'Fertile');\n }\n\n // Transform Strength to Dexterity / Inertia jewel\n if(\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), 'Inertia')) {\n $point->stats = $this->replaceMod($point->stats, 'Inertia');\n }\n\n // Transform Melee and Melee Weapon Type to Bow / Lioneye's Fall jewel\n if(\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), \"Lioneye's Fall\")) {\n for ($i=0; $i < count($point->stats); $i++) { \n $point->stats[$i] = $this->lioneyesFall($point->stats[$i]);\n }\n }\n\n // Transform 50% increased Effect of non-Keystone Passive Skills / Might of the Meek jewel\n if (\\Str::contains(str_replace(\"<<set:MS>><<set:M>><<set:S>>\", \"\", $jewel['slot']['name']), 'Might of the Meek')) {\n for ($i = 0; $i < count($point->stats); $i++) {\n // if Keystone continue\n if ($point->keystone) {\n continue;\n }\n $mod = $point->stats[$i];\n $modValue = (int) filter_var($mod, FILTER_SANITIZE_NUMBER_INT);\n $modValue += ($modValue * 0.5); \n $modName = preg_replace('/\\d+/u', '#', $mod);\n $point->stats[$i] = str_replace('#', round($modValue), $modName);\n }\n }\n \n\n }\n \n }\n\n return $point->stats;\n }", "function bgfCheckForConsanguinity($db, $vrsCurrentCow, $bullRow) \n{\n /***\n $bullQuery = \"SELECT * FROM `bulls_details` WHERE bull_no='$vrsCurrentBull';\" ; \n $bullResult = mysqli_query($db, $bullQuery);\n If ($bullResult ->num_rows > 0) {\n \t$bullRow = mysqli_fetch_assoc($bullResult );\n }\n else {\n \treturn -1;\n }\n ***/\n $cowQuery = \"SELECT * FROM `local_cows` WHERE cow_no='$vrsCurrentCow';\" ; \n $cowResult = mysqli_query($db, $cowQuery );\n If ($cowResult ->num_rows > 0) {\n \t$cowRow = mysqli_fetch_assoc($cowResult );\n }\n else {\n \treturn -1;\n }\n // check if accumulated CVM values are more then 1\n $cowParam = $cowRow['Genetic_defect'];\n if ($cowParam > 1) {\n $cowParam = 1;\n }\n\t$bullParam= $bullRow['CVM'];\n\tif (($bullParam + $cowParam) > 1) {\n\treturn 1;\n\t}\n\t\t\n\t// check parents\n\t$cowParam = $cowRow['sire']; \n\t$bullParam= $bullRow['sire'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\t\n\t// check cow grandfathers vs bull father\n\t$cowParam = $cowRow['PGS'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\t$cowParam = $cowRow['MGS'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\t\n\t$cowParam = $cowRow['sire']; \n\t$bullParam= $bullRow['sire'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\t\n\t$cowParam = $cowRow['PGS'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\t\n\t$cowParam = $cowRow['MGS'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\t\n\t$cowParam = $cowRow['sire']; \n\t$bullParam= $bullRow['PGS'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\n\t$cowParam = $cowRow['PGS'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\n\t$cowParam = $cowRow['MGS'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\t\n\t$cowParam = $cowRow['sire']; \n\t$bullParam= $bullRow['MGS'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\t\n\t$cowParam = $cowRow['PGS'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\n\t$cowParam = $cowRow['MGS'];\n\tif ($bullParam == $cowParam) {\n\treturn 1;\n\t}\n\t\n\t// if arrived here then there is no blood relation - return 0 for false\n\treturn 0;\n}", "public function test_repeated_code_in_different_type(){\n $firstPlanType = $this->createPlanType();\n $secondPlanType = $this->createPlanType();\n\n $firstPlan = $this->createPlan('test_code', $firstPlanType);\n $secondPlan = $this->createPlan('test_code', $secondPlanType);\n\n $this->assertSame($firstPlan->code, 'test_code');\n $this->assertSame($secondPlan->code, 'test_code');\n }", "function findleaf(){\n\t\tif($this->hasfood == false && $this->drainstamina() && !is_array($this->world->findenemy($this->posx, $this->posy, $this->type))){\n\t\t\t$foods = array();\n\t\t\tforeach($this->world->food as $key => $food){\n\t\t\t\t$foods[$key][] = $this->world->food[$key]->posx();\n\t\t\t\t$foods[$key][] = $this->world->food[$key]->posy();\n\t\t\t\t$foods[$key][] = $this->world->food[$key]->quality();\n\t\t\t\t$foods[$key][] = $key;\n\t\t\t\t$foods[$key][] = $this->world->food[$key]->name();\n\t\t\t}\n\t\t\t$tilesaway = 100;\n\t\t\t$order = array();\n\t\t\tforeach($foods as $key => $item){\n\t\t\t\t$xtest = abs($item[0] - $this->posx);\n\t\t\t\t$ytest = abs($item[1] - $this->posy);\n\t\t\t\t$testvalue = floor(($xtest + $ytest) / 2);\n\t\t\t\tif( $testvalue < $tilesaway ){\n\t\t\t\t\t$tilesaway = $testvalue;\n\t\t\t\t\tarray_unshift($order, $item[0], $item[1], $item[2], $item[3], $item[4]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//print_r($order);\n\t\t\tif($order[0] < $this->posx && $order[1] > $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx + 1, $this->posy - 1)){\n\t\t\t\t\t$this->posy++;\n\t\t\t\t\t$this->posx--;\n\t\t\t\t} elseif($this->world->checklocation($this->posx - 1, $this->posy)){\n\t\t\t\t\t$this->posx++;\n\t\t\t\t} elseif($this->world->checklocation($this->posx, $this->posy + 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t}\n\t\t\t} elseif($order[0] < $this->posx && $order[1] < $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx + 1, $this->posy + 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t\t$this->posx--;\n\t\t\t\t} elseif($this->world->checklocation($this->posx + 1, $this->posy)){\n\t\t\t\t\t$this->posx--;\n\t\t\t\t} elseif($this->world->checklocation($this->posx, $this->posy + 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t}\n\t\t\t} elseif($order[0] > $this->posx && $order[1] > $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx - 1, $this->posy - 1)){\n\t\t\t\t\t$this->posy++;\n\t\t\t\t\t$this->posx++;\n\t\t\t\t} elseif($this->world->checklocation($this->posx - 1, $this->posy)){\n\t\t\t\t\t$this->posx++;\n\t\t\t\t} elseif($this->world->checklocation($this->posx, $this->posy - 1)){\n\t\t\t\t\t$this->posy++;\n\t\t\t\t}\n\t\t\t} elseif($order[0] > $this->posx && $order[1] < $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx - 1, $this->posy + 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t\t$this->posx++;\n\t\t\t\t} elseif($this->world->checklocation($this->posx - 1, $this->posy)){\n\t\t\t\t\t$this->posx++;\n\t\t\t\t} elseif($this->world->checklocation($this->posx, $this->posy - 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t}\n\t\t\t}elseif($order[0] > $this->posx){\n\t\t\t\tif($this->world->checklocation($this->posx + 1, $this->posy)){\n\t\t\t\t\t$this->posx++;\n\t\t\t\t}\n\t\t\t} elseif($order[0] < $this->posx){\n\t\t\t\tif($this->world->checklocation($this->posx - 1, $this->posy)){\n\t\t\t\t\t$this->posx--;\n\t\t\t\t}\n\t\t\t} elseif($order[1] > $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx, $this->posy + 1)){\n\t\t\t\t\t$this->posy++;\n\t\t\t\t}\n\t\t\t} elseif($order[1] < $this->posy){\n\t\t\t\tif($this->world->checklocation($this->posx, $this->posy - 1)){\n\t\t\t\t\t$this->posy--;\n\t\t\t\t}\n\t\t\t} \n\t\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ant moved to \" . $order[4] . \" at \" . $order[0] . \"-\" . $order[1]);\n\t\t\tif($order[0] == $this->posx && $order[1] == $this->posy && $this->world->food[$order[3]]->used == 0){\n\t\t\t\t$this->booststamina();\n\t\t\t\t$this->hasfood = true;\n\t\t\t\t$this->quality = $order[2];\n\t\t\t\t//echo \"<br>Order 2:\" . $order[2] . \"<br>Quality:\" . $this->quality . \"<br>\";\n\t\t\t\t$this->world->food[($order[3])]->editused(1);\n\t\t\t\t$this->brain->setstate(\"gohome\");\n\t\t\t\t$this->appendtoturn(\"<b>\" . $this->type . \"</b>(\" . $this->stamina . \") ant picked up \" . $order[4] . \" at \" . $order[0] . \"-\" . $order[1]);\n\t\t\t}\n\t\t\tif($this->lastpos == $this->posx . $this->posy){\n\t\t\t\t$this->checkifsameloc();\n\t\t\t}\n\t\t} elseif(is_array($this->world->findenemy($this->posx, $this->posy, $this->type))){\n\t\t\t$this->brain->setstate(\"attack\");\n\t\t\t$this->update();\n\t\t}else{\n\t\t\t$this->brain->setstate(\"gohome\");\n\t\t}\n\t}", "public function isIsosceles()\n {\n return $this->a == $this->b\n || $this->a == $this->c\n || $this->b == $this->c;\n }", "public function testBowlingOneSpare()\n {\n $this->rollSpare();\n $this->bowling->roll(3);\n $this->bowling->rollMany(17, 0);\n\n $this->assertEquals(16, $this->bowling->getScore());\n }", "public function czyjatura(){\n if($this->punktygracz>$this->punktyprzeciwnik){\n $this->kolejg=1; $this->koljep=0;\n }\n elseif($this->punktygracz<$this->punktyprzeciwnik){\n $this->kolejp=1; $this->kolejg=0;\n }\n elseif($this->punktygracz==$this->punktyprzeciwnik){\n $this->losowy();\n }\n }", "static function pythagore($r){//adj/opp/hyp \nif(!$r[0])$r[0]=self::pytha_cote($r[2],$r[1]);\nif(!$r[1])$r[1]=self::pytha_cote($r[2],$r[0]);\nif(!$r[2])$r[2]=self::hypothenuse($r[0],$r[1]);\nreturn $r;}", "public function __construct()\n {\n $this->_1859_P_Proof = array('PR 1', 'PR 2');\n $this->_1859_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6');\n\n $this->_1860_P_Proof = array('PR 1', 'PR 2');\n $this->_1860_P = array('Snow 1', 'Snow 2');\n\n $this->_1861_P_Proof = array('PR 1', 'PR 2');\n $this->_1861_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6');\n\n $this->_1862_P_Proof = array('PR 1', 'PR 2');\n $this->_1862_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4');\n\n $this->_1863_P_Proof = array('PR 1', 'PR 2');\n $this->_1863_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13');\n\n $this->_1864_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1864_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20');\n\n $this->_1865_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1865_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15');\n\n $this->_1866_P_Proof = array('PR 1');\n $this->_1866_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16');\n\n $this->_1867_P_Proof = array();\n $this->_1867_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8');\n\n $this->_1868_P_Proof = array('PR 1');\n $this->_1868_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11');\n\n $this->_1869_P_Proof = array('PR 1', 'PR 2');\n $this->_1869_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16');\n\n $this->_1870_P_Proof = array('PR 1', 'PR 2');\n $this->_1870_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33', 'Snow 34', 'Snow 35', 'Snow 36', 'Snow 37', 'Snow 38', 'Snow 39', 'Snow 40', 'Snow 41');\n\n $this->_1871_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1871_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5');\n\n $this->_1872_P_Proof = array('PR 1');\n $this->_1872_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14');\n\n $this->_1873_P_Proof = array('PR 1');\n $this->_1873_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7');\n\n $this->_1874_P_Proof = array('PR 1');\n $this->_1874_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4');\n\n $this->_1875_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1875_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15');\n\n $this->_1876_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1876_P = array('Snow 1');\n\n $this->_1877_P_Proof = ['PR 1', 'PR 2', 'PR 3'];\n $this->_1877_P = array('Snow 1', 'Snow 2');\n\n $this->_1878_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1878_P = array('Snow 1', 'Snow 2', 'Snow 3');\n\n $this->_1879_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1879_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4');\n\n $this->_1880_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1880_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4');\n\n $this->_1881_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1881_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7');\n\n $this->_1882_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1882_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7');\n\n $this->_1883_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1883_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10');\n\n $this->_1884_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1884_P = array('Snow 1', 'Snow 2', 'Snow 3');\n\n $this->_1885_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1885_P = array('Snow 1', 'Snow 2');\n\n $this->_1886_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1886_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8');\n\n $this->_1887_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5', 'PR 6');\n $this->_1887_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10');\n\n $this->_1888_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1888_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33');\n\n $this->_1889_P_Proof = array('PR 1', 'PR 2');\n $this->_1889_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33');\n\n $this->_1890_P_Proof = array('PR 1', 'PR 2');\n $this->_1890_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15');\n\n $this->_1891_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1891_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23');\n\n $this->_1892_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1892_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14');\n\n $this->_1893_P_Proof = array('PR 1', 'PR 2');\n $this->_1893_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18');\n\n $this->_1894_P_Proof = array('PR 1', 'PR 2');\n $this->_1894_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6');\n\n $this->_1895_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1895_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31');\n\n $this->_1896_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1896_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17');\n\n $this->_1897_P_Proof = array('PR 1', 'PR 2');\n $this->_1897_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18');\n\n $this->_1898_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1898_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33', 'Snow 34', 'Snow 35', 'Snow 36');\n\n $this->_1899_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1899_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22');\n\n $this->_1900_P_Proof = array('PR 1', 'PR 2');\n $this->_1900_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23');\n\n $this->_1901_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1901_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24');\n\n $this->_1902_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1902_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13');\n\n $this->_1903_P_Proof = array('PR 1');\n $this->_1903_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25');\n\n $this->_1904_P_Proof = array('PR 1');\n $this->_1904_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16');\n\n $this->_1905_P_Proof = array('PR 1');\n $this->_1905_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29');\n\n $this->_1906_P_Proof = array('PR 1');\n $this->_1906_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33', 'Snow 34', 'Snow 35', 'Snow 36', 'Snow 37', 'Snow 38', 'Snow 44');\n\n $this->_1907_P_Proof = array('PR 1');\n $this->_1907_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33', 'Snow 34', 'Snow 35', 'Snow 36', 'Snow 37', 'Snow 38', 'Snow 39', 'Snow 40', 'Snow 41', 'Snow 42', 'Snow 43', 'Snow 44', 'Snow 45', 'Snow 46', 'Snow 47', 'Snow 48', 'Snow 49', 'Snow 50');\n\n $this->_1908_P_Proof = array('PR 1', 'PR 2');\n $this->_1908_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23');\n $this->_1908_S = array('Snow 1', 'Snow 2');\n\n $this->_1909_P_Proof = array('PR 1');\n $this->_1909_P = array('Snow 1', 'Snow 2');\n $this->_1909_S = array('Snow 1', 'Snow 2');\n }", "private function _random_shape() {\n $rshapes = array();\n // Bounding points that constrain the maximal shape expansion\n $min = new Point(0, 0);\n $max = new Point($this->width, $this->height);\n // Get a start point\n $previous = $startp = new Point(secure_rand($min->x, $max->x), secure_rand($min->y, $max->y));\n // Of how many random geometrical primitives should our random shape consist?\n $ngp = secure_rand(min($this->dsettings['shapeify']['r_num_gp']), max($this->dsettings['shapeify']['r_num_gp']));\n\n foreach (range(0, $ngp) as $j) {\n // Find a random endpoint for geometrical primitves\n // If there are only 4 remaining shapes to add, choose a random point that\n // is closer to the endpoint!\n $rp = new Point(secure_rand($min->x, $max->x), secure_rand($min->y, $max->y));\n if (($ngp - 4) <= $j) {\n $rp = new Point(secure_rand($min->x, $max->x), secure_rand($min->y, $max->y));\n // Make the component closer to the startpoint that is currently wider away\n // This ensures that the component switches over the iterations (most likely).\n $axis = abs($startp->x - $rp->x) > abs($startp->y - $rp->y) ? 'x' : 'y';\n if ($axis === 'x') {\n $rp->x += ($startp->x > $rp->x) ? abs($startp->x - $rp->x) / 4 : abs($startp->x - $rp->x) / -4;\n } else {\n $rp->y += ($startp->y > $rp->y) ? abs($startp->y - $rp->y) / 4 : abs($startp->y - $rp->y) / -4;\n }\n }\n\n if ($j == ($ngp - 1)) { // Close the shape. With a line\n $rshapes[] = array($previous, $startp);\n break;\n } elseif (rand(0, 1) == 1) { // Add a line\n $rshapes[] = array($previous, $rp);\n } else { // Add quadratic bezier curve\n $rshapes[] = array($previous, new Point($previous->x, $rp->y), $rp);\n }\n\n $previous = $rp;\n }\n return $rshapes;\n }", "public function attackBee() {\r\n $keyType = array_rand($this->bee); \t\t\t// Sélection random d'un type d'abeille (queen, worker, drone)\r\n $keyBee = array_rand($this->bee[$keyType]);\t\t// Sélection random d'une abeille \r\n \r\n if($this->bee[$keyType][$keyBee]->attack()) {\r\n \tunset($this->bee[$keyType][$keyBee]);\r\n \tif($keyType == 'queen' && count($this->bee[$keyType]) <= 0) { // Si la renne est à 0 point de vie on réinitialise la partie\r\n \t\t echo '<br />La renne est à 0 point de vie.';\r\n \t\t $this->resetGame();\r\n \t}\t\r\n }\r\n if(count($this->bee[$keyType]) <= 0) unset($this->bee[$keyType]); \r\n }" ]
[ "0.57009983", "0.54219955", "0.5272543", "0.52230954", "0.50832486", "0.5049596", "0.50447696", "0.50113237", "0.5006848", "0.49880555", "0.49194634", "0.48910213", "0.4867056", "0.48333025", "0.48178434", "0.48093683", "0.4789314", "0.47677246", "0.47655663", "0.4762122", "0.47585085", "0.47519827", "0.473593", "0.4714792", "0.47123054", "0.47059506", "0.46992716", "0.4684073", "0.4670711", "0.4667334" ]
0.63935393
0
/ GET Prepara Formulario para Registrar Fotografia POST Guarda el Registro
public function registrarFotografiaAction(Request $request) { $fotografia= new Fotografia(); if ($request->isMethod('GET')) { if (!$request->query->has('id')) return $this->render('SisproBundle:Plantillas:prohibido.html.twig'); $idProyecto = $request->query->get('id'); $data['idProyecto'] = $idProyecto; // Hidratamos los campos del formulario $data = $this->_hidratarForm($data); $formulario = $this->createForm(new FotografiaType($data['actividades']), $fotografia); } if ($request->isMethod('POST')) { $data = $request->request->get('data'); $actividad = $this->getDoctrine() ->getRepository('SisproBundle:Actividad') ->find($data['actividad']); if (!$actividad) die('Actividad no encontrada.'); $proyecto = $actividad->getProyecto(); $data['proyecto'] = $proyecto; $data['idProyecto'] = $proyecto->getId(); // Hidratamos los campos del formulario $data = $this->_hidratarForm($data); $formulario = $this->createForm(new FotografiaType($data['actividades']), $fotografia); $formulario->bind($request); $data['fotografia'] = $fotografia; if ($formulario->isValid()) { $this->_registrarFotografia($data); // REGISTRA LA ACCION EN LA BITACORA $data['registro']='Registro de Fotografia en el proyecto: '. $proyecto->getCodigo().' - '.$proyecto->getNombre(). '. Realizado por: '.$this->getUser()->__toString(); $data['entidad']='Fotografia'; $data['operacion']='INSERT'; $this->_registrarBitacora($data); return $this->render('SisproBundle:Ejecucion:exitoFotografia.html.twig', array('data' => $data)); } } // REVISAMOS PERMISOLOGÍA PARA VER EL PROYECTO if (!$this->_revisarPermisologia($data)) return $this->render('SisproBundle:Plantillas:prohibido.html.twig'); // Hidratamos las fotos $data = $this->_hidratarFotos($data); return $this->render('SisproBundle:Ejecucion:registrarFotografia.html.twig', array('formulario' => $formulario->createView(), 'data' => $data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _GetFrm(){\n\t\t// Cargo desde el formulario\n\t\t$this->Registro['id_evento'] = $_POST['id_evento'];\n\t\t$hora = $_POST[\"horaHour\"].\":\".$_POST[\"horaMinute\"].\":00\";\n\t\t$fecha = $_POST[\"fechaYear\"].\"-\".$_POST[\"fechaMonth\"].\"-\".$_POST[\"fechaDay\"];\n\t\t$this->Registro['fecha'] = $fecha.\" \".$hora;\n\t\t$this->Registro['nombre_evento'] = $_POST['nombre_evento'];\n\t\t$this->Registro['descripcion'] = stripslashes($_POST['descripcion']);\n\t\t$this->Registro['lugar'] = stripslashes($_POST['lugar']);\n\t\t$this->Registro['alcance'] = $_POST['alcance'];\n\t\t$this->Registro['id_sucursal'] = $_POST['id_sucursal'];\n\t\t$this->Registro['visible'] = $_POST['visible'] ? 1 : 0;\n\t\t$this->CargarFotos();\n\t}", "public function registrarpago( $elregistro)\n{\n //será usado un archivo de (mete)texto, usando append para que escriba los registros sucesivos y ver si el proceso de post\n // hasta la escritura sean correctos\n \n /* $elregistro=array(\n\t\t 'intranet'=>$data['username'], // el intranet será el indice de este arreglo\n\t\t 'cant_pago'=>$this->input->post('cant'),\n\t\t 'numref'=>$this->input->post('numrefcheq'),\n\t\t 'cod_pat'=>$this->input->post('patrimonio')\n \t*/\n //esta ruta está \"entubada\":debe ser ruta absoluta\n // por ahora no sé como hacer para que sea portable este código\n $fp = fopen(\"/home/systemas/Devel/CodeEmudb/bd.txt\", \"a\"); // se abra para agregar registro en el orden como llegan\nfputs($fp, \"SE REGISTRA PAGO:\". PHP_EOL);\nfputs($fp, \"Nombre/Intranet Usuario: \".$elregistro['intranet'] . PHP_EOL);\nfputs($fp, \"Número referencia Cheque: \".$elregistro['numref'] . PHP_EOL);\nfputs($fp, \"Cantidad Depositada: \".$elregistro['cant_pago']. PHP_EOL);\nfputs($fp, \"Código patrimonio Pagado: \".$elregistro['cod_pat']. PHP_EOL);\nfputs($fp, \" * *\". PHP_EOL);\nfclose($fp);\n\nreturn 'Pago registrado';\n \n}", "public function registrarHabitacionController(){\n ?>\n <div id=\"\">\n <form method=\"post\" class=\"frm-single\" action=\"index.php?action=habitaciones\" enctype=\"multipart/form-data\">\n <div class=\"inside\">\n <div class=\"title\"><strong>Registrar</strong>&nbsp;Habitacion</div>\n\n \n <div class=\"form-group margin-bottom-20\">\n <select class=\"form-control\" name=\"tipoHabitacion\">\n <option value=\"\">Tipo de Habitación</option>\n <option value=\"1\">Simple</option>\n <option value=\"2\">Doble</option>\n <option value=\"3\">Matrimonial</option>\n </select>\n </div>\n \n <div><input type=\"file\" name=\"archivo\" class=\"frm-inp\" accept=\"image/*\"></div>\n\n <!-- /.clearfix -->\n <button type=\"submit\" class=\"frm-submit btn\">Aceptar<i class=\"fa fa-arrow-circle-right\"></i></button>\n \n </div>\n <!-- .inside -->\n </form>\n <!-- /.frm-single -->\n </div><!--/#single-wrapper -->\n <?php\n }", "function enlaceRegistrar() {\r\n ?><input type='hidden' name='formulario' value=\"<? echo $this->formulario ?>\">\r\n <input type='hidden' name='action' value=\"<? echo $this->bloque ?>\">\r\n <input type='hidden' name='opcion' value=\"registrar\">\r\n <input value=\"Generar\" name=\"aceptar\" tabindex='20' type=\"button\" onclick=\"document.forms['<? echo $this->formulario ?>'].submit()\"> \r\n\r\n\r\n <?\r\n }", "public function actualizarRegistro($request)\n\t{\n\t\tif (!isset($_POST))\n\t\t{\n\t\t\t$this->json = array(\n\t\t\t\t\"status\" => false,\n\t\t\t\t\"mensaje\" => \"El formulario no se envío adecuadamente.\"\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!isset($_POST['id_registro']))\n\t\t\t{\n\t\t\t\theader (\"HTTP/1.1 514 An Error\");\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t$evento = $this->model->getEvento($this->idEvento);\n\t\t\t$this->fova->campos = $request->query;\n\n\t\t\t$this->fova->validarCampo(\"nombre\", \"req\", \"\", 2, 100);\n\t\t\t$this->fova->validarCampo(\"app\", \"req\", \"\", 2, 50);\n\t\t\t$this->fova->validarCampo(\"apm\", \"\", \"\", 2, 50);\n\t\t\t$this->fova->validarCampo(\"titulo\", \"\", \"\", 0, 20);\n\t\t\t$this->fova->validarCampo(\"rfc\", \"\", \"\", 0, 13);\n\t\t\t$this->fova->validarCampo(\"curp\", \"\", \"\", 0, 18);\n\t\t\t$this->fova->validarCampo(\"genero\", \"\", \"\", 1, 1);\n\t\t\t//$this->fova->validarCampo(\"idioma\", \"req\", \"\", 2, 2);\n\t\t\t$this->fova->validarCampo(\"emp_o_ins\", \"\", \"\", 2, 125);\n\t\t\t$this->fova->validarCampo(\"cargo\", \"\", \"\", 3, 50);\n\t\t\t$this->fova->validarCampo(\"email\", \"\", \"\", 8, 125);\n\t\t\t$this->fova->validarCampo(\"id_tag\", \"\", \"\", 1, 0, 'INT');\n\n\t\t\t$this->fova->validarCampo(\"cat_registro\", \"req\", \"\", 2, 10);\n\t\t\t$this->fova->validarCampo(\"id_costo\", \"req\", \"\", 1, 2, \"INT\");\n\t\t\t$this->fova->validarCampo(\"forma_pago\", \"req\", \"\", 2, 2);\n\t\t\t$this->fova->validarCampo(\"status\", \"req\", \"\", 3, 3);\n\n\t\t\t$this->fova->validarCampo(\"clave_asociada\", \"\", \"\", 0, 15);\n\n\t\t\tif ($this->fova->validacion['status'])\n\t\t\t{\n\t\t\t\t// Obtenemos el costo de la categoria para el registro\n\t\t\t\t$costo_total = $this->evt->getCostoCategoria(\n\t\t\t\t\t$this->fova->campos['cat_registro'],\n\t\t\t\t\t$this->fova->campos['id_costo'],\n\t\t\t\t\t$this->idEvento\n\t\t\t\t);\n\n\t\t\t\tif ($evento->evt_iva > 0)\n\t\t\t\t{\n\t\t\t\t\t$costo_total->costo = $costo_total->costo * $evento->evt_iva;\n\t\t\t\t}\n\n\t\t\t\t$this->fova->agregarCampo(\"costo_registro\", $costo_total->costo);\n\n\t\t\t\t$this->fova->campos['id_tag'] = $this->func->generarTagRFID($this->fova->campos['id_tag']);\n\n\t\t\t\t$this->fova->campos['costo_total'] = $this->func->moneda2db($request->query['costo_total']);\n\n\t\t\t\tif ($this->model->actualizarRegistro($this->fova->campos, $this->user_login['id']))\n\t\t\t\t{\n\t\t\t\t\t$totalRegPagados = 0;\n\t\t\t\t\t$regStatus = \"PAG\";\n\t\t\t\t\tif ($this->fova->campos['status'] == $regStatus)\n\t\t\t\t\t{\n\t\t\t\t\t\t$totalRegPagados = $this->evt->getTotalRegistros($this->fova->campos['tabla_registros'], $regStatus);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->fova->campos['save_photo'] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!$this->guardarFotografia($this->fova->campos['photo'], $this->fova->campos['id_registro']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$fotoMensaje = 'El fotografia no fue guardad, por favor intentalo nuevamente.';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->json = array(\n\t\t\t\t\t\t\"status\" => \"funcion\",\n\t\t\t\t\t\t\"nomFuncion\" => \"finActualizarRegistro\",\n\t\t\t\t\t\t\"seccion\" => $this->seccion,\n\t\t\t\t\t\t\"idReg\" => $this->fova->campos['id_registro'],\n\t\t\t\t\t\t\"statusReg\" => $this->fova->campos['status'],\n\t\t\t\t\t\t\"formaPago\" => $this->fova->campos['forma_pago'],\n\t\t\t\t\t\t\"totalRegPagados\" => $totalRegPagados,\n\t\t\t\t\t\t\"mensaje\" => \"El registro se actualizo con exito.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->json = array(\n\t\t\t\t\t\t\"status\" => false,\n\t\t\t\t\t\t\"mensaje\" => \"No fue posible actualizar el registro, intentalo de nuevo.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->json = $this->fova->validacion;\n\t\t\t}\n\n\t\t}\n\n\t\techo json_encode($this->json);\n\t}", "private function mostraFormCarica()\n {\n $v_storico = new v_storico();\n $Utente = c_sessione::getUtenteDaSessione();\n \n if(get_class($Utente)!=e_bibliotecario::class) // se l'utente non e' un bibliotecario\n $v_storico->Errore($Utente, 'Devi essere un bibiotecario per accedere a questa funzionalità');\n else \n $v_storico->mostraFormCarica($Utente); //mostra form \n }", "function registroDatosAction()\r\n {\r\n $this->_helper->layout->setLayout('publicacion');\r\n \r\n require_once 'Agrupador.php';\r\n require_once 'Publicacion.php';\r\n \r\n require_once APPLICATION_PATH . '/modules/usuario/forms/formPublicacion.php';\r\n \r\n $mUbigeo = new Ubigeo();\r\n $mAviso = new Aviso();\r\n $mPublicacion = new Publicacion();\r\n $mAgrupador = new Agrupador();\r\n $form = new Usuario_formPublicacion();\r\n $isPostId = true;\r\n \r\n $arrPasos = new stdClass();\r\n $arrPasos->paso1 = true;\r\n $arrPasos->paso2 = true;\r\n $arrPasos->paso3 = true;\r\n $arrPasos->paso4 = true;\r\n \r\n $imd = $this->getConfig()->fileshare->toArray();\r\n $publicacionEstado = 1;\r\n $valToken = false;\r\n \r\n $form->addToken();\r\n $form->addDestaque();\r\n $form->addCategoriasHidden(); \r\n \r\n $arrImg = array();\r\n \r\n //->Sesion para elimanar img\r\n $this->session->imgtm = array();\r\n \r\n try{\r\n $allParams = $this->getRequest()->getPost();\r\n //$idAviso = $this->getRequest()->getPost('idAviso','');\r\n $idAviso = $allParams['idAviso'];\r\n $destaqueId = $allParams['destaqueId'];\r\n \r\n $cod = $this->_request->getParam('cod', '');\r\n \r\n if (empty($idAviso)) {\r\n $idAviso = $cod;\r\n $isPostId = false;\r\n }\r\n \r\n if (!empty($idAviso)) {\r\n $form->addRegistroDatos();\r\n// if(!empty($cod)) $form->disabledEditar();\r\n if (!empty($idAviso)) {\r\n \r\n $form->addIdAviso($idAviso);\r\n \r\n $arrEditAviso = $mPublicacion->getPublicacion($idAviso, $this->identity->ID_USR);\r\n if ($arrEditAviso->K_EST == 1 && !$isPostId) {//->Actualiza\r\n $form->disabledEditar();\r\n $publicacionEstado = 2;\r\n $arrPasos->paso1 = false;\r\n $arrPasos->paso2 = false;\r\n } elseif ($arrEditAviso->K_ID_DESTAQUE < $destaqueId && $arrEditAviso->K_EST == 1 \r\n && $isPostId) {\r\n //Destaque\r\n $form->disabledEditar();\r\n $publicacionEstado = 3;\r\n $arrPasos->paso2 = false;\r\n $arrEditAviso->idDestaque = $arrEditAviso->K_ID_DESTAQUE;\r\n if ($destaqueId==9 || $destaqueId == 10)\r\n $form->addPrintedText();\r\n } elseif ($arrEditAviso->K_EST == 5 && $isPostId) {\r\n //republicar\r\n $publicacionEstado = 4;\r\n $arrPasos->paso2 = false;\r\n if ($destaqueId==9 || $destaqueId == 10) $form->addPrintedText();\r\n } else throw new Exception('Error Edicion..');\r\n \r\n \r\n $allParams['product_type'] = $arrEditAviso->K_ID_TIPO_PRODUCTO;\r\n $allParams['announcement_title'] = $arrEditAviso->K_TITULO;\r\n $allParams['price'] = $arrEditAviso->K_PRECIO;\r\n $allParams['informacion_adicional'] = $arrEditAviso->K_HTML;\r\n $allParams['currency'] = $arrEditAviso->K_ID_TIPO_MONEDA;\r\n \r\n $allParams['destaqueId'] = ($isPostId)\r\n ?$destaqueId:$arrEditAviso->K_ID_DESTAQUE;\r\n \r\n $allParams['categoriaId1'] = $arrEditAviso->L1;\r\n $allParams['categoriaId2'] = $arrEditAviso->L2;\r\n $allParams['categoriaId3'] = $arrEditAviso->L3;\r\n $allParams['categoriaId4'] = $arrEditAviso->L4;\r\n $allParams['categoriaText1'] = $arrEditAviso->L1_NOM;\r\n $allParams['categoriaText2'] = $arrEditAviso->L2_NOM;\r\n $allParams['categoriaText3'] = $arrEditAviso->L3_NOM;\r\n $allParams['categoriaText4'] = $arrEditAviso->L4_NOM;\r\n \r\n $allParams['payment_method'] = explode(\",\", $arrEditAviso->K_MEDIO_PAGOS);\r\n //$arrImg = explode(\",\", $arrEditAviso->K_IMAGENES);\r\n //$allParams['ids_hidden_ad'] = $arrEditAviso->K_IMAGENES;\r\n $arrImgAll = explode(\",\", $arrEditAviso->K_IMAGENES);\r\n $this->session->imgDel = array();\r\n $increment = 1;\r\n foreach ($arrImgAll as $value) {\r\n $_key = time()+$increment;\r\n $increment++;\r\n $arrImg[$_key] = $value;\r\n $this->session->img[$_key] = $value;\r\n $this->session->imgDel[$_key] = $value;\r\n }\r\n //echo $arrEditAviso->K_ID_DEPARTAMENTO;exit;\r\n //$allParams['ubication_departement'] = explode(\",\", $arrEditAviso->K_ID_DEPARTAMENTO);\r\n $allParams['ubication_departement'] = $arrEditAviso->K_ID_DEPARTAMENTO;\r\n $allParams['ubication_province'] = $arrEditAviso->K_ID_PROVINCIA;\r\n $allParams['ubication_district'] = $arrEditAviso->K_ID_DISTRITO;\r\n \r\n $destaqueId = $allParams['destaqueId'];\r\n $form->setProvinciaJosonValidate(\r\n array('K_ID_DEPARTAMENTO' => $arrEditAviso->K_ID_DEPARTAMENTO)\r\n );\r\n $form->setDistritoJosonValidate(\r\n array(\r\n 'K_ID_DEPARTAMENTO' => $arrEditAviso->K_ID_DEPARTAMENTO,\r\n 'K_ID_PROVINCIA' => $arrEditAviso->K_ID_PROVINCIA\r\n )\r\n );\r\n $form->setDefaults($allParams);\r\n }\r\n } else {\r\n if (!$form->isValid($allParams)) {\r\n $valToken = $form->atoken->getErrors();\r\n $valToken = !empty($valToken);\r\n throw new Exception('Error form');\r\n }\r\n $form->_letterFreeMax = $arrDestaque->NUM_TEXTO_IMPRESO;\r\n if ($destaqueId==9 || $destaqueId == 10) $form->addPrintedText();\r\n $form->addRegistroDatos();\r\n }\r\n \r\n $arrDestaque = $this->_validarDestaque($destaqueId);\r\n //var_dump($arrDestaque);exit;\r\n if (!$arrDestaque) throw new Exception('Error Datos Destaque');\r\n \r\n $arrUbigeo['depa'] = Zend_Json::encode($mUbigeo->getListJoson(1));\r\n $arrUbigeo['prov'] = Zend_Json::encode($mUbigeo->getListJoson(2));\r\n $arrUbigeo['dist'] = Zend_Json::encode($mUbigeo->getListJoson(3));\r\n \r\n $form->addToken(3);\r\n \r\n } catch (Exception $exc) {\r\n// echo $exc->getMessage();exit;\r\n $this->session->sesionPaso1 = ($valToken)?1:2;\r\n $this->_redirect($this->view->baseUrl() . '/usuario/publicacion/registro-destaque/error/1');\r\n }\r\n \r\n //var_dump($arrDestaque);exit;\r\n $this->view->telefonoUser = $this->identity->FONO1;\r\n $this->view->arrDestaque = $arrDestaque;\r\n $this->view->form = $form;\r\n $this->view->arrPaso = $arrPasos;\r\n $this->view->arrUbigeo = $arrUbigeo;\r\n $this->view->destaqueId = $destaqueId;\r\n $this->view->publicacionEstado = $publicacionEstado;\r\n $this->view->arrImg = $arrImg;\r\n $this->view->ruta = $imd['url'] . '/'.$imd['original'].'/' . $this->identity->ID_USR . '/';\r\n //->Puglin Dax\r\n $this->view->daxTagOpc = $destaqueId;\r\n }", "function registra()\n {\n $v_utente = new v_utente();\n $Utente = $v_utente->creaUtente(); // viene creato un utente con i parametri della form\n if($v_utente->validazioneIscrizione($Utente))\n {\n if(!f_persistance::getInstance()->esiste(e_utente::class, f_target::ESISTE_NICK, $Utente->getNick()) && !f_persistance::getInstance()->esiste(e_utente::class, f_target::ESISTE_MAIL, $Utente->getMail()))\n {\n // se la mail e il nickname non sono stati ancora usati, si puo salvare l'utente\n $Utente->hashPassword(); // si cripta la password\n f_persistance::getInstance()->salva($Utente);\n\t\t\t\tc_sessione::inizioSessione($Utente);\n\t\t\t\t\n header('Location: /BiblioLibro');\n }\n else\n $v_utente->mostraIscrizione(true);\n }\n else\n $v_utente->mostraIscrizione();\n }", "public function getForm(){\n return route('register');\n }", "function agregar_nuevo_formulario($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion){\n\t$errFlag = false;\n\t$errArr['errortitulo'] = '';\n\t$errArr['errorarchivo'] = '';\n\t$errArr['errorproducto'] = '';\n\t$errArr['errorentidad'] = '';\n\n\t//VEO SI SE HA HECHO CLICK EN EL BOTON GUARDAR\n\tif(isset($_POST['accionGuardar'])) {\n\t\t\n\t\tif($errFlag){\n\t\t\t//HUBO ERRORES EN LOS CAMPOS NO SE PODRA SUBIR EL ARCHIVO\t\t\t\n\t\t\t\n\t\t}else{\n\t\t $validacion = validarPdf('txtArchivo', 2097152, '2 MB', '../file_form', true);\n\t\t\tif($validacion['flag']) {\n\t\t\t\t//SE VALIDO CORRECTAMENTE LA IMAGEN\n\t\t\t\t$archivoServidor = $validacion['archivo'];\n\t\t\t} else {\n\t\t\t\t//EL ARCHIVO NO SE VALIDO\n\t\t\t\t$errArr['errorarchivo'] = $validacion['mensaje'];\n\t\t\t\t$errFlag = true;\n\t\t\t}\n\t }\t\t\n\t\t\n\t\t//VEMOS SI TODO SE VALIDO BIEN\n\t\tif($errFlag) {\n\t\t\t//HUBIERON ERRORES, MOSTRAMOS EL FORM CON LOS ERRORES\n\t\t\tmostrar_crear_formulario($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion, $errArr);\n\t\t} else {\n\t\t\t//SI NO HUBIERON ERRORES, CARGAMOS LOS DATOS A LA BASE DE DATOS\n\n\t\t\t//SEGURIDAD\n\t\t\t$titulo = $conexion->real_escape_string($_POST['txtTitulo']);\n\t\t\t$idefin = $conexion->real_escape_string($_POST['idefin']);\n\t\t\t$idhome = $conexion->real_escape_string($_POST['idhome']);\n\t\t\t//GENERAMOS ID CODIFICADO UNICO\n\t\t\t$id_new_formulario = generar_id_codificado('@S#1$2013');\n\t\t\t//METEMOS LOS DATOS A LA BASE DE DATOS\n\t\t\t$insert =\"INSERT INTO s_sgc_formulario(id_formulario, id_home, archivo, titulo) \"\n\t\t\t\t .\"VALUES('\".$id_new_formulario.\"', '\".$idhome.\"', '\".$archivoServidor.\"', '\".$titulo.\"')\";\n\t\t\t\t\t\t\n\t\t\t//VERIFICAMOS SI HUBO ERROR EN EL INGRESO DEL REGISTRO\n\t\t\tif($conexion->query($insert)===TRUE){\n\t\t\t\t$mensaje=\"Se registro correctamente los datos del formulario\";\n\t\t\t header('Location: index.php?l=archivos&var='.$_GET['var'].'&op=1&msg='.base64_encode($mensaje));\n\t\t\t exit;\n\t\t\t} else {\n\t\t\t\t$mensaje=\"Hubo un error al ingresar los datos, consulte con su administrador \".\"\\n \".$conexion->errno.\": \". $conexion->error;\n\t\t\t header('Location: index.php?l=archivos&var='.$_GET['var'].'&op=2&msg='.base64_encode($mensaje));\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\t//MUESTRO EL FORM PARA CREAR UNA CATEGORIA\n\t\tmostrar_crear_formulario($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion, $errArr);\n\t}\n}", "public function registroPaquete(){\n $id = auth()->user()->id;\n $empleado = Empleado::all()->where('user_id',$id)->first();\n $area = Area::find($empleado->area_id);\n $rango = Rango::find($empleado->rango_id);\n\n if($area->nombre == 'Entrega' || $rango->nombre != 'Empleado'){\n return redirect('registro/buscar')->with('error', 'Pagina no autorizada');\n }\n \n $datos = ['empleado'=>$empleado, 'area'=>$area, 'rango'=>$rango];\n \n //genera los datos necesario para el formulario dependiedo del area y rango\n $datos = $this->generarDatos($datos, $datos['area']->nombre, $rango);\n\n return view('registros.registrar', array('datos'=>$datos)); \n }", "function _GetFrm(){\n\t\t// Cargo desde el formulario\n\t\t$this->Registro['id_faq'] = $_POST['id_faq'];\n\t\t$this->Registro['pregunta'] = $_POST['pregunta'];\n\t\t$this->Registro['numero'] = $_POST['numero'];\n\t\t$this->Registro['respuesta'] = $_POST['respuesta'];\n\t\t$this->Registro['visible'] = $_POST['visible'] ? 1 : 0;\n\t}", "public function registrarJuego(){\n $titulo = $_POST['Titulo'];\n $nombre = $_POST['Nombre'];\n $anio = $_POST['Anio'];\n $protagonistas = $_POST['Protagonistas'];\n $director = $_POST['Director'];\n $productor = $_POST['Productor'];\n $tecnologia = $_POST['Tecnologia'];\n $precio = $_POST['Precio'];\n \n\n $consulta = $this->tiendaModel->registrarJuego($titulo, $nombre, $anio, $protagonistas, $director, $productor, $tecnologia, $precio);\n echo $consulta; \n }", "public function registrar()\n {\n #validamos si vienen valores por el metodo Post\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n #recibimos la contraseña y la encriptamos y hacemos el arreglo de datos\n if (isset($_POST[\"ndocumento\"])) {\n $encriptar = crypt($_POST[\"contra\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n $datos = array(\"ndocumento\" => strip_tags(trim($_POST[\"ndocumento\"])), \"tdocumento\" => strip_tags($_POST[\"tdocumento\"]),\n \"primer_nombre\" => strip_tags($_POST[\"primer_nombre\"]), \"segundo_nombre\" => strip_tags($_POST[\"segundo_nombre\"]), \"primer_apellido\" => strip_tags($_POST[\"primer_apellido\"]), \"segundo_apellido\" => strip_tags($_POST[\"segundo_apellido\"]),\n \"contra\" => strip_tags($encriptar), \"contra1\" => strip_tags($_POST[\"contra1\"]), \"correo\" => strip_tags($_POST[\"correo\"]), \"rol\" => \"3\", \"estado\" => \"1\");\n }if (isset($_POST[\"ndocumento1\"])) {\n $encriptar = crypt($_POST[\"contra\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n $datos = array(\"ndocumento\" => strip_tags(trim($_POST[\"ndocumento1\"])), \"contra\" => strip_tags($encriptar), \"correo\"=> strip_tags($_POST[\"correo\"]), \"rol\" => \"3\", \"estado\" => \"1\");\n }\n \n\n #validamos si las contraseña y su confirmacion son diferentes\n if (strip_tags($_POST[\"contra\"]) != strip_tags($_POST[\"contra1\"])) {\n $datos = array('mensaje' => 'Las Contraseñas no Coinciden');\n $this->vista(\"paginas/registrar\", $datos);\n } else {\n\n #Llamamos el metodo validarUsuarioModel para validar que no este registrado en la base de datos\n if (!$this->usuarioModelo->validarUsuarioModel($datos)) {\n if ($this->usuarioModelo->registrarUsuariomodel($datos)) {\n $datos = array('aviso' => 'El Usuario se Registro con Exito', 'alert' => 'success');\n $this->vista(\"paginas/inicio\", $datos);\n } else {\n\n $datos = array('mensaje' => 'Algo Salio Mal');\n $this->vista(\"paginas/registrar\", $datos);\n\n }\n } else {\n $usuario = $this->usuarioModelo->validarUsuarioModel($datos);\n if ($usuario->contrasena == 'N/A' && $usuario->correo == 'N/A') {\n \n if ($this->usuarioModelo->completarRegistroModel($datos)) {\n $datos = array('aviso' => 'El Usuario se Registro con Exito', 'alert' => 'success');\n $this->vista(\"paginas/inicio\", $datos);\n } else {\n\n $datos = array('mensaje' => 'Algo Salio Mal');\n $this->vista(\"paginas/registrar\", $datos);\n\n }\n }else{\n $datos = array('mensaje' => 'Un usuario ya se encuentra registrado con este Numero de documento o Correo');\n $this->vista(\"paginas/registrar\", $datos);\n }\n \n }\n }\n\n } else {\n\n $this->vista(\"paginas/registrar\");\n\n }\n\n }", "public function fAgregaDocen(){\n\t\t$usr = strtoupper($this->input->post('name')); \n\t\t$psw = strtoupper($this->input->post('psw'));\n\t\t$type = $this->input->post('type');\n\t\t//Se agrega a la base de datos\n\t\t$respuesta = $this->ModelosP->agregaUser($usr, $psw, $type);\n\t\t$respuesta = $this->ModelosP->agregaDocen($usr);\n\t\tif($respuesta == NULL){\n\t\t\techo \"Hubo un Problema al insertar el usuario\";\n\t\t}else{\n\t\t\t$this->load->view('VaddDone');\n\t\t}\n\t}", "public function save(){\n /* RECIBIMOS EL FORMULARIO DE REGISTRO DE LA CARPETA \"views/usuario/registro.php\" */\n if(isset($_POST)){\n /* COMPROBAMOS QUE NOS LLEGUEN VALORES DEL FORMULARIO */\n $nombre = isset($_POST['nombre']) ? $_POST['nombre']: false;\n $apellidos = isset($_POST['apellidos']) ? $_POST['apellidos']: false;\n $email = isset($_POST['email']) ? $_POST['email']: false;\n $password = isset($_POST['password']) ? $_POST['password']: false;\n\n if($nombre &&$apellidos&&$email && $password){\n $usuario = new Usuario();\n $usuario -> setNombre($nombre);\n $usuario -> setApellidos($apellidos);\n $usuario -> setEmail($email);\n $usuario -> setPassword($password);\n $save = $usuario ->save();\n if($save){\n $_SESSION['register'] = \"complete\";\n }else{\n $_SESSION['register'] = \"failed\";\n }\n }else{\n $_SESSION['register'] = \"failed\";\n }\n } else{\n $_SESSION['register'] = \"failed\";\n }\n header(\"Location:\".base_url.'usuario/registro');\n }", "function _GetFrm(){\r\r\n\t\t// Cargo desde el formulario\r\r\n\t\t$id = $_POST['id_cupon'];\r\r\n\t\t$this->Registro['id_cupon'] = $id;\r\r\n\t\t$this->Registro['Nombre'] = $_POST['Nombre'];\r\r\n\t\t$this->Registro['Tipo'] = $_POST['Tipo'];\r\r\n\t\t$this->Registro['Valor'] = $_POST['Valor'];\r\r\n\t\t$this->Registro['PrefijoCodigo'] = $_POST['PrefijoCodigo'];\r\r\n\t\t$this->Registro['FechaIni'] = $_POST['FechaIni'];\r\r\n\t\t$this->Registro['FechaFin'] = $_POST['FechaFin'];\r\r\n\t}", "public function registro(){\n\n\t\t\t//comprobar si es un usuari ja registrat, diferent a admin\n\t\t\tif (!Login::isAdmin()&&Login::getUsuario())\n\t\t\t\theader(\"location:index.php?controlador=usuario&operacion=modificacion\");\n\t\t\t\t//throw new Exception(\"Ja estas registrat! Cal tancar sessió per crear nou registre.\");\n\t\t\t\n\t\t\t//si no llegan los datos a guardar\n\t\t\tif(empty($_POST['guardar'])){\n\t\t\t\t\n\t\t\t\t//mostramos la vista del formulario\n\t\t\t\t$datos = array();\n\t\t\t\t$datos['usuario'] = Login::getUsuario();\n\t\t\t\t$datos['max_image_size'] = Config::get()->user_image_max_size;\n\t\t\t\t$this->load_view('view/usuarios/registro.php', $datos);\n\t\t\t\n\t\t\t//si llegan los datos por POST\n\t\t\t}else{\n\t\t\t\t//crear una instancia de Usuario\n\t\t\t\t$u = new UsuarioModel();\n\t\t\t\t$conexion = Database::get();\n\t\t\t\t\n\t\t\t\t//tomar los datos que vienen por POST\n\t\t\t\t//real_escape_string evita las SQL Injections\n\t\t\t\t$u->dni = $conexion->real_escape_string($_POST['dni']);\n\t\t\t\t$u->data_naixement = $conexion->real_escape_string($_POST['data_naixement']);\n\t\t\t\t$u->nom= strtoupper($conexion->real_escape_string($_POST['nom']));\n\t\t\t\t$u->cognom1= strtoupper($conexion->real_escape_string($_POST['cognom1']));\n\t\t\t\t$u->cognom2= strtoupper($conexion->real_escape_string($_POST['cognom2']));\n\t\t\t\t$u->estudis= $conexion->real_escape_string($_POST['estudis']);\n\t\t\t\t$u->situacio_laboral= $conexion->real_escape_string($_POST['situacio_laboral']);\n\t\t\t\t$u->prestacio= $conexion->real_escape_string($_POST['prestacio']);\n\t\t\t\t$u->telefon_mobil= $conexion->real_escape_string($_POST['telefon_mobil']);\n\t\t\t\t$u->telefon_fix= $conexion->real_escape_string($_POST['telefon_fix']);\n\t\t\t\t$u->email= strtolower($conexion->real_escape_string($_POST['email']));\n\t\t\t\t/*\n\t\t\t\t$u->imatge= Config::get()->default_user_image;\n\t\t\t\t\n\t\t\t\t//recuperar y guardar la imagen (solamente si ha sido enviada)\n\t\t\t\tif($_FILES['imatge']['error']!=4){\n\t\t\t\t\t//el directorio y el tam_maximo se configuran en el fichero config.php\n\t\t\t\t\t$dir = Config::get()->user_image_directory;\n\t\t\t\t\t$tam = Config::get()->user_image_max_size;\n\t\t\t\t\t\t\n\t\t\t\t\t$upload = new Upload($_FILES['imatge'], $dir, $tam);\n\t\t\t\t\t$u->imatge = $upload->upload_image();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\t * OLD\n\t\t\t\t *\t\t\n\t\t\t\t$u->nombre = $conexion->real_escape_string($_POST['nombre']);\n\t\t\t\t$u->email = $conexion->real_escape_string($_POST['email']);\n\t\t\t\t$u->imagen = Config::get()->default_user_image;\n\t\t\t\t\n\t\t\t\t//recuperar y guardar la imagen (solamente si ha sido enviada)\n\t\t\t\tif($_FILES['imagen']['error']!=4){\n\t\t\t\t\t//el directorio y el tam_maximo se configuran en el fichero config.php\n\t\t\t\t\t$dir = Config::get()->user_image_directory;\n\t\t\t\t\t$tam = Config::get()->user_image_max_size;\n\t\t\t\t\t\n\t\t\t\t\t$upload = new Upload($_FILES['imagen'], $dir, $tam);\n\t\t\t\t\t$u->imagen = $upload->upload_image();\n\t\t\t\t}\n\t\t\t\t*/\t\t\t\t\n\t\t\t\t//guardar el usuario en BDD\n\t\t\t\tif(!$u->guardar())\n\t\t\t\t\tthrow new Exception(\"No s'ha pogut registrar l'usuari\");\n\t\t\t\t\n\t\t\t\t//mostrar la vista de éxito\n\t\t\t\t$_SESSION['user'] = serialize(UsuarioModel::getUsuario_ByDni($u->dni));\n\t\t\t\tLogin::comprobar(); //marca la sessió ja de l'usuari\n\t\t\t\t$datos = array();\n\t\t\t\t$datos['usuario'] = Login::getUsuario();\n\t\t\t\t$datos['mensaje'] = 'Operació de registre completada amb èxit';\n\t\t\t\t$this->load_view('view/exito.php', $datos);\n\t\t\t}\n\t\t}", "public function getRegistrar()\n \t{\n \t\t// desplegamos un formulario básico\n \t\techo 'Aqui podemos registrar a los usuarios: ';\n \t\techo Form::open(array('url' => 'usuarios/crear', 'method' => 'post'));\n \t\techo Form::label('name', 'Nombre: ');\n \t\techo Form::text('nombre');\n \t\techo Form::submit('Registrar');\n \t\techo Form::close();\n \n \t}", "public function showRegistrationForm()\n {\n $aluno = new Aluno();\n $cursos = Curso::pluck('nome', 'id')->all();\n return view('aluno.auth.register', compact('aluno', 'cursos'));\n }", "function formularioRespuesta($n,$p,$nom) {\n echo \"<div class='contenedorPregunta'>\";\n echo \"<textarea id='nodo' name='nodo' form='formulario' style='display:none;'>\" . $n . \"</textarea>\";\n echo \"<textarea id='nombreAnt' name='nombreAnt' form='formulario' style='display:none;'>\" . $nom . \"</textarea>\";\n\n echo \"<h3>¿En quién habías pensado?</h3>\";\n echo \"<textarea id='nombre' name='nombre' form='formulario' placeholder='Nombre'></textarea>\";\n echo \"<h3>¿Qué tiene este personaje que no tenga \" . $nom . \"?</h3>\";\n echo \"<textarea id='caracteristicas' name='caracteristicas' form='formulario' placeholder='Características'></textarea>\";\n\n echo \"<form action='crear.php' id='formulario' method='POST'>\";\n echo \"<button type='submit' name='enviar'>Enviar</button>\";\n echo \"</form>\";\n echo \"</div>\";\n\n }", "function form_libro()\n{\n global $web, $cveperiodo;\n\n if (!isset($_GET['info1']) || !isset($_GET['info2'])) {\n message('danger', 'Información incompleta');\n }\n\n $lectura = $web->getReading($_GET['info1']);\n if (!isset($lectura[0])) {\n message(\"danger\", \"No altere la estructura de la interfaz\");\n }\n\n $web->iniClases('usuario', \"index grupos libro\");\n\n //config tabla de libros\n //para no mostrar los libros que ya fueron registrados para ese alumno en ese periodo\n $libros = $web->getTableBooks(array($lectura[0]['nocontrol'], $cveperiodo, $_GET['info1']));\n $datos = array('data' => $libros);\n \n // config de la columna portada\n for ($i = 0; $i < sizeof($datos['data']); $i++) {\n $datos['data'][$i]['titulo'] = \"<a href='grupo.php?accion=insert&info=\".$datos['data'][$i]['cvelibro'].\"&info2=\".$_GET['info1'].\"' \n title='Seleccionar Libro'>\".$datos['data'][$i]['titulo'].\"</a>\";\n \n $datos['data'][$i][4] = \"<center><a href='grupo.php?accion=insert&info=\".$datos['data'][$i]['cvelibro'].\"&info2=\".$_GET['info1'].\"'\n title='Seleccionar Libro'><img width='50%' src='../Images/portadas/\".$datos['data'][$i][4].\"' alt='Seleccionar'></a></center>\";\n \n unset($datos['data'][$i]['cvelibro']);\n unset($datos['data'][$i][0]);\n }\n \n $web->DB->SetFetchMode(ADODB_FETCH_NUM);\n $datos = json_encode($datos);\n \n $file = fopen(\"TextFiles/libros.txt\", \"w\");\n fwrite($file, $datos);\n \n //mensaje sobre libros\n $libros = $web->getBooks($lectura[0]['nocontrol'], $_GET['info1']);\n if (!isset($libros[0])) {\n $web->simple_message('warning', 'No hay libros registrados');\n } else {\n if (sizeof($libros) < 5) {\n $web->simple_message('warning', 'Debe seleccionar mínimo 5 libros');\n }\n\n $libros = existsReports($libros, $lectura); // CHECAR SI HA SUBIDO LOS REPORTES DE LOS LIBROS\n $web->smarty->assign('libros', $libros);\n }\n\n $web->smarty->assign('datos', $datos);\n $web->smarty->assign('upload', true);\n $web->smarty->assign('grupo', $_GET['info2']);\n $web->smarty->assign('cvelectura', $_GET['info1']);\n $web->smarty->assign('form_libro', true);\n $web->smarty->display('form_libro.html');\n die();\n}", "public function eliminarFotografia()\n\t{\n\t\tif (isset($_GET['id']) && !empty($_GET['id']))\n\t\t{\n\t\t\t$idRegistro = $_GET['id'];\n\n\t\t\tif ($this->sess->get(\"idRegistro\") == $idRegistro)\n\t\t\t{\n\t\t\t\t$evento = $this->model->getEvento($this->idEvento);\n\n\t\t\t\tif ($this->model->eliminarFotografia($idRegistro, $evento->evt_clave))\n\t\t\t\t{\n\t\t\t\t\t$this->json = array(\n\t\t\t\t\t\t'status' => 'funcion',\n\t\t\t\t\t\t'nomFuncion' => 'eliminarFotografia',\n\t\t\t\t\t\t'seccion' => $this->seccion\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->json = array(\n\t\t\t\t\t\t'status' => 'funcion',\n\t\t\t\t\t\t'nomFuncion' => 'errorEliminarFotografia',\n\t\t\t\t\t\t'mensaje' => 'No fue posible eliminar la fotografia de este registro, intentalo de nuevo por favor.'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\theader (\"HTTP/1.1 514 An Error\");\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader (\"HTTP/1.1 514 An Error\");\n\t\t\texit();\n\t\t}\n\n\t\techo json_encode($this->json);\n\t}", "public function myPersonalInformationAction( Request $request ){\n// $repository = $this->getDoctrine()->getRepository('LesDataBundle:Restaurants');\n// $person = $repository->findOneByName(\"Resto du Paris\");\n\n $form = $this->createForm(new MyPersonalInformationType() , array(\n 'action' => $this->generateUrl('restaurant_my_information'),\n 'method' => 'POST',\n ));\n\n $form->handleRequest($request);\n if ($form->isValid()){\n $data = $form->getData();\n return new Response(\" Test myinformation \");\n }\n\n// exit(\\Doctrine\\Common\\Util\\Debug::dump($this->resto));\n return $this->render(\"LesRestaurantBundle:Admin:PersonalInformation/myPersonalInformation.html.twig\",\n array( 'form' => $form->createView() )\n );\n }", "public function registrarRervacionController(){\n //llamada la metodo del modelo para recuperar los datos que seran mostrados\n $respuesta = Datos::vistaHabitacionesModel(\"habitaciones\");\n ?>\n <div id=\"\">\n <form method=\"post\" class=\"frm-single \" action=\"index.php?action=reservaciones\">\n <div class=\"inside\">\n <div class=\"title\"><strong>Registrar</strong>&nbsp;Reservación</div>\n \n <div class=\"form-group margin-bottom-20\">\n <select class=\"form-control\" name=\"habitacion\">\n <option value=\"\">Número de habitación</option>\n <?php foreach($respuesta as $row => $item){ ?>\n <option value=\"<?php echo $item['id']; ?>\"><?php echo $item['id'].' - '.$item['tipo'] ?></option>\n <?php } ?>\n </select>\n </div>\n\n <?php \n //llamada la metodo del modelo para recuperar los datos que seran mostrados\n $respuesta = Datos::vistaClientesModel(\"clientes\"); \n ?>\n \n <div class=\"form-group margin-bottom-20\">\n <select class=\"form-control\" name=\"cliente\">\n <option value=\"\">Cliente</option>\n <?php foreach($respuesta as $row => $item){ ?>\n <option value=\"<?php echo $item['id']; ?>\"><?php echo $item['nombre'] ?></option>\n <?php } ?>\n </select>\n </div>\n \n\t\t\t\t\t\t\t\t\t\t<div class=\"input-group margin-bottom-20\">\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"date\" class=\"form-control\" placeholder=\"mm/dd/yyyy\" id=\"datepicker-autoclose\" name=\"fecha\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"input-group-addon bg-primary text-white\"><i class=\"fa fa-calendar\"></i></span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n <div class=\"frm-input\"><input type=\"number\" placeholder=\"Número de noches\" name=\"numeroNoches\" class=\"frm-inp\" value=\"<?php echo $respuesta['telefono']?>\" requiered><i class=\"fa fa-clock-o frm-ico\"></i></div>\n \n <button type=\"submit\" class=\"frm-submit btn\">Aceptar<i class=\"fa fa-arrow-circle-right\"></i></button>\n \n </div>\n <!-- .inside -->\n </form>\n <!-- /.frm-single -->\n </div><!--/#single-wrapper -->\n <?php\n }", "function registrarFinalistas(){\r\n\t\t$Puntuacion= new PuntuacionFinalista();\r\n\t\t$Puntuacion->register(array(\r\n\t\t\t'usuario_id' => $_SESSION['user']['usuario_id'],\r\n\t\t\t'pincho_id' => $_POST['pincho_id'],\r\n\t\t\t'nota' => $_POST['nota']));\r\n\r\n}", "public function registro()\n\t{\n $data[\"titulo\"]=\"Registro de preguntas frecuentes\";\n $data[\"descripcion\"]=\"Este Modulo Permite Ingresar O Modificar Preguntas Frecuentes\";\n $data[\"imagen\"]=\"preguntas.png\";\n $data[\"mensajes\"]=\"\";\n \n // Agregar los campos que son considerador requeridos: nombres, apellidos y documento\n // dentro form_validation que se llama set_rules (campo,texto,requerido)\n $this->form_validation->set_rules('pregunta','<strong>Preguntas</strong>','required');\n $this->form_validation->set_rules('respuesta','Respuestas','required');\n \n \n // podemos validar si se ejecuto el boton \"guardar\"\n if ($this->form_validation->run()===FALSE) {\n \n } else {\n // realice algun proceso de insercion\n // ANTES DE INSERTAR, PASAR EL NOMBRE DEL ARCHIVO\n $this->preguntas_model->ingresar(\"\");\n\n $data[\"mensajes\"]=\"Registro ingresado con exito\";\n \n }\n $data[\"lista\"]=$this->preguntas_model->listar_registros();\n \n $data[\"nombreusuario\"]=$this->session->userdata('nombre').\" \".$this->session->userdata('apellido');\n $data[\"idusuario\"]=$this->session->userdata('id'); \n \n $this->load->view('preguntas_formulario',$data);\n\t}", "function ir_a_fila($agregado=\"\")\n\t{\n\t\t$this->agregado_form = $agregado;\n\t\t$this->id_form = ($agregado !== '') ? $agregado . '_' . $this->id_form_orig : $this->id_form_orig;\n\t}", "public function validarRegistro($request)\n\t{\n\t\tif (!isset($_POST))\n\t\t{\n\t\t\t$this->json = array(\n\t\t\t\t\"status\" => false,\n\t\t\t\t\"mensaje\" => \"El formulario no se envío adecuadamente.\"\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Obtenemos datos del evento\n\t\t\t$evento = $this->model->getEvento($this->idEvento);\n\t\t\t$this->fova->campos = $request->query;\n\t\t\t$fotoMensaje = '';\n\n\t\t\t$this->fova->validarCampo(\"id_tag\", \"\", \"\", 0, 20);\n\t\t\t$this->fova->validarCampo(\"titulo\", \"\", \"\", 0, 20);\n\t\t\t$this->fova->validarCampo(\"nombre\", \"req\", \"\", 2, 100);\n\t\t\t$this->fova->validarCampo(\"app\", \"req\", \"\", 2, 50);\n\t\t\t$this->fova->validarCampo(\"apm\", \"\", \"\", 2, 50);\n\t\t\t\n\t\t\t$this->fova->validarCampo(\"rfc\", \"\", \"\", 0, 13);\n\t\t\t$this->fova->validarCampo(\"curp\", \"\", \"\", 0, 18);\n\t\t\t$this->fova->validarCampo(\"genero\", \"\", \"\", 1, 1);\n\t\t\t//$this->fova->validarCampo(\"idioma\", \"req\", \"\", 2, 2);\n\t\t\t$this->fova->validarCampo(\"emp_o_ins\", \"\", \"\", 2, 125);\n\t\t\t$this->fova->validarCampo(\"cargo\", \"\", \"\", 3, 75);\n\t\t\t$this->fova->validarCampo(\"folio_pago\", \"\", \"\", 1, 15, \"INT\");\n\t\t\t/*$this->fova->validarCampo(\"direccion\", \"\", \"\", 3, 125);\n\t\t\t$this->fova->validarCampo(\"colonia\", \"\", \"\", 1, 40);\n\t\t\t$this->fova->validarCampo(\"ciudad\", \"\", \"\", 1, 40);\n\t\t\t$this->fova->validarCampo(\"estado\", \"\", \"\", 1, 40);\n\t\t\t$this->fova->validarCampo(\"pais\", \"\", \"\", 1, 40);\n\n\t\t\t\n\t\t\t$this->fova->validarCampo(\"lada_telefono\", \"\", \"\", 1, 4);\n\t\t\t$this->fova->validarCampo(\"telefono_particular\", \"\", \"\", 1, 25);\n\t\t\t$this->fova->validarCampo(\"telefono_movil\", \"\", \"\", 1, 25);\n\t\t\t$this->fova->validarCampo(\"fax_RS\", \"\", \"\", 1, 25);*/\n\t\t\t$this->fova->validarCampo(\"comentarios\", \"\", \"\", 1, 0);\n\n\t\t\t$this->fova->validarCampo(\"email\", \"\", \"\", 5, 125, \"MAIL\");\n\n\t\t\t$this->fova->validarCampo(\"cat_registro\", \"req\", \"\", 2, 10);\n\t\t\t$this->fova->validarCampo(\"id_costo\", \"req\", \"\", 1, 2, \"INT\");\n\t\t\t$this->fova->validarCampo(\"forma_pago\", \"req\", \"\", 2, 2);\n\t\t\t$this->fova->validarCampo(\"status\", \"req\", \"\", 3, 3);\n\n\t\t\t$this->fova->validarCampo(\"clave_asociada\", \"\", \"\", 0, 15);\n\n\t\t\tif ($this->fova->validacion['status'])\n\t\t\t{\n\n\t\t\t\t// Genera el folio de registro\n\t\t\t\t$folio_registro = time();\n\t\t\t\t$this->fova->agregarCampo(\"folio_registro\", $folio_registro);\n\n\t\t\t\t// Genera la clave del registro\n\t\t\t\t$clave_registro = md5($this->func->generarID(24));\n\t\t\t\t$this->fova->agregarCampo(\"clave_registro\", $clave_registro);\n\n\t\t\t\t// Obtenemos el costo total del registro\n\t\t\t\t$costo_total = $this->evt->getCostoCategoria(\n\t\t\t\t\t$this->fova->campos['cat_registro'],\n\t\t\t\t\t$this->fova->campos['id_costo'],\n\t\t\t\t\t$this->idEvento\n\t\t\t\t);\n\n\t\t\t\tif ($evento->evt_iva > 0)\n\t\t\t\t{\n\t\t\t\t\t$costo_total->costo = $costo_total->costo * $evento->evt_iva;\n\t\t\t\t}\n\n\t\t\t\t$this->fova->agregarCampo(\"costo_registro\", $costo_total->costo);\n\t\t\t\t$this->fova->agregarCampo(\"costo_total\", $costo_total->costo);\n\n\t\t\t\tif ($idNuevoRegistro = $this->guardarRegistro($this->fova->campos))\n\t\t\t\t{\n\t\t\t\t\t$this->sess->set('idRegistro', $idNuevoRegistro);\n\n\t\t\t\t\t$totalRegistros = $this->evt->getTotalRegistros($this->fova->campos['tabla_registros']);\n\n\t\t\t\t\t$totalRegPagados = 0;\n\t\t\t\t\t$regStatus = \"PAG\";\n\t\t\t\t\tif ($this->fova->campos['status'] == $regStatus)\n\t\t\t\t\t{\n\t\t\t\t\t\t$totalRegPagados = $this->evt->getTotalRegistros($this->fova->campos['tabla_registros'], $regStatus);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->fova->campos['save_photo'] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!$this->guardarFotografia($this->fova->campos['photo'], $idNuevoRegistro))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$fotoMensaje = 'El fotografia no fue guardad, por favor intente agregar la fotografia editando el registro.';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->json = array(\n\t\t\t\t\t\t\"status\" => \"funcion\",\n\t\t\t\t\t\t\"nomFuncion\" => \"finNuevoRegistro\",\n\t\t\t\t\t\t\"idRegistro\" => $idNuevoRegistro,\n\t\t\t\t\t\t\"totalRegistros\" => $totalRegistros,\n\t\t\t\t\t\t\"totalRegPagados\" => $totalRegPagados,\n\t\t\t\t\t\t\"mensaje\" => \"El nuevo registro fue agregado con exito.\",\n\t\t\t\t\t\t'fotoMensaje' => $fotoMensaje\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->json = array(\n\t\t\t\t\t\t\"status\" => false,\n\t\t\t\t\t\t\"mensaje\" => \"No fue posible guardar el registro, intentalo de nuevo.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->json = $this->fova->validacion;\n\t\t\t}\n\n\t\t}\n\n\t\techo json_encode($this->json);\n\t}", "public function registerform()\n {\n return view('vehicle.register')->with('defaultImg', $this->s3->gets3upload());\n }" ]
[ "0.61913884", "0.6128244", "0.61132264", "0.60823596", "0.6079111", "0.6022117", "0.59983665", "0.59873027", "0.59696865", "0.5952466", "0.5941719", "0.5917287", "0.5887182", "0.5879037", "0.58455276", "0.58390033", "0.58175343", "0.58127874", "0.5777859", "0.57713807", "0.5765603", "0.57487595", "0.57450485", "0.57277554", "0.57149196", "0.57120526", "0.57086146", "0.56959844", "0.56747013", "0.5667947" ]
0.68885946
0
/ Actualiza Panel de Fotografia
private function _panelFotografia($data) { return $this->renderView('SisproBundle:Ejecucion:fotografias.html.twig', array('data' => $data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hookDisplayProductTabContent($params) {\n if(Tools::isSubmit(\"fotocliente_submit_foto\")) {\n if(isset($_FILES[\"foto\"])) {\n $foto = $_FILES[\"foto\"];\n if($foto[\"name\"] != \"\") {\n $allowed = array('image/gif', 'image/jpeg', 'image/jpg', 'image/png');\n if(in_array($foto[\"type\"], $allowed)) {\n $path = './upload/';\n list($width, $height) = getimagesize($foto['tmp_name']);\n $propo = 400/$width;\n $copy = ImageManager::resize($foto[\"tmp_name\"], $path.$foto['name'], 400, $propo*$height, $foto[\"type\"]);\n if(!$copy) {\n $this->context->smarty->assign(\"errorForm\", $this->l(\"Error moviendo la imagen: \").$path.$foto[\"name\"]);\n } else {\n $id_product = Tools::getValue(\"id_product\");\n $pathfoto = \"upload/\".$foto['name'];\n $comentario = Tools::getValue(\"comment\");\n\n //Creamos una nueva instancio de la clase FotoclienteObj\n $fotoObj = new FotoclienteObj();\n $fotoObj->id_product = (int)$id_product;\n $fotoObj->foto = $pathfoto;\n $fotoObj->comment = pSQL($comentario);\n $result = $fotoObj->add(); //El metodo add() hace el objecto creado sea guardado en la DB\n\n if($result) {\n $this->context->smarty->assign(\"saveForm\", \"1\");\n } else {\n $this->context->smarty->assign(\"errorForm\", $this->l(\"No se a podido grabar la foto en la BD\"));\n }\n }\n } else {\n $this->context->smarty->assign(\"errorForm\", $this->l(\"Formato de imagen no valido\"));\n }\n }\n }\n }\n\n //Obtnemos todas las fotos del id_product de la pagina\n $fotos = FotoclienteObj::getProductFotos(Tools::getValue(\"id_product\"));\n $this->context->smarty->assign('fotos', $fotos);\n\n $enable_comment = Configuration::get(\"FOTOCLI_COMMENTS\");\n $this->context->smarty->assign(\"enable_comment\", $enable_comment);\n\n //Agregamos css y js al hook\n $this->context->controller->addCSS($this->_path.\"views/css/fotocliente.css\");\n $this->context->controller->addJS($this->_path.\"views/js/fotocliente.js\");\n\n return $this->display(__FILE__, \"displayProductTabContent.tpl\");\n }", "function fotografias($id=\"\",$opcion='0',$cpt) {\n\n if ($cpt<>\"per_id\") {\n switch ($cpt) {\n case 'alu_id'\t:\n $sid=\"select alu_per_id from ac_alumno where alu_id=\".$id;\n $ids= new QUERY;\n $ids->consulta($sid);\n $lid=$id;\n $id = $ids->valores_fila();\n $id=$id[0];\n $ids->cerrar();\n break;\n }\n }\n $tot=_fotos.\"/\".$id.\".jpg\";\n $alt=_fotos.\"/nofoto.jpg\";\n\n if (file_exists($tot)) {\n echo \"<img src='$tot' alt='fotografia'>\";\n\n\n }\n else {\n if($opcion==1 and $id<>\"\") {\n echo '<a href=\"#\" onClick=window.open(\"'._url.'/componentes/subidor.php?mod_id='.$this->mod_id.'&tarea='.$this->tarea.'&id='.$id.'&cpt='.$this->cpt.'&lid='.$lid.'&eme=eme\",\"Alertas\",\"toolbar=no,width=400,height=100,scrollbars=no\")><img src='.$alt.'></a>';\n }\n else {\n echo \"<img src='$alt' alt='fotografia'>\";\n }\n }\n }", "public function fotoUpload()\n\t{\n\t\t$this->display(\n\t\t\tarray(\n\t\t\t\t'seccion' => $this->seccion\n\t\t\t)\n\t\t);\n\t}", "function show_perfil(){\n\t\tglobal $tabla_usuarios;\n\t\tglobal $tabla_funcionarios;\n\t\t\n\t\t$id_usuario = get_cookie_id_user();\t\n\t\t$usuario = run_select_query(\"Select *, DATE_FORMAT(cumple,'%d/%M/%Y') as cumple from $tabla_usuarios where id = '$id_usuario'\");\n \n\t\t$nombre_usuario = $usuario[0]['nombre'];\t\n\t\t$iniciales = $usuario[0]['iniciales'];\n\t\t$correo = $usuario[0]['correo'];\n\t\t$foto = $usuario[0]['foto'];\n\t\t$password = $usuario[0]['password'];\n\t\t$extension = $usuario[0]['extension'];\n\t\t$telefono = $usuario[0]['telefono'];\n\t\t$celular = $usuario[0]['celular'];\n\t\t$direccion = $usuario[0]['direccion'];\n\t\t$cumple = $usuario[0]['cumple'];\n\t\t$id_funcionario = $usuario[0]['id_funcionario'];\n\t\t\n\t\t$direccion_google = str_replace(\" \",\"+\",$direccion);\n\t\t\n if($id_funcionario != \"\"){\n\t\t$documentos = run_select_query(\"Select * from documentos_funcionario where id_funcionario = '$id_funcionario' AND valor != ''\");\n\t\t$nombre_documento_titular = $valor_titular = $archivo_dependiente = $lista_documentos = \"\";\n\t\tforeach($documentos as $key => $value){\n\t\t\t$nombre_documento_titular = $documentos[$key]['nombre'];\n\t\t\t$valor_titular = $documentos[$key]['valor'];\t\n\t\t\t$archivo_dependiente = $documentos[$key]['archivo'];\t\n\t\t\t$lista_documentos.=\"<li><a href='index.php?ver_documento&archivo=$archivo_dependiente&carpeta=protocolo' target='_blank'>$nombre_documento_titular - $valor_titular</a></li>\";\n\t\t}\n\t\t\n\t\t$dependientes = run_select_query(\"Select * from funcionarios where id_padre = '$id_funcionario'\");\n if($dependientes)\n\t\tforeach($dependientes as $key2 => $value2){\n\t\t\n\t\t$id_dependiente = $dependientes[$key2]['id'];\n\t\t$nombre_dependiente = $dependientes[$key2]['nombre'];\t\n\t\t$lista_documentos_dependientes.= \"<h3>\".$nombre_dependiente.\"</h3>\";\t\n\t\t$documentos_dependientes = run_select_query(\"Select * from documentos_funcionario where id_funcionario = '$id_dependiente' AND valor != ''\");\n\t\t$nombre_documento_dependiente = $valor_dependiente = $archivo_dependiente = \"\";\n\t\tforeach($documentos_dependientes as $key3 => $value3){\n\t\t\t$nombre_documento_dependiente = $documentos_dependientes[$key3]['nombre'];\n\t\t\t$valor_dependiente = $documentos_dependientes[$key3]['valor'];\t\n\t\t\t$archivo_dependiente = $documentos_dependientes[$key3]['archivo'];\t\n\t\t\t$lista_documentos_dependientes.=\"<li><a href='index.php?ver_documento&archivo=$archivo_dependiente&carpeta=protocolo' target='_blank'>$nombre_documento_dependiente - $valor_dependiente</a></li>\";\n\t\t}\n\t\t\t\n\t\t}\n\t}\n\t\t?>\n\t\t<table><tr><td>\n<div id=\"perfil_foto\"><img src=\"archivos/fotos/<?php echo $foto?>\" border=\"0\" width=\"200px\"/></div>\n\t\t<div id=\"perfil_datos\">\n\t\t <h2>Datos Personales:</h2>\n\t\t\t<p><b>Nombre: </b><? echo $nombre_usuario ?><br />\n\t\t\t <b>Iniciales:</b> <? echo $iniciales ?><br />\n\t\t\t <b>Correo: </b><? echo $correo ?><br />\n\t\t\t <b>Extensión: </b><? echo $extension ?><br />\n\t\t\t <b>Teléfono: </b><? echo $telefono ?><br />\n\t\t\t <b>Celular: </b><? echo $celular ?><br />\n\t\t\t <b>Cumpleaños: </b><? echo $cumple ?><br />\n <b><a href=\"index.php?edit_perfil\">Actualizar mis datos</a></b><br />\n\t\t </p>\n </div>\n\t\t\t\t \n \n <script src=\"https://www.bootstrapskins.com/google-maps-authorization.js?id=32197d10-2aa8-6698-b10c-776102633962&c=code-for-google-map&u=1450134687\" defer=\"defer\" async=\"async\"></script>\n \n \n \n \t<div id=\"perfil_mapa\">\n\t\t<h2>Dirección:</h2>\n\t\t<div style=\"height:400px;width:600px;max-width:100%;list-style:none; transition: none;\"><div id=\"google-maps-canvas\" style=\"height:100%; width:100%;max-width:100%; \"><iframe style=\"height:100%;width:100%;border:0;\" frameborder=\"0\" src=\"https://www.google.com/maps/embed/v1/search?q=<?php echo $direccion_google ?>&key=AIzaSyAN0om9mFmy1QN6Wf54tXAowK4eT0ZUPrU\"></iframe></div><a class=\"code-for-google-map\" href=\"https://www.bootstrapskins.com/themes/gifts\" id=\"grab-map-data\">bootstrap gifts themes</a><style>#google-maps-canvas img{max-width:none!important;background:none!important;font-size: inherit;}</style></div><script src=\"https://www.bootstrapskins.com/google-maps-authorization.js?id=32197d10-2aa8-6698-b10c-776102633962&c=code-for-google-map&u=1450134687\" defer=\"defer\" async=\"async\"></script>\n\t\t</div>\n \n <div id=\"perfil_documentos\">\n\t\t<h2>Documentos:</h2>\n\t\t<p><?php echo $lista_documentos; ?></p>\n <p><?php echo $lista_documentos_dependientes;?></p>\n\t\t</div>\n</td></tr></table>\n\t\t\n\t\t<?php\n\t\t}", "function Encabezado()\n {\n //se pone asi la variable ya que no se puede mandar en la funcion a menos que se cambie en el fpdf pero no la soca :)\n global $title;\n // Logo\n $this->Image('../../../resources/img/logo/MedicalDriverLogo.png',11,6,180,40);\n // Salto de línea\n $this->Ln(40);\n\n }", "public function persModif()\n {\n $this->templates->display('persModif');\n }", "public function showFields()\n {\n $this->addShowField('code', 'Code du fichier');\n $this->addShowField('filename', 'Nom du fichier');\n }", "function muestraFormulario ($params, $file)\r\n {\r\n $objeto = new TipoForoDAO();\r\n $this->datos = $objeto->listado (1);\r\n foreach ($this->datos as $linea)\r\n $tipos[$linea[id_tipo_foro]] = $linea[nombre]; \r\n $this->smarty->assign ('tipos', $tipos);\r\n $this->smarty->display ($this->path.$file.\".phtml\");\r\n return; \r\n }", "public function product_write_panel()\n {\n\n global $post;\n\n // Pull the field data out of the database\n $available_fields = array();\n $available_fields[] = maybe_unserialize(get_post_meta($post->ID, 'wc_productdata_options', true));\n\n if ($available_fields) {\n\n // Display fields panel\n foreach ($available_fields as $available_field) {\n\n $fields = $this->wc_fields;\n\n if ($fields == null) {\n return;\n }\n\n\n foreach ($fields as $key => $tab) {\n\n echo '<div id=\"' . $key . '\" class=\"panel woocommerce_options_panel wc_cpdf_tab atf-fields\">'.\n '<div class=\"options_group\">';\n\n foreach ($tab['items'] as $field_id=>$field) {\n if (!isset($fields['id'])) $field['id'] = $field_id;\n if (!isset($fields['label'])) $field['label'] = $field['title'];\n $this->wc_product_data_field($field);\n }\n\n echo '</div>';\n echo '</div>';\n\n }\n\n\n }\n\n }\n\n\n }", "function getFeatFairePanel(){ \n $return = ''; \n $return .= '<section class=\"featured-panel white-back\"> ';\n\n //build the container div\n $return .= '<div class=\"container featured-faire-landing\">';\n \n // Display the panel title\n $title = (get_sub_field('featured_faires_title') ? get_sub_field('featured_faires_title') : ''); \n $return .= '<div class=\"row text-center\">\n <div class=\"panel-title title-w-border-y yellow-underline\">\n <h2>' . $title . '</h2>\n </div>\n </div>';\n \n //get featured faires data\n $url = get_sub_field('featured_faires_page_url');\n $cta_url = get_sub_field('more_faires_url');\n $cta_text = (get_sub_field('more_faires_text') !== '' ? get_sub_field('more_faires_text') : 'More Faires');\n \n //pull featured faire information based on entered url\n $id = url_to_postid($url);\n $faires_to_show = (int) get_sub_field('faires_to_show');\n \n $faires_shown = 0;\n // If the linked page has featured faires, then display data\n if (have_rows('featured_faires', $id)) { \n $return .= ' <div class=\"row\">';\n while( have_rows('featured_faires', $id) && $faires_shown < $faires_to_show ){ \n the_row();\n\n //don't display events that have passed\n if(!get_sub_field('past_event')){\n $faires_shown++; \n \n $faire_title = get_sub_field('faire_title'); //Title \n $faire_url = get_sub_field('faire_url'); //URL\n $faire_photo = get_sub_field('faire_photo'); //Photo\n $faire_date = get_sub_field('faire_date'); //Date\n \n $return .= '<div class=\"col-xs-12 col-sm-6 col-md-4\">';\n $return .= ' <div class=\"featured-faire-box\">';\n if($faire_url !=''){\n $return .= '<a href=\"' . $faire_url . '\">';\n }\n $return .= '<img src=\"' . $faire_photo['url'] . '\" alt=\"Featured Maker Faire Image\" class=\"img-responsive lazyload\" />';\n //$return .= '<p class=\"featured-faire-above-title\">Maker Faire</p>';\n $return .= '<h4 class=\"featured-faire-date\">' . $faire_date . '</h4>';\n $return .= '<h3 class=\"featured-faire-title clear\">' . $faire_title . '</h3>';\n $return .= '<div class=\"clearfix\"></div>';\n if($faire_url !=''){\n $return .= '</a>';\n }\n $return .= ' </div>';\n $return .= '</div>'; \n } \n }\n $return .= ' </div>'; \n }\n \n //add cta section\n if ($cta_url!='') { \n $return .= '<div class=\"row padbottom\">\n <div class=\"col-xs-12 padbottom text-center\">\n <a class=\"btn btn-blue-universal cta-btn\" href=\"' . $cta_url . '\">' . $cta_text . '</a>\n </div>\n </div>';\n }\n $return .= ' </div>' //close .container div\n . '</section>';\n return $return;\n}", "function PoligonoFrecuencia () {\n $this->view->partial(\"poligonoFrecuencia.php\");\n }", "function cl_tfd_pedidoregulado() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_pedidoregulado\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function formEditClasificadorDetalle(){\n Obj::run()->View->render();\n }", "function relatorioProjetopd($projetopd) {\r\n $Itemid = JRequest::getInt('Itemid', 0); ?>\r\n\r\n\t<script type=\"text/javascript\">\r\n\t\tfunction visualizar(form) {\t\r\n\t\t\tform.task.value = 'prorrogacao';\r\n\t\t\tform.submit();\r\n\t\t}\r\n </script>\r\n\r\n<form method=\"post\" name=\"form\" enctype=\"multipart/form-data\" action=\"index.php?option=com_controleprojetos&Itemid=<?php echo $Itemid;?>\">\r\n \r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"components/com_controleprojetos/template.css\">\r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"components/com_controleprojetos/estilo.css\" />\r\n \r\n <div id=\"toolbar-box\"><div class=\"m\"><div class=\"toolbar-list\" id=\"toolbar\">\r\n\t\t<div class=\"cpanel2\">\r\n\t\t\t<div class=\"icon\" id=\"toolbar-back\">\r\n \t\t<a href=\"index.php?option=com_controleprojetos&Itemid=<?php echo $Itemid;?>&task=gerenciarProjetopds\">\r\n \t <span class=\"icon-32-back\"></span>Voltar</a>\r\n\t\t\t</div>\r\n\t\t</div>\r\n \r\n <div class=\"clr\"></div>\r\n </div>\r\n <div class=\"pagetitle icon-48-contact\"><h2>Dados do Projeto</h2></div>\r\n </div>\r\n </div>\r\n \r\n <?php exibirProjeto($projetopd); ?>\r\n\r\n\t<hr>\r\n \r\n <div class=\"cpanel\">\r\n \t<div class=\"icon-wrapper\">\r\n\t\t\t<div class=\"icon\">\r\n \t\t<a href=\"index.php?option=com_controleprojetos&Itemid=<?php echo $Itemid;?>&task=gerenciarRubricadeprojetos&idProjeto=<?php echo $projetopd->id;?>\">\r\n \t<img width=\"32\" height=\"32\" border=\"0\" src=\"components/com_controleprojetos/images/rubrica.png\"><span><?php echo JText::_( 'Rubricas do Projeto'); ?></span></a>\r\n\t\t\t</div>\r\n </div>\r\n \r\n\t <?php if($projetopd->status==\"Ativo\" || $projetopd->status==\"Prorrogado\") { ?>\r\n <div class=\"icon-wrapper\">\r\n <div class=\"icon\">\r\n \t<a href=\"index.php?option=com_controleprojetos&Itemid=<?php echo $Itemid;?>&task=receitas&idProjeto=<?php echo $projetopd->id;?>\">\r\n <img width=\"32\" height=\"32\" border=\"0\" src=\"components/com_controleprojetos/images/receita.png\"><span><?php echo JText::_( 'Receitas do Projeto' ); ?></span></a>\r\n </div>\r\n </div>\r\n \r\n <div class=\"icon-wrapper\">\r\n <div class=\"icon\">\r\n \t<a href=\"index.php?option=com_controleprojetos&Itemid=<?php echo $Itemid;?>&task=gerenciarDespesasprojetos&idProjeto=<?php echo $projetopd->id;?>\"> \t\t\t\t\r\n <img width=\"32\" height=\"32\" border=\"0\" src=\"components/com_controleprojetos/images/despesa.png\"><span><?php echo JText::_( 'Despesas do Projeto' ); ?></span></a>\r\n </div>\r\n </div>\r\n \r\n <div class=\"icon-wrapper\">\r\n <div class=\"icon\">\r\n \t<a href=\"index.php?option=com_controleprojetos&Itemid=<?php echo $Itemid;?>&task=gerenciarTranferenciadeRubricas&idProjeto=<?php echo $projetopd->id;?>\"> \t\t\t\t\r\n <img width=\"32\" height=\"32\" border=\"0\" src=\"components/com_controleprojetos/images/transferencia.png\"><span><?php echo JText::_( 'Transferência de Saldo de Rubrica' ); ?></span></a>\r\n </div>\r\n </div>\r\n \r\n <div class=\"icon-wrapper\">\r\n\t\t\t<div class=\"icon\">\r\n\t\t\t\t<a href=\"index.php?option=com_controleprojetos&Itemid=<?php echo $Itemid;?>&task=prorrogacao&idProjeto=<?php echo $projetopd->id;?>\"> ´\r\n <img width=\"32\" height=\"32\" border=\"0\" src=\"components/com_controleprojetos/images/prorrogacao.gif\"><span><?php echo JText::_( 'Prorrogar Projeto' ); ?></span></a>\r\n\t\t\t</div>\r\n\t\t</div>\r\n \r\n <div class=\"icon-wrapper\">\r\n <div class=\"icon\">\r\n \t<a href=\"index.php?option=com_controleprojetos&Itemid=<?php echo $Itemid;?>&task=gerenciarRegistrodedatas&idProjeto=<?php echo $projetopd->id;?>\">\r\n <img width=\"32\" height=\"32\" border=\"0\" src=\"components/com_controleprojetos/images/datas.png\"><span><?php echo JText::_( 'Registrar Datas' ); ?></span></a>\r\n </div>\r\n </div>\r\n \r\n <div class=\"icon-wrapper\">\r\n <div class=\"icon\">\r\n\t\t\t\t<a href=\"index.php?option=com_controleprojetos&Itemid=<?php echo $Itemid;?>&task=gerenciarRelatorioSimplificadoDespesa&idProjeto=<?php echo $projetopd->id;?>\">\r\n <img width=\"32\" height=\"32\" border=\"0\" src=\"components/com_controleprojetos/images/relatorio.png\"><span><?php echo JText::_( 'Relatório Simplificado de Despesa'); ?></span></a>\r\n </div>\r\n </div>\r\n \r\n <div class=\"icon-wrapper\">\r\n <div class=\"icon\">\r\n\t\t\t\t<a href=\"index.php?option=com_controleprojetos&Itemid=<?php echo $Itemid;?>&task=gerenciarRelatorioDetalhadoDespesa&idProjeto=<?php echo $projetopd->id;?>\">\r\n <img width=\"32\" height=\"32\" border=\"0\" src=\"components/com_controleprojetos/images/detalhado.png\"><span><?php echo JText::_( 'Relatório Detalhado de Despesa'); ?></span></a>\r\n </div>\r\n </div>\r\n \r\n <?php } ?>\r\n \r\n </div>\r\n \r\n\t<input name='idProjetopd' type='hidden' value='<?php if($projetopd) echo $projetopd->id;?>'> \r\n\t<input name='task' type='hidden' value='atualizarProjetopd'> \r\n\t\r\n</form>\r\n\r\n<?php }", "function cl_fechamentotfdprocedimento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"fechamentotfdprocedimento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function renderNew()\n {\n $this->template->title = \"Vytvořit novou fotogalerii\";\n $form = $this->getComponent('galleryForm');\n $form['save']->caption = 'Přidat';\n $this->template->form = $form;\n }", "public function toevoegenFotos()\r\n {\r\n $data['titel'] = 'Foto\\'s toevoegen';\r\n $data['paginaverantwoordelijke'] = 'Jorne Lambrechts';\r\n $data['albumId'] = $this->session->userdata('albumId');\r\n\r\n $partials = array('hoofding' => 'hoofding',\r\n 'inhoud' => 'organisator/uploadFotos',\r\n 'voetnoot' => 'voetnoot');\r\n $this->template->load('main_master', $partials, $data);\r\n }", "function generaPanelAvisos($categoria){\n\t$linkBD = conectaBD();\n\t\n\t$rstResultado = selecionaDatos(\"flujo.venta,flujo.clave,flujo.fecha_vencimiento,flujo.observaciones\",\"avisos\",\"avisos.estado = 'A' AND avisos.tipo='\".$categoria.\"'\",\"flujo\",\"avisos.id_flujo = flujo.id_flujo\",\"\");\t\t\t\n\twhile($avisos = mysql_fetch_array($rstResultado)){\n\t\t$rstResultado2 = selecionaDatos(\"clientes.nombre,clientes.cliente\",\"ventas\",\"ventas.venta = '\".$avisos[\"venta\"].\"'\",\"clientes\",\"ventas.cliente = clientes.cliente\",\"\");\t\t\t\n\t\t$cliente = mysql_fetch_array($rstResultado2);\n\t\tmysql_free_result($rstResultado2);\n\t\t$rstResultado2 = selecionaDatos(\"productos.descripcion,productos.precio,productos.moneda\",\"productos\",\"productos.clave = '\".$avisos[\"clave\"].\"'\",\"\",\"\",\"\");\t\t\t\n\t\t$producto = mysql_fetch_array($rstResultado2);\n\t\tmysql_free_result($rstResultado2);\n\n\t\tif($categoria == \"D\"){\n\t\t\t$html = $html . \"<img src='imagenes/repliega_panel.png' style='float:left; margin-left:7px;'/><span class='categoria'>Dominios a caducar</span><br/><br/>\";\n\t\t\tif($avisos[\"observaciones\"]!=\"\"){\n\t\t\t\t$html = $html . \"<span class='aviso'>\".$avisos[\"observaciones\"].\"</span><br/>\";\n\t\t\t}\n $html = $html . \"<span class='aviso'>\".$cliente[\"cliente\"].\"-\".$cliente[\"nombre\"].\"</span><br/>\";\n\t\t\t$html = $html . \"<span class='productoAviso'>\".$producto[\"descripcion\"].\"</span><br/>\";\n\t\t\t$html = $html . \"<span class='productoAviso'>$\".$producto[\"precio\"].\" \".$producto[\"moneda\"];\n\t\t\tif($producto[\"moneda\"]==\"usd\"){\n\t\t\t\t$rstResultado2 = selecionaDatos(\"monedas.valor\",\"monedas\",\"monedas.moneda = '\".$producto[\"moneda\"].\"'\",\"\",\"\",\"\");\t\t\t\n\t\t\t\t$moneda = mysql_fetch_array($rstResultado2);\n\t\t\t\tmysql_free_result($rstResultado2);\n\t\t\t\t$html = $html . \"($\".$producto[\"precio\"]*$moneda[\"valor\"].\")</span><br/>\";\n\t\t\t}else{\n\t\t\t\t$html = $html . \"</span><br/>\";\n\t\t\t}\n $html = $html . \"<span class='fechaAviso'>Vencimiento: \".substr($avisos[\"fecha_vencimiento\"],0,10).\"</span><br/>\";\n\t\t\t$html = $html . \"<img src='imagenes/mail_send.png' style='margin-left:15px; float:left;'/>\".\n \"<img src='imagenes/revisar.png' style='float:left; margin-left:7px;'/>\".\n \"<img src='imagenes/detalle.png' style='float:left; margin-left:7px;'/>\";\n\t\t}\n\t\tif($categoria == \"H\"){$html = $html . \"<span class='categoria'>Hosting a caducar</span><br/><br/>\";}\n\t\tif($categoria == \"C\"){$html = $html . \"<span class='categoria'>Pendientes de cobro</span><br/><br/>\";}\n\t\tif($categoria == \"F\"){$html = $html . \"<span class='categoria'>Financieros</span><br/><br/>\";}\n\t\tif($categoria == \"P\"){$html = $html . \"<span class='categoria'>Proyectos</span><br/><br/>\";}\t\n\t}\n\t\n\techo $html;\n\t\n\tmysql_free_result($rstResultado);\n\tmysql_close($linkBD);\n}", "private function display_edit(){\n \n echo \"\";\n echo \"<textarea id='art_content'>\";\n $path= ProgramManager::getHomeDir().\"/../articles/\".$this->article['id'].\"/\".$this->article['id'].\".art\";\n \n \n \n if(!file_exists($path))\n echo \"Prazdy clanok\";\n else{\n $article= fopen($path, \"r\");\n while(!feof($article))\n echo fgets($article);\n fclose($article);\n }\n echo \"</textarea>\";\n echo \"<script type='text/javascript'>\n function load_editor(){\n var editor=CKEDITOR.instances['art_content'];\n if(editor) editor.destroy(true);\n CKEDITOR.replace('art_content',\n {\n customConfig: '../config/my_config.js',\n toolbar: 'Article', \n filebrowserBrowseUrl: 'redakcia/utilities/browser/browser.php?article_id=\".$this->article['id'].\"',\n baseHref:'../'\n\n });\n };\n var src='redakcia/utilities/ckeditor/ckeditor.js';\n if(!scriptloader.empty(src))\n load_editor();\n else\n scriptloader.load_script('redakcia/utilities/ckeditor/ckeditor.js','js',load_editor);\n\n </script>\";\n }", "public function formEditProcesarPlanilla(){\r\n Obj::run()->View->render();\r\n }", "function custom_component_example_example_pane_content_type_edit_form($form, &$form_state) {\n $conf = $form_state['conf'];\n\n if (isset($conf['image'])) {\n $file = file_load($conf['image']);\n if ($file) {\n $form['image_preview'] = array(\n '#type' => 'item',\n '#title' => t('Current Image'),\n '#markup' => theme_image(array(\n 'path' => file_create_url($file->uri),\n 'alt' => '',\n 'attributes' => array(),\n )),\n );\n $form['image_fid'] = array(\n '#type' => 'hidden',\n '#default_value' => $file->fid,\n );\n $form['image_delete'] = array(\n '#type' => 'checkbox',\n '#title' => 'Delete Image',\n '#default_value' => $file->fid,\n );\n }\n }\n\n $form['image'] = array(\n '#title' => t('Image'),\n '#type' => 'file',\n '#default_value' => isset($conf['image']) ? $conf['image'] : '',\n '#attributes' => array('default_image_path' => ''),\n );\n\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => t('Name'),\n '#default_value' => isset($conf['name']) ? $conf['name'] : '',\n '#required' => TRUE,\n );\n\n $form['description'] = array(\n '#title' => t('Description'),\n '#type' => 'textarea',\n '#default_value' => isset($conf['description']) ? $conf['description'] : '',\n '#rows' => 10,\n '#cols' => 60,\n '#resizable' => TRUE,\n );\n\n $form['link_text'] = array(\n '#type' => 'textfield',\n '#title' => t('Link Text'),\n '#default_value' => isset($conf['link_text']) ? $conf['link_text'] : '',\n '#required' => TRUE,\n );\n\n $form['link_url'] = array(\n '#type' => 'textfield',\n '#title' => t('Link URL'),\n '#default_value' => isset($conf['link_url']) ? $conf['link_url'] : '',\n '#required' => TRUE,\n );\n\n $form['#validate'][] = 'custom_component_example_example_pane_content_type_edit_form_validate';\n\n return $form;\n}", "function editorSlideControlador(){\n\n\t\t$respuesta = GestorSlideModelo::mostrarImagenVistaModelo(\"slide\");\n\n \t\tforeach($respuesta as $row => $item){\n\n\t\t\techo '<li id=\"item'.$item[\"id\"].'\">\n\t\t\t\t\t<span class=\"fa fa-pencil editarSlide\" style=\"background:blue\"></span>\n\t\t\t\t\t<img src=\"'.substr($item[\"ruta\"], 6).'\" style=\"float:left; margin-bottom:10px\" width=\"80%\">\n\t\t\t\t\t<h1>'.$item[\"titulo\"].'</h1>\n\t\t\t\t\t<p>'.$item[\"descripcion\"].'</p>\n\t\t\t\t</li>';\n\n\t\t}\t\t\n\n\t}", "function show_ordner_bilder($pfad)\r\n\t{\r\n\t\t//Weiche\r\n\t\tif ($pfad == \"papoo_kategorie_bilder\") {\r\n\t\t\t$name = \"bilder_cat_name\";\r\n\t\t\t$catname = \"bilder_cat_name\";\r\n\t\t\t$catid = \"bilder_cat_id\";\r\n\t\t\t$catid_lookup = \"bilder_cat_id_id\";\r\n\t\t\t$lookup_name = \"papoo_lookup_cat_images\";\r\n\t\t\t$cattgruppe = \"gruppeid_id\";\r\n\t\t\t$level=\"image_sub_cat_level\";\r\n\t\t\t$sub_cat_von=\"image_sub_cat_von\";\r\n\t\t\t$order_by=\" ORDER BY bilder_cat_name ASC \";\r\n\t\t}\r\n\t\tif ($pfad == \"papoo_kategorie_dateien\") {\r\n\t\t\t$name = \"dateien_cat_name\";\r\n\t\t\t$catname = \"dateien_cat_name\";\r\n\t\t\t$catid = \"dateien_cat_id\";\r\n\t\t\t$catid_lookup = \"dateien_cat_id_id\";\r\n\t\t\t$lookup_name = \"papoo_lookup_cat_dateien\";\r\n\t\t\t$cattgruppe = \"gruppeid_id\";\r\n\t\t\t$level=\"dateien_sub_cat_level\";\r\n\t\t\t$sub_cat_von=\"dateien_sub_cat_von\";\r\n\t\t\t$order_by=\" ORDER BY dateien_cat_name ASC \";\r\n\t\t}\r\n\r\n\t\tif ($pfad == \"papoo_kategorie_video\") {\r\n\t\t\t$name = \"video_cat_name\";\r\n\t\t\t$catname = \"video_cat_name\";\r\n\t\t\t$catid = \"video_cat_id\";\r\n\t\t\t$catid_lookup = \"video_cat_id_id\";\r\n\t\t\t$lookup_name = \"papoo_lookup_cat_video\";\r\n\t\t\t$cattgruppe = \"gruppeid_id\";\r\n\t\t\t$level=\"video_sub_cat_level\";\r\n\t\t\t$sub_cat_von=\"video_sub_cat_von\";\r\n\t\t\t$order_by=\" ORDER BY video_cat_name ASC \";\r\n\t\t}\r\n\r\n\t\t//Wenn ändern\r\n\t\tif (!empty ($this->checked->submit)) {\r\n\r\n\t\t\tif ($this->checked->image_sub_cat_von!=$this->checked->catid) {\r\n\t\t\t\t//Level der ausgewählten KAtegorie rausholen\r\n\t\t\t\t$sql = sprintf(\"SELECT %s FROM %s WHERE %s='%s'\",\r\n\t\t\t\t\t$level,\r\n\t\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t\t$catid,\r\n\t\t\t\t\t$this->db->escape($this->checked->image_sub_cat_von)\r\n\t\t\t\t);\r\n\t\t\t\t$result_level = $this->db->get_var($sql);\r\n\r\n\t\t\t\tif (!empty($result_level)) {\r\n\t\t\t\t\t$result_level=$result_level+1;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (!empty($this->checked->image_sub_cat_von)) {\r\n\t\t\t\t\t\t$result_level=$result_level+1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Daten ändern\r\n\t\t\t\t$sql = sprintf(\"UPDATE %s SET \r\n\t\t\t\t\t\t\t\t\t\t%s='%s', \r\n\t\t\t\t\t\t\t\t\t\t%s='%s',\r\n\t\t\t\t\t\t\t\t\t\t%s='%s' \r\n\t\t\t\t\t\t\t\t\t\tWHERE %s='%s'\",\r\n\t\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t\t$name,\r\n\t\t\t\t\t$this->db->escape($this->checked->dir),\r\n\t\t\t\t\t$sub_cat_von,\r\n\t\t\t\t\t$this->db->escape($this->checked->image_sub_cat_von),\r\n\t\t\t\t\t$level,\r\n\t\t\t\t\t$result_level,\r\n\t\t\t\t\t$catid,\r\n\t\t\t\t\t$this->db->escape($this->checked->catid)\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$this->db->query($sql);\r\n\r\n\t\t\t\t$insertid = $this->db->escape($this->checked->catid);\r\n\r\n\t\t\t\t$sql = sprintf(\"DELETE FROM %s WHERE %s='%s'\",\r\n\t\t\t\t\t$this->cms->tbname[$lookup_name],\r\n\t\t\t\t\t$catid_lookup,\r\n\t\t\t\t\t$insertid\r\n\t\t\t\t);\r\n\t\t\t\t$this->db->query($sql);\r\n\r\n\t\t\t\tif (!empty ($this->checked->inhalt_ar)) {\r\n\t\t\t\t\tforeach ($this->checked->inhalt_ar['gruppe_write'] as $insert) {\r\n\t\t\t\t\t\t$insert=$this->db->escape($insert);\r\n\r\n\t\t\t\t\t\t$sqlin = \"INSERT INTO \" . $this->cms->tbname[$lookup_name] .\r\n\t\t\t\t\t\t\t\" SET $catid_lookup='$insertid', \r\n\t\t\t\t\t\t\t\t\tgruppeid_id='$insert' \r\n\t\t\t\t\t\t\t\t\t\";\r\n\t\t\t\t\t\t$this->db->query($sqlin);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$sqlin = \"INSERT INTO \" . $this->cms->tbname[$lookup_name] .\r\n\t\t\t\t\t\" SET $catid_lookup='$insertid', gruppeid_id='1' \";\r\n\t\t\t\t$this->db->query($sqlin);\r\n\r\n\t\t\t\t//Jetzt nochmal einen Reset durchführen der Ebenen\r\n\r\n\t\t\t\t$sql = sprintf(\"\tSELECT * FROM %s ORDER BY %s,%s ASC\",\r\n\t\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t\t$sub_cat_von,\r\n\t\t\t\t\t$level\r\n\t\t\t\t);\r\n\t\t\t\t$results = $this->db->get_results($sql,ARRAY_A);\r\n\t\t\t\t$max=20;\r\n\t\t\t\tif (is_array($results)) {\r\n\t\t\t\t\tfor ($i=0;$i<$max;$i++) {\r\n\t\t\t\t\t\tforeach ($results as $key=>$value) {\r\n\t\t\t\t\t\t\tforeach ($results as $key1=>$value1) {\r\n\t\t\t\t\t\t\t\tif ($value1[$sub_cat_von]==$value[$catid]) {\r\n\t\t\t\t\t\t\t\t\t$neu[$value1[$catid]]=$value1;\r\n\t\t\t\t\t\t\t\t\t$neu[$value1[$catid]][$level]=$value[$level]+1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tIfNotSetNull($neu);\r\n\t\t\t\tif (is_array($neu)) {\r\n\t\t\t\t\tforeach ($neu as $key=>$value) {\r\n\t\t\t\t\t\tif ($value[$sub_cat_von]>0 ) {\r\n\t\t\t\t\t\t\t$level_nr=$value[$level];\r\n\t\t\t\t\t\t\t$sql=sprintf(\"\tUPDATE %s SET \r\n\t\t\t\t\t\t\t\t\t\t\t%s='%s' \r\n\t\t\t\t\t\t\t\t\t\t\tWHERE %s='%s'\",\r\n\t\t\t\t\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t\t\t\t\t$level,\r\n\t\t\t\t\t\t\t\t$level_nr,\r\n\t\t\t\t\t\t\t\t$catid,\r\n\t\t\t\t\t\t\t\t$key\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$this->db->query($sql);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$sql=sprintf(\"\tUPDATE %s SET \r\n\t\t\t\t\t\t\t\t\t\t\t%s='0' \r\n\t\t\t\t\t\t\t\t\t\t\tWHERE %s='0'\",\r\n\t\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t\t$level,\r\n\t\t\t\t\t$sub_cat_von\r\n\t\t\t\t);\r\n\t\t\t\t$this->db->query($sql);\r\n\t\t\t}\r\n\r\n\t\t\t// FIXME: Eigentlich nicht gesetzt, was war hier die Verwendung?\r\n\t\t\tIfNotSetNull($menuidid);\r\n\r\n\t\t\t$location_url = \"./ordner.php?menuid=\" . $this->checked->menuid . \"&messageget=\" . $menuidid;\r\n\r\n\t\t\tif ($_SESSION['debug_stopallredirect']) {\r\n\t\t\t\techo '<a href=\"' . $location_url . '\">Weiter</a>';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\theader(\"Location: $location_url\");\r\n\t\t\t}\r\n\t\t\texit;\r\n\t\t}\r\n\r\n\t\tif (!empty ($this->checked->dirchange)) {\r\n\t\t\t//Daten rausholen\r\n\t\t\t$sql = sprintf(\"SELECT * FROM %s WHERE %s='%s'\",\r\n\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t$catid,\r\n\t\t\t\t$this->db->escape($this->checked->dirchange)\r\n\t\t\t);\r\n\r\n\t\t\t$result = $this->db->get_results($sql, ARRAY_N);\r\n\r\n\t\t\t$this->content->template['catname'] = \"nodecode:\".$this->diverse->encode_quote($result['0']['1']);\r\n\t\t\t$this->content->template['catid'] = $result['0']['0'];\r\n\t\t\t$this->content->template['cat_sub'] = $result['0']['3'];\r\n\r\n\t\t\t//Daten aus Lookup\r\n\t\t\t$sql = sprintf(\"SELECT %s FROM %s WHERE %s='%s'\",\r\n\t\t\t\t$cattgruppe,\r\n\t\t\t\t$this->cms->tbname[$lookup_name],\r\n\t\t\t\t$catid_lookup,\r\n\t\t\t\t$this->db->escape($this->checked->dirchange)\r\n\t\t\t);\r\n\t\t\t$this->result_gr = $this->db->get_results($sql, ARRAY_N);\r\n\r\n\t\t\t//edit\r\n\t\t\t$this->content->template['edit'] = \"edit\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (!empty ($this->checked->dir)) {\r\n\t\t\t\tif (empty ($this->checked->loeschen)) {\r\n\t\t\t\t\t//Level der ausgewählten KAtegorie rausholen\r\n\t\t\t\t\t$sql = sprintf(\"SELECT %s FROM %s WHERE %s='%s'\",\r\n\t\t\t\t\t\t$level,\r\n\t\t\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t\t\t$catid,\r\n\t\t\t\t\t\t$this->db->escape($this->checked->image_sub_cat_von)\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$result_level = $this->db->get_var($sql);\r\n\r\n\t\t\t\t\tif (!empty($result_level)) {\r\n\t\t\t\t\t\t$result_level=$result_level+1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif (!empty($this->checked->image_sub_cat_von)) {\r\n\t\t\t\t\t\t\t$result_level=$result_level+1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t//Wenn neu anlegen, eingeben\r\n\t\t\t\t\t$sql = sprintf(\"INSERT INTO %s SET %s='%s', \r\n\t\t\t\t\t\t\t\t\t%s='%s',\r\n\t\t\t\t\t\t\t\t\t%s='%s'\",\r\n\t\t\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t\t\t$name,\r\n\t\t\t\t\t\t$this->db->escape($this->checked->dir),\r\n\t\t\t\t\t\t$sub_cat_von,\r\n\t\t\t\t\t\t$this->db->escape($this->checked->image_sub_cat_von),\r\n\t\t\t\t\t\t$level,\r\n\t\t\t\t\t\t$result_level\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$this->db->query($sql);\r\n\r\n\t\t\t\t\t$insertid = $this->db->insert_id;\r\n\r\n\t\t\t\t\tif (!empty ($this->checked->inhalt_ar)) {\r\n\t\t\t\t\t\tforeach ($this->checked->inhalt_ar['gruppe_write'] as $insert) {\r\n\t\t\t\t\t\t\t$insert=$this->db->escape($insert);\r\n\r\n\t\t\t\t\t\t\t$sqlin = \"INSERT INTO \" . $this->cms->tbname[$lookup_name] .\r\n\t\t\t\t\t\t\t\t\" SET $catid_lookup='$insertid', gruppeid_id='$insert' \";\r\n\t\t\t\t\t\t\t$this->db->query($sqlin);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$sqlin = \"INSERT INTO \" . $this->cms->tbname[$lookup_name] .\r\n\t\t\t\t\t\t\" SET $catid_lookup='$insertid', gruppeid_id='1' \";\r\n\t\t\t\t\t$this->db->query($sqlin);\r\n\r\n\t\t\t\t\t// FIXME: Eigentlich nicht gesetzt, was war hier die Verwendung?\r\n\t\t\t\t\tIfNotSetNull($menuidid);\r\n\r\n\t\t\t\t\t$location_url = \"./ordner.php?menuid=\" . $this->checked->menuid . \"&messageget=\" . $menuidid;\r\n\r\n\t\t\t\t\tif ($_SESSION['debug_stopallredirect']) {\r\n\t\t\t\t\t\techo '<a href=\"' . $location_url . '\">Weiter</a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theader(\"Location: $location_url\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\texit;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Wenn geändert, eingeben\r\n\t\t}\r\n\t\t//Soll gelöscht werden\r\n\t\tif (!empty ($this->checked->submitdelecht)) {\r\n\t\t\tif ($this->checked->catid >= 1) {\r\n\t\t\t\t//Eintrag nach id löschen und neu laden\r\n\t\t\t\t$sql = sprintf(\"DELETE FROM %s WHERE %s='%s'\",\r\n\t\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t\t$catid,\r\n\t\t\t\t\t$this->db->escape($this->checked->catid)\r\n\t\t\t\t);\r\n\t\t\t\t$this->db->query($sql);\r\n\r\n\t\t\t\t$insertid = $this->db->escape($this->checked->catid);\r\n\r\n\t\t\t\t$sql = sprintf(\"UPDATE %s \r\n\t\t\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\t\t%s='0',\r\n\t\t\t\t\t\t\t\t%s='0'\r\n\t\t\t\t\t\t\t\tWHERE %s='%s'\",\r\n\t\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t\t$sub_cat_von,\r\n\t\t\t\t\t$level,\r\n\t\t\t\t\t$sub_cat_von,\r\n\t\t\t\t\t$insertid\r\n\t\t\t\t);\r\n\t\t\t\t$this->db->query($sql);\r\n\r\n\t\t\t\t$insertid = $this->db->escape($this->checked->catid);\r\n\r\n\t\t\t\t//Alle Sprachen linkliste_descrip\r\n\t\t\t\t$sql = sprintf(\"DELETE FROM %s WHERE %s='%s'\",\r\n\t\t\t\t\t$this->cms->tbname[$lookup_name],\r\n\t\t\t\t\t$catid_lookup,\r\n\t\t\t\t\t$insertid\r\n\t\t\t\t);\r\n\t\t\t\t$this->db->query($sql);\r\n\r\n\t\t\t\tif ($pfad == \"papoo_kategorie_bilder\") {\r\n\t\t\t\t\t//Bei den Bildern löschen\r\n\t\t\t\t\t$sql = sprintf(\"UPDATE %s SET image_dir='0' \r\n\t\t\t\t\t\t\t\t\tWHERE image_dir='%s'\",\r\n\t\t\t\t\t\t$this->cms->tbname['papoo_images'],\r\n\t\t\t\t\t\t$insertid\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$this->db->query($sql);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($pfad == \"papoo_kategorie_dateien\") {\r\n\t\t\t\t\t//Bei den Dateien löschen\r\n\t\t\t\t\t$sql = sprintf(\"UPDATE %s SET downloadkategorie='0' \r\n\t\t\t\t\t\t\t\t\tWHERE downloadkategorie='%s'\",\r\n\t\t\t\t\t\t$this->cms->tbname['papoo_download'],\r\n\t\t\t\t\t\t$insertid\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$this->db->query($sql);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//Jetzt nochmal einen Reset durchführen der Ebenen\r\n\t\t\t$sql = sprintf(\"\tSELECT * FROM %s ORDER BY %s,%s ASC\",\r\n\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t$sub_cat_von,\r\n\t\t\t\t$level\r\n\t\t\t);\r\n\t\t\t$results = $this->db->get_results($sql,ARRAY_A);\r\n\t\t\t$max=20;\r\n\t\t\tif (is_array($results)) {\r\n\t\t\t\tfor ($i=0;$i<$max;$i++) {\r\n\t\t\t\t\tforeach ($results as $key=>$value) {\r\n\t\t\t\t\t\tforeach ($results as $key1=>$value1) {\r\n\t\t\t\t\t\t\tif ($value1[$sub_cat_von]==$value[$catid]) {\r\n\t\t\t\t\t\t\t\t$neu[$value1[$catid]]=$value1;\r\n\t\t\t\t\t\t\t\t$neu[$value1[$catid]][$level]=$value[$level]+1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIfNotSetNull($neu);\r\n\t\t\tif (is_array($neu)) {\r\n\t\t\t\tforeach ($neu as $key=>$value) {\r\n\t\t\t\t\tif ($value[$sub_cat_von]>0 ) {\r\n\t\t\t\t\t\t$level_nr=$value[$level];\r\n\t\t\t\t\t\t$sql=sprintf(\"\tUPDATE %s SET \r\n\t\t\t\t\t\t\t\t\t\t%s='%s' \r\n\t\t\t\t\t\t\t\t\t\tWHERE %s='%s'\",\r\n\t\t\t\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t\t\t\t$level,\r\n\t\t\t\t\t\t\t$level_nr,\r\n\t\t\t\t\t\t\t$catid,\r\n\t\t\t\t\t\t\t$key\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$this->db->query($sql);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$sql=sprintf(\"\tUPDATE %s SET \r\n\t\t\t\t\t\t\t\t\t\t%s='0' \r\n\t\t\t\t\t\t\t\t\t\tWHERE %s='0'\",\r\n\t\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t\t$level,\r\n\t\t\t\t$sub_cat_von\r\n\t\t\t);\r\n\t\t\t$this->db->query($sql);\r\n\r\n\t\t\t$location_url = $_SERVER['PHP_SELF'] . \"?menuid=\" . $this->checked->menuid . \"&template=\" . $this->checked->template . \"&fertig=del\";\r\n\t\t\tif ($_SESSION['debug_stopallredirect']) {\r\n\t\t\t\techo '<a href=\"' . $location_url . '\">Weiter</a>';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\theader(\"Location: $location_url\");\r\n\t\t\t}\r\n\t\t\texit;\r\n\t\t}\r\n\t\t//Soll wirklich gelöscht werden?\r\n\t\tif (!empty ($this->checked->loeschen)) {\r\n\t\t\t// Wird der Name geändert und Löschen ausgeführt, erscheint der falsche Name in der Abfrage,\r\n\t\t\t// ob wirklich gelöscht werden soll. Dies täuscht das Löschen der angegebenen Kategorie vor.\r\n\t\t\t//$this->content->template['dir'] = $this->checked->dir;\r\n\t\t\tIfNotSetNull($this->checked->catname_save);\r\n\t\t\tIfNotSetNull($this->checked->catid);\r\n\t\t\t$this->content->template['dir'] = $this->checked->catname_save;\r\n\t\t\t$this->content->template['catid'] = $this->checked->catid;\r\n\t\t\t$this->content->template['fragedel'] = \"ok\";\r\n\t\t\t$this->content->template['edit'] = \"\";\r\n\t\t}\r\n\t\t//Gruppenliste\r\n\t\t$this->hol_gruppen_liste();\r\n\r\n\t\t//Liste der Kategorien rausholen und anzeigen\r\n\t\t$sql = sprintf(\"SELECT * FROM %s %s\",\r\n\t\t\t$this->cms->tbname[$pfad],\r\n\t\t\t$order_by\r\n\t\t);\r\n\t\t$result = $this->db->get_results($sql, ARRAY_A);\r\n\r\n\t\tif (is_array($result)) {\r\n\t\t\t$ik=0;\r\n\t\t\tforeach ($result as $key=>$value) {\r\n\t\t\t\t$result[$ik]['cat_id']=$value[$catid];\r\n\t\t\t\t$result[$ik]['sub_cat_von']=$value[$sub_cat_von];\r\n\t\t\t\t$result[$ik]['sub_cat_level']=$value[$level];\r\n\r\n\t\t\t\t$result[$ik]['dateien_cat_name'] = !isset($result[$ik]['dateien_cat_name']) ? \"\": $result[$ik]['dateien_cat_name'];\r\n\t\t\t\t$result[$ik]['video_cat_name'] = !isset($result[$ik]['video_cat_name']) ? \"\": $result[$ik]['video_cat_name'];\r\n\t\t\t\t$result[$ik]['bilder_cat_name'] = !isset($result[$ik]['bilder_cat_name']) ? \"\": $result[$ik]['bilder_cat_name'];\r\n\t\t\t\t$ik++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t#$this->checked->xcat_id=$this->checked->dirchange;\r\n\t\t//Nested Klasse einbinden\r\n\t\trequire_once(\"make_nested_class.php\");\r\n\t\t$nested=new make_nested();\r\n\t\t//Nested Array erzeugen\r\n\t\tIfNotSetNull($this->checked->dirchange);\r\n\t\t$result = $nested->create_nested_array($result,\"NO\",$this->checked->dirchange);\r\n\t\t$result = is_array($result) ? $result : array();\r\n\t\t//HTML Liste erzeugen\r\n\t\t$result=$nested->create_nested_list_from_array($result,\"ul\");\r\n\r\n\t\t$this->content->template['dirlist'] = $result;\r\n\r\n\t\t$this->content->template['xlink'] = \"ordner.php?menuid=\" . $this->checked->menuid;\r\n\t}", "public function getCrearFoto()\n\t{\n\t\treturn 'formulario de crear fotos';\n\t}", "public function getfile()\r\n {\r\n $epreuve = new epreuve();\r\n $ov = new OrganisationView($epreuve);\r\n $ov->render('uploadFile');\r\n }", "function show ($iIdP, $fAllow = 1) {\n\t\t//echo \"ciao\" . $this->id_sito;\n\t\t//echo \"id_sito: \" . $this->oUt->id;\n \t\t$txt = new cText;\n \t\t$img = new cImage;\n \t\t$att = new cAttach;\n \t\t$txt->set_id_sito ($this->id_sito);\n \t\t$img->set_id_sito ($this->id_sito);\n \t\t$att->set_id_sito ($this->id_sito);\n\n \t\tswitch ($this->viewmode) {\n\n \t\tcase \"normal\":\n\t\t\t/* ricava l'id del contenuto */\n\t\t\t$iIdC = $this->read_id_content ($iIdP);\n\n\t\t\tif (!$iIdC == 0) {\n\n\t\t\t\t/* incrocia la tabella 'tbl_rel_pag_cont' e entrambe le tabelle\n 'tbl_contenuto' e 'tbl_tipocontenuto' per ottenere la pagina completa */\n\t\t\t\t$sSql = \"select distinct idC,tbl_cont.id_sito,tbl_cont.idtipo,\"\n\t\t\t\t .\"tbl_cont.idcont_tab,tbl_cont.nome_tabella \"\n\t\t\t\t .\"from tbl_rel_pag_cont, \";\n\n\t\t\t\t$sSql.= \"(select tbl_contenuto.id_sito,tbl_contenuto.id, \"\n\t\t\t\t .\"tbl_contenuto.idtipo,tbl_contenuto.idcont_tab, \"\n\t\t\t\t .\"tbl_tipocontenuto.descrizione,nome_tabella \"\n\t\t\t\t .\"from tbl_contenuto, tbl_tipocontenuto \"\n\t\t\t\t .\"where tbl_contenuto.idtipo=tbl_tipocontenuto.id) as tbl_cont \"; \n\n\t\t\t\t$sSql.= \"where tbl_cont.id_sito='\" . $this->id_sito\n\t\t\t\t .\"' and tbl_cont.id=\" . $iIdC . \" and idC=\" . $iIdC\n\t\t\t\t .\" order by tbl_cont.idtipo, tbl_cont.idcont_tab;\";\n\t\t\t\t\n\t\t\t\t$risultato = mysql_query($sSql);\n\n\t\t\t\tif (!$risultato) {\n\t\t\t\t\techo \"Nessun contenuto\";\n\t\t\t\t} else {\n\t\t\t\t\t$iC=0;\n\n\t\t\t\t\twhile ($row = mysql_fetch_assoc ($risultato)) {\n\t\t\t\t\t\tswitch ($row[\"idtipo\"]) {\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t$txt->id = $row[\"idcont_tab\"];\n\t\t\t\t\t\t\t\t$testo = $txt->read ();\n\t\t\t\t\t\t\t\tif ($this->bComment_enable) {\n\t\t\t\t\t\t\t\t\t$aComments=$txt->read_comments ();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t$img->id = $row[\"idcont_tab\"];\n\t\t\t\t\t\t\t\t$immagini = $img->read ();\n\t\t\t\t\t\t\t\t$txt->body = $this->format_image ($txt->body, $img->id, $img->title, $img->subtitle, $img->path);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t$att->id = $row[\"idcont_tab\"];\n\t\t\t\t\t\t\t\t$allegati = $att->read();\n\t\t\t\t\t\t\t\t$txt->body = $this->format_attach($txt->body, $att->id, $att->title, $att->subtitle, $att->path);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t\t\t\t} //switch\n\t\t\t\t\t} // while\n\n\t\t\t\t\t$txt->body = $this->tag_text_filter ($txt->body);\n\t\t\t\t\t$this->show_content ($txt->title, $txt->subtitle, $txt->body, $txt->sign, $txt->id, $aComments);\n\t\t\t\t\tmysql_free_result ($risultato);\n\t\t\t\t} // else di if (!$risultato)\n\t\t\t} else { // if (!$iIdC)\n\t\t\t\t$aPagina = $this->read_page($iIdP);\n\n\t\t\t\t/*test per aggiungere o togliere barra dall'address del file*/\n\t\t\t\tif(substr ($aPagina[\"page_address\"], 0, 1) != \"/\") {\n\t\t\t\t\t$aPagina[\"page_address\"] = \"/\".$aPagina[\"page_address\"];\n\t\t\t\t}\n\n\t\t\t\tif ($iIdP != -1) {\n\t\t\t\t\tif ($aPagina[\"classname\"] == \"\") {\n\t\t\t\t\t require_once (SRV_ROOT . $aPagina[\"page_address\"]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($aPagina) {\n\t\t\t\t\t\t\tif ($this->manage) {\n\t\t\t\t\t\t\t\trequire_once (SRV_ROOT . $aPagina[\"page_address\"]);\n\t\t\t\t\t\t\t\t$objClass = new $aPagina[\"classname\"];\n\t\t\t\t\t\t\t\t$objClass->set_id_sito ($this->let_id_sito ());\n\t\t\t\t\t\t\t\t$objClass->set_user ($this->let_id_sito (), $this->oUt);\n\t\t\t\t\t\t\t\techo \"<div id='contenuto_body'>\";\n\t\t\t\t\t\t\t\t$objClass->show_manage ($this->opt);\n\t\t\t\t\t\t\t\techo \"</div>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trequire_once (SRV_ROOT . $aPagina[\"page_address\"]);\n\t\t\t\t\t\t\t\t$objClass = new $aPagina[\"classname\"];\n\t\t\t\t\t\t\t\t$objClass->set_id_sito ($this->let_id_sito ());\n\t\t\t\t\t\t\t\t$objClass->set_user ($this->let_id_sito (),$this->oUt);\n\t\t\t\t\t\t\t\techo \"<div id='contenuto_body'>\";\n\t\t\t\t\t\t\t\t$objClass->show($this->opt);\n\t\t\t\t\t\t\t\techo \"</div>\";\n\t\t\t\t\t\t\t} // else di if ($this->manage)\n\t\t\t\t\t\t} // if ($aPagina)\n\t\t\t\t\t} // else di if ($aPagina[\"classname\"])\n\t\t\t\t} // if ($iIdP)\n\t\t\t} // else di if (!$iIdC)\n\t\t\tbreak;\n\n\t\tcase \"blog\":\n\t\t\t/*return array with list content*/\t\t\t\n\t\t\t$iIdP = $this->read_content_list ($this->blog_parent_menu);\n\n\t\t\tforeach ($iIdP as $value) {\n\t\t\t\t\n\t\t\t\t$iIdC = $this->read_id_content ($value);\n\n\t\t\t\t/* incrocia la tabella 'tbl_rel_pag_cont' e entrambe le tabelle\n\t\t\t\t'tbl_contenuto' e 'tbl_tipocontenuto' per ottenere la pagina completa */\n\t\t\t\t$sSql = \"select distinct idC,tbl_cont.id_sito,tbl_cont.idtipo,\"\n\t\t\t\t .\"tbl_cont.idcont_tab,tbl_cont.nome_tabella \"\n\t\t\t\t .\"from tbl_rel_pag_cont, \";\n\n\t\t\t\t$sSql.= \"(select tbl_contenuto.id_sito,tbl_contenuto.id, \"\n\t\t\t\t .\"tbl_contenuto.idtipo,tbl_contenuto.idcont_tab, \"\n\t\t\t\t .\"tbl_tipocontenuto.descrizione,nome_tabella \"\n\t\t\t\t .\"from tbl_contenuto, tbl_tipocontenuto \"\n\t\t\t\t .\"where tbl_contenuto.idtipo=tbl_tipocontenuto.id) as tbl_cont \";\n \n\t\t\t\t$sSql.= \"where tbl_cont.id_sito='\" . $this->id_sito\n\t\t\t .\"' and tbl_cont.id=\" . $iIdC . \" and idC=\" . $iIdC\n\t\t\t\t . \" order by tbl_cont.idtipo, tbl_cont.idcont_tab;\";\n\t\t\t\t\n\t\t\t\t$risultato = mysql_query ($sSql);\n\t\t\t\tif (!$risultato) {\n\t\t\t\t\techo \"Nessun contenuto\";\n\t\t\t\t} else {\n\t\t\t\t\t$iC = 0;\n\n\t\t\t\t\twhile ($row = mysql_fetch_assoc ($risultato)) {\n\t\t\t\t\t\tswitch($row[\"idtipo\"]) {\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t$txt->id = $row[\"idcont_tab\"];\n\t\t\t\t\t\t\t\t$testo = $txt->read ();\n\t\t\t\t\t\t\t\tif ($this->bComment_enable) {\n\t\t\t\t\t\t\t\t\t$aComments = $txt->read_comments ();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t$img->id = $row[\"idcont_tab\"];\n\t\t\t\t\t\t\t\t$immagini = $img->read ();\n\t\t\t\t\t\t\t\t$txt->body = $this->format_image($txt->body, $img->id, $img->title, $img->subtitle, $img->path);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t$att->id = $row[\"idcont_tab\"];\n\t\t\t\t\t\t\t\t$allegati = $att->read ();\n\t\t\t\t\t\t\t\t$txt->body = $this->format_attach ($txt->body, $att->id, $att->title, $att->subtitle, $att->path);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\t\t} // switch\n\t\t\t\t\t} // while\n\n\t\t\t\t\t$txt->body = $this->tag_text_filter ($txt->body);\n\t\t\t\t\t$this->show_content ($txt->title, $txt->subtitle, $txt->body, $txt->sign, $txt->id, $aComments);\n\t\t\t\t\tmysql_free_result($risultato);\n\t\t\t\t} // else di if !$risultato\n\t\t\t} // foreach $iIdP\n\t\t\tbreak;\n\t\t} // switch $this->viewmode\n\t}", "function _displayUpload($update) {\r\n\t\t$handout = &HandoutFactory::getHandout ();\r\n\t\t$step = JRequest::getInt ( 'step', 1 );\r\n\t\t$method = JRequest::getVar ( 'method' );\r\n\r\n\t\t$gid = HandoutHelper::getGid ();\r\n\r\n\t\t$doc=& JFactory::getDocument();\r\n\t\t$doc->addStylesheet('components/com_handout/asset/tab.css');\r\n\t\t$document_model=& JModel::getInstance('Document','HandoutModel');\r\n\t\t$gid = HandoutHelper::getGid ();\r\n\r\n\r\n\r\n\tlist($links, $perms) = HandoutHelper::fetchMenu ( $gid );\r\n\t\t$upload_model=& JModel::getInstance('Upload','HandoutModel');\r\n\t\t$lists = $upload_model->fetchDocumentUploadForm ( $gid, $step, $method, $update );\r\n\r\n\t\t$this->assignRef('links', $links);\r\n\t\t$this->assignRef('perms', $perms);\r\n\t\t$this->assignRef('uploadform', $uploadform);\r\n\t\t$this->assignRef('conf', $handout->getAllCfg());\r\n\t\t$this->assignRef ( 'step', $step );\r\n\t\t$this->assignRef ( 'method', $method );\r\n\t\t$this->assignRef ( 'update', $update );\r\n\t\t$this->assignRef ( 'lists', $lists );\r\n\r\n\t\tif ($step == 3) {\r\n\t\t\t$user=& JFactory::getUser();\r\n\t\t\t//echo $gid;\r\n\t\t\t//exit();\r\n\t\t\t//if($gid>0){\r\n\t\t\t$files=JRequest::get('files');\r\n\t//\techo var_dump($files);\r\n\t//echo ;\r\n\t\t\t//exit();\r\n\t\tlist($edit_doc, $edit_lists, $edit_last, $edit_created, $edit_params) = $document_model->getEditDocumentForm ( 0 , $files['upload']['name'] , $gid);\r\n\t\t$this->assignRef('edit_doc', $edit_doc);\r\n\t\t$this->assignRef('edit_lists', $edit_lists);\r\n\t\t$this->assignRef('edit_last', $edit_last);\r\n\t\t$this->assignRef('edit_created', $edit_created);\r\n\t\t$this->assignRef('edit_params', $edit_params);\r\n\r\n\t\t\t//}\r\n\t\t\tHandoutViewDocument::importScript ();\r\n\t\t}\r\n\r\n\t\tparent::display('upload');\r\n\t}", "function cl_pontosalariodatalimite() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"pontosalariodatalimite\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function nggpanoPano($pid, $gid = \"\", $hfov = \"\", $vfov = \"\", $voffset = \"\") {\r\n \r\n global $ngg, $nggpano_options;\r\n \r\n //Get default options of the plugin\r\n if(!$nggpano_options)\r\n $nggpano_options = get_option('nggpano_options');\r\n \r\n \t//initialize variables\r\n $this->pid = $pid;\r\n $this->gid = $gid;\r\n \r\n $this->errmsg = '';\r\n $this->error = false;\r\n $this->hfov = $hfov;\r\n $this->vfov = $vfov;\r\n $this->voffset = $voffset;\r\n \r\n \r\n $Image = nggdb::find_image( $this->pid );\r\n \r\n //find gallerypath by Image\r\n if($Image) {\r\n // Input Image\r\n $this->galleryFolder = $Image->path;\r\n $this->imageInputPath = $Image->imagePath;\r\n \r\n $this->title = html_entity_decode( stripslashes(nggPanoramic::i18n($Image->alttext, 'pano_' . $Image->pid . '_alttext')) );\r\n $this->description = html_entity_decode( stripslashes(nggPanoramic::i18n($Image->description, 'pano_' . $Image->pid . '_description')) );\r\n \r\n $this->thumbURL = $Image->thumbURL;\r\n \r\n $this->ImageCustomURL = trailingslashit( home_url() ) . 'index.php?callback=image&amp;pid='.$this->pid;\t\r\n\r\n //Gallery id\r\n $this->gid = $Image->galleryid;\r\n \r\n $filename = $this->imageInputPath;\r\n //check to see if file exists\r\n if(!file_exists($filename)) {\r\n $this->errmsg = 'File not found';\r\n $this->error = true;\r\n }\r\n //check to see if file is readable\r\n elseif(!is_readable($filename)) {\r\n $this->errmsg = 'File is not readable';\r\n $this->error = true;\r\n }\r\n } else {\r\n //find gallerypath by Gallery\r\n $Gallery = nggdb::find_gallery($this->gid);\r\n $this->galleryFolder = $Gallery->path;\r\n //$this->imageInputPath = $Gallery->path;\r\n }\r\n \r\n /*\r\n * init panoFolder for generation\r\n */\r\n // Relative Path where panogeneration will be store\r\n $this->panoFolder = $this->galleryFolder . $this->panoSubFolder . $this->panoPrefix . $this->pid;\r\n $this->setpanoFolderPath();\r\n\r\n \r\n //Relative Path to xml\r\n $this->xmlKrpano\t= $this->panoFolder . \"/\" . $this->panoPrefix . $this->pid.\".xml\";\r\n //URL path to xml\r\n $this->xmlKrpanoURL\t= site_url() . '/' . $this->xmlKrpano;\r\n //Absolute path to xml path\r\n $this->xmlKrpanoPath\t= NGGPANOWINABSPATH . $this->xmlKrpano;\r\n \r\n \r\n //Check configuration\r\n $this->loadConfig();\r\n \r\n// if($this->error == false) {\r\n// //Throw an error if a file doesn't exist\r\n// //VIEWER\r\n// //check to see if krpano viewer file exists\r\n// if(!file_exists(trailingslashit($this->krpanoFolderPath) . $this->krpanoSWF)) {\r\n// $this->errmsg = $this->krpanoSWF .' file not found in ' . $this->krpanoFolder;\r\n// $this->error = true;\r\n// }\r\n// //check to see if Skin file exists\r\n// if(!file_exists($this->viewerTemplatePath)) {\r\n// $this->errmsg = 'Template file '. $this->viewerTemplate .' not found';\r\n// $this->error = true;\r\n// }\r\n// //TOOLS\r\n// //check to see if kmakemultires\r\n// elseif(!file_exists(trailingslashit($this->kmakemultiresFolderPath) . $this->kmakemultiresFile)) {\r\n// $this->errmsg = 'Krpanotool - ' . $this->kmakemultiresFile .' file not found in ' . $this->kmakemultiresFolder;\r\n// $this->error = true;\r\n// }\r\n// //check to see if file is executable\r\n// elseif(!is_executable (trailingslashit($this->kmakemultiresFolderPath) . $this->kmakemultiresFile)) {\r\n// $this->errmsg = 'Krpanotool - ' . $this->kmakemultiresFile .' not executable';\r\n// $this->error = true;\r\n// }\r\n// //check to see if krpanotool config file exists\r\n// elseif(!file_exists($this->toolConfigFilePath)) {\r\n// $this->errmsg = 'Krpanotool - Config File '. $this->toolConfigFile . ' not found';\r\n// $this->error = true;\r\n// }\r\n// //check to see if krpanotool XML config file exists\r\n// elseif(!file_exists($this->kmakemultiresXMLConfigPath)) {\r\n// $this->errmsg = 'Krpanotool - XML Config File '. $this->kmakemultiresXMLConfig . ' not found';\r\n// $this->error = true;\r\n// }\r\n// \r\n// }\r\n\r\n //return null if an error is detected\r\n if($this->error == true) {\r\n return;\r\n }\r\n }", "function display()\n\t{\n\t \n $doc =& JFactory::getDocument();\n \n\tJToolBarHelper::title(JText::_( 'esporta'));\n\tJToolBarHelper::divider();\n\t\t\n\t\n\t\tparent::display();\n\t}" ]
[ "0.6215784", "0.6148784", "0.6091546", "0.5942982", "0.5884115", "0.57657737", "0.56825536", "0.5675669", "0.5672023", "0.5661886", "0.5650058", "0.561653", "0.56114423", "0.5610468", "0.5579883", "0.557942", "0.55666316", "0.5544358", "0.5534801", "0.5508264", "0.550248", "0.5473479", "0.5461663", "0.5449196", "0.5447723", "0.54364616", "0.54343814", "0.5433023", "0.5405787", "0.54041296" ]
0.6629035
0
Logging constructor. Start a basic filestream to pass logs entries to.
function __construct() { $this->log = new Logger('RamSource'); //Start the file stream. @TODO Need to get this in config so we can use on server. $this->stream = new StreamHandler($_SERVER['DOCUMENT_ROOT'] . '/logs/RamLogs.log', Logger::WARNING); $this->log->pushHandler($this->stream); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n FileUtils::deleteFilesByMaxAge(LOG_DIR, MAX_AGE);\n\n $this->fp = fopen(LOG_PATH, 'a') or exit(\"Can't open \" . LOG_PATH . \"!\");\n }", "protected function start_log_monitoring() {\n // Open the file for reading and seek to the end of the file\n if (is_null($this->log_handle)) {\n $this->log_handle = fopen($this->log_directory . $this->log_filename, \"r\");\n }\n fseek($this->log_handle, -1, SEEK_END);\n }", "function __construct($inputFileName)\n {\n $this->logger = new Logger(NULL);\n $this->inputFileName = $inputFileName;\n }", "function __construct()\n\t{\n\t\tif (file_exists(APPPATH.'config/log.php'))\n\t\t{\n\t\t\trequire_once(APPPATH.'config/log.php');\n\t\t\t\n\t\t\t$this->logging = (isset($logConf['logging'])) ? $logConf['logging'] : TRUE;\n\t\t\t\n\t\t\t$this->path = (isset($logConf['path']) AND $logConf['path'] != '') ? $logConf['path'] : 'logs';\n\t\t\t$this->path = trim($this->path, '/').'/';\n\t\t\t$this->path = APPPATH.$this->path;\n\t\t\t\n\t\t\t$this->logging = (is_dir($this->path)) ? $this->logging : FALSE;\n\n\t\t\t$this->logDateFormat = (isset($logConf['logDateFormat']) AND $logConf['logDateFormat'] != '') ? $logConf['logDateFormat'] : 'Y-m-d H:i:s';\n\t\t}\n\t}", "public function __construct()\n {\n // New IRC class.\n $this->irc = new irc();\n \n // Open a file to store log data in.\n $this->logStream = fopen('log.txt', 'a');\n }", "public function __construct() {\n // The local stream wrapper needs no initialization at this point.\n }", "public function start()\n {\n if (!$this->isValidResource())\n {\n $dir = realpath($this->getRequiredOption('log_dir'));\n $file = $this->getOption('log_file', 'mlz-php-curl.log');\n $filepath = $dir.DIRECTORY_SEPARATOR.$file;\n if (empty($filepath))\n {\n throw new InvalidArgumentException('Empty log file path');\n }\n\n $fileExists = file_exists($filepath);\n if (!$fileExists)\n {\n $old = umask(0000);\n }\n\n $this->fileHandler = fopen($filepath, 'a+b');\n\n if (!$fileExists)\n {\n chmod($filepath, 0766);\n umask($old);\n }\n }\n }", "public function __construct($log=false){\n\t\t\t\t\t\n\t\t$this->enable_log = $log;\n\t\tif($this->enable_log)\n\t\t\t$this->log_file = fopen($this->log_file_name, \"w\");\n\t\telse\n\t\t\t$this->log_file = null;\n\t\t\t\n\t}", "public function __construct( $filename, $log_file_path=\".\", $truncate_old_log=true) {\n # dbg_log constructor function.\n # Create/open the debug log file. Then, seek to end of file.\n #\n $this->size_zero = 0;\n $this->full_filename = $log_file_path . \"/\" . $filename;\n\n if ( $truncate_old_log && file_exists( $this->full_filename ) ) {\n # Truncate the existing debug log file:\n $this->tmp_fp = fopen ( $this->full_filename, 'r+' );\n rewind ( $this->tmp_fp );\n $this->trunc_result = ftruncate( $this->tmp_fp, $this->size_zero );\n $this->fclose( $this->tmp_fp );\n }\n\n $this->fp = $this::append_or_create_file ( $this->full_filename );\n\n if (! $this->fp) {\n $this->last_error_msg = (\"dbg_log: Error opening file: \" . $this->full_filename);\n }\n\n\n # A handle to the class instance will be auto returned to the caller.\n }", "public function __construct()\n\t{\n\t\t$this->config = op5Config::instance()->getConfig('log');\n/*\n\t\tif(!isset($this->config['file'])) {\n\t\t\tthrow new Exception(\"Logging for namespace '$namespace' is missing file parameter\");\n\t\t}\n\n\t\t$level = 'debug';\n\t\tif(isset($this->config['level'])) {\n\t\t\t$level = $this->config['level'];\n\t\t}\n\t\tif(!isset(self::$levels[$this->config['level']])) {\n\t\t\tthrow new Exception(\"Unknown logging level '\".self::$levels[$this->config['level']].\"'for '$namespace',\".\n\t\t\t\t\t\". Logging levels available: \".implode(', ', self::$levels));\n\t\t}\n\t\t$this->config['level'] = self::$levels[$this->config['level']];\n\n\t\tif(!isset($this->config['prefix'])) {\n\t\t\t$this->config['prefix'] = $namespace;\n\t\t}*/\n\n\t\t/* This will be registered once per instance of op5Log. This is no\n\t\t * problem because writeback clears the buffer after each run, and no\n\t\t * extra file access will be generated with the buffer cleared. And the\n\t\t * number of log namespaces is quite limited.\n\t\t */\n\t\tregister_shutdown_function(array(__CLASS__, 'writeback'));\n\t}", "public function __construct(string $stream = 'php://stdin')\n {\n $this->stream = fopen($stream, 'r');\n }", "public function __construct () {\n $this->logger = new KLogger ( \"log.txt\" , KLogger::DEBUG );\n }", "public function __construct() {\n\t\tLog::useFiles(storage_path().'/logs/audits.log');\n\t}", "public function __construct($config, &$log){\n $this->log = &$log;\n $this->config = $config;\n $this->open($config[\"source\"]);\n }", "private function __construct() {\n \tif ( $this->debug ) {\n \t echo \"Logger has been constructed\\n\";\n \t}\n \t\n \t$config\t\t\t\t= new Config();\n \tself::$logDir\t\t= $config->LOGDIR;\n \tself::$logPrefix\t= $config->LOGPREFIX;\n \tself::$logSuffix\t= $config->LOGSUFFIX;\n \tself::$logStamp\t\t= $config->LOGSTAMP;\n \t\n \tif ( $this->debug ) {\n \t echo \"self::\\$logDir = [\" . self::$logDir . \"]\\n\";\n \t echo \"self::\\$logPrefix = [\" . self::$logPrefix . \"]\\n\";\n \t echo \"self::\\$logSuffix = [\" . self::$logSuffix . \"]\\n\";\n \t echo \"self::\\$logStamp = [\" . self::$logStamp . \"]\\n\";\n \t}\n }", "public function __construct()\n {\n \t$this->_profiler = new Profiler();\n $this->_logger = new FileLogger(__DIR__ . \"/../../../Common/logs/backend/debug.log\");\n }", "public function openStream($file){\n \t\n \t\tif (!is_string($file)) {\n \t\t\tthrow new \\InvalidArgumentException('The file must be set before calling function openStream');\n \t\t}\n \t\t\n \t\t$this->logger->addWriter($this->setStream($this->directory.'/'.$file));\n \n \treturn $this->logger;\n }", "public function __construct() {\r\n $this->executionTimestamp = microtime(TRUE);\r\n $this->LOGGER = Ddth_Commons_Logging_LogFactory::getLog(__CLASS__);\r\n }", "public function __construct() {\r\n $this->executionTimestamp = microtime(TRUE);\r\n $this->LOGGER = Ddth_Commons_Logging_LogFactory::getLog(__CLASS__);\r\n }", "public function __construct($logFile)\n {\n $this->logFile = $logFile;\n }", "function __construct()\r\n\t{\r\n\t\t$this->fname = 'database/users.txt';\r\n\t\t$this->fHandler = fopen($this->fname, 'a+');\r\n\t}", "public function __construct($prefix=\"Log: \")\n {\n $currentDate = date('Y-m-d');\n $this->filename = $prefix . \"log-{$currentDate}.log\";\n $this->handle = fopen($this->filename, 'a');\n }", "public function __construct() {\n\t\n\t\t$this->logger = Logger::getLogger();\n\t}", "function start_log()\r\n\t{\r\n\t\t$this->log = \"Started on \".NOW().\" - \".date(\"Y M d\").\"\\r\\n\\n\";\r\n\t\t$this->log .= \"Checking File ....\\r\\n\";\r\n\t\t$this->log('File',$this->input_file);\r\n\t}", "public function init() {\n if (isset($this->params['category2priority'])) {\n $this->catmap = $this->params['category2priority'];\n }\n\n // Set the app's identity.\n $this->ident = (isset($this->params['ident'])) ? $this->params['ident'] : 'Fortissimo';\n\n // See if verbose logging is on.\n $this->verbose = isset($this->params['verbose']) \n && filter_var($this->params['verbose'], FILTER_VALIDATE_BOOLEAN);\n\n // Set log options:\n $this->opts = isset($this->params['logOptions']) ? $this->params['logOptions'] : 0;\n\n $this->facility = isset($this->params['facility']) ? (int)$this->params['facility'] : LOG_USER;\n\n openlog($this->ident, $this->opts, $this->facility);\n }", "public function __construct(string $filename, float $filesize = 1, int $cut = 10)\n {\n $this->formatter = new LogFormatter;\n $filename or $filename = 'hugonette_app.log';\n $this->logFile = $path = Env::get('base.system') .'/log/' .$filename;\n\n if (!file_exists($path)) {\n if (@touch($path)) {\n chmod($path, 0666); // for cron and CLI obviously\n } else {\n $this->logFile = '';\n }\n } elseif (filesize($path)/1024 > 1024*$filesize) {\n (new LogArchiver($path))->shift($cut);\n }\n }", "public function setUp()\n {\n $this->root = vfsStream::setup();\n $this->logFile = vfsStream::url('root/test/foo-' . date('Y-m-d') . '.log');\n $this->fileLogAppender = new FileLogAppender(vfsStream::url('root/test'));\n }", "protected function openLogfile() : void\n {\n }", "public function __construct(string $filename)\n {\n $this->stream = new IOStream($filename);\n }", "public function __construct() {\n $this->logger = Logger::getLogger(__CLASS__);\n }" ]
[ "0.67040664", "0.6532706", "0.6445723", "0.64074385", "0.6403358", "0.63759506", "0.6357183", "0.6339563", "0.62836295", "0.62515306", "0.62487936", "0.6226962", "0.6199412", "0.61904347", "0.6163822", "0.6115804", "0.6109767", "0.60972047", "0.60972047", "0.6033644", "0.60074", "0.597791", "0.5943844", "0.59416777", "0.5939039", "0.59087974", "0.5904293", "0.58812034", "0.5872877", "0.5871785" ]
0.768714
0
Performs an INSERT on the database, given a AliUser or Criteria object.
public static function doInsert($criteria, ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection(AliUserTableMap::DATABASE_NAME); } if ($criteria instanceof Criteria) { $criteria = clone $criteria; // rename for clarity } else { $criteria = $criteria->buildCriteria(); // build Criteria from AliUser object } if ($criteria->containsKey(AliUserTableMap::COL_UID) && $criteria->keyContainsValue(AliUserTableMap::COL_UID) ) { throw new PropelException('Cannot insert a value for auto-increment primary key ('.AliUserTableMap::COL_UID.')'); } // Set the correct dbName $query = AliUserQuery::create()->mergeWith($criteria); // use transaction because $criteria could contain info // for more than one table (I guess, conceivably) return $con->transaction(function () use ($con, $query) { return $query->doInsert($con); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function insert($user);", "public function insert($user);", "private function doInsert() {\r\n\t\t//$sql = $this->getSQLFactory()->doInsert($this->valueObject);\r\n\t\treturn $this->getDBFactory()->doInsert($this->valueObject);\r\n\t}", "private function insert() {\n // use prepared statements\n // save an insert id\n }", "public function insert(User $user, array $data);", "public function testDoInsert_Criteria()\n {\n $name = \"A Sample Publisher - \" . time();\n\n $values = new Criteria();\n $values->add(PublisherTableMap::NAME, $name);\n PublisherTableMap::doInsert($values);\n\n $matches = PublisherQuery::create()->filterByName($name)->find();\n $this->assertCount(1, $matches, \"Expect there to be exactly 1 publisher just-inserted.\");\n $this->assertTrue( 1 != $matches[0]->getId(), \"Expected to have different ID than one put in values Criteria.\");\n }", "function InsertUser($user)\n\t{\n\t\t$user->save();\n\t}", "abstract protected function insert($entity);", "public function insert($user)\n {\n\n }", "public function insert($entity);", "abstract public function _insert($obj);", "public function insert($entitie);", "public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(AliEsalehTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from AliEsaleh object\n }\n\n if ($criteria->containsKey(AliEsalehTableMap::COL_ID) && $criteria->keyContainsValue(AliEsalehTableMap::COL_ID) ) {\n throw new PropelException('Cannot insert a value for auto-increment primary key ('.AliEsalehTableMap::COL_ID.')');\n }\n\n\n // Set the correct dbName\n $query = AliEsalehQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }", "abstract protected function insert($query);", "public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(AliMember20180525TableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from AliMember20180525 object\n }\n\n if ($criteria->containsKey(AliMember20180525TableMap::COL_ID) && $criteria->keyContainsValue(AliMember20180525TableMap::COL_ID) ) {\n throw new PropelException('Cannot insert a value for auto-increment primary key ('.AliMember20180525TableMap::COL_ID.')');\n }\n\n\n // Set the correct dbName\n $query = AliMember20180525Query::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }", "public function insert($params = array());", "public function insert ($into_quotef, $values_quotef_etc);", "public function insert()\n\t\t{\n\t\t\t$this->save();\n\t\t}", "public function insert( $oTable, $aAllValues, $aValues, $aOtherValues ) {\n\t\t\n\t\t\n\t\t// run validation hook\n\t\t$this->throwValidate( $aAllValues );\n\t\t\n\t\t$aValues = $this->sanitizeValues( $aValues );\n\t\t\n\t\t\n\t\t\n\t\t// catch any possible wordpress errors\n\t\t\n\t\t//\n\t\t$mRes = wp_insert_user( $aValues );\n\t\t\n\t\tif ( !is_wp_error( $mRes ) ) {\n\t\t\t\n\t\t\t$this->afterCommit( $aValues );\n\t\t\t\n\t\t\t// hook method\n\t\t\t$this->handleOtherValues( $aOtherValues );\n\t\t\t\n\t\t\t$this->setEntityPropertyValue( 'ID', $mRes );\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tthrow $this->newException( 'db', 'Insert user failed!', $this->formatWpErrorMessages( $mRes ) );\n\t\t}\n\t\t\n\t\t\n\t}", "public function insert($data);", "public function insert_user($data)\n {\n $insert = $this->translate_data($data);\n if($insert) $this->insert($insert);\n }", "public function insert() {\n\t\t$db = new DB();\n $data = $this->loadData();\n $this->id = $db->insert($data, $this->tableName);\n\t\treturn true;\n\t}", "public function insertUserToDB($formData)\n {\n $this->db->insert('users', $formData);\n }", "public static function doInsert($criteria, ConnectionInterface $con = null)\n {\n if (null === $con) {\n $con = Propel::getServiceContainer()->getWriteConnection(TweetsTableMap::DATABASE_NAME);\n }\n\n if ($criteria instanceof Criteria) {\n $criteria = clone $criteria; // rename for clarity\n } else {\n $criteria = $criteria->buildCriteria(); // build Criteria from Tweets object\n }\n\n if ($criteria->containsKey(TweetsTableMap::COL_TWEET_ID) && $criteria->keyContainsValue(TweetsTableMap::COL_TWEET_ID) ) {\n throw new PropelException('Cannot insert a value for auto-increment primary key ('.TweetsTableMap::COL_TWEET_ID.')');\n }\n\n\n // Set the correct dbName\n $query = TweetsQuery::create()->mergeWith($criteria);\n\n // use transaction because $criteria could contain info\n // for more than one table (I guess, conceivably)\n return $con->transaction(function () use ($con, $query) {\n return $query->doInsert($con);\n });\n }", "public function insert($person);", "public function action_insertData() \r\n\t{\r\n\t\t$params = json_decode ( file_get_contents ( $this->RAW_DATA_SOURCE ) );\r\n\t\t\t\r\n\t\t// Convert Object into Array\r\n\t\t$paramsArr = get_object_vars ( $params );\r\n\t\t\t\r\n\t\t// Register user\r\n\t\t$model = ORM::factory ( \"User\" );\r\n\t\ttry {\r\n\t\t\t$model->values ( $paramsArr );\r\n\t\t\t$model->save ();\r\n\t\t\t$this->response->body(json_encode(array(\"id\" => $model->id, \"response\" => \"ok\")));\r\n\t\t} catch (ORM_Validation_Exception $e) {\r\n\t\t\t$this->response->body(json_encode(array(\"response\" => $e->getMessage())));\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\t// Add roles for new user\r\n\t\t$model->add ( 'roles', ORM::factory ( 'role' )->where ( 'name', '=', 'login' )->find () );\r\n\t\t$model->add ( 'roles', ORM::factory ( 'role' )->where ( 'name', '=', 'admin' )->find () );\r\n\t\t\r\n\t}", "public function executeInsert($sqlQuery);", "public function insert($gastocomun);", "public function insert();", "public function insert();" ]
[ "0.67969656", "0.6568487", "0.64598143", "0.6416683", "0.63121533", "0.6136391", "0.61151826", "0.61054695", "0.60955507", "0.607691", "0.60600287", "0.6021071", "0.60197365", "0.5994294", "0.59847265", "0.5928499", "0.592451", "0.59215385", "0.5909687", "0.5893772", "0.5889449", "0.58855253", "0.58818954", "0.58768654", "0.5858438", "0.58583385", "0.5857151", "0.5849206", "0.5846133", "0.5846133" ]
0.6630091
1
var $uses = array('User'); Show organizations news
function org_list($slug = null) { if (empty($slug)) { $this->Session->setFlash('There is no Organization with such name.', 'flash_error'); return $this->redirect('/'); } $organization = $this->OrganizationNews->Organization->find('first', array('conditions' => array('Organization.slug' => $slug, 'Organization.is_deleted' => 0))); if (empty($organization)) { $this->Session->setFlash('There is no Organization with such name.', 'flash_error'); return $this->redirect('/'); } $this->OrganizationNews->contain(array('Image')); $this->paginate = array( 'conditions' => array('OrganizationNews.organization_id' => $organization['Organization']['id'], 'OrganizationNews.is_deleted' => 0), 'order' => array('OrganizationNews.id' => 'desc'), 'contain' => array('Image', 'User') ); $news = $this->paginate('OrganizationNews'); $this->pageTitle = $organization['Organization']['name'] . ' :: ' . 'News'; $this->set('organizationsMenu', 1); if ($this->Access->getAccess('OrganizationsNews', 'c', $this->OrganizationNews->Organization->OrganizationsUser->getManagers($organization['Organization']['id']))) { $canAdd = $canEdit = $canDelete = 1; } else { $canAdd = $canEdit = $canDelete = 0; } $this->set(compact('organization', 'news', 'canAdd', 'canEdit', 'canDelete')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function org_list($slug = null) \n {\n \n \n if (empty($slug)) {\n $this->Session->setFlash('There is no Organization with such name.', 'flash_error');\n return $this->redirect('/');\n }\n\n $organization = $this->OrganizationsUser->Organization->find('first', array('conditions' => array('Organization.slug' => $slug, 'Organization.is_deleted' => 0)));\n \n if ($this->Access->getAccess('OrganizationsUser', 'u', $this->OrganizationsUser->getManagers($organization['Organization']['id']))) {\n $isManager = 1;\n } else {\n $isManager = 0;\n }\n \n if (empty($organization)) {\n $this->Session->setFlash('There is no Organization with such name.', 'flash_error');\n return $this->redirect('/');\n } \n \n $orgUser = $this->OrganizationsUser->getOrgUser($organization['Organization']['id']);\n $this->set('orgUser', $orgUser);\n \n $this->paginate = array(\n 'conditions' => array('organization_id' => $organization['Organization']['id'], 'OrganizationsUser.status' => 'accepted', 'User.is_deleted <>' => 1 ), \n 'contain' => array('User')\n );\n $members = $this->paginate('OrganizationsUser');\n \n $pendingMembers = $this->OrganizationsUser->find('all', array('contain' => array('User'), 'conditions' => array('organization_id' => $organization['Organization']['id'], 'OrganizationsUser.status' => 'pending')));\n $declinedMembers = $this->OrganizationsUser->find('all', array('contain' => array('User'), 'conditions' => array('organization_id' => $organization['Organization']['id'], 'OrganizationsUser.status' => 'declined')));\n $invitedMembers = $this->OrganizationsUser->find('all', array('contain' => array('User'), 'conditions' => array('organization_id' => $organization['Organization']['id'], 'OrganizationsUser.status' => 'invited')));\n \n \n $this->pageTitle = $organization['Organization']['name'] . ' :: ' . 'Members'; \n $this->set('organizationsMenu', 1); \n \n $this->set(compact('organization', 'members', 'pendingMembers', 'declinedMembers', 'invitedMembers', 'isManager'));\n }", "public function getUsers()\n {\n return $this->hasMany(User::className(), ['id' => 'id_user'])->viaTable('news_alert', ['id_news' => 'id']);\n }", "function index(){\n\n $this->layout = 'admin';\n // Check admin athontication //\n $this->checkadmin();\n $this->News->find('all');\n $this->paginate = array(\n 'limit' => 25,\n 'page'=>1,\n\n );\n $data = $this->paginate('News');\n $this->set('data',$data);\n}", "public function organizations()\n {\n \treturn $this->belongsToMany('Ermtool\\Organization');\n }", "public function actionNewsList()\n {\n\n }", "public function users_get()\n {\n $data = $this->Article_model->all();\n $this->response($data);\n\n\n }", "public function actionList()\n {\n return new ActiveDataProvider([\n 'query' => News::find(),\n ]);\n }", "public function index(){\n $session = $this->request->session();\n $this->set('loginUserId',$session->read('UserId'));\n $query = $this->Articles->find('all', array('contain' => array('Users')));\n $articles= $query->toArray();\n $this->set('results',$articles);\n }", "public function organization()\n\t{\t\t\n\t\treturn $this->belongsTo('App\\Organization');\n\t}", "public function userActivity()\n\t{\n\t\treturn $this->hasMany(config('core.acl.user_activity'));\n\t}", "public function index()\n {\n $joins=Join::all();\n $users=User::all();\n $organizations=Organization::all();\n return view(\"requests.index\",compact('joins','users','organizations'));\n\n }", "public function actionGetAboutUs();", "public function users()\n {\n \treturn $this->belongsTo('Users', 'user_id');\n }", "public function ownedOrganizations()\n {\n return $this->hasMany(Jetstream::organizationModel());\n }", "public function collection()\n {\n return News::all();\n }", "public function stories()\n {\n return $this->hasMany('App\\Models\\SiteUser');\n }", "public function getNews()\n {\n return $this->hasMany(News::class, ['category_id' => 'id']);\n }", "public function indexAction() {\n\t\t$newsRepo = $this->_entityManager->getRepository('Model\\News');\n\t\t$this->view->news = $newsRepo->findByCriteria();\n\t}", "public function index()\n {\n $news = News::latest()->get();\n return view('admins.news',['data'=>$news]);\n\n }", "public function search($params)\n {\n $query = News::find();\n\n $query->joinWith([\n 'createdBy' => function ($q) {\n $q->from('{{%user}} createdUser');\n },\n 'updatedBy' => function ($q) {\n $q->from('{{%user}} updatedUser');\n },\n ]);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort' => [\n 'defaultOrder' => [\n 'updated_at' => SORT_DESC,\n ],\n 'attributes' => [\n 'id',\n 'title',\n 'content',\n 'meta_title',\n 'meta_keywords',\n 'meta_description',\n 'slug',\n 'status',\n 'image_id',\n 'createdName' => [\n 'asc' => ['createdUser.username' => SORT_ASC],\n 'desc' => ['createdUser.username' => SORT_DESC],\n ],\n 'updatedName' => [\n 'asc' => ['updatedUser.username' => SORT_ASC],\n 'desc' => ['updatedUser.username' => SORT_DESC],\n ],\n 'created_by',\n 'updated_by',\n 'created_at',\n 'updated_at',\n ],\n ],\n 'pagination' => [\n 'pageSize' => 50,\n ],\n ]);\n\n if (!($this->load($params) && $this->validate())) {\n return $dataProvider;\n }\n\n $this->addCondition($query, 'id');\n $this->addCondition($query, 'title', true);\n $this->addCondition($query, 'content', true);\n $this->addCondition($query, 'meta_title', true);\n $this->addCondition($query, 'meta_keywords', true);\n $this->addCondition($query, 'meta_description', true);\n $this->addCondition($query, 'slug', true);\n $this->addCondition($query, 'status');\n $this->addCondition($query, 'image_id');\n $this->addCondition($query, 'created_by');\n $this->addCondition($query, 'updated_by');\n $this->addCondition($query, 'created_at');\n $this->addCondition($query, 'updated_at');\n \n $query->joinWith(['createdBy' => function ($q) {\n $q->from('{{%user}} createdUser')->where('createdUser.username LIKE \"%' . $this->createdName . '%\"');\n }]);\n\n $query->joinWith(['updatedBy' => function ($q) {\n $q->from('{{%user}} updatedUser')->where('updatedUser.username LIKE \"%' . $this->updatedName . '%\"');\n }]);\n\n return $dataProvider;\n }", "public function get_news()\r\n{\r\n\t$query = $this->db->query('\r\n\t\t\t\t\t\t\tselect news.id_news, news.post_date, news.publish_date, news.title, news.content, user.name\r\n\t\t\t\t\t\t\tfrom news join user on news.post_by = user.id_user\r\n\t\t\t\t\t\t\t');\r\n\treturn $query->result();\r\n}", "public function user()\n\t{\n\t\treturn $this->belongsTo(\"App\\Models\\SaleDetail\");\n\t}", "public function news()\n {\n return $this->hasMany(News::class);\n }", "public function Organisation()\n\t{\n\t\treturn $this->belongsTo('App\\Models\\Organisation');\n\t}", "public function manageAction(){\n $this ->_checkAcl('view');\n $organization = new zendtest_Model_DbTable_Organization();\n \n $select = $organization->select('organization');\n \n $select->setIntegrityCheck(false)\n ->join('person', 'person.person_id=organization.create_id')\n ->reset(Zend_Db_Select::COLUMNS)\n ->columns('organization.*')\n ->columns('person.fname')\n ->columns('person.lname')\n ->columns('person.email');\n \n \n $paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select));\n \n $elements = Zend_Registry::getInstance()->constants->elementsperpage;\n $paginator ->setItemCountPerPage(empty($elements) ? '4' : $elements);\n \n $request = $this->getParam('page');\n $paginator->setCurrentPageNumber(empty($request) ? '1' : $request);\n \n \n \n $this ->view->paginator = $paginator;\n \n }", "public function actionIndex()\n {\n $user_id = $this->get('u_id', '');\n $description = $this->get('description');\n\n $query = Business::find()\n ->where(['status' => 1, 'is_del' => 0]);\n\n if($user_id){\n $query->andWhere(['u_id' => $user_id]);\n } else {\n $user_info = $this->getUserInfo();\n if ($user_info) {\n $query->andWhere(['or', ['is_pri' => 0], ['u_id' => $user_info['id']]]);\n } else {\n $query->andWhere(['is_pri' => 0]);\n }\n }\n\n $query->andFilterWhere(['like', 'description', $description]);\n\n $query->orderBy('`id` DESC');\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query\n ]);\n\n return $dataProvider;\n }", "public function index()\n {\n //\n $news = News::orderBy('created_at', 'DESC')->get();\n $user = User::with('role')->find(auth('web')->user()->id); \n $userRole = $user->role->name;\n return view('backoffice.news.news_show', compact('news', 'userRole'));\n }", "public function organization() {\n return $this->belongsTo('App\\Models\\Organization'); \n }", "public function member()\n\t{\n\t\t// Get infor from database\n\t\t$users = user::all();\n\t\t$enterprisea = enterprise_account::all();\n\t\treturn view('member', compact('users','enterprisea'));\n\t}", "public function viewUsers();" ]
[ "0.6375108", "0.60218155", "0.59794825", "0.5956802", "0.59260267", "0.5890292", "0.58818066", "0.58259326", "0.58168226", "0.57996476", "0.5786901", "0.57861674", "0.5734214", "0.5681278", "0.5672263", "0.5667656", "0.5658347", "0.56577885", "0.56547534", "0.56448954", "0.5644605", "0.56390184", "0.56304", "0.5621942", "0.5616743", "0.561422", "0.56142104", "0.561251", "0.5602348", "0.5598724" ]
0.6466093
0
/ Returns true if the date has passed
private function dateHasPassed($date) { $timezone = new DateTimeZone('Europe/Stockholm'); $now = new DateTime('now', $timezone); $now = $now->format('m/d/Y'); return $now > $date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateDate()\n {\n /** @var SS_Datetime $from */\n $from = $this->dbObject('ValidFrom');\n /** @var SS_Datetime $till */\n $till = $this->dbObject('ValidTill');\n\n return (bool)($from->InPast() && $till->InFuture());\n }", "public function valid ()\n\t{\n\t\treturn $this->current->format('Ymd') <= $this->enddate_ymd;\n\t}", "public function validateDate()\n {\n $current_date = strtotime(date('Y-m-d'));\n\n if ($fromDate = $this->getData('from_date')) {\n $from = strtotime($fromDate);\n if ($current_date<$from) {\n return false;\n }\n }\n if ($toDate = $this->getData('to_date')) {\n $to = strtotime($toDate);\n if ($current_date>$to) {\n return false;\n }\n }\n return true;\n }", "public function action_check_date()\n\t{\n\t\t$post = $this->request->post();\n\n\t\tif (array_key_exists('start', $post))\n\t\t{\n\t\t\tif (strtotime($post['start']) <= strtotime($post['end']))\n\t\t\t\techo TRUE;\n\t\t\telse\n\t\t\t\techo 'Dates are invalid.';\n\t\t}\n\t}", "public function test2(){\n\n $today = '2019-11-05';\n $endDate = '2019-11-04';\n\n if($endDate < $today){\n echo 'true';\n }\n else{\n echo 'false';\n }\n\n\n }", "public function testHaveMoreThan(){\n $date = new \\DateTime();\n $date2 = $date->add(new \\DateInterval('P10D'));\n $boolean = DateTimeValidator::dateMoreThan($date2, 9);\n $this->assertTrue($boolean);\n }", "public function getIsExpired()\n {\n return new \\DateTime('today') > $this->getEndAt();\n }", "public function testDatePassed(){\n $date = new \\DateTime('05/08/1945 00:00:00');\n $boolean = DateTimeValidator::DatePassed($date);\n $this->assertTrue($boolean);\n }", "function va_date_error() {\n\tglobal $verify_age;\n\treturn (bool) ( $verify_age->valid_date === false );\n}", "private function CheckExpiration($date){\n $today = time();\n if($today > $date){\n return false;\n }else{\n return true;\n }\n }", "private static function checkDate($time)\n {\n return (time() < strtotime($time));\n }", "public function isExpired() {\n return !$this->getTeamDate()->isFuture();\n }", "public function testIsComing(){\n $date = new \\DateTime('01/01/2112 00:00:00');\n $boolean = DateTimeValidator::dateComing($date);\n $this->assertTrue($boolean);\n }", "private function isValidDatePoint() {\r\n $d = strtotime($this->currentpoint);\r\n $f = new DateTime($this->firstevent);\r\n $f->sub(new DateInterval($this->dateadd));\r\n $l = new DateTime($this->lastevent);\r\n\r\n $first = strtotime($f->format('Y-m-d H:i:s'));\r\n $last = strtotime($l->format('Y-m-d H:i:s'));\r\n\r\n if ($d < $first || $d > $last) {\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "function webquest_check_dates($webquest) {\r\n // allow submission and assessment to start on the same date and to end on the same date\r\n // but enforce non-empty submission period and non-empty assessment period.\r\n return ($webquest->submissionstart < $webquest->submissionend);\r\n}", "private function checkDate()\n {\n $now = (new DateTime())\n ->modify('last day of this month')\n ->setTime(23, 59, 0);\n\n $date = DateTime::createFromFormat(\n 'Y-m',\n $this->expiration_year->format('Y') . '-' . $this->expiration_month->format('m')\n )\n ->modify('last day of this month')\n ->setTime(23, 59, 0);\n\n if ($date < $now) {\n throw new InvalidArgument(\n 'Provided date must be in the future.'\n );\n }\n }", "protected function checkRottenTime()\n {\n $now = new DateTime(\"now\");\n $old = new DateTime($this->date_fall);\n $diff = $old->diff($now);\n\n if ($diff->format('h') > 5)\n return false;\n \n return true;\n }", "public function hasExpired(): bool\n {\n if (is_null($this->valid_until)) {\n return false;\n }\n\n return $this->valid_until->isPast();\n }", "function checkTheDate($date)\n\t{\n\t\treturn (date('Y-m-d', strtotime($date)) == $date);\n\t}", "public function isValid()\n {\n return $this->getCreatedAt()->add(new \\DateInterval('PT1H')) > DateTime::now();\n }", "public function isCurrentDate(): bool;", "function DateCheck( $indate) {\r\n\treturn true;\r\n}", "public function hasCurrentTime(){\n return $this->_has(3);\n }", "function checkIfInThePast($date) {\n // set today date\n $today = date('Ymd');\n // if date is less than today\n if (strtotime($date) < strtotime($today)) {\n // return true\n // i.e. yes date is in the past\n return true;\n } // if\n }", "function isGoodDate($date)\n{\n list($day, $month, $year) = split('[/.-]', $date); \n\n echo $day . \"/\" . $month . \"/\" . $year . \"<br>\";\n\n if(!checkdate($day, $month, $year))\n {\n return FALSE;\n }\n return mktime(0, 0, 0, $month, $day, $year) >\n mktime(0, 0, 0, date(\"m\"), date(\"d\") - MAX_DAY_HISTORY, date(\"Y\"));\n}", "public function valid() {\n return ($this->position <= $this->numDays) ? true : false;\n }", "public function includesPresent(): bool\n {\n return now()->between($this->start_date, $this->end_date, true); \n }", "public function check_valid(){ \n\t\tif(!empty($this->data['HrAttChange']['att_date'])){\n\t\t\tif(strtotime($this->format_date_save($this->data['HrAttChange']['att_date'])) >= strtotime(date('Y-m-d'))){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function hasExpired() \n {\n return strtotime($this->expires_at) < time();\n }", "public function isExpired()\n {\n return isset($this->ends_at) && \\Carbon\\Carbon::now()->endOfDay() > $this->ends_at;\n }" ]
[ "0.7627766", "0.74220246", "0.69779086", "0.6947412", "0.69288063", "0.6907429", "0.6871426", "0.68681586", "0.6861936", "0.68560845", "0.682922", "0.68282354", "0.6828067", "0.6771597", "0.67428863", "0.6683013", "0.668092", "0.66806585", "0.6658366", "0.6654641", "0.66296285", "0.6629168", "0.66255754", "0.66167754", "0.65995735", "0.65971595", "0.65924245", "0.6584047", "0.6581984", "0.6577098" ]
0.7879956
0
accessors in alphabetical order accessor method for sightingId
public function getSightingId(): Uuid { return ($this->sightingId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWithId()\n {\n }", "function getId();", "function getId();", "function getId();", "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public static function getIdProperty(): string;", "public function getId(){ return $this->_id; }", "public function GetId ();", "function getIdValue()\n {\n }", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "public function getId()\n {\n return $this->key ?: $this->long ?: $this->short;\n }", "function getIdName()\n {\n return \"id\";\n }", "public function getId( );", "public function getIdName();", "function getId()\n {\n return $this->__id ;\n }", "function getIdName()\n {\n }", "function getId(){return $this->id;}", "function getID(){\n\t\treturn this->Id;\t\t\n\t}" ]
[ "0.6532949", "0.64737713", "0.64737713", "0.64737713", "0.64524186", "0.64524186", "0.64524186", "0.64524186", "0.64524186", "0.64524186", "0.64524186", "0.64524186", "0.64524186", "0.64524186", "0.64524186", "0.63874024", "0.63630164", "0.635592", "0.63456726", "0.6345447", "0.6345447", "0.6345447", "0.6334604", "0.6323359", "0.6320745", "0.6316415", "0.63047415", "0.6295398", "0.6291651", "0.62882996" ]
0.6851159
0
accessor method for the sighting species Id
public function getSightingBirdSpeciesId(): Uuid { return ($this->sightingBirdSpeciesId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSpecies()\n {\n return $this->species;\n }", "public function getSpecies() {\n\t\t\treturn $this->species;\n\t\t}", "public function getIdentifier(){\n\t\treturn $this->getPluginKey().\"-\".$this->getThingId().\"-\".$this->getThingVariationId();\n\t}", "public function getSekolahId()\n {\n return $this->sekolah_id;\n }", "public function getSekolahId()\n {\n return $this->sekolah_id;\n }", "function getSeriesId() {\n\t\t return $this->getData('seriesId');\n\t}", "public function getSportId()\n {\n return $this->sportId;\n }", "public function getIdSejour() {\r\n return $this->idSejour;\r\n }", "public function getSerieId()\n {\n return $this->serieId;\n }", "public function getIdentifier()\r\n {\r\n return $this->id;\r\n }", "public function getSightingId(): Uuid {\n\t\treturn ($this->sightingId);\n\t}", "function getIdValue()\n {\n }", "public static function getIdProperty(): string;", "function getSwimmerId()\n {\n return $this->__swimmer_id ;\n }", "function getSwimmerId()\n {\n return $this->__swimmerid ;\n }", "public function getStudentId()\n {\n return $this->studentId;\n }", "public function getIdentifier()\n {\n return $this->id;\n }", "public function getSquareId()\n {\n return $this->square_id;\n }", "public function identifier();", "public function identifier();", "public function getIdentifier() {\n\t\treturn $this->id;\n\t}", "public function identifier()\n {\n return $this->identifier;\n }", "public function SRID() : int\n {\n return $this->srid;\n }", "public function id()\n {\n return $this->cleanName.Str::upper($this->value);\n }", "public function specie()\n {\n return $this->belongsTo(Specie::class, 'species_id','customId');\n }", "public function getIdentifier(): string\n\t{\n return $this->identifier;\n }", "function getIdName()\n {\n return \"id\";\n }", "public function getVariationId();", "function getIdName()\n {\n }", "public function getIdentifier();" ]
[ "0.69458", "0.65943044", "0.6481246", "0.64185214", "0.64185214", "0.63557225", "0.6346109", "0.6331901", "0.6319948", "0.63174814", "0.62863463", "0.6268196", "0.62679595", "0.6238372", "0.6234429", "0.6209988", "0.62095785", "0.6187139", "0.61833274", "0.61833274", "0.6182168", "0.6166785", "0.6165126", "0.61595786", "0.6149067", "0.6145655", "0.613996", "0.61352897", "0.612227", "0.6120879" ]
0.77598476
0
accessor for sighting birdPhoto
public function getSightingBirdPhoto(): string { return ($this->sightingBirdPhoto); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPhoto()\n {\n return $this->getValue();\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getArticleBirdImage(): string {\n\t\treturn ($this->articleBirdImage);\n\t}", "public function getPic()\n {\n return $this->pic;\n }", "function getPicture()\r\n {\r\n return $this->_picture;\r\n }", "function getPicture()\r\n\t{\r\n\t\treturn $this->picture;\r\n\t}", "public function getPicture()\n{\nreturn $this->picture;\n}", "public function getPicture ()\r\n {\r\n return $this->picture;\r\n }", "public function getPicture()\n {\n return $this->picture;\n }", "public function getImage() { return $this->image;}", "public function getPhotoAttribute()\n {\n return $this->attributes['photo'] ?? asset('images/program-placeholder.jpg');\n }", "public function getImage(){\r\n return $this->image;\r\n }", "function getImg()\n {\n return $this->img;\n }", "public function getPicture()\n {\n return $this->picture;\n }", "public function getPicture()\n {\n return $this->picture;\n }", "public function getPicture()\n {\n return $this->picture;\n }", "public function getPicture()\n {\n return $this->picture;\n }", "public function getPicture()\n {\n return $this->picture;\n }", "public function getPhoto_id()\n {\n return $this->photo_id;\n }", "public function getCoverPhoto()\n {\n return $this->cover_photo;\n }", "public function getPicture() {\n return $this->picture;\n }", "public function getPhotoPath()\n {\n return $this->photoPath;\n }", "public function getFullImage()\n {\n return $this->photo;\n }", "function getPicture() {\n return $this->picture_or_definition;\n }" ]
[ "0.74804574", "0.7342613", "0.7342613", "0.7342613", "0.7342613", "0.7342613", "0.7342613", "0.7342613", "0.7178366", "0.6973546", "0.6953827", "0.6939513", "0.6834478", "0.68103945", "0.67719686", "0.67265916", "0.6659625", "0.66522855", "0.6625697", "0.66247994", "0.66247994", "0.66247994", "0.66247994", "0.66247994", "0.6605874", "0.6601179", "0.6600665", "0.6591583", "0.6586022", "0.65351856" ]
0.7695649
0
accessor for sighting LocX
public function getSightingLocX(): float { return $this->sightingLocX; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getXY() {\n return $this->xy;\n }", "function loc(){\n return $this->loc;\n }", "public function getX();", "function pointLocation() {\n \n }", "public function getX() {\n return $this->x;\n }", "public function getXCoordinate(): int;", "public function originX() { return $this->_m_originX; }", "public function originX() { return $this->_m_originX; }", "public function getXPosition();", "public function getX()\n {\n return $this->x;\n }", "public function getX()\n {\n return $this->x;\n }", "public function getX()\n {\n return $this->x;\n }", "public function getX() {\n return $this->x;\n }", "public function getLocation() {\r\n\treturn $this->location;\r\n }", "public function getX() {\n return $this->get(self::X);\n }", "public function getLocation(){\n\t\treturn $this->location;\n\t}", "public function getX()\n\t{\n\t\treturn $this->X;\n\t}", "public function getLocation();", "public function getLocation();", "public function getX()\n {\n return $this->_data['coords'][0];\n }", "public function getLocation() {\r\n return $this->location;\r\n }", "function get_position ()\n \t{\n \t\t$res = $this->call(\"Mouse.GetXY\");\n \t\t$pos =strpos($res,\" \");\n \t\t$this->x = substr($res ,0,$pos);\n \t\t$this->y = substr($res ,$pos+1,strlen($res)-$pos-1);\n \t}", "public function getX()\n {\n return $this->position->getX();\n }", "function getLocation()\n {\n\n }", "public function getLocador() {\n return $this->locador;\n }", "public function getCoordinates ()\n {\n return $this->coordinates;\n }", "public function get_location()\n {\n return $this->location;\n }", "public function getLocType()\n {\n return $this->loc_type;\n }", "public function getLocation() {\n\t\treturn $this->location;\n\t}", "public function getLocation() {\n\t\treturn $this->location;\n\t}" ]
[ "0.6813869", "0.67981404", "0.65705866", "0.64289844", "0.6427496", "0.6370394", "0.63530934", "0.63530934", "0.6201392", "0.61890036", "0.61890036", "0.61890036", "0.61653394", "0.61394435", "0.60988724", "0.60840935", "0.6067436", "0.60668015", "0.60668015", "0.60319453", "0.59560996", "0.5929481", "0.5928472", "0.5915387", "0.5860058", "0.5849099", "0.58387214", "0.58222693", "0.581568", "0.581568" ]
0.6939082
0
accessor for sighting LocY
public function getSightingLocY(): float { return $this->sightingLocY; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getYCoordinate(): int;", "function getXY() {\n return $this->xy;\n }", "public function originY() { return $this->_m_originY; }", "public function originY() { return $this->_m_originY; }", "public function getY()\n {\n return $this->_data['coords'][1];\n }", "public function getY() {\n return $this->get(self::Y);\n }", "public function getY();", "public function getY()\n {\n return $this->y;\n }", "public function getY()\n {\n return $this->y;\n }", "public function getY()\n {\n return $this->y;\n }", "public function getY()\n {\n return $this->y;\n }", "public function getY()\n\t{\n\t\treturn $this->Y;\n\t}", "public function getY() {\n return $this->y;\n }", "public function getYPosition();", "function loc(){\n return $this->loc;\n }", "function get_y()\n \t{\n \t\treturn $this->call(\"Mouse.GetY\");\n \t}", "public function getY()\n {\n return $this->position->getY();\n }", "public function getSightingLocX(): float {\n\t\treturn $this->sightingLocX;\n\t}", "function setY($y) {\n if(is_double($y) && $y >= 0 && $y <= 1) {\n $conn = new ApiConnection();\n $URL = \"lights/\" . $this->lightID . \"/state\";\n $data = '{\"xy\": [' . $this->getXY()[0] .',' . $y . ']}';\n $result = $conn->sendPutCmd($URL, $data);\n return $result;\n } else {\n return null;\n }\n }", "public function getLocation() {\r\n\treturn $this->location;\r\n }", "public function getLocation();", "public function getLocation();", "function get_longitude()\n {\n return ($this->longitude);\n }", "public function getLocation(){\n\t\treturn $this->location;\n\t}", "function pointLocation() {\n \n }", "public function getY(): float\n {\n return $this->y;\n }", "public function getYIntercept()\n {\n return ($this->getPointA()->getOrdinate() - ($this->getPointA()->getAbscissa() * $this->getSlope()));\n }", "public function getLocation() {\r\n return $this->location;\r\n }", "public function getLoyalityPointValue();", "public function getOffsetY()\n {\n return $this->offset_y;\n }" ]
[ "0.68911254", "0.6807237", "0.67653394", "0.67653394", "0.6686692", "0.6675565", "0.66738266", "0.6653483", "0.6653483", "0.6653483", "0.6653483", "0.66066384", "0.6595809", "0.65668863", "0.65199685", "0.64022255", "0.6387028", "0.6331361", "0.63157636", "0.63154995", "0.6305982", "0.6305982", "0.62829065", "0.6233268", "0.62138635", "0.6171184", "0.6166756", "0.61395323", "0.61239344", "0.6099005" ]
0.75144166
0
Gets the available directions status
public static function getDirectionsStatus() { return array( self::INVALID_REQUEST, self::MAX_WAYPOINTS_EXCEEDED, self::NOT_FOUND, self::OK, self::OVER_QUERY_LIMIT, self::REQUEST_DENIED, self::UNKNOWN_ERROR, self::ZERO_RESULTS ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function DirectionsEnabled() {\n\t\treturn Config::inst()->get('GoogleDirections', 'directions_enabled');\n\t}", "public function getAvailability();", "private function getAvailability ()\n {\n $this->getPreviousAvailability();\n $this->getNextAvailability();\n }", "public function index()\n {\n return ResponseHelper::findSuccess('Directions', DirectionResource::collection((Direction::all())));\n }", "public function getAvailableStatuses()\n\t{\n\t\treturn [self::STATUS_ENABLED => __('Enabled'), self::STATUS_DISABLED => __('Disabled')];\n\t}", "public function available()\n {\n $shipping_options = ShippingOption::where('available', 1)\n ->orderBy('provider')\n ->orderBy('service')\n ->get();\n\n return response()->json(['status' => 'success', 'data' => $shipping_options]);\n }", "public static function availableStatuses()\n\t{\n\t\treturn [\n\t\t\tself::ACTIVE_STATUS => self::ACTIVE_STATUS,\n\t\t\tself::COMING_SOON_STATUS => self::COMING_SOON_STATUS,\n\t\t\tself::SOLD_OUT_STATUS => self::SOLD_OUT_STATUS,\n\t\t];\n\t}", "public function getPossibleStatus() {\n return array('Offen', 'Geschlossen');\n }", "public function list_ads_availability()\n {\n // Returns the Ads in an Array\n $ads_a = array();\n global $wpdb;\n $query = \"SELECT * FROM \" . wp_adpress_campaigns::ads_table() . \" WHERE campaign_id=\" . $this->id . \";\";\n for ($i = 0; $i < $this->ad_definition['number']; $i++) {\n $result = $wpdb->get_row($query, ARRAY_A, $i);\n $ads_a[] = $result['status'];\n }\n return $ads_a;\n }", "public static function getAvailable()\n {\n return self::$available;\n }", "public function listDriveThroughInfo() {\n $db = Database::connect();\n $builder = $db->table('test_drive_through');\n $result = $builder->get()->getResult();\n if (isset($result)){\n return $result;}\n else {\n return false;\n }\n }", "public function getAvailable(){\n $this->retrieveData();\n return $this->roomList;\n }", "public function available()\n {\n $zones = ShippingZone::where('available', 1)->orderBy('available', 'desc')->orderBy('title')->get();\n\n return response()->json(['status' => 'success', 'data' => $zones]);\n }", "public function getAvailableStatuses()\n {\n return [self::STATUS_ENABLED => __('Enabled'), self::STATUS_DISABLED => __('Disabled')];\n }", "public function getStationsStatus()\n {\n return $this->stationsStatus;\n }", "public function getAvailableStatuses()\n {\n return [self::STATUS_DISABLED => __('Disabled'), self::STATUS_ENABLED => __('Enabled')];\n }", "public function getNetworkLookupAvailable() { return $this->networkLookupAvailable; }", "public function getLegalStatus();", "protected function get_allowed_status() {\r\n\t\treturn Users::get_statuses(); \t\r\n\t}", "public function getAvailable()\n {\n return $this->_available;\n }", "public function listNeededOutgoingStates(): array;", "public function getAvailableMoves(): array;", "public function getStatus()\n\t{\n\t\treturn $this->oImapFolder->GetExtended('STATUS');\n\t}", "public function get_driving_information($start, $finish, $raw = false)\n{\n\tif(strcmp($start, $finish) == 0)\n\t{\n\t\t$time = 0;\n\t\tif($raw)\n\t\t{\n\t\t\t$time .= ' seconds';\n\t\t}\n \n\t\treturn array('distance' => 0, 'time' => $time);\n\t}\n \n\t$start = urlencode($start);\n\t$finish = urlencode($finish);\n \n\t$distance = 'unknown';\n\t$time\t\t= 'unknown';\n \n\t$url = 'http://maps.googleapis.com/maps/api/directions/xml?origin='.$start.'&destination='.$finish.'&sensor=false';\n\tif($data = file_get_contents($url))\n\t{\n\t\t$xml = new SimpleXMLElement($data);\n \n\t\tif(isset($xml->route->leg->duration->value) AND (int)$xml->route->leg->duration->value > 0)\n\t\t{\n\t\t\tif($raw)\n\t\t\t{\n\t\t\t\t$distance = (string)$xml->route->leg->distance->text;\n\t\t\t\t$time\t = (string)$xml->route->leg->duration->text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$distance = (int)$xml->route->leg->distance->value / 1000; \n\t\t\t\t$time\t = (int)$xml->route->leg->duration->value;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$distance='false';\n\t\t}\n \n\t\treturn array('distance' => $distance, 'time' => $time);\n\t}\n\telse\n\t{\n\t\tthrow new Exception('Could not resolve URL');\n\t}\n}", "public function getAvailableStatuses()\n {\n return [self::STATUS_ANSWERED => __('Answered') , self::STATUS_NOT_ANSWERED => __('Not Answered')];\n }", "public function getAvailableMoves()\n\t\t{\n\t\t\treturn $this->availableMoves;\n\t\t}", "public function getAvailabilityEnds();", "public function getDirectionAllowableValues()\n {\n return [\n self::DIRECTION_INBOUND,\n self::DIRECTION_OUTBOUND_API,\n self::DIRECTION_OUTBOUND_CALL,\n self::DIRECTION_OUTBOUND_REPLY,\n self::DIRECTION_UNKNOWN,\n ];\n }", "function isAvailable() {\n\t\treturn @is_readable($this->location);\n\t}", "abstract public function get_status();" ]
[ "0.669248", "0.61703676", "0.6114723", "0.5987395", "0.5764533", "0.5734232", "0.57335", "0.57319266", "0.57253176", "0.57125425", "0.5709508", "0.57029045", "0.56349814", "0.5612381", "0.55799496", "0.5572431", "0.5550341", "0.55483615", "0.55431616", "0.5539525", "0.55189764", "0.55007184", "0.54624146", "0.5415562", "0.5398179", "0.5395254", "0.53791314", "0.5341842", "0.5337421", "0.53368455" ]
0.7617648
0
A user has one profile
public function userProfile() { return $this->hasOne('Leitom\Boilerplate\UserProfile'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function profile()\n {\n return $this->hasOne(UserProfile::class);\n }", "public function profile()\n {\n return $this->hasOne(UserProfile::class);\n }", "public function profile()\n {\n return $this->hasOne(UserProfile::class);\n }", "public function profile()\n {\n return $this->hasOne(UserProfile::class);\n }", "public function getProfile()\n {\n return $this->hasOne(Profile::className(), ['user_id' => 'id']);\n }", "public function getProfile()\n {\n return $this->hasOne(Profile::className(), ['user_id' => 'id']);\n }", "public function profile()\n {\n return $this->hasOne('App\\UserProfile');\n }", "public function profile()\n\t{\n\t\treturn $this->hasOne(\"IntercraftDb\\\\Models\\\\Profile\");\n\t}", "public function profile()\n {\n return $this->hasOne(Profile::class);\n }", "public function profile()\n {\n return $this->hasOne(Profile::class);\n }", "public function profile()\n {\n return $this->hasOne(Profile::class);\n }", "public function profile()\n {\n return $this->hasOne(Profile::class);\n }", "public function profile()\n {\n return $this->hasOne('App\\Models\\UserProfile', 'user_id');\n }", "public function getUserProfile()\n {\n return $this->hasOne(UserProfile::class, ['user_id' => 'id'])\n ->via('user');\n }", "public function profile()\n {\n return $this->hasOne('App\\Models\\Profile');\n }", "public function profile()\n {\n // hasOne untuk merelasi one to one \n // Parameter 1 untuk diarahkan ke class yang direlasi\n // Parameter 2 deklarasi foreign key\n // Parameter 3 deklarasi key dari table yang direlasi\n // $this->hasOne(Profile::class, 'foreign_user', 'primary_key');\n\n // Aturan yang mudah hanya menggunakan 1 parameter\n return $this->hasOne(Profile::class);\n }", "public function profile()\n {\n return $this->hasOne('App\\UserMeta')->withDefault();\n }", "public function profile()\n {\n return $this->hasOne('App\\Models\\sys\\Profile');\n }", "public function profile()\n {\n return $this->HasOne('App\\Profile','id', 'id_profile');\n }", "public function profile()\n {\n \t$this->User->id = $this->othAuth->user('id');\n \t$user = $this->User->read();\n\n \tif(!empty($this->data))\n \t{\t\n \t\tif($this->User->save($this->data))\n \t\t{\n \t\t\t$this->set('saved', true);\n \t\t\t$this->othAuth->updateSession($this->data); \t\t\t\n \t\t}\n \t\t\n \t\t$user = $this->data;\t\t \t\t\n \t}\n \t\n \t$this->set('user', $user);\n }", "public function socialLoginProfile()\n {\n return $this->hasOne(SocialLoginProfile::class);\n }", "public function profile()\n {\n return $this->hasOne('App\\Models\\StudentProfile');\n }", "public function profile()\n {\n return $this->belongsTo(Profile::class);\n }", "public function getUserProfile();", "public function myprofile() {\n\t\t$userId = $this->UserAuth->getUserId();\n\t\t$user = $this->User->read(null, $userId);\n\t\t$this->set('user', $user);\n\t}", "public function student_profile()\n {\n return $this->hasOne('App\\UserStudentProfile');\n }", "public function profile()\n {\n return $this->belongsTo('App\\Profile', 'profile_id');\n }", "function bbp_is_single_user_profile()\n{\n}", "public function profile()\n {\n return $this->hasMany(\\App\\Models\\Profile::class);\n }", "public function testAUserHasProfile()\n {\n $user = factory(User::class)->create();\n\n $this->withoutExceptionHandling()->get('/profile/'.$user->name)->assertSee($user->name);\n }" ]
[ "0.7668563", "0.7668563", "0.7668563", "0.7668563", "0.76405513", "0.76405513", "0.76113284", "0.7579845", "0.75169724", "0.75169724", "0.75169724", "0.75169724", "0.75150096", "0.74879116", "0.74603987", "0.7442699", "0.7407073", "0.7404367", "0.7207748", "0.7205983", "0.7125579", "0.7067063", "0.7012618", "0.6958142", "0.6951651", "0.694503", "0.6804838", "0.67199546", "0.66848147", "0.66826516" ]
0.7756531
0
Inserts a value to the collection. Returns true if the collection did not already contain the specified element.
public function insert($val) { $this->len++; $this->arr[] = $val; if (!isset($this->indexMap[$val])) { $this->indexMap[$val] = [$this->len]; return true; } array_push($this->indexMap[$val], $this->len); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add($element): bool\n {\n foreach ($this->elements as $setElement) {\n if ($setElement === $element) {\n return false;\n }\n }\n\n $this->elements[] = $element;\n\n return true;\n }", "public function add($element):bool{\n\n // Check if the value already exists in this\n // binary tree, if it does ignore adding it\n if($this->contains($element)):\n return false;\n\n // Otherwise add this element to the binary tree\n else:\n $this->root = $this->addElement($this->root, $element);\n $this->nodeCount++;\n return true;\n endif;\n }", "public function addExists( $value){\n return $this->_add(6, $value);\n }", "public function insert() {\n\t\t\treturn true;\n\t\t}", "public function add($key, $value)\n {\n $retunValue = false;\n\n if (!$this->has($key)) {\n $this->set($key, $value);\n $retunValue = true;\n }\n\n return $retunValue;\n }", "public function set(mixed $key, mixed $value): bool\n {\n $added = true;\n $bucket = $this->locate($key);\n\n if ($bucket !== null) {\n $this->removeBucket($bucket);\n $this->rewind();\n $added = false;\n }\n\n $this->insertBetween($key, $value, $this->head, $this->head->next());\n $this->offset = 0;\n\n return $added;\n }", "public function put($element) {\n if (!$this->contains($element)) {\n $this->elements[] = $element;\n $this->fire(new SetPutEvent($element));\n }\n }", "public static function add(&$array, $key, $value)\n {\n if (is_null(self::get($array, $key))) {\n self::set($array, $key, $value);\n return true;\n }\n return false;\n }", "function add_item(&$arr, $item)\n{\n if (array_search($item, $arr) === false) {\n $arr[] = $item;\n return true;\n } else {\n return false;\n }\n}", "public function addValue($value)\n {\n if ($this->type->basicValueCheck($value)) {\n $array = $this->getRawValue();\n $array[] = $this->type->castValue($value);\n $this->setRawValue($array);\n\n return true;\n }\n\n return false;\n }", "public function add(): bool\n\t{\n\t\t$preparedData = $this->sqlHelper->prepareInsert($this->tableName, [\n\t\t\t'DATE_CREATE' => (new DateTime()),\n\t\t\t'UUID' => $this->uuid,\n\t\t]);\n\n\t\t$this->connection->queryExecute(\n\t\t\t\"INSERT IGNORE INTO $this->tableName (\" . $preparedData[0] . \") VALUES (\" . $preparedData[1] . \");\"\n\t\t);\n\t\t$rowsAffected = $this->connection->getAffectedRowsCount();\n\n\t\treturn $rowsAffected > 0;\n\t}", "public static function insert(array &$original, $value, $pos)\n\t{\n\t\tif (count($original) < abs($pos))\n\t\t{\n\t\t\ttrigger_error('Position larger than number of elements in array in which to insert.');\n\t\t\treturn false;\n\t\t}\n\n\t\tarray_splice($original, $pos, 0, $value);\n\t\treturn true;\n\t}", "public function add($value);", "public function add($value);", "public function add_value( $value ) {\n\n\t\t$result = $this->add_single_value( $value );\n\n\t\treturn ( true == $result || 0 < $result );\n\n\t}", "function insertLast($value) {\n if($this->isEmpty()){\n $this->deque[0] = $value;\n $this->tail = 1;\n $this->head = 0;\n return true;\n }\n\n if($this->isFull()){\n return false;\n }\n\n $this->deque[$this->tail] = $value;\n $this->tail = ($this->tail + 1) % $this->capacity;\n\n return true;\n }", "public function insert(&$el,$position) : bool {\n $retVal = false;\n if ($this->validateSize()) {\n $listSize = $this->size();\n\n if ($listSize == 0 && $position == 0) {\n //empty list and insert at start.\n $retVal = $this->add($el);\n } else if ($listSize == 1 && $position == 0) {\n //list size is 1 and position = 0. inser at the start.\n $this->_insertStart($el);\n\n $retVal = true;\n } else if ($listSize == 1 && $position == 1) {\n //list size is 1 and position = 1. inser at the end.\n $newNode = new Node($el);\n $this->tail = $newNode;\n $this->head->setNext($this->tail);\n $this->size++;\n\n $retVal = true;\n } else if ($position == $listSize) {\n //insert at the end.\n $retVal = $this->add($el);\n } else if ($position < $listSize) {\n //insert in the middle or at the start\n if ($position == 0) {\n //inser at the start.\n $this->_insertStart($el, false);\n\n $retVal = true;\n } else {\n //insert in the middle.\n $retVal = $this->_insertMiddle($el, $position);\n }\n }\n }\n\n return $retVal;\n }", "public static function insert($arr, $dotPath, $value)\n {\n // Pass to self::exists() to determine existence\n if (self::exists($arr, $dotPath)) {\n\n // Already exists\n return false;\n }\n\n return self::write($arr, ltrim(rtrim($dotPath, '.'), '.'), $value);\n }", "public function add($idx, $val)\n {\n $entry = $this->getEntry($idx);\n if ( $entry == NULL ) return false;\n\n return $this->insertBefore($entry, $val);\n }", "static private function addIfSet(array &$array, $key, $value)\n {\n if (isset($value)) {\n $array[$key] = $value;\n }\n }", "public function contains($element): bool;", "public function Contains($Element): bool;", "public function has($element): bool\n\t{\n\t\tforeach ($this->collection as $item) {\n\t\t\tif ($item === $element) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function containsValue($value) {\n return in_array($value, $this->collection);\n }", "public function insert($item, $position)\n {\n if($position > $this->head) return false;\n switch($position) {\n case $this->head:\n array_push($this->items, $item);\n break;\n case $this->tail:\n array_unshift($this->items,$item);\n break;\n default:\n $first = array_slice($this->items,0,$position-1);\n $last = array_slice($this->items,$position);\n $first[] = $item;\n $this->items = array_merge($first,$last);\n }\n return true;\n }", "public function add($key, $value) {\r\n\t\tif(!isset(self::$cache[$this->accessorClass][$key])) {\r\n\t\t\tself::$cache[$this->accessorClass][$key] = array();\r\n\t\t}\r\n\t\tself::$cache[$this->accessorClass][$key][key($value)] = current($value);\r\n\t\t$this->triggerRebuild();\r\n\t\treturn true;\r\n\t}", "function addWord( $word )\n {\n if ( in_array( $word, $this->wordList ) )\n {\n return false;\n }\n else\n {\n $this->wordList[] = $word;\n return true;\n }\n }", "public function insert(): bool\n {\n return $this->execute('insert');\n }", "public function addElement1($e) {\n\t\tif($this->elements[] = $e) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function add($value) : void;" ]
[ "0.65775806", "0.6105469", "0.5921919", "0.58586115", "0.57920724", "0.57879716", "0.57557774", "0.5694096", "0.56734294", "0.55263966", "0.5500733", "0.54386985", "0.53802365", "0.53802365", "0.5369172", "0.5344026", "0.52982813", "0.5259198", "0.5234793", "0.52170813", "0.5184344", "0.5180924", "0.5168275", "0.51313204", "0.51269007", "0.5125815", "0.5098795", "0.50952166", "0.5094198", "0.50920576" ]
0.6317193
1
Get Instance Global version of the getInstance method in libraries, returns an instance of the super/core (controller) object.
function &getInstance() { $core = ns(NS, NSLIBRARY) . 'controller'; return $core::getInstance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getInstance() { return parent::getInstance(get_class()); }", "public static function get_instance();", "public static function getInstance()\r\n {\r\n return parent::getInstance();\r\n }", "public function getInstance(){\r\n\t\treturn(self::getInstanceOf(__CLASS__));\r\n\t}", "public static function getInstance() {\n\t\treturn parent::getInstance ( __CLASS__ );\n\t}", "function &get_instance()\n{\n return Controller::getInstance();\n}", "function getInstance() {\n return XP_Controller::get_instance();\n}", "public static function get_instance() { return self::$instance; }", "static public function getInstance()\n\t{\n\t\treturn parent::getInstance();\n\t}", "static public function getInstance()\n\t{\n\t\treturn parent::getInstance();\n\t}", "public static function get_instance() {\n\t\n\t\treturn self::$instance;\n\t\n\t}", "public static function instance() {\n\t\tstatic $instance = null;\n\n\t\t// Only run these methods if they haven't been ran previously\n\t\tif ( null === $instance ) {\n\t\t\t$instance = new Core;\n\t\t\t// $instance->load();\n\t\t\tadd_action( 'plugins_loaded', array( &$instance, 'load' ) );\n\t\t}\n\n\t\t// Always return the instance\n\t\treturn $instance;\n\t}", "public static function get_instance() {\n\t\treturn self::$instance;\n\t}", "public static function instance()\n {\n return parent::instance();\n }", "function &getInstance()\n{\n return \\core\\App::getInstance();\n}", "public static function get_instance()\n\t{\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n return static::$__instance;\n }", "static protected function getInstance()\n\t{\n\t\tif (null === self::$oInstance) {\n\t\t\tstatic::boot();\n\t\t}\n\t\treturn self::$oInstance;\n\t}", "protected function ci()\r\n\t{\r\n\t\treturn get_instance();\r\n\t}", "public static function getInstance() {\n return self::bootstrap();\n }", "public static function &get_instance()\n\t{\n\t\treturn self::$_inst;\n\t}", "public static function &get_instance()\n\t{\n\t\treturn self::$_instance;\n\t}", "public static function &get_instance(){\n return self::$instance;\n }", "public static function GetGlobalInstance()\n {\n\n return self::$instance;\n\n }", "static public function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }", "public static function getInstance()\n\t{\n\t\treturn Self::$__instance;\n\t}", "public static function getInstance()\n\t{\n\t\treturn static::forge();\n\t}", "public static function getInstance() {\n return self::$instance;\n }", "public static function getInstance()\n {\n return static::$instance;\n }", "public static function getInstance()\n {\n return static::$instance;\n }" ]
[ "0.7930748", "0.7684802", "0.7655002", "0.76195884", "0.76073873", "0.756183", "0.7545688", "0.74624324", "0.742307", "0.742307", "0.74146545", "0.7408436", "0.74016654", "0.73735595", "0.7334913", "0.7333555", "0.72699386", "0.72261596", "0.7224801", "0.72182655", "0.7211865", "0.72094214", "0.7204229", "0.72028", "0.72013897", "0.7184532", "0.7164056", "0.714577", "0.71236575", "0.71236575" ]
0.82459956
0
This file contains the code to handle the [hewaplayer ...] shortcode. Creates the code to display an HTML5 player for the specified file.
function hewa_shortcode_player( $atts ) { // Extract attributes and set default values // TODO: the default path might point to a custom video that invites the user to select a video. // TODO: default width and height ratio should be calculated from the video. $params = shortcode_atts( array( 'width' => 480, 'height' => 270, 'path' => 'cdn/A1TAAdmin/VendorAdm/tests/test-signal-3.mp4' ), $atts); // Videojs wp_enqueue_style( 'videojs-css', plugins_url( 'bower_components/video.js-dist/dist/video-js/video-js.min.css', __FILE__ ) ); wp_enqueue_script( 'videojs', plugins_url( 'bower_components/video.js-dist/dist/video-js/video.js', __FILE__ ) ); // Our js wp_enqueue_script( 'helixwarejs', plugins_url( 'js/helixware.js', __FILE__ ) ); wp_localize_script( 'helixwarejs', 'videojs_params', array( 'class' => 'hewa-player', 'swfurl' => plugins_url( 'bower_components/video.js-dist/dist/video-js/video-js.swf', __FILE__ ) ) ); // Retrieving sources $clips = hewa_get_clip_urls( $params['path'] ); // TODO: the above call might return an error, handle it here and display a friendly message. // Setting width and height $width_e = esc_attr( $params['width'] ); $height_e = esc_attr( $params['height'] ); // Return HTML template echo <<<EOF <video class='video-js vjs-default-skin hewa-player' controls preload='auto' data-setup='{ "techOrder": ["html5", "flash"] }' width="$width_e" height="$height_e"> EOF; // Print the streaming sources, we only need to: // * HLS streaming (m3u8) for Safari, iOS, Android // * Flash for all the others (Chrome, Internet Explorer, Safari) foreach( $clips as $key => $clip ) { switch ( $key ) { // HLS streaming. case 'm3u8-redirector': hewa_player_print_source_tag( admin_url('admin-ajax.php') . '?action=hewa_m3u8&file=' . urlencode( $clip->file ), 'application/x-mpegURL' ); break; // Flash streaming. case 'flash-direct': hewa_player_print_source_tag( $clip->url, 'rtmp/mp4' ); break; } } echo <<<EOF <p class="vjs-no-js">To view this video consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p> </video> EOF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function oxy_shortcode_rtmp_player($atts) {\n extract(shortcode_atts(array(\n 'ip' => '84.200.83.137',\n 'stream' => 'myStream'\n ), $atts));\n $output = '<div class = \"span4\">';\n $output .= '<strong>Начало:</strong> 12.00 Ландау (14.00 Московское время, 13.00 Киевское, 06.00 восточное сша)';\n $output .= '</div>';\n $output .= '<div class = \"span8\">';\n $output .= '<div id = \"playerygRpQJGcOwEP\">';\n $output .= '<script src = \"' . hb_get_host_jw_player_script() . '\"></script>';\n $output .= '<script type = \\'text/javascript\\'>';\n $output .= 'jwplayer(\\'playerygRpQJGcOwEP\\').setup({';\n $output .= 'playlist: [{';\n $output .= 'image: \"' . get_theme_root_uri() . '/smartbox-theme-custom/images/broadcast.jpg\",';\n $output .= 'sources: [';\n $output .= '{ file: \"rtmp://84.200.83.137/live/myStream.sdp\", },';\n $output .= '],';\n $output .= '}],';\n $output .= 'sources: [{';\n $output .= 'file: \"http://84.200.83.137:1935/vod/mp4:sample.mp4/manifest.f4m\"';\n $output .= '}],';\n $output .= 'sources: [{';\n $output .= 'file: \"http://84.200.83.137:1935/vod/mp4:sample.mp4/playlist.m3u8\"';\n $output .= '}],';\n $output .= 'height: 360,';\n $output .= 'rtmp: {';\n $output .= 'subscribe: true';\n $output .= '},';\n $output .= 'width: 640';\n $output .= '});';\n $output .= '</script></div></div>';\n $atts = array(\n 'title' => 'Прямая трансляция'\n );\n return oxy_shortcode_section($atts, $output);\n}", "function sc_audio_player( $atts, $content = NULL ) {\n\textract( shortcode_atts( array( 'src_ogg' => '', 'src_mp3' => '' ), $atts ) );\n\t$ogg = '';\n\t$mp3 = '';\n\t$sources = '';\n\tif( !empty( $src_ogg ) ) $ogg = '<source src=\"' . esc_attr( $src_ogg ) . '\" />';\n\tif( !empty( $src_mp3 ) ) $mp3 = '<source src=\"' . esc_attr( $src_mp3 ) . '\" />';\n\t$sources = $ogg . \"\\n\" . $mp3;\n\treturn '<div class=\"audio-container\"><audio preload=\"auto\" controls>' . $sources . '</audio></div>';\n}", "function oxy_shortcode_js_player($atts) {\n extract(shortcode_atts(array(\n 'sources' => '',\n 'title' => '',\n 'image' => '',\n 'height' => '',\n 'width' => ''\n ), $atts));\n\n if (empty($image))\n $image = \"\\\"\" . get_theme_root_uri() . \"/smartbox-theme-custom/images/broadcast.jpg\\\"\";\n\n if (empty($height))\n $height = \"200\";\n\n if (empty($width))\n $width = \"360\";\n $uniqid = \"player\" . uniqid();\n $output = '<div id = \"' . $uniqid . '\">';\n $output .= '<script src = \"' . hb_get_host_jw_player_script() . '\"></script>';\n //$output .= '<script src = \"http://84.200.83.37/wp-content/themes/smartbox-theme-custom/inc/js/JS_Player.js' . '\"></script>';\n $output .= '<script type = \\'text/javascript\\'>';\n $output .= 'jwplayer(\\'' . $uniqid . '\\').setup({';\n $output .= ' height: ' . $height . ',';\n $output .= ' width: ' . $width . ',';\n $output .= 'playlist: [{';\n $output .= 'image: ' . $image . ',';\n $output .= 'sources: [';\n $sourcesArray = explode(\",\", $sources);\n $addComma = false;\n $counter = 0;\n foreach ($sourcesArray as $source) {\n if (isset($source)) {\n $counter = $counter + 1;\n if ($addComma)\n $output .= ',';\n $output .= '{ file: \"' . $source . '\", label: \"' . $counter . '\" }';\n $addComma = true;\n }\n }\n $output .= ']';\n $output .= '}]';\n $output .= '});';\n $output .= '</script></div>';\n $atts = array(\n 'title' => $title\n );\n\n return $output;\n}", "function wp_ivoox_shortcode( $atts, $content = null ) {\n extract(shortcode_atts(array(\n 'type'=>'normal'\n ), $atts ));\n\n if(is_null($content)){\n return '<p style=\"font-style: italic;\">' . __(\"You must provide an ivoox.com URL\", \"wp-ivoox\") . '<p>';\n }\n if (preg_match('/^http.+?_(.{2})_(.+?)_1\\.html(\\?.*?)*$/i', $content, $result)) {\n $ivoox_id = $result[2];\n switch ($type) {\n case 'mini':\n $code = '<iframe width=\"238\" height=\"48\" frameborder=\"0\" allowfullscreen=\"\" scrolling=\"no\" src=\"http://www.ivoox.com/player_ek_' . $ivoox_id . '_1.html\"></iframe>';\n break;\n case 'flash':\n $code = '<object id=\"player' . $ivoox_id . '\" width=\"240\" height=\"133\" type=\"application/x-shockwave-flash\" data=\"http://www.ivoox.com/playerivoox_ee_' . $ivoox_id . '_1.html\"><param name=\"movie\" value=\"http://www.ivoox.com/playerivoox_ee_' . $ivoox_id . '_1.html\"></param><param name=\"AllowScriptAccess\" value=\"always\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.ivoox.com/playerivoox_ee_' . $ivoox_id . '_1.html\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" wmode=\"transparent\" allowscriptaccess=\"always\" width=\"240\" height=\"133\"></embed></object>';\n break;\n default:\n $code = '<iframe width=\"100%\" height=\"120\" frameborder=\"0\" allowfullscreen=\"\" scrolling=\"no\" src=\"http://www.ivoox.com/player_ej_' . $ivoox_id . '_1.html\"></iframe>';\n break;\n }\n return $code;\n } else {\n return '<p style=\"font-style: italic;\">' . __(\"Please, check the ivoox.com URL is correct\", \"wp-ivoox\") . '<p>';\n }\n }", "function youku($atts, $content=null){\r\nextract(shortcode_atts(array(\"width\"=>'500', \"height\"=>'375'),$atts));\r\nreturn'<embed type=\"application/x-shockwave-flash\" src=\"'.$content.'\" id=\"movie_player\" name=\"movie_player\" bgcolor=\"#FFFFFF\" quality=\"high\" allowfullscreen=\"true\" flashvars=\"isShowRelatedVideo=false&showAd=0&show_pre=1&show_next=1&isAutoPlay=true&isDebug=false&UserID=&winType=interior&playMovie=true&MMControl=false&MMout=false&RecordCode=1001,1002,1003,1004,1005,1006,2001,3001,3002,3003,3004,3005,3007,3008,9999\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" width=\"'.$width.'\" height=\"'.$height.'\">';}", "function hypEmbedSource($atts) {\n extract(shortcode_atts(array(\n 'domain' => '',\n 'title' => '',\n 'link' => '',\n 'excerpt' => '',\n 'child_user' => '',\n 'child_time' => '',\n 'child_annotation' => ''\n ), $atts));\n\n return do_shortcode('\n <div class=\"hyp-embed\">\n <div class=\"hyp-topbar\">\n <span>'.$domain.'</span>\n <span>/</span>\n <a href=\"'.$link.'\">'.$title.'</a>\n </div>\n <div class=\"hyp-quote\">\n <div class=\"hyp-body\">'.$excerpt.'</div>\n </div>\n <div class=\"hyp-annotation\">\n <div class=\"hyp-time\">'.$child_time.'</div>\n <div class=\"hyp-user\">'.$child_user.'</div>\n <div class=\"hyp-body\">'.$child_annotation.'</div>\n <div class=\"hyp-bottombar\">\n <div class=\"hyp-store\"><a href=\"'.$link.'\">View Annotation</a> from:&nbsp;&nbsp;<span>hypothes.is</span></div>\n </div>\n </div>\n </div>\n ');\n }", "function youtube_callback_shortcode_qwe($atts)\n{\n $atts= shortcode_atts(\n array(\n 'src'=>'',\n 'width'=> 820,\n 'height'=> 465,\n 'title'=>''\n ), $atts\n );\n return '\n &nbsp;\n <div id=\"\" class=\"youtube-qwe\">\n <h3>'.$atts['title'].'</h3>\n <iframe class=\"qwe-row-xs-5 qwe-row-lg-5 qwe-row-md-5 qwe-row-sm-5\" src=\"'.$atts['src'].'\" width=\"'.$atts['width'].'\" height=\"'.$atts['height'].'\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"></iframe> \n </div>\n &nbsp;\n ';\n}", "function oxy_shortcode_audio( $atts, $content = null) {\n $atts = shortcode_atts( array(\n 'src' => '',\n 'loop' => '0',\n 'autoplay' => '0',\n 'preload' => 'none',\n // global options\n 'extra_classes' => '',\n 'margin_top' => 'short-top',\n 'margin_bottom' => 'short-bottom',\n 'scroll_animation' => 'none',\n 'scroll_animation_delay' => '0'\n ), $atts );\n\n $classes = array();\n $classes[] = $atts['extra_classes'];\n $classes[] = 'element-' . $atts['margin_top'];\n $classes[] = 'element-' . $atts['margin_bottom'];\n if( $atts['scroll_animation'] !== 'none' ) {\n $classes[] = 'os-animation';\n }\n\n ob_start();\n include( locate_template( 'partials/shortcodes/audio.php' ) );\n $output = ob_get_contents();\n ob_end_clean();\n return $output;\n}", "public function the_audio_player( $args = array() ) {\n\t\t$default = array(\n\t\t\t'url' => '',\n\t\t\t'seek' => '',\n\t\t\t'player' => 'plyr',\n\t\t\t'download' => 'false',\n\t\t);\n\t\t$args = $args + $default;\n\t\t$post = $this->post;\n\n\t\tif ( '' === $args['url'] ) {\n\t\t\t$args['url'] = get_post_meta( $post->ID, 'sermon_audio', true );\n\t\t}\n\n\t\tif ( '' !== $args['url'] ) {\n\t\t\t$output = '<div class=\"sm-pro-sermon-audio-player sm-pro-sermon-audio-player-' . esc_attr( $args['player'] ) . '\">';\n\t\t\tif ( strtolower( 'WordPress' ) === $args['player'] ) {\n\t\t\t\t$attr = array(\n\t\t\t\t\t'src' => $args['url'],\n\t\t\t\t\t'preload' => 'none',\n\t\t\t\t);\n\n\t\t\t\t$output .= wp_audio_shortcode( $attr );\n\t\t\t} else {\n\t\t\t\t$extra_settings = '';\n\n\t\t\t\tif ( is_numeric( $args['seek'] ) ) {\n\t\t\t\t\t// Sanitation just in case.\n\t\t\t\t\t$extra_settings = 'data-plyr_seek=\\'' . intval( $args['seek'] ) . '\\'';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $args['download'] ) ) {\n\n\t\t\t\t\t$config_download = array(\n\t\t\t\t\t\t'urls' => array(\n\t\t\t\t\t\t\t'download' => $args['url'],\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'controls' => array(\n\t\t\t\t\t\t\t'download',\n\t\t\t\t\t\t\t'play-large',\n\t\t\t\t\t\t\t'play',\n\t\t\t\t\t\t\t'progress',\n\t\t\t\t\t\t\t'current-time',\n\t\t\t\t\t\t\t'mute',\n\t\t\t\t\t\t\t'volume',\n\t\t\t\t\t\t\t'captions',\n\t\t\t\t\t\t\t'settings',\n\t\t\t\t\t\t\t'pip',\n\t\t\t\t\t\t\t'airplay',\n\t\t\t\t\t\t\t'fullscreen',\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\n\t\t\t\t\t$extra_settings .= ' data-plyr-config=\\'' . json_encode( $config_download ) . '\\'';\n\t\t\t\t}\n\n\n\t\t\t\t$output .= '<audio controls preload=\"metadata\" class=\"wpfc-sermon-player ' . ( 'mediaelement' === $args['player'] ? 'mejs__player' : '' ) . '\" ' . $extra_settings . '>';\n\t\t\t\t$output .= '<source src=\"' . $args['url'] . '\">';\n\t\t\t\t$output .= '</audio>';\n\t\t\t}\n\n\t\t\t$output .= '</div>';\n\t\t} else {\n\t\t\t$output = '';\n\t\t}\n\n\t\t/**\n\t\t * Allows to filter the player HTML.\n\t\t *\n\t\t * @since 1.0.0-beta.1\n\t\t *\n\t\t * @param string $output The HTML.\n\t\t * @param \\WP_Post $post The sermon.\n\t\t * @param array $args The settings.\n\t\t */\n\t\techo apply_filters( 'smp/shortcodes/the_audio_player', $output, $post, $args );\n\t}", "function wibbitz_player_init($atts) {\n\n\t\t// Get all parameters\n\t\t$atts = shortcode_atts(array(\n\t\t\t'wibbitz-clip-id' => 'wibbitz-clip-id',\n\t\t\t'wibbitz-autoplay' => 'wibbitz-autoplay',\n\t\t\t'wibbitz-mute' => 'wibbitz-mute',\n\t\t\t'wibbitz-next' => 'wibbitz-next',\n\t\t\t'wibbitz-hovertounmute' => 'wibbitz-hovertounmute',\n\t\t\t'wibbitz-poster' => 'wibbitz-poster'\n\t\t), $atts);\n\n\t\t// Load static embed script\n\t\twp_enqueue_script('script', plugin_dir_url(__FILE__) . 'script.js');\n\n\t\t// Handle autoplay mute\n\t\tif ($atts['wibbitz-autoplay'] === \"true\" && $atts['wibbitz-mute'] === \"true\") {\n\t\t\treturn '<div wibbitz=\"wbtz-static-embed\" wibbitz-poster=\"' . $atts['wibbitz-poster'] . '\" wibbitz-clip-id=\"' . $atts['wibbitz-clip-id'] . '\" wibbitz-autoplay=\"' . $atts['wibbitz-autoplay'] . '\" wibbitz-mute=\"' . $atts['wibbitz-mute'] . '\" wibbitz-next=\"' . $atts['wibbitz-next'] . '\" wibbitz-hovertounmute=\"' . $atts['wibbitz-hovertounmute'] . '\"></div>';\n\t\t} else {\n\t\t\treturn '<div wibbitz=\"wbtz-static-embed\" wibbitz-poster=\"' . $atts['wibbitz-poster'] . '\" wibbitz-clip-id=\"' . $atts['wibbitz-clip-id'] . '\" wibbitz-autoplay=\"' . $atts['wibbitz-autoplay'] . '\" wibbitz-mute=\"' . $atts['wibbitz-mute'] . '\" wibbitz-next=\"' . $atts['wibbitz-next'] . '\"></div>';\n\t\t}\n\t}", "public function the_video_player( $args = array() ) {\n\t\t$default = array(\n\t\t\t'url' => '',\n\t\t\t'seek' => '',\n\t\t\t'player' => 'plyr',\n\t\t);\n\t\t$args = $args + $default;\n\t\t$post = $this->post;\n\n\t\tif ( ! is_string( $args['url'] ) || trim( $args['url'] ) === '' ) {\n\t\t\t$output = '';\n\t\t} else {\n\n\t\t\tif ( strpos( $args['url'], 'facebook.' ) !== false ) {\n\t\t\t\twp_enqueue_script( 'wpfc-sm-fb-player' );\n\n\t\t\t\tparse_str( parse_url( $args['url'], PHP_URL_QUERY ), $query );\n\n\t\t\t\t$output = '<div class=\"fb-video\" data-href=\"' . $args['url'] . '\" data-width=\"' . ( isset( $query['width'] ) ? ( is_numeric( $query['width'] ) ? $query['width'] : '600' ) : '600' ) . '\" data-allowfullscreen=\"' . ( isset( $query['fullscreen'] ) ? ( 'yes' === $query['width'] ? 'true' : 'false' ) : 'true' ) . '\"></div>';\n\t\t\t} else {\n\t\t\t\t$player = strtolower( \\SermonManager::getOption( 'player' ) ?: 'plyr' );\n\n\t\t\t\tif ( strtolower( 'WordPress' ) === $player ) {\n\t\t\t\t\t$attr = array(\n\t\t\t\t\t\t'src' => $args['url'],\n\t\t\t\t\t\t'preload' => 'none',\n\t\t\t\t\t);\n\n\t\t\t\t\t$output = wp_video_shortcode( $attr );\n\t\t\t\t} else {\n\t\t\t\t\t$is_youtube_long = strpos( strtolower( $args['url'] ), 'youtube.com' );\n\t\t\t\t\t$is_youtube_short = strpos( strtolower( $args['url'] ), 'youtu.be' );\n\t\t\t\t\t$is_youtube = $is_youtube_long || $is_youtube_short;\n\t\t\t\t\t$is_vimeo = strpos( strtolower( $args['url'] ), 'vimeo.com' );\n\t\t\t\t\t$extra_settings = '';\n\t\t\t\t\t$output = '';\n\n\t\t\t\t\tif ( is_numeric( $args['seek'] ) ) {\n\t\t\t\t\t\t// Sanitation just in case.\n\t\t\t\t\t\t$extra_settings = 'data-plyr_seek=\\'' . intval( $args['seek'] ) . '\\'';\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( 'plyr' === $player && ( $is_youtube || $is_vimeo ) ) {\n\t\t\t\t\t\t$output .= '<div data-type=\"' . ( $is_youtube ? 'youtube' : 'vimeo' ) . '\" data-video-id=\"' . $args['url'] . '\" class=\"wpfc-sermon-video-player video-' . ( $is_youtube ? 'youtube' : 'vimeo' ) . ( 'mediaelement' === $player ? 'mejs__player' : '' ) . '\" ' . $extra_settings . '></div>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$output .= '<video controls preload=\"metadata\" class=\"wpfc-sermon-video-player ' . ( 'mediaelement' === $player ? 'mejs__player' : '' ) . '\" ' . $extra_settings . '>';\n\t\t\t\t\t\t$output .= '<source src=\"' . $args['url'] . '\">';\n\t\t\t\t\t\t$output .= '</video>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Allows to filter the player HTML.\n\t\t *\n\t\t * @since 1.0.0-beta.1\n\t\t *\n\t\t * @param string $output The HTML.\n\t\t * @param \\WP_Post $post The sermon.\n\t\t * @param array $args The settings.\n\t\t */\n\t\techo apply_filters( 'smp/shortcodes/the_video_player', $output, $post, $args );\n\t}", "function kw_livestream_shortcode( $atts, $content = null )\r\n{\r\n\r\n \textract( shortcode_atts( array(\r\n 'layout' => '0',\r\n\t\t'autoplay' => 'true',\r\n\t\t'width' => '890',\r\n\t\t'height' => '639',\r\n\t\t'visibility' => 'public',\r\n\t\t'channel' => '',\r\n\t\t'color' => 'ffffff',\r\n\t\t'mute' => 'false',\r\n\t\t'iconover' => 'e7e7e7',\r\n\t\t'iconcolor' => 'cccccc',\r\n\t\t'allowchat' => 'false',\r\n\t\t'message' => ''\r\n \t), $atts ) );\r\n\t \r\n\t\t$layout = trim($layout);\r\n\t\t$autoplay = trim($autoplay);\r\n\t\t$width = trim($width);\r\n\t\t$height = trim($height);\r\n\t\t$visibility = trim($visibility);\r\n\t\t$channel = trim($channel);\r\n\t\t$color = trim($color);\r\n\t\t$mute = trim($mute);\r\n\t\t$iconover = trim($iconover);\r\n\t\t$iconcolor = trim($iconcolor);\r\n\t\t$allowchat = trim($allowchat);\r\n\t\t$message = trim($message);\r\n\t\r\n\t\t$color = str_replace(array('#','A','E','F','D','C','B'),array('','a','e','f','d','c','b'),$color);\r\n\t\t$iconcolor = str_replace(array('#','A','E','F','D','C','B'),array('','a','e','f','d','c','b'),$iconcolor);\r\n\t\t$iconover = str_replace(array('#','A','E','F','D','C','B'),array('','a','e','f','d','c','b'),$iconover);\r\n\r\n\t\tif ($visibility == \"user only\")\r\n\t\t{\r\n\t\t\tif ( is_user_logged_in() )\r\n\t\t\t{\r\n\t\t\t\treturn '<div style=\"width:'.$width.'px;height:'.$height.'px;border:3px solid #'.$color.'; border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-khtml-border-radius:5px\"><iframe src=\"http://cdn.livestream.com/embed/'.$channel.'?layout='.$layout.'&color=0x'.$color.'&autoPlay='.$autoplay.'&mute='.$mute.'&iconColorOver=0x'.$iconover.'&iconColor=0x'.$iconcolor.'&allowchat='.$allowchat.'&width='.$width.'&height='.$height.'\" width=\"'.$width.'\" height=\"'.$height.'\" style=\"border:0;outline:0\" frameborder=0 scrolling=no></iframe></div>&nbsp;';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo ''.$message.'';\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\treturn '<div style=\"width:'.$width.'px;height:'.$height.'px;border:3px solid #'.$color.'; border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-khtml-border-radius:5px\"><iframe src=\"http://cdn.livestream.com/embed/'.$channel.'?layout='.$layout.'&color=0x'.$color.'&autoPlay='.$autoplay.'&mute='.$mute.'&iconColorOver=0x'.$iconover.'&iconColor=0x'.$iconcolor.'&allowchat='.$allowchat.'&width='.$width.'&height='.$height.'\" width=\"'.$width.'\" height=\"'.$height.'\" style=\"border:0;outline:0\" frameborder=0 scrolling=no></iframe></div>&nbsp;';\r\n\t\t\t}\r\n\t\t\r\n}", "function tutv_zing_mp3_short_code() {\n\trequire 'template.php';\n\tdo_action( 'tutv_equeue_script_zing_mp3' );\n\n\treturn '';\n}", "function hewa_player_print_source_tag( $source, $type ) {\n\n $source_e = esc_attr( $source );\n $type_e = esc_attr( $type );\n echo \"<source src='$source_e' type='$type_e'>\";\n}", "function currencyExchangeView_shortcode()\n{\n\tob_start();\n\tinclude(CURRENCY_EXCHANGE_PLUGIN_DIR . \"/render/currencyConverterView.php\");\n\treturn ob_get_clean();\n}", "function vye_video_shortcode_alt1( $paras = '', $content = '' ) {\r\n\treturn do_shortcode( vye_video_shortcode( $paras, $content, '', 1 ) );\r\n}", "function vye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_shortcode = '' ) {\r\n\r\n\textract( shortcode_atts( array( 'type' => '', 'width' => '', 'height' => '', 'fullscreen' => '', 'related' => '', 'autoplay' => '', 'loop' => '', 'start' => '', 'info' => '', 'annotation' => '', 'cc' => '', 'style' => '', 'link' => '', 'react' => '', 'stop' => '', 'sweetspot' => '', 'disablekb' => '', 'ratio' => '', 'autohide' => '', 'controls' => '', 'profile' => '', 'embedplus' => '', 'audio' => '', 'id' => '', 'url' => '', 'rel' => '', 'fs' => '', \t'cc_load_policy' => '', 'iv_load_policy' => '', 'showinfo' => '', 'youtubeurl' => '', 'template' => '', 'list' => '', 'hd' => '', 'color' => '', 'theme' => '', 'ssl' => '', 'height' => '', 'width' => '', 'dynamic' => '', 'h' => '', 'w' => '', 'search' => '', 'user' => '', 'vq' => '' ), $paras ) );\r\n\r\n\t// If no profile specified and an alternative shortcode used, get that shortcodes default profile\r\n\r\n\tif ( ( $profile == '' ) && ( $alt_shortcode != '' ) ) {\r\n\r\n\t\t// Profile is now blank or 2\r\n\r\n\t\tif ( $alt_shortcode == '1' ) { $alt_shortcode = ''; }\r\n\r\n\t\t// Get general options\r\n\r\n\t\t$options = vye_set_general_defaults();\r\n\t\t$profile = $options[ 'alt_profile' . $alt_shortcode ];\r\n\t}\r\n\r\n\t// If an alternative field is set, use it\r\n\r\n\tif ( ( $id != '' ) && ( $content == '' ) ) { $content = $id; }\r\n\tif ( ( $url != '' ) && ( $content == '' ) ) { $content = $url; }\r\n\tif ( ( $youtubeurl != '' ) && ( $content == '' ) ) { $content = $youtubeurl; }\r\n\r\n\tif ( ( $h != '' ) && ( $height == '' ) ) { $height = $h; }\r\n\tif ( ( $w != '' ) && ( $width == '' ) ) { $width = $w; }\r\n\r\n\tif ( ( $rel != '' ) && ( $related == '' ) ) { $related = $rel;}\r\n\tif ( ( $fs != '' ) && ( $fullscreen == '' ) ) { $fullscreen = $fs;}\r\n\tif ( ( $cc_load_policy != '' ) && ( $cc == '' ) ) { $cc = $cc_load_policy;}\r\n\tif ( ( $iv_load_policy != '' ) && ( $annotation == '' ) ) { $annotation = $iv_load_policy;}\r\n\tif ( ( $showinfo != '' ) && ( $info == '' ) ) { $info = $showinfo;}\r\n\r\n\t// If ID was not passed in the content and the first parameter is set, assume that to be the ID\r\n\r\n\tif ( ( $content == '' ) && ( $paras[ 0 ] != '' ) ) {\r\n\t\t$content = $paras[ 0 ];\r\n\t\tif ( (substr( $content, 0, 1 ) == \":\" ) or ( substr( $content, 0, 1 ) == \"=\" ) ) { $content = substr( $content, 1 ); }\r\n\t\tif ( $paras[ 1 ] != '' ) { $width = $paras[ 1 ]; }\r\n\t\tif ( $paras[ 2 ] != '' ) { $height = $paras[ 2 ]; }\r\n\t}\r\n\r\n\t// Get Embed type\r\n\r\n\t$type = vye_get_embed_type( $type, $embedplus );\r\n\r\n\t// Set up Autohide parameter\r\n\r\n\t$autohide = vye_set_autohide( $autohide );\r\n\r\n\t// Create YouTube code\r\n\r\n\t$youtube_code = vye_generate_youtube_code( $content, $type, $width, $height, vye_convert( $fullscreen ), vye_convert( $related ), vye_convert( $autoplay ), vye_convert( $loop ), $start, vye_convert( $info ), vye_convert_3( $annotation ), vye_convert( $cc ), $style, vye_convert( $link ), vye_convert( $react ), $stop, vye_convert( $sweetspot ), vye_convert( $disablekb ), $ratio, $autohide, $controls, $profile, $list, vye_convert( $audio ), $template, vye_convert( $hd ), $color, $theme, vye_convert( $ssl ), vye_convert( $dynamic ), vye_convert( $search ), vye_convert( $user ), $vq );\r\n\r\n\treturn do_shortcode( $youtube_code );\r\n}", "function register_youtube_shortcode()\n{\n add_shortcode( 'youtube', 'youtube_callback_shortcode_qwe');\n}", "function resp_video( $atts ) {\n extract( shortcode_atts( array (\n 'embedlink' => ''\n ), $atts ) );\n return '<div class=\"videoWrapper\"><iframe src=\"' . $embedlink . '\" height=\"240\" width=\"320\" allowfullscreen=\"\" frameborder=\"0\"></iframe></div>';\n}", "function mediaplugin_filter_wmp_callback($link, $autostart=false) {\n $url = $link[1];\n if (empty($link[3]) or empty($link[4])) {\n $mpsize = '';\n $size = 'width=\"300\" height=\"260\"';\n $autosize = 'true';\n } else {\n $size = 'width=\"'.$link[3].'\" height=\"'.$link[4].'\"';\n $mpsize = $size;\n $autosize = 'false';\n }\n $mimetype = mimeinfo('type', $url);\n $autostart = $autostart ? 'true' : 'false';\n\n return $link[0].\n'<span class=\"mediaplugin mediaplugin_wmp\">\n<object classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" '.$mpsize.'\n standby=\"Loading Microsoft(R) Windows(R) Media Player components...\"\n type=\"application/x-oleobject\">\n <param name=\"Filename\" value=\"'.$url.'\" />\n <param name=\"src\" value=\"'.$url.'\" />\n <param name=\"url\" value=\"'.$url.'\" />\n <param name=\"ShowControls\" value=\"true\" />\n <param name=\"AutoRewind\" value=\"true\" />\n <param name=\"AutoStart\" value=\"'.$autostart.'\" />\n <param name=\"Autosize\" value=\"'.$autosize.'\" />\n <param name=\"EnableContextMenu\" value=\"true\" />\n <param name=\"TransparentAtStart\" value=\"false\" />\n <param name=\"AnimationAtStart\" value=\"false\" />\n <param name=\"ShowGotoBar\" value=\"false\" />\n <param name=\"EnableFullScreenControls\" value=\"true\" />\n<!--[if !IE]>-->\n <object data=\"'.$url.'\" type=\"'.$mimetype.'\" '.$size.'>\n <param name=\"src\" value=\"'.$url.'\" />\n <param name=\"controller\" value=\"true\" />\n <param name=\"autoplay\" value=\"'.$autostart.'\" />\n <param name=\"autostart\" value=\"'.$autostart.'\" />\n <param name=\"resize\" value=\"scale\" />\n </object>\n<!--<![endif]-->\n</object></span>';\n}", "function vsw_show_video($atts, $content = null) {\n\textract(shortcode_atts(array(\n\t \"id\" => ' ',\n\t\t\"source\" => ' ',\n\t\t\"width\" => ' ',\n\t\t\"height\" => ' ',\n\t\t\"autoplay\" => ' ',\n\t), $atts));\n\t\nreturn vsw_show_video_class($id,$source,$width,$height,$autoplay);\n}", "function html5_shortcode_demo($atts, $content = null)\n{\n return '<div class=\"shortcode-demo\">' . do_shortcode($content) . '</div>'; // do_shortcode allows for nested Shortcodes\n}", "function html5_shortcode_demo($atts, $content = null)\n{\n return '<div class=\"shortcode-demo\">' . do_shortcode($content) . '</div>'; // do_shortcode allows for nested Shortcodes\n}", "function html5_shortcode_demo($atts, $content = null)\n{\n return '<div class=\"shortcode-demo\">' . do_shortcode($content) . '</div>'; // do_shortcode allows for nested Shortcodes\n}", "function register_squaree_shortcode()\n{\n add_shortcode( 'squaree', 'squaree_callback_shortcode_qwe');\n}", "function sc_embed( $atts, $content = NULL ) {\n\textract( shortcode_atts( array( 'section_title' => '', 'responsive' => 'true', 'share' => '' ), $atts ) );\n\t$output = '';\n\t$share_link = '';\n\tif( !empty( $section_title ) ) $output .= '<h1 class=\"title-widget\">' . esc_attr( $section_title ) . '</h1>';\n\tif( !empty( $share ) ) $share_link = esc_attr( $share );\n\telse $output .= '<div class=\"alert alert-danger\">' . __( 'Source is undefined!', 'kazaz' ) . '</div>';\n\t$responsive_class = ( $responsive == 'false' ) ? 'embed' : 'video';\n\t$output .= '<div class=\"' . $responsive_class . '-container\">' . wp_oembed_get( $share_link ) . '</div>';\n\t\n\treturn $output;\n}", "function shortcode_youtube( $atts = array(), $content = NULL ) {\n \n\t $content = str_ireplace(\"http://www.youtube.com/watch?v=\", \"\", $content);\n\t\t$search1 = stripos($content, \"&\");\n\t\t$search2 = stripos($content, \"[/youtube]\"); \n\t\tif ($search1 != FALSE) {\n\t\t\t$junk = substr($content, $search1, $search2 - $search1);\n\t\t\t$content = str_replace($junk, \"\", $content);\n\t\t}\n\t\t\t\t\t\n\t\treturn '<iframe width=\"560\" height=\"349\" src=\"http://www.youtube.com/embed/'.$content.'\" frameborder=\"0\" allowfullscreen></iframe>';\n\t \n\t}", "function lms_letsmix_shortcode( $args = '', $content = '' ) {\r\n\r\n /*\r\n * If $args and $content are empty just return\r\n */\r\n if ( empty( $args ) && empty( $content ) ){\r\n return;\r\n } else {\r\n\r\n /*\r\n * If args is empty, grab $content instead\r\n */\r\n if ( empty( $args ) ){\r\n $args = html_entity_decode( $content, ENT_QUOTES );\r\n } else {\r\n /*\r\n * $args isn't empty, so let's process it\r\n */\r\n extract( shortcode_atts( array(\r\n 'url' => '',\r\n 'mix_id' => '',\r\n 'size' => '',\r\n 'autostart' => '',\r\n 'width' => '',\r\n 'height' => '',\r\n 'tracklist' => ''\r\n ),\r\n $args )\r\n );\r\n }\r\n\r\n /*\r\n * If we don't have a $url yet, but $content is not a number\r\n * we assume that $content is the url\r\n */\r\n if ( $url == \"\" and ( !is_numeric( $content ) ) ){\r\n $url = $content;\r\n } elseif ( is_numeric( $content ) ){\r\n /*\r\n * If $content is a number, it should be the mix_id\r\n */\r\n $mix_id = absint( $content );\r\n }\r\n\r\n /*\r\n * Still nothing? Give up and head back\r\n */\r\n if ( $url == \"\" && $mix_id == \"\" ){\r\n return;\r\n }\r\n\r\n /*\r\n * We have a URL, so let's parse it and grab the mix_id\r\n * but do a little checking along the way.\r\n * Element 1 has to be \"mix\"\r\n * Element 2 has to be a number\r\n */\r\n if ( $url != \"\" ){\r\n $url = parse_url( $url );\r\n if ( $url ){\r\n $split_url = explode( \"/\", $url['path'] );\r\n\r\n if ( !$split_url[1] == \"mix\" ){\r\n return;\r\n } else {\r\n if ( is_numeric( $split_url[2] ) ){\r\n $mix_id = absint( $split_url[2] );\r\n } else {\r\n return;\r\n }\r\n } // $url seems valid\r\n }\r\n } // $url is not empty\r\n $final_embed = lms_build_embed( $mix_id, $size, $autostart, $width, $height, $tracklist );\r\n } // $args & $content are not empty\r\n\r\n return $final_embed;\r\n}", "function alx_embed_html($html)\n {\n return '<div class=\"video-container\">' . $html . '</div>';\n }", "function vye_video_shortcode_alt2( $paras = '', $content = '' ) {\r\n\treturn do_shortcode( vye_video_shortcode( $paras, $content, '', 2 ) );\r\n}" ]
[ "0.62524664", "0.61430484", "0.6014259", "0.597064", "0.59329027", "0.5832651", "0.5770711", "0.5768822", "0.56632286", "0.5635953", "0.5634511", "0.5596097", "0.5582221", "0.5439882", "0.5295141", "0.52887905", "0.5287161", "0.52485037", "0.52427334", "0.52338445", "0.5181537", "0.5173643", "0.5173643", "0.5173643", "0.51556593", "0.51446205", "0.5131911", "0.51215106", "0.51175714", "0.51167804" ]
0.6676445
0
Print a source tag with the provided src and type attributes.
function hewa_player_print_source_tag( $source, $type ) { $source_e = esc_attr( $source ); $type_e = esc_attr( $type ); echo "<source src='$source_e' type='$type_e'>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function source($src = '')\n {\n return '<source src=\"'.$src.'\" />';\n }", "function getSource($media, array $options);", "public function setSrc($src)\n\t{\n\t\t$this->_src = $src;\n\t}", "public function media($type = '', $src = '', $attributes = [])\n {\n if(!in_array($type, ['audio', 'video'])) {\n return '';\n }\n\n $html = '';\n $sources = '';\n\n if(is_string($src)) {\n $attributes['src'] = $src;\n } elseif(is_array($src)) {\n while(list($k, $source) = each($src)) {\n $sources .= $this->source($source);\n }\n } \n $html = '<'.$type.$this->attributes($attributes).'>'.$sources;\n $html .= 'Your browser does not support the '.$type.' element.</'.$type.'>';\n\n return $html; \n }", "public function __construct($src = null, $type = null, $lazy = false) {\n parent::__construct('source');\n if ($src !== null) {\n $this->setSrc($src);\n }\n if ($type !== null) {\n $this->setType($type);\n }\n $this->setLazy($lazy);\n }", "public static function src(string ...$subs): string\n {\n return self::build(self::base(), 'src', ...$subs);\n }", "function show_source ($file_name, $return) {}", "public function imgSrc( $type )\r\n\t{\r\n\t}", "public function attrib_src($data) {\n return $this->process($data, function(\\SimpleXMLElement $obj) : string {\n return (string) $obj->attributes()['src'];\n });\n }", "public function sourceable();", "public function getSrc() {\n return $this->attrs()->get('src');\n }", "public function getSource();", "public function getSource();", "public function getSource();", "public function getSource();", "function getSourceType($media, array $options);", "public function print_script( $src ) {\n\n\t\tif ( defined( 'TVE_DEBUG' ) && TVE_DEBUG ) {\n\t\t\t$src = preg_replace( '#\\.min\\.js$#', '.js', $src );\n\t\t}\n\n\t\t$src .= '?v=' . TVE_Ult_Const::PLUGIN_VERSION;\n\n\t\t?>\t\t<script type=\"text/javascript\" src=\"<?php echo $src ?>\"></script><?php\n\t}", "public function set($src) {\n $src = str_replace('+','%27',urldecode($this->modx->getOption('src',$this->config,'')));\n if (empty($src)) return '';\n return $this->setSourceFilename($src);\n }", "public function renderThumbnailSrc()\n {\n printf($this->getRelativePath(true), $this->thumbnail_file_name);\n }", "public function getSrc()\n\t{\n\t\treturn $this->_src;\n\t}", "public function display($source = null)\n {\n if (is_null($source)) {\n $source = ob_get_clean();\n }\n echo $this->fetch($source);\n if ($this->configs['debug']) {\n echo $this->logger->report($this->log_reporting());\n }\n }", "abstract public function getSource();", "public function renderImageSrc()\n {\n printf($this->getRelativePath(), $this->image_file_name);\n }", "public function __construct($src)\n\t{\n\t\t$this->src = $src;\n\t}", "public function source($url);", "public function setSource($source);", "public function setSource($source);", "public function setSource($source);", "public function showSource(){\r\n echo \"course.php\";\r\n show_source(__FILE__);\r\n }", "public function src()\n\t{\n\t\treturn $this->src;\n\t}" ]
[ "0.7283732", "0.59144586", "0.58289355", "0.58285505", "0.5787286", "0.57783324", "0.5747031", "0.57085544", "0.56691337", "0.552261", "0.55045956", "0.5503398", "0.5503398", "0.5503398", "0.5503398", "0.5500411", "0.5408976", "0.53744215", "0.5361549", "0.5331015", "0.5323382", "0.5292623", "0.5290549", "0.528512", "0.5253192", "0.523636", "0.523636", "0.523636", "0.5223928", "0.51821065" ]
0.7924171
0
Deletes the collections for all models that were loaded using the loadMongoFixtures method.
public static function clearMongoDatabase() { foreach (self::$_models as $model) { if (substr($model->useDbConfig, 0, 5) !== 'test_') { throw new InternalErrorException('Tried to clear fixturedata for model ' . $model->alias . ', but it is currently not using a test datasource.'); } $collections = $model->listSources(); /** * @var MongoCollection $collection */ foreach ($collections as $collection) { $collection->drop(); }; } self::$_models = array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dropAllCollections() {\n\t\tforeach (array_keys($this->fixture) as $collection) {\n\t\t\t$this->connection->collection($collection)->drop();\n\t\t}\n\t\treturn $this;\n\t}", "protected function tearDown()\n {\n foreach ($this->loadedFixtures as $fixture) {\n unlink($fixture);\n }\n\n parent::tearDown();\n }", "public static function deleteTestCollection()\n\t{\n\t\tKinvey::deleteCollection(array(\n\t\t\t'collection' => 'widgets',\n\t\t\t'authMode' => 'admin',\n\t\t));\n\t}", "protected static function _deleteFixtures($fixtures)\n {\n //phpcs:enable\n foreach ($fixtures as $fixture) {\n self::deleteFixture($fixture, true);\n }\n }", "public function delete_tweets_collection()\r\t{\r\t\t$this->mongo_db->drop_collection('tweets');\r\t}", "public function testDeleteAll()\n {\n $models = array();\n for ($i = 0; $i < 10; $i++) {\n $models[] = array(\n 'hash_before' => md5(uniqid()),\n 'hash_after' => md5(uniqid()),\n );\n }\n\n $this->createModels('tiny_compressimages/image', $models);\n\n $this->assertEquals(10, $this->_instance->getCollection()->getSize());\n\n $this->_instance->deleteAll();\n\n $this->assertEquals(0, $this->_instance->getCollection()->getSize());\n }", "protected function tearDown(): void\n {\n $fixtureNamespace = self::_getFixtureNamespace();\n if (isset(self::$_methodLevelFixtures[$fixtureNamespace])\n && count(self::$_methodLevelFixtures[$fixtureNamespace])\n ) {\n self::_deleteFixtures(self::$_methodLevelFixtures[$fixtureNamespace]);\n }\n $this->_callModelsDelete();\n $this->_restoreAppConfig();\n parent::tearDown();\n }", "protected function tearDown()\n {\n $dataMapper = $this->getDataMapper();\n foreach ($this->testModules as $module) {\n $dataMapper->delete($module);\n }\n }", "public static function tearDownAfterClass()\n\t{\n\t\t// Remove our testing database before writing tests.\n\t\t$mongo = new Mongo;\n\n\t\t$config = Kohana::$config->load(\"mundo\");\n\n\t\t// Select our database\n\t\t$db = $mongo->{$config->database};\n\n\t\t// Drop it like it's hot.\n\t\t$db->drop();\n\t}", "public function tearDown() {\n try {\n $this->xpdo->manager->removeObjectContainer('sti.baseClass');\n $this->xpdo->manager->removeObjectContainer('sti.relClassOne');\n\t\t\t$this->xpdo->manager->removeObjectContainer('sti.relClassMany');\n } catch (Exception $e) {\n $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage(), '', __METHOD__, __FILE__, __LINE__);\n }\n parent::tearDown();\n }", "public function tearDown()\n {\n $this->schema('default')->drop('users');\n $this->schema('default')->drop('channels');\n $this->schema('default')->drop('threads');\n }", "public function deleteAll()\n {\n $this->delete();\n foreach ($this->_model->related as $name => $info) {\n $model = $this->_model->getRelated($name)->getModel();\n $model->cache->delete();\n }\n }", "protected function _cleanup()\n {\n $modelFiles = Doctrine_Core::getLoadedModelFiles();\n $filesToClean = array_diff($modelFiles, $this->_startingModelFiles);\n\n foreach ($filesToClean as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n\n // clean up tmp directories\n Doctrine_Lib::removeDirectories($this->_tmpPath . DIRECTORY_SEPARATOR . strtolower(self::$_fromPrefix) . '_doctrine_tmp_dirs');\n Doctrine_Lib::removeDirectories($this->_tmpPath . DIRECTORY_SEPARATOR . strtolower(self::$_toPrefix) . '_doctrine_tmp_dirs');\n }", "protected function ___clear() {\n\t\t$this->models = [];\n\t}", "public function tearDown()\n {\n // Remove all tmp files\n $files = glob($this->getFixturesPath('tmp') . '/*');\n foreach ($files as $file) {\n if (is_file($file)) {\n @unlink($file);\n }\n }\n }", "protected function tearDown() {\n Book::deleteAll();\n Author::deleteAll();\n }", "protected function tearDown(): void\n {\n Tenant::all()->each->delete();\n }", "protected function tearDown() {\n Book::deleteAll();\n Author::deleteAll();\n BookList::deleteAll();\n }", "private function cleanDatabase()\n {\n // sets foreign key checks to zero\n // TODO: needs to removed before going live\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach ($this->tables as $table)\n {\n DB::table($table)->truncate();\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function clearDatabases();", "public function actionReset()\n {\n $this->unloadFixtures();\n $this->generateFixtures();\n $this->loadFixtures();\n }", "public function tearDown()\n {\n \\r\\tableDrop(PersistentObject::collectionName())->run($this->fixture->getConnection()->getHandle());\n\n parent::tearDown();\n }", "protected function tearDown() {\n\n $contacts = Contacts::getMultiple();\n foreach ( $contacts->contacts as $contact ) {\n Contacts::delete( $contact->contact_id );\n }\n }", "public function tearDown()\n\t{\n\t\tunset($this->_collectionMock);\n\t}", "public function tearDown()\n\t{\n\t\ttry\n\t\t{\n\t\t\tself::deleteTestCollection();\n\t\t}\n\t\tcatch (KinveyResponseException $e){}\n\n\t\t$users = Kinvey::query(array('collection' => 'user', 'username' => '[email protected]'));\n\t\tif (!empty($users)) Kinvey::deleteEntity(array('collection' => 'user', '_id' => $users[0]['_id'], 'authMode' => 'admin', 'hard' => 'true'));\n\t}", "public function tearDown()\n\t{\n\t\t// stop mocking any classes we are currently mocking\n\t\tMockery::close();\n\n\t\t// delete models that we have saved to the db\n\t\t// note: this happens in the reverse order as they were created\n\t\tself::$factoryMuffin->deleteSaved();\n\n\t\t// run any extraneous cleanup routines we have\n\t\t$this->cleanup();\n\n\t\t// if we seeded the db, then migrate down, thus unseeding the db\n\t\tif ($this->seeded)\n\t\t{\n\t\t\t$this->migrateDown();\n\t\t\t$this->seeded = false;\n\t\t\t$this->migrated = false;\n\t\t}\n\n\t\tparent::tearDown();\n\t}", "function clean_database(){\n\t\t$models = array(\n\t\t\t'Album',\n\t\t\t'AlbumDetail',\n\t\t\t'AlbumSubGenre',\n\t\t\t'AlbumImage',\n\t\t\t'AlbumMonthlyGenreChart',\n\t\t\t'AlbumMonthlyGenreChartArchive',\n\t\t\t'AlbumMonthlySubGenreChart',\n\t\t\t'AlbumMonthlySubGenreChartArchive',\n\t\t\t'AlbumStat',\n\t\t\t'AlbumTrack',\n\t\t\t'AlbumWeeklyGenreChart',\n\t\t\t'AlbumWeeklyGenreChartArchive',\n\t\t\t'AlbumWeeklySubGenreChart',\n\t\t\t'AlbumWeeklySubGenreChartArchive',\n\t\t\t'Band',\n\t\t\t'BandSubGenre',\n\t\t\t'BandViolation',\n\t\t\t'Label',\n\t\t\t'Song',\n\t\t\t'SongMonthlyGenreChart',\n\t\t\t'SongMonthlyGenreChartArchive',\n\t\t\t'SongMonthlySubGenreChart',\n\t\t\t'SongMonthlySubGenreChartArchive',\n\t\t\t'SongStat',\n\t\t\t'SongWeeklyGenreChart',\n\t\t\t'SongWeeklyGenreChartArchive',\n\t\t\t'SongWeeklySubGenreChart',\n\t\t\t'SongWeeklySubGenreChartArchive',\n\t\t\t'SystemNotes',\n\t\t\t'Violations',\t\n\t\t\t'RadioStationPlaylist',\n\t\t\t'RadioStationPlaylistArchive',\n\t\t\t'RadioStaffPlaylist',\n\t\t\t'RadioStaffPlaylistArchive',\n\t\t);\n\n\t\tforeach($models as $model){\n\t\t\t$this->loadModel($model);\n\t\t\t$this->$model->truncate();\n\t\t}\n\t}", "protected static function _unsetFixtureNamespace()\n {\n //phpcs:enable\n $fixturesNamespace = self::_getFixtureNamespace();\n unset(self::$_fixtures[$fixturesNamespace]);\n self::$_fixturesNamespace = null;\n }", "public function purge(){\n\n $escenarios=$this->escenarios;\n $this->precondiciones()->detach();\n $this->aserciones()->detach(); \n \n foreach ($escenarios as $key => $escenario) {\n $escenario->purge();\n }\n\n $this->delete();\n }", "public function tearDown() {\n\t\tunset($this->reflectionClassPropertyNames);\n\t\tunset($this->persitenceManagerMock);\n\t\tunset($this->reflectionServiceMock);\n\t\tunset($this->fixture);\n\t}" ]
[ "0.6945584", "0.67580354", "0.6573425", "0.65411", "0.63836396", "0.63593715", "0.63413703", "0.63039553", "0.62719405", "0.62431633", "0.6222049", "0.61965066", "0.61832035", "0.6158866", "0.61385226", "0.61200404", "0.60928774", "0.60898626", "0.6071194", "0.6058865", "0.6056372", "0.60445946", "0.6036909", "0.60349977", "0.60260385", "0.6001643", "0.60013866", "0.5952532", "0.5950083", "0.59458375" ]
0.81806284
0
Store component configuration just like webform would do it. The values are already at their proper places in `$form_state['values']` because the `parents` array is provided in `_webform_edit_opt_in()`.
public function configurationSubmit(&$form, &$form_state) { $component = $form_state['values']; ArrayConfig::mergeDefaults($component, $this->element['#webform_component']); $this->element['#webform_component'] = $component; parent::configurationSubmit($form, $form_state); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getConfigFormValues()\n {;\n return array(\n 'MYMODULE_LOCATION_LAT' => Configuration::get('MYMODULE_LOCATION_LAT', true),\n 'MYMODULE_LOCATION_LNG' => Configuration::get('MYMODULE_LOCATION_LNG', true),\n 'MYMODULE_LOCATION_ICON' => Configuration::get('MYMODULE_LOCATION_ICON', true),\n 'MYMODULE_LOCATION_CENTER_LAT' => Configuration::get('MYMODULE_LOCATION_CENTER_LAT', true),\n 'MYMODULE_LOCATION_CENTER_LNG' => Configuration::get('MYMODULE_LOCATION_CENTER_LNG', true),\n 'MYMODULE_LOCATION_ZOOM' => Configuration::get('MYMODULE_LOCATION_ZOOM', true),\n );\n }", "function environments_task_rules_component_settings(array $form_state) {\n $form = array();\n $task = isset($form_state['task']) ? $form_state['task'] : NULL;\n\n $form['components'] = array(\n '#name' => 'settings[components]',\n '#type' => 'select',\n '#title' => t('Components'),\n '#description' => t('You can select one or more Rules \"Action\" components.'),\n '#multiple' => TRUE,\n '#options' => _environments_get_rules_components(),\n '#empty_option' => ' -' . t('Select components') . '- ',\n '#default_value' => isset($task['settings']['components']) ? $task['settings']['components'] : array(),\n );\n\n $form['enable'] = array(\n '#name' => 'settings[enable]',\n '#type' => 'checkbox',\n '#title' => t('Enable Rules'),\n '#description' => t(\"If checked, the Rules module will be explicitly enabled. Otherwise, it\\'s up to you to make sure it's enabled when this task runs! This task will fail if Rules is not enabled.\"),\n '#default_value' => isset($task['settings']['enable']) ? $task['settings']['enable'] : TRUE,\n );\n\n return $form;\n}", "protected function getConfigFormValues()\n {\n return array(\n 'PS_CITIES_LIVE_MODE' => Configuration::get('PS_CITIES_LIVE_MODE', true),\n 'PS_CITIES_ACCOUNT_EMAIL' => Configuration::get('PS_CITIES_ACCOUNT_EMAIL', '[email protected]'),\n 'PS_CITIES_ACCOUNT_PASSWORD' => Configuration::get('PS_CITIES_ACCOUNT_PASSWORD', null),\n );\n }", "function oa_jira_collector_widget_edit_form_submit($form, &$form_state) {\n foreach (array_keys($form_state['plugin']['defaults']) as $key) {\n if (isset($form_state['values'][$key])) {\n $form_state['conf'][$key] = $form_state['values'][$key];\n }\n }\n}", "protected function populateState() {\n\t\t$app = JFactory::getApplication('administrator');\n\n\t\tif (!($extension = $app->getUserState('com_flexicontent.edit.'.$this->getName().'.extension'))) {\n\t\t\t$extension = JRequest::getCmd('extension', 'com_flexicontent');\n\t\t}\n\t\t// Load the User state.\n\t\tif (!($pk = (int) $app->getUserState('com_flexicontent.edit.'.$this->getName().'.id'))) {\n\t\t\t$cid = JRequest::getVar('cid', array(0));\n\t\t\t$pk = (int)$cid[0];\n\t\t}\n\t\t$this->setState($this->getName().'.id', $pk);\n\n\n\t\t$this->setState('com_flexicontent.type.extension', $extension);\n\t\t$parts = explode('.',$extension);\n\t\t// extract the component name\n\t\t$this->setState('com_flexicontent.type.component', $parts[0]);\n\t\t// extract the optional section name\n\t\t$this->setState('com_flexicontent.type.section', (count($parts)>1)?$parts[1]:null);\n\n\t\t// Load the parameters.\n\t\t//$params\t= JComponentHelper::getParams('com_flexicontent');\n\t\t//$this->setState('params', $params);\n\t}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Live mode'),\n 'name' => 'PS_CITIES_LIVE_MODE',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in live mode'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a valid email address'),\n 'name' => 'PS_CITIES_ACCOUNT_EMAIL',\n 'label' => $this->l('Email'),\n ),\n array(\n 'type' => 'password',\n 'name' => 'PS_CITIES_ACCOUNT_PASSWORD',\n 'label' => $this->l('Password'),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "public function configurationForm(array $form, FormStateInterface $form_state);", "public function buildConnectorConfigForm(array &$form, FormStateInterface $form_state) {\n $form['connector_config'] = [];\n\n $connector_id = $this->configuration['connector'];\n if ($connector_id) {\n $connector = $this->solrConnectorPluginManager->createInstance($connector_id, $this->configuration['connector_config']);\n if ($connector instanceof PluginFormInterface) {\n $form_state->set('connector', $connector_id);\n if ($form_state->isRebuilding()) {\n drupal_set_message($this->t('Please configure the selected Solr connector.'), 'warning');\n }\n // Attach the Solr connector plugin configuration form.\n $connector_form_state = SubformState::createForSubform($form['connector_config'], $form, $form_state);\n $form['connector_config'] = $connector->buildConfigurationForm($form['connector_config'], $connector_form_state);\n\n // Modify the backend plugin configuration container element.\n $form['connector_config']['#type'] = 'details';\n $form['connector_config']['#title'] = $this->t('Configure %plugin Solr connector', array('%plugin' => $connector->label()));\n $form['connector_config']['#description'] = $connector->getDescription();\n $form['connector_config']['#open'] = TRUE;\n }\n }\n $form['connector_config'] += ['#type' => 'container'];\n $form['connector_config']['#attributes'] = [\n 'id' => 'search-api-solr-connector-config-form',\n ];\n $form['connector_config']['#tree'] = TRUE;\n\n }", "protected function getConfigFormValues()\n {\n return array(\n 'AUTOLOGINBACKOFFICE_EMPLOYEE' => Configuration::get('AUTOLOGINBACKOFFICE_EMPLOYEE', '1'),\n 'AUTOLOGINBACKOFFICE_SHOP' => Configuration::get('AUTOLOGINBACKOFFICE_SHOP', '1')\n );\n }", "function modbus_chart_table_report_content_type_edit_form_submit($form, &$form_state) {\r\n foreach (array_keys($form_state['plugin']['defaults']) as $key) {\r\n $form_state['conf'][$key] = $form_state['values'][$key];\r\n }\r\n}", "protected function getConfigFormValues()\n {\n return array(\n 'MYCONFIGURATOR_LIVE_MODE' => Configuration::get('MYCONFIGURATOR_LIVE_MODE', true),\n 'MYCONFIGURATOR_ACCOUNT_EMAIL' => Configuration::get('MYCONFIGURATOR_ACCOUNT_EMAIL', '[email protected]'),\n 'MYCONFIGURATOR_ACCOUNT_PASSWORD' => Configuration::get('MYCONFIGURATOR_ACCOUNT_PASSWORD', null),\n );\n }", "function vih_plugins_node_submitted_content_type_edit_form_submit($form, &$form_state) {\n // Copy everything from our defaults.\n foreach (array_keys($form_state['plugin']['defaults']) as $key) {\n $form_state['conf'][$key] = $form_state['values'][$key];\n }\n}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Live mode'),\n 'name' => 'MYCONFIGURATOR_LIVE_MODE',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in live mode'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a valid email address'),\n 'name' => 'MYCONFIGURATOR_ACCOUNT_EMAIL',\n 'label' => $this->l('Email'),\n ),\n array(\n 'type' => 'password',\n 'name' => 'MYCONFIGURATOR_ACCOUNT_PASSWORD',\n 'label' => $this->l('Password'),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function ctools_user_contact_content_type_edit_form_submit(&$form, &$form_state) {\n // Copy everything from our defaults.\n/*\n foreach (array_keys($form_state['plugin']['defaults']) as $key) {\n $form_state['conf'][$key] = $form_state['values'][$key];\n }\n*/\n}", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Move on hover'),\n 'name' => 'SOCIALSIDEBAR_HOVER',\n 'is_bool' => true,\n 'desc' => $this->l('Disable hover animations'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled'),\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled'),\n ),\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Hide on mobile'),\n 'name' => 'SOCIALSIDEBAR_MOBILE',\n 'is_bool' => true,\n 'desc' => $this->l('Disable on mobile'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Enabled'),\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Disabled'),\n ),\n ),\n ),\n array(\n 'type' => 'radio',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Select sidebar position'),\n 'name' => 'SOCIALSIDEBAR_POSITION',\n 'label' => $this->l('Sidebar Position'),\n 'values' => array(\n array(\n 'id' => 'left',\n 'value' => null,\n 'label' => $this->getTranslator()->trans('Left', array(), 'Modules.Socialsidebar.Admin'),\n ),\n array(\n 'id' => 'right',\n 'value' => true,\n 'label' => $this->getTranslator()->trans('Right', array(), 'Modules.Socialsidebar.Admin'),\n ),\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a Facebook profile address '),\n 'name' => 'SOCIALSIDEBAR_FACEBOOK',\n 'label' => $this->l('Facebook'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a Instagram profile address '),\n 'name' => 'SOCIALSIDEBAR_INSTAGRAM',\n 'label' => $this->l('Instagram'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a Youtube chanel address'),\n 'name' => 'SOCIALSIDEBAR_YOUTUBE',\n 'label' => $this->l('Youtube'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a Twitter profile addres'),\n 'name' => 'SOCIALSIDEBAR_TWITTER',\n 'label' => $this->l('Twitter'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a Tumbrl profile addres'),\n 'name' => 'SOCIALSIDEBAR_TUMBRL',\n 'label' => $this->l('Tumbrl'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a Printerest profile addres'),\n 'name' => 'SOCIALSIDEBAR_PRINTEREST',\n 'label' => $this->l('PRINTEREST'),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-envelope\"></i>',\n 'desc' => $this->l('Enter a LinkedIn profile addres'),\n 'name' => 'SOCIALSIDEBAR_LINKEDIN',\n 'label' => $this->l('Linkedin'),\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'switch',\n 'label' => $this->l('Production mode'),\n 'name' => 'COCOLIS_LIVE_MODE',\n 'is_bool' => true,\n 'desc' => $this->l('Use this module in development (sandbox) or production mode?'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Production mode enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Production mode disabled')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Debug mode'),\n 'name' => 'COCOLIS_DEBUG_MODE',\n 'is_bool' => true,\n 'desc' => $this->l('In case of problems you can activate this option to help the Cocolis development team to solve anomalies'),\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => true,\n 'label' => $this->l('Debug mode enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => false,\n 'label' => $this->l('Debug mode disabled')\n )\n ),\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'name' => 'COCOLIS_WIDTH',\n 'label' => $this->l('Average width (in cm)'),\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'name' => 'COCOLIS_HEIGHT',\n 'label' => $this->l('Average height (in cm)'),\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'name' => 'COCOLIS_LENGTH',\n 'label' => $this->l('Average length (in cm)'),\n 'desc' => $this->l(\"Permet de calculer les frais en l'absence du volume renseigné \n dans la fiche produit\")\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'name' => 'COCOLIS_ADDRESS',\n 'label' => $this->l('Your address'),\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'name' => 'COCOLIS_ZIP',\n 'label' => $this->l('Your postal code'),\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'name' => 'COCOLIS_CITY',\n 'label' => $this->l('Your city'),\n ),\n array(\n 'col' => 1,\n 'type' => 'text',\n 'name' => 'COCOLIS_COUNTRY',\n 'label' => $this->l('Your country'),\n ),\n array(\n 'col' => 4,\n 'type' => 'text',\n 'prefix' => '<i class=\"icon icon-terminal\"></i>',\n 'desc' => $this->l(\"Enter the app-id provided to you\"),\n 'name' => 'COCOLIS_APPID',\n 'label' => $this->l(\"Application ID\"),\n ),\n array(\n 'type' => 'password',\n 'name' => 'COCOLIS_PASSWORD',\n 'label' => $this->l('Password'),\n )\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "private function storeConfig() {\n global $DB;\n\n if (count($this->configs)) {\n $existing = $DB->request(\n \"glpi_configs\", [\n 'context' => $this->context,\n 'name' => array_keys($this->configs)\n ]\n );\n foreach ($existing as $conf) {\n unset($this->configs[$conf['name']]);\n }\n if (count($this->configs)) {\n Config::setConfigurationValues($this->context, $this->configs);\n $this->displayMessage(sprintf(\n __('Configuration values added for %1$s.'),\n implode(', ', array_keys($this->configs))\n ));\n }\n }\n }", "function og_menu_single_pane_edit_form_submit($form, &$form_state) {\n foreach (array_keys($form_state['values']) as $key) {\n if (isset($form_state['values'][$key])) {\n if ($key == 'og_menu_single_parent') {\n $form_state['values'][$key] = substr($form_state['values'][$key], strpos($form_state['values'][$key], ':') + 1);\n }\n $form_state['conf'][$key] = $form_state['values'][$key];\n }\n }\n}", "protected function getConfigFormValues()\n {\n return array(\n 'COCOLIS_LIVE_MODE' => Configuration::get('COCOLIS_LIVE_MODE', true),\n 'COCOLIS_DEBUG_MODE' => Configuration::get('COCOLIS_DEBUG_MODE', false),\n 'COCOLIS_APPID' => Configuration::get('COCOLIS_APPID', 'app_id'),\n 'COCOLIS_PASSWORD' => Configuration::get('COCOLIS_PASSWORD', null),\n 'COCOLIS_ZIP' => Configuration::get('COCOLIS_ZIP', null),\n 'COCOLIS_HEIGHT' => Configuration::get('COCOLIS_HEIGHT', null),\n 'COCOLIS_WIDTH' => Configuration::get('COCOLIS_WIDTH', null),\n 'COCOLIS_LENGTH' => Configuration::get('COCOLIS_LENGTH', null),\n 'COCOLIS_ADDRESS' => Configuration::get('COCOLIS_ADDRESS', null),\n 'COCOLIS_CITY' => Configuration::get('COCOLIS_CITY', null),\n 'COCOLIS_COUNTRY' => Configuration::get('COCOLIS_COUNTRY', null)\n );\n }", "public function updateContextConfigurationForm($form_element, FormStateInterface $form_state, &$form) {\n if ($values = $form_state->getValues()) {\n // This callback breaks out of the subform, so be sure to respect the\n // array parents.\n $parents = $form_element['#parents'];\n // Remove 'context_values' and append 'allowed_plugins' instead.\n array_pop($parents);\n $parents[] = 'allowed_plugins';\n $value = NestedArray::getValue($values, $parents);\n // Sometimes delimiters end up with \\n instead of \\r\\n.\n $this->configuration['allowed_plugins'] = explode(\"\\n\", str_replace(\"\\r\\n\", \"\\n\", $value));\n\n list($used_context, $used_by_plugins) = $this->getSocialShareLinkManager()\n ->getMergedContextDefinitions($this->configuration['allowed_plugins']);\n }\n\n $form_element = $this->buildContextConfigurationForm($form_element, $form_state, $this->configuration, $used_context, $used_by_plugins);\n $form_element['context_values']['#type'] = 'fieldset';\n $form_element['context_values']['#title'] = $this->t('Social link plugin configuration');\n\n return $form_element;\n }", "function panels_panel_context_edit_settings($form, &$form_state) {\n $conf = $form_state['handler']->conf;\n $form['conf']['title'] = array(\n '#type' => 'textfield',\n '#default_value' => $conf['title'],\n '#title' => t('Administrative title'),\n '#description' => t('Administrative title of this variant.'),\n );\n\n $form['conf']['no_blocks'] = array(\n '#type' => 'checkbox',\n '#default_value' => $conf['no_blocks'],\n '#title' => t('Disable Drupal blocks/regions'),\n '#description' => t('Check this to have the page disable all regions displayed in the theme. Note that some themes support this setting better than others. If in doubt, try with stock themes to see.'),\n );\n\n $form['conf']['body_classes_to_remove'] = array(\n '#type' => 'textfield',\n '#size' => 128,\n '#default_value' => $conf['body_classes_to_remove'],\n '#title' => t('Remove body CSS classes'),\n '#description' => t('The CSS classes to remove from the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars.'),\n );\n\n $form['conf']['body_classes_to_add'] = array(\n '#type' => 'textfield',\n '#size' => 128,\n '#default_value' => $conf['body_classes_to_add'],\n '#title' => t('Add body CSS classes'),\n '#description' => t('The CSS classes to add to the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars.'),\n );\n\n ctools_include('plugins', 'panels');\n $pipelines = panels_get_renderer_pipelines();\n\n // Handle backward compatibility with the IPE checkbox.\n if (empty($conf['pipeline'])) {\n $conf['pipeline'] = !empty($conf['use_ipe']) ? 'ipe' : 'standard';\n }\n\n // If there are no pipelines, that probably means we're operating in\n // legacy mode.\n if (empty($pipelines)) {\n // We retain the original pipeline so we don't wreck things by installing\n // old modules.\n $form['conf']['pipeline'] = array(\n '#type' => 'value',\n '#value' => $conf['pipeline'],\n );\n }\n else {\n $options = array();\n foreach ($pipelines as $name => $pipeline) {\n $options[$name] = check_plain($pipeline->admin_title) . '<div class=\"description\">' . check_plain($pipeline->admin_description) . '</div>';\n }\n\n $form['conf']['pipeline'] = array(\n '#type' => 'radios',\n '#options' => $options,\n '#title' => t('Renderer'),\n '#default_value' => $conf['pipeline'],\n );\n }\n\n $form['conf']['css_id'] = array(\n '#type' => 'textfield',\n '#size' => 35,\n '#default_value' => $conf['css_id'],\n '#title' => t('CSS ID'),\n '#description' => t('The CSS ID to apply to this page'),\n );\n\n $form['conf']['css'] = array(\n '#type' => 'textarea',\n '#title' => t('CSS code'),\n '#description' => t('Enter well-formed CSS code here; this code will be embedded into the page, and should only be used for minor adjustments; it is usually better to try to put CSS for the page into the theme if possible. This CSS will be filtered for safety so some CSS may not work.'),\n '#default_value' => $conf['css'],\n );\n\n return $form;\n}", "public function settingsForm(array $form, FormStateInterface $form_state);", "public function settingsForm(array $form, FormStateInterface $form_state);", "public function stateAction()\n {\n $configState = array(\n $this->getRequest()->getParam('container') => $this->getRequest()\n ->getParam('value')\n );\n $this->_saveState($configState);\n }", "protected function getConfigFormValues()\n {\n return array(\n 'SOCIALSIDEBAR_HOVER' => Configuration::get('SOCIALSIDEBAR_HOVER', true),\n 'SOCIALSIDEBAR_MOBILE' => Configuration::get('SOCIALSIDEBAR_MOBILE', true),\n 'SOCIALSIDEBAR_FACEBOOK' => Configuration::get('SOCIALSIDEBAR_FACEBOOK', null),\n 'SOCIALSIDEBAR_INSTAGRAM' => Configuration::get('SOCIALSIDEBAR_INSTAGRAM', null),\n 'SOCIALSIDEBAR_YOUTUBE' => Configuration::get('SOCIALSIDEBAR_YOUTUBE', null),\n 'SOCIALSIDEBAR_TWITTER' => Configuration::get('SOCIALSIDEBAR_TWITTER', null),\n 'SOCIALSIDEBAR_TUMBRL' => Configuration::get('SOCIALSIDEBAR_TUMBRL', null),\n 'SOCIALSIDEBAR_PRINTEREST' => Configuration::get('SOCIALSIDEBAR_PRINTEREST', null),\n 'SOCIALSIDEBAR_LINKEDIN' => Configuration::get('SOCIALSIDEBAR_LINKEDIN', null),\n 'SOCIALSIDEBAR_POSITION' => Configuration::get('SOCIALSIDEBAR_POSITION', null),\n );\n }", "protected function applyFormStateToConfiguration(FormStateInterface $form_state) {\n $values = $form_state->getValues();\n foreach ($values as $key => $value) {\n if (array_key_exists($key, $this->configuration)) {\n $this->configuration[$key] = $value;\n }\n }\n }", "function panels_panel_context_edit_settings_submit(&$form, &$form_state) {\n $form_state['handler']->conf['no_blocks'] = $form_state['values']['no_blocks'];\n $form_state['handler']->conf['body_classes_to_remove'] = $form_state['values']['body_classes_to_remove'];\n $form_state['handler']->conf['body_classes_to_add'] = $form_state['values']['body_classes_to_add'];\n $form_state['handler']->conf['pipeline'] = $form_state['values']['pipeline'];\n $form_state['handler']->conf['css_id'] = $form_state['values']['css_id'];\n $form_state['handler']->conf['css'] = $form_state['values']['css'];\n $form_state['handler']->conf['title'] = $form_state['values']['title'];\n\n // Unset the old checkbox so we don't store needless data.\n if (isset($form_state['handler']->conf['use_ipe'])) {\n unset($form_state['handler']->conf['use_ipe']);\n }\n}", "public function postProcess() {\n $vals = &$this->form_state['values'];\n $vals['value'] = '';\n foreach ($vals['civicrm_options_fieldset']['civicrm_defaults'] as $k) {\n if ($k) {\n $vals['value'] .= ($vals['value'] ? ',' : '') . str_replace('_web_civi_option_selected_', '', $k);\n }\n }\n if (isset($vals['civicrm_options_fieldset']['civicrm_options'])) {\n if (empty($vals['extra']['civicrm_live_options'])) {\n $items = array();\n foreach ($vals['civicrm_options_fieldset']['civicrm_options'] as $k) {\n if ($k) {\n $v = str_replace('_web_civi_option_selected_', '', $k);\n if (!($label = $vals['civicrm_options_fieldset']['civicrm_option_label_' . $v])) {\n $label = $this->form['civicrm_options_fieldset']['civicrm_option_name_' . $v]['#value'];\n }\n $items[$vals['civicrm_options_fieldset']['civicrm_option_weight_' . $v]] = $v . '|' . $label;\n }\n }\n ksort($items);\n $vals['extra']['items'] = implode(\"\\n\", $items);\n\n // A single static radio should be shown as a checkbox\n if (count($items) == 1 && empty($vals['extra']['aslist'])) {\n $vals['extra']['multiple'] = 1;\n }\n }\n else {\n $items = wf_crm_field_options($vals, 'live_options', $this->data);\n $items += wf_crm_str2array($vals['extra']['items']);\n $vals['extra']['items'] = wf_crm_array2str($items);\n }\n }\n }", "protected function getConfigForm()\n {\n $employees = Db::getInstance()->executeS('\n SELECT `email`, `firstname`, `lastname`\n FROM `'._DB_PREFIX_.'employee`\n '.($active_only ? ' WHERE `active` = 1' : '').'\n ORDER BY `lastname` ASC\n ');\n // var_dump($employees);\n\n $employees_opts = array();\n\n foreach ($employees as $emp) {\n // var_dump($emp);\n $employees_opts[] = array( 'email'=> $emp['email'],\n 'name' => $emp['firstname'] . ' ' . $emp['lastname']\n );\n }\n\n // if(Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE')) {\n $shops = Shop::getShops();\n // var_dump($shops);\n\n $shops_opts = array();\n\n foreach ($shops as $shop) {\n $shops_opts[] = array( 'id'=> $shop['id_shop'],\n 'name' => $shop['name']\n );\n }\n // }\n \n\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n // array(\n // 'type' => 'switch',\n // 'label' => $this->l('Live mode'),\n // 'name' => 'AUTOLOGINBACKOFFICE_LIVE_MODE',\n // 'is_bool' => true,\n // 'desc' => $this->l('Use this module in live mode'),\n // 'values' => array(\n // array(\n // 'id' => 'active_on',\n // 'value' => true,\n // 'label' => $this->l('Enabled')\n // ),\n // array(\n // 'id' => 'active_off',\n // 'value' => false,\n // 'label' => $this->l('Disabled')\n // )\n // ),\n // ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Login as Employee'),\n 'desc' => $this->l('Auto Login as this employee'),\n 'name' => 'AUTOLOGINBACKOFFICE_EMPLOYEE',\n 'required' => true,\n 'default_value' => $this->context->employee->id,\n 'options' => array(\n 'query' => $employees_opts,\n 'id' => 'email',\n 'name' => 'name',\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Login to Shop'),\n 'desc' => $this->l('Auto Login to this shop. Useful for Multi shop environment.'),\n 'name' => 'AUTOLOGINBACKOFFICE_SHOP',\n 'required' => true,\n 'default_value' => $this->context->shop->id,\n 'options' => array(\n 'query' => $shops_opts,\n 'id' => 'id',\n 'name' => 'name',\n )\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "function argentinagobar_bloques_campo_edit_form_submit($form, &$form_state) {\n foreach (array_keys($form_state['plugin']['defaults']) as $key) {\n if (isset($form_state['values'][$key])) {\n $form_state['conf'][$key] = $form_state['values'][$key];\n }\n }\n}" ]
[ "0.61800045", "0.6115656", "0.6099743", "0.6086033", "0.6014958", "0.59882027", "0.59092987", "0.59090865", "0.590135", "0.58943653", "0.5873621", "0.58513725", "0.584647", "0.5834405", "0.581645", "0.5814434", "0.5807282", "0.5798543", "0.5792641", "0.578865", "0.56499994", "0.56262195", "0.56262195", "0.5622292", "0.5598436", "0.5592052", "0.55865574", "0.55828434", "0.55741614", "0.55685776" ]
0.64093995
0
Receives a list of strings and extracts the command, action and parameters from that list.
private function parseArgs($args): array { $command = $action = null; $params = []; foreach ($args as $argument) { if ('-' !== $argument[0]) if (null === $command) $command = $argument; elseif (null === $action) $action = $argument; else $this->alert('Invalid argument ' . $argument . '!', ['command' => $command, 'action' => $action, 'serverArguments' => $_SERVER['argv'], 'processedArguments' => $args]); else { $argument = substr($argument, 1); // supports both one - or two - ( - / -- ) if ('-' == $argument[0]) $argument = substr($argument, 1); $argument = explode('=', $argument, 2); $params[$argument[0]] = isset($argument[1]) ? $argument[1] : true; } } return [ 'command' => $command, 'action' => $action, 'params' => $params ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parse()\n {\n $ret = [];\n for ($i = 1; $i < $this->argc; $i++) {\n $this->parseToken($i, $ret);\n }\n $this->clearAtKeys($ret);\n $this->dieIfMissingArgument($ret);\n\n return $ret;\n }", "static public function parse_commands($input)\n\t{\n\t\t$commands = array();\n\n\t\tforeach ($input as $k => $c)\n\t\t{\n\t\t\t//if we're dealing string as parameter or an assoc array\n\t\t\tif (!is_array($c) OR count(array_filter(array_keys($c), 'is_string')) > 0)\n\t\t\t{\n\t\t\t\t$commands[] = array('name' => $k, 'param' => $c);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if multiple command instances were defined (non-assoc array)\n\t\t\t\tforeach ($c as $p)\n\t\t\t\t{\n\t\t\t\t\t$commands[] = array('name' => $k, 'param' => $p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $commands;\n\t}", "abstract public function getArgumentLists();", "private static function getopt(): array\n {\n $args = $_SERVER['argv'] ?? [];\n $cmd = $args ? array_shift($args) : '';\n $action = $args ? array_shift($args) : '';\n\n $options = self::parseOpt($args);\n\n return [$action, $options];\n }", "public function parseArguments() {\r\n if( !isSet( $_GET['args'] ) ) return Array();\r\n else return explode( '|', $_GET['args'] );\r\n }", "private static function parseActionPart($action)\n {\n $a = explode(':', $action);\n if (count($a) != 2)\n {\n throw new \\RuntimeException('Invalid structure of route description ' .\n '. Delimiter symbol \":\" between class and action not found in string ' . $action);\n }\n return [trim($a[0]), trim($a[1])];\n }", "public function getActionArgumentDefinitions($action);", "protected static function parseArguments()\n {\n $arguments = $_SERVER['argv'];\n foreach ($arguments as $argument) {\n /** All arguments after the command are added to the argument list */\n if (self::$command) {\n self::$arguments[] = $argument;\n }\n\n /** First recognisable argument is set as command */\n if (isset(self::$commandList[$argument])) {\n self::$command = $argument;\n }\n }\n\n }", "public function formatArgs($args)\n {\n // The first argument is always the file\n unset($args[0]);\n\n if (isset($args[1])) {\n $command = explode(':', $args[1]);\n unset($args[1]);\n } else {\n // No Command Specified.\n return array();\n }\n\n try {\n\n $action = (isset($command[1]) ? $command[1] : 'main');\n $cmd = $this->library->find($command[0].':'.$action);\n $task = get_class($cmd);\n\n return array(\n 'task' => $task,\n 'action' => $action,\n 'params' => $args\n );\n\n } catch (\\Exception $e) {\n\n // No Command FOUND\n return array();\n }\n }", "private function extractParameters()\n {\n if ($this->parameters) {\n return;\n }\n preg_match_all('/\\:([A-Za-z0-9_]+)/', $this->createPattern, $matches);\n $this->parameters = array_flip($matches[1]);\n }", "public static function arguments() {\n $args = $_SERVER['argv'];\n array_shift($args);\n $args = join($args, ' ');\n\n preg_match_all('/ (--\\w+ (?:[= ] [^-]+ [^\\s-] )? ) | (-\\w+) | (\\w+) /x', $args, $match);\n $args = array_shift($match);\n\n /*\n Array\n (\n [0] => asdf\n [1] => asdf\n [2] => --help\n [3] => --dest=/var/\n [4] => -asd\n [5] => -h\n [6] => --option mew arf moo\n [7] => -z\n )\n */\n\n $ret = array(\n 'input' => array(),\n 'commands' => array(),\n 'flags' => array()\n );\n\n foreach ($args as $arg) {\n\n // Is it a command? (prefixed with --)\n if (substr($arg, 0, 2) === '--') {\n\n $value = preg_split('/[= ]/', $arg, 2);\n $com = substr(array_shift($value), 2);\n $value = join($value);\n\n $ret['commands'][$com] = !empty($value) ? $value : true;\n continue;\n }\n\n // Is it a flag? (prefixed with -)\n if (substr($arg, 0, 1) === '-') {\n $ret['flags'][] = substr($arg, 1);\n continue;\n }\n\n $ret['input'][] = $arg;\n continue;\n }\n\n return $ret;\n }", "private function _readArgs()\n {\n if (is_array($_SERVER['argv'])) {\n return array_slice($_SERVER['argv'], 1);\n }\n return array();\n }", "protected function getAvailableActionArguments()\n {\n return [\n self::ARG_ACTION_CHANGE,\n self::ARG_ACTION_ADD,\n self::ARG_ACTION_REMOVE\n ];\n }", "public function parse()\n {\n\n // passed arguments are available in the $GLOBALS array\n $params = implode(\" \", $GLOBALS['argv']);\n\n\n// replace by a single value, not to replace but to match corresponding parameters to corresponding values\n//$params = preg_replace('/\\-{1,2}[a-zA-z]+ *= */','|', $params);\n\n $params = preg_match_all(\n '/'.\n // parameter is any item having beginning with 1-2 dashes, but not having a 3rd one before\n // followed by alpha characters (perhaps add numerical) followed by arbitrary number of spaces\n // or having an equal sign after\n '( (?<!-)\\-{1,2}[a-zA-z]+ *=? *)'.\n\n // do not accept even the first dash, value cannot accept dash and ends up when a new dash begins\n // so cant contain and cannot be followed by a one, maybe should except space too\n '([^-]*(?!\\-)+'.\n // value, not followed by -\n //'(?!\\-)'.\n ')/',\n $params,\n $matches\n );\n\n\n // matches[1] = params, left side , matches[2] = params right side\n // trims every element by a character in another array passed as a 3rd parameter with pregenerated ' ' values\n $params = array_map('trim', $matches[1], array_fill(0,count($matches[1]),' '));\n\n\n// params , left side , paramL=valueR\n foreach ($params as &$param) {\n // workaround the above regexp allowed params like --p, whereas it should allow only -p, or full size --param\n // remove single letter params with double dash prefix , the regexp should be remade to this not complicately\n if (strpos($param, \"--\") !== false && strlen($param)<=5){\n echo $param.\" \\n\\n\\n\\n\";\n //unset($el);\n $param = \"\";\n }\n }\n\n\n\n // trim any dashes from all the array elements, to have params in array ['-p','--directory'] => ['p', 'directory']\n $params = array_map('trim', $params, array_fill(0, count($params),'-'));\n // make param names indexes of an array\n // [0=>'p', 1=>'directory'] => ['p'=>'0', 'directory'=>'1']\n $params = array_flip($params);\n\n\n // map params (params' indexes) to their values ['p'=>'0', 'directory'=>'1'] = > ['p'=>'pParam', 'directory'=>'directoryParam']\n foreach ($params as $paramName => $paramIndex) {\n\n // if a param was removed (became empty) as incorrect double dash -- usage for shortened parameters\n if (empty($paramName)) {\n continue;\n }\n\n $params[$paramName] = $matches[2][$paramIndex];\n\n }\n $params = $this->mapParamsWithShortFlags($params);\n\n\n return $params;\n }", "public function getCommandArray() : array\n {\n\n // Lvd.\n $result = [];\n\n // Find params.\n preg_match_all('/([a-z]{3,})(:)([^;]+)(;?)/', $this->command, $elements);\n\n // Define them in result array.\n for ($i = 0; $i < count($elements[0]); ++$i) {\n $result[$elements[1][$i]] = $elements[3][$i];\n }\n\n return $result;\n }", "protected function parse(array $argv){\n \n // canary...\n if(empty($argv)){ return array(); }//if\n \n $argv = $this->normalize($argv);\n $name = $val = null;\n \n $ret_list = array();\n $ret_map = array();\n \n for($i = 0, $max = count($argv); $i < $max ; $i++){\n \n $arg = $argv[$i];\n \n if($this->isLong($arg)){\n \n list($name,$val) = $this->parseLong($arg);\n $this->setField($name,$val);\n \n $ret_map[$name] = $val;\n \n }else if($this->isShort($arg)){\n \n list($i,$name,$val) = $this->parseShort($i,$argv);\n $this->setField($name,$val);\n \n }else{\n \n $this->addList($arg);\n \n }//if/else\n \n }//foreach\n \n }", "private function getArgs() {\n\t\treturn [ $this->argument('jobId'), $this->argument('fromCourse'), $this->argument('toCourse'), $this->argument('backOfficeUser')];\n\t}", "function getCommands($content) {\n $content=str_replace(\"\\r\",\"\",$content);\n $content=preg_replace(\"/ +/\",\" \",$content);\n $patern = '/^\\s{0,1}(\\w*)\\s{0,1}(.*)$/simU';\n $lines = explode(\"\\n\", $content);\n while (list($i, $line) = each($lines))\n if (!empty($line)){\n $line = trim($line);\n $arguments = array();\n $arguments = explode (' ', $line );\n $command = $arguments[0];\n array_shift($arguments);\n $commands[$command] = implode(' ', $arguments);\n //$commands[$i][0] = $command;\n //$commands[$i][1] = implode(' ', $arguments);\n }\n return $commands;\n}", "private function getActions() \n\t{\n\t\t// create a new ReflectionClass instance for the current class \n\t\t$c = new ReflectionClass(get_class($this));\n\t\t\n\t\t// get all the defined methods\n\t\t$methods = $c->getMethods();\n\t\t\n\t\t$actions = array();\n\t\t\n\t\t// iterate through the methods filtering out any that are not\n\t\t// prefixed with action_.\n\t\tforeach ($methods as $method) \n\t\t{\t\t\t\n\t\t\tif (stristr($method->getName(),'action_')) \n\t\t\t{\n\t\t\t\t// remove the prefix to get the action name\n\t\t\t\t$action = str_replace('action_','',$method->getName());\n\t\t\t\t\n\t\t\t\t// iterate through the parameters adding each to an array\n\t\t\t\t// wrapping optional params. with []\n\t\t\t\t$actions[$action] = array();\n\t\t\t\tforeach ($method->getParameters() as $param) \n\t\t\t\t{\n\t\t\t\t\t$name = strtoupper($param->getName());\n\t\t\t\t\tif ($param->isOptional()) \n\t\t\t\t\t{\n\t\t\t\t\t\t$name = '['.$name.']';\t\n\t\t\t\t\t} \n\t\t\t\t\t$actions[$action][] = $name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_actions = $actions;\n\t}", "private function extractArguments(array $arguments)\n {\n $this->fieldName = Arr::get($arguments, 0);\n $this->labelName = Arr::get($arguments, 1);\n $this->content = Arr::get($arguments, 2);\n $this->lang = Arr::get($arguments, 3);\n }", "function actionList() {\n }", "public static function parseCommand($command)\n {\n if (preg_match('/([@\\w\\\\\\\\]+)::(\\w+)\\((.*)\\)/', $command, $match)) {\n $params = explode(',', $match[3]);\n // trim params and strip quotes\n foreach ($params as &$param) {\n $param = trim($param, \" \\\"'\\t\\n\\r\\0\\x0B\");\n }\n if ((1 == count($params)) && ('' == $params[0])) {\n // prevents to pass an empty string\n $params[0] = null;\n }\n\n return [\n $match[1],\n $match[2],\n $params,\n ];\n }\n\n throw new TaskManagerException('Command not recognized');\n }", "function script_parse_args() {\n // Set default values.\n $args = [\n 'script' => '',\n 'help' => FALSE,\n 'profile' => 'minimal',\n 'project' => '',\n 'version' => '',\n 'vcs' => '',\n 'patches' => '',\n 'dependencies' => '',\n ];\n\n // Override with set values.\n $args['script'] = basename(array_shift($_SERVER['argv']));\n\n while ($arg = array_shift($_SERVER['argv'])) {\n if (preg_match('/--(\\S+)/', $arg, $matches)) {\n // Argument found.\n if (array_key_exists($matches[1], $args)) {\n // Argument found in list.\n $previous_arg = $matches[1];\n if (is_bool($args[$previous_arg])) {\n $args[$matches[1]] = TRUE;\n }\n elseif (is_array($args[$previous_arg])) {\n $value = array_shift($_SERVER['argv']);\n $args[$matches[1]] = array_map('trim', explode(',', $value));\n }\n else {\n $args[$matches[1]] = array_shift($_SERVER['argv']);\n }\n }\n else {\n // Argument not found in list.\n echo (\"Unknown argument '$arg'.\");\n exit(1);\n }\n }\n }\n\n return [$args];\n}", "public function parseCommand(string $command): array;", "public function &actionlist1() {\n $o=&XShell::from_screen('imod','props');\n $o['actions']=array();\n $this->_actionlist($o['actions']);\n return $o['actions'];\n }", "private function parseArguments(array $args)\n { \n $ret = array(\n 'exec' => '',\n 'options' => array(),\n 'flags' => array(),\n 'arguments' => array(),\n );\n $ret['exec'] = array_shift($args);\n while (($arg = array_shift($args)) != NULL)\n {\n if (mb_substr($arg, 0, 2, self::ENCODING) === '--')\n {\n $option = mb_substr($arg, 2, mb_strlen($arg) - 2, self::ENCODING);\n $opt = array();\n if (mb_strpos($option, '=', 0, self::ENCODING) !== FALSE)\n list($opt['key'], $opt['value']) = explode('=', $option, 2);\n else\n $opt = array('key' => $option, 'value' => null);\n $ret['options'][$opt['key']] = $opt['value'];\n continue;\n }\n \n if (mb_substr($arg, 0, 1, self::ENCODING) === '-')\n {\n for ($i = 1; isset($arg[$i]) ; $i++)\n $ret['flags'][$arg[$i]] = true;\n continue;\n }\n $ret['arguments'][] = $arg;\n }\n return $ret;\n }", "function inc_cfg_analyse_args_dist($args) {\n\tif (strpos($args, '::') !== false) {\n\t\treturn explode('::', $args, 2);\n\t} elseif (strpos($args, '/') !== false) {\n\t\treturn array('metapack', $args);\n\t}\n\treturn array('meta', $args);\n}", "private function getArgument(string $arguments): array\r\n {\r\n $argExploded = [];\r\n if(!empty($arguments)){\r\n $arguments = explode(' ', $arguments);\r\n foreach($arguments as $argument){\r\n if(strstr($argument, '=')){\r\n list($name, $value) = explode('=', $argument);\r\n $argExploded[$name] = $value;\r\n }\r\n }\r\n }\r\n return $argExploded;\r\n }", "private function readArguments($argv){\n if(isset($argv) && sizeof($argv) == 4){\n $whatFlag = false;\n $textFlag = false;\n $noKey = false;\n foreach($argv as $a){\n $p = explode('=',$a);\n if($p[0] == '-key'){//reads the key\n $this->key = $p[1];\n $noKey = true;\n }\n if($p[0] == '-txt'){//reads text\n $textFlag = true;\n $this->txt = $p[1];\n }elseif($p[0] == '-file'){//reads file\n $textFlag = true;\n if(!is_file($p[1]))\n exit('The value for \\'-file\\' is not a file!');\n $content = @file_get_contents($p[1]);\n if(!$content) exit('There was a problem reading the file!');\n else $this->txt = $content;\n }\n if($p[0] == '-what'){//reads elements to extract\n $whatFlag = true;\n $this->what = $p[1];\n }\n }\n if(!$noKey)\n exit(\"\\nMake sure you specify the key to use in the API request using '-key=<key>'\\n\\n\");\n if(!$whatFlag)\n exit(\"\\nMake sure you specify the elements to extract using '-what=<elements>'\\n\\n\");\n if(!$textFlag)\n exit(\"\\nMake sure you specify the text to analyze using either '-txt=<text>' or '-file=<filename>'\\n\\n\");\n }else\n exit(\"\\nSome parameters are missing, make sure you have included with the correct syntaxis:\\n\n -key=<key> --> key to use in the requet\\n\n -what=<elements> --> the elements to extract, separated by '|' and between quotes\\n\n -txt=<text> or -file=<filename> --> the text to analyze\\n\\n\");\n\n }", "private function doActions() {\n\t\tforeach ($this->actions as $action) {\n\t\t\t//(debug) echo \"action: $action... \\n\";\n\t\t\t$words = explode(' ', $action);\n\t\t\t$function = 'a_' . array_shift($words);\n\t\t\tcall_user_func_array(array($this, $function), $words);\n\t\t}\n\t}" ]
[ "0.5849926", "0.57326585", "0.56482404", "0.55944324", "0.5558214", "0.5503299", "0.54628044", "0.5449183", "0.5431177", "0.5419004", "0.5346824", "0.53376406", "0.53226155", "0.5310858", "0.52942", "0.52835006", "0.52304655", "0.52244747", "0.52228105", "0.5202932", "0.51599014", "0.5157077", "0.51254165", "0.5122762", "0.512171", "0.5120646", "0.5119854", "0.5103674", "0.50992393", "0.5094778" ]
0.58586305
0
Returns full namespace and classname for selected command. Command name is modified with `ucfirst()` method. Also `'app'` it's added as a vendor name in namespace and $this>commandsNamespace as part of the namespace. In case of modules, if there are no aliases for selected module then `$modulesNamespace` it's added and then module name plus `$commandsNamespace`, in case an alias it's found, then that alias it's used instead of 'app', modulesNamespace and module name . Examples: Command: home Module : Result : \app\commands\Home Command: home Module: admin Result: \app\modules\admin\commands\Home Command: home Module: chat Alias for chat: outsidevendor\chatModule Result: \outsidevender\chatModule\commands\Home
public function getCommandClassFromNameAndModule($command, $module): string { if (isset($this->commandAliases[$command])) { // check if is an alias first. return $this->commandAliases[$command]; } if (!$module) { return '\\app\\' . $this->commandsNamespace . '\\' . ucfirst($command); } elseif (isset($this->modulesAliases[$module])) { return '\\' . $this->modulesAliases[$module] . '\\' . $this->commandsNamespace . '\\' . ucfirst($command); } return '\\app\\' . $this->modulesNamespace . '\\' . $module . '\\' . $this->commandsNamespace . '\\' . ucfirst($command); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCommandClass() {\n return $this->commandClass;\n }", "public function testSetCommandsNamespace()\n {\n $app = new Conso(new Input(), $this->output);\n $app->setCommandsNamespace('Conso\\\\');\n\n $this->assertEquals(\n 'Conso\\\\',\n $app->getCommandsNamespace()\n );\n }", "protected function formulateName()\n {\n $classTokens = explode('\\\\', get_class($this));\n $bundleName = array_shift($classTokens);\n $className = array_pop($classTokens);\n $prefix = strtolower(str_replace('Bundle', '', $bundleName));\n $command = strtolower(str_replace('Command', '', $className)); \n\n return \"{$prefix}:{$command}\";\n }", "protected function getConsoleControllerNamespace() {\n return 'johnitvn\\userplus\\simple\\commands';\n }", "public function getName()\n\t{\n\t\t// Return commands without namespace if standalone\n\t\tif (!$this->isInsideLaravel()) {\n\t\t\treturn str_replace('deploy:', null, $this->name);\n\t\t}\n\n\t\treturn $this->name;\n\t}", "public function testRootNamespaceWithModuleOption(): void\n {\n $this->moduleManager->shouldReceive(\"getWorkbench\")->andReturn(null);\n\n foreach ($this->commands as $class) {\n $command = $this->getCommand($class);\n $command->shouldReceive(\"option\")->withArgs([\"module\"])->andReturn($module = \"myModule\");\n\n // The module manager should return the namespace\n $command->shouldReceive(\"isVanilla\")->andReturn(false);\n $this->moduleManager->shouldReceive(\"getModuleNamespace\")->withArgs([$module])->andReturn(\n $namespace = \"Namespace\"\n );\n\n // And that result should be returned\n $uut = $this->getMethodFromClass($this->method, $class);\n $result = $uut->invoke($command);\n $this->assertSame($namespace, $result);\n }\n }", "public function testRootNamespaceWithModuleInWorkbench(): void\n {\n $this->moduleManager->shouldReceive(\"getWorkbench\")->andReturn($module = \"MyModule\");\n\n foreach ($this->commands as $class) {\n $command = $this->getCommand($class);\n $command->shouldReceive(\"option\")->withArgs([\"module\"])->andReturn(null);\n\n // The module manager should return the namespace\n $command->shouldReceive(\"isVanilla\")->andReturn(false);\n $this->moduleManager->shouldReceive(\"getModuleNamespace\")->withArgs([$module])->andReturn(\n $namespace = \"Namespace\"\n );\n\n // And that result should be returned\n $uut = $this->getMethodFromClass($this->method, $class);\n $result = $uut->invoke($command);\n $this->assertSame($namespace, $result);\n }\n }", "public function getDroidCommandPrefix();", "protected function getNamespace()\r\n\t{\r\n\t\t$arguments = array(self::$config['namespace']);\r\n\t\t\r\n\t\tforeach (func_get_args() as $item)\r\n\t\t{\r\n\t\t\t$arguments[] = resolveName($item);\r\n\t\t}\r\n\t\t\r\n\t\treturn implode('\\\\', $arguments);\r\n\t}", "public function testSouldGetNamespace()\n {\n $app = [];\n $command = m::mock('Zizaco\\Confide\\ControllerCommand', [$app]);\n $command->shouldAllowMockingProtectedMethods();\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n $command->shouldReceive('getNamespace')\n ->passthru();\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n $this->assertEquals(\n 'Some\\Namespace',\n $command->getNamespace('Some\\Namespace\\Something')\n );\n\n $this->assertEquals(\n 'Some\\Thing',\n $command->getNamespace('Some\\Thing\\Resource')\n );\n\n $this->assertEquals(\n '',\n $command->getNamespace('Users')\n );\n }", "public function getCommandClass($commandID)\n {\n if (isset($this->commands[$commandID = strtoupper($commandID)])) {\n return $this->commands[$commandID];\n }\n }", "function getCmdClass()\n\t{\n\t\treturn strtolower($_GET[\"cmdClass\"]);\n\t}", "public function getCommand(): string\n {\n return $this->command;\n }", "public function getCommand();", "public function getCommand();", "public function getCommand();", "public function getCommand();", "public function getCommand(): string\n {\n return $this->_command;\n }", "private function getNamespace() {\n $namespace = 'App\\Controllers\\\\';\n if (array_key_exists('namespace', $this->params)) {\n $namespace .= $this->params['namespace'] . '\\\\';\n }\n return $namespace;\n }", "protected function getRootNameSpace()\n {\n [$vendor, $name] = explode('/', $this->package);\n\n $default = str_replace(['-'], '', Str::title($vendor).'\\\\'.Str::title($name));\n\n if (! $namespace = $this->option('namespace')) {\n $namespace = $this->ask('Root namespace', $default);\n }\n\n return $namespace === 'default' ? $default : $namespace;\n }", "public function testParseCommandAndTaskWithNamespace()\n\t{\n\t\t$args = [\n\t\t\t'muse',\n\t\t\t'repository:package',\n\t\t\t'install'\n\t\t];\n\n\t\t$arguments = new Arguments($args);\n\t\t$arguments->parse();\n\n\t\t$this->assertEquals('Hubzero\\Console\\Command\\Repository\\Package', $arguments->get('class'), 'Arguments parser failed to find the proper command');\n\t\t$this->assertEquals('install', $arguments->get('task'), 'Arguments parser failed to find the proper task');\n\t}", "public function testRootNamespaceWithoutModules(): void\n {\n $this->moduleManager->shouldReceive(\"getWorkbench\")->andReturn(null);\n\n foreach ($this->commands as $class) {\n $command = $this->getCommand($class);\n $command->shouldReceive(\"option\")->withArgs([\"module\"])->andReturn(null);\n\n // The parent call should be made\n $command->shouldReceive(\"parentCall\")->withArgs([$this->method])->andReturn($namespace = \"Namespace\");\n\n // And that result should be returned\n $uut = $this->getMethodFromClass($this->method, $class);\n $result = $uut->invoke($command);\n $this->assertSame($namespace, $result);\n }\n }", "public function getNamespace(): string\n {\n return 'GepurIt\\SingleInstanceCommandBundle';\n }", "public function inflect(Command $command): string;", "static public function list_commands()\n\t{\n\t\tstatic $commands = NULL;\n\n\t\tif ($commands == NULL)\n\t\t{\n\t\t\t// Include paths must be searched in reverse\n\t\t\t$paths = array_reverse(Kohana::list_files('classes/Item/Command/'));\n\n\t\t\t// Array of class names that have been found\n\t\t\t$found = array();\n\n\t\t\tforeach ($paths as $files)\n\t\t\t{\n\t\t\t\t$replacements = array_merge(Kohana::include_paths(), array('classes' . DIRECTORY_SEPARATOR . 'Item' . DIRECTORY_SEPARATOR . 'Command' . DIRECTORY_SEPARATOR, '.php'));\n\n\t\t\t\tif (is_array($files))\n\t\t\t\t{\n\t\t\t\t\tforeach ($files as $file)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($replacements as $replace)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$file = str_replace($replace, '', $file);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$found[] = $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$commands = $found;\n\t\t}\n\n\t\treturn $commands;\n\t}", "protected function getCommands(): array\n\t{\n\t\t// Define core commands\n\n\t\t$commands =\n\t\t[\n\t\t\t'app:generate-key' => GenerateKey::class,\n\t\t\t'app:generate-secret' => GenerateSecret::class,\n\t\t\t'app:generate-preloader' => GeneratePreloader::class,\n\t\t];\n\n\t\tif($this->container->has(Routes::class))\n\t\t{\n\t\t\t$commands = [...$commands, ...\n\t\t\t[\n\t\t\t\t'app:routes' => ListRoutes::class,\n\t\t\t\t'app:server' => Server::class,\n\t\t\t]];\n\t\t}\n\n\t\tif($this->container->has(CacheManager::class))\n\t\t{\n\t\t\t$commands = [...$commands, ...\n\t\t\t[\n\t\t\t\t'cache:remove' => Remove::class,\n\t\t\t\t'cache:clear' => Clear::class,\n\t\t\t]];\n\t\t}\n\n\t\tif($this->container->has(DatabaseConnectionManager::class))\n\t\t{\n\t\t\t$commands = [...$commands, ...\n\t\t\t[\n\t\t\t\t'migration:create' => Create::class,\n\t\t\t\t'migration:status' => Status::class,\n\t\t\t\t'migration:up' => Up::class,\n\t\t\t\t'migration:down' => Down::class,\n\t\t\t\t'migration:reset' => Reset::class,\n\t\t\t]];\n\t\t}\n\n\t\t// Add application commands\n\n\t\t$commands += $this->getApplicationCommands();\n\n\t\t// Add package commands\n\n\t\tforeach($this->packages as $package)\n\t\t{\n\t\t\t$commands += $package->getCommands();\n\t\t}\n\n\t\t// Return commands\n\n\t\treturn $commands;\n\t}", "public static function possibleCommands($argv)\n {\n $candidates = ['/'=>[]] + Util::pathAndArgs($argv, true);\n\n $commands = [];\n $class = null;\n foreach (array_reverse($candidates) as $path => $params) {\n $paths = \\Gini\\Core::pharFilePaths(CLASS_DIR, rtrim('Gini/Controller/CLI/'.$path, '/'));\n foreach ($paths as $p) {\n if (!is_dir($p)) continue;\n\n $dh = opendir($p);\n if ($dh) {\n while ($name = readdir($dh)) {\n if ($name[0] == '.') continue;\n if (!is_file($p . '/' . $name)) continue;\n $commands[] = strtolower(basename($name, '.php'));\n }\n closedir($dh);\n }\n\n }\n\n if (count($commands) > 0) break; // break the loop if hits.\n\n // enumerate actions in class\n $path = strtr(ltrim($path, '/'), ['-'=>'', '_'=>'']);\n $basename = basename($path);\n $dirname = dirname($path);\n\n $class_namespace = '\\Gini\\Controller\\CLI\\\\';\n if ($dirname != '.') {\n $class_namespace .= strtr($dirname, ['/'=>'\\\\']).'\\\\';\n }\n\n $class = $class_namespace . $basename;\n if (class_exists($class)) break;\n\n $class = $class_namespace . 'Controller' . $basename;\n if (class_exists($class)) break;\n\n $class = null;\n }\n\n if (count($commands) == 0 || $path == '/') {\n\n if (!$class) {\n $class = '\\Gini\\Controller\\CLI\\App';\n $params = $argv;\n }\n\n if (class_exists($class)) {\n $rc = new \\ReflectionClass($class);\n $methods = $rc->getMethods(\\ReflectionMethod::IS_PUBLIC);\n foreach ($methods as $m) {\n if (strncmp('action', $m->name, 6) != 0) continue;\n if (preg_match_all('`([A-Z]+[a-z\\d]+|.+)`', substr($m->name, 6), $parts)) {\n $method = strtolower(implode('-', $parts[0]));\n if ($params[0] === $method) {\n $commands = [];\n break;\n }\n $commands[] = $method;\n }\n }\n }\n\n }\n\n return $commands;\n }", "public static function getClassNameFromNamespace()\n {\n $classArray = explode(\"\\\\\", self::$namespace);\n return $classArray[count($classArray) - 1];\n }", "final public function showCommandList()\n {\n $ref = new \\ReflectionClass($this);\n $sName = lcfirst(self::getName() ?: $ref->getShortName());\n\n if (!($classDes = self::getDescription())) {\n $classDes = Annotation::description($ref->getDocComment()) ?: 'No Description for the console controller';\n }\n\n $commands = [];\n foreach ($this->getAllCommandMethods($ref) as $cmd => $m) {\n $desc = Annotation::firstLine($m->getDocComment());\n\n if ($cmd) {\n $commands[$cmd] = $desc;\n }\n }\n\n // sort commands\n ksort($commands);\n\n // move 'help' to last.\n if ($helpCmd = $commands['help'] ?? null) {\n unset($commands['help']);\n $commands['help'] = $helpCmd;\n }\n\n $script = $this->getScriptName();\n\n if ($this->standAlone) {\n $name = $sName . ' ';\n $usage = \"$script <info>{command}</info> [arguments] [options]\";\n } else {\n $name = $sName . $this->delimiter;\n $usage = \"$script {$name}<info>{command}</info> [arguments] [options]\";\n }\n\n $this->output->mList([\n 'Description:' => $classDes,\n 'Usage:' => $usage,\n //'Group Name:' => \"<info>$sName</info>\",\n 'Commands:' => $commands,\n 'Options:' => [\n '-h,--help' => 'Show help of the command group or specified command action',\n ],\n ]);\n\n $this->write(sprintf(\n \"To see more information about a command, please use: <cyan>$script {command} -h</cyan>\",\n $this->standAlone ? ' ' . $name : ''\n ));\n }", "public function getCommands() {\n $cmds = array();\n foreach ($this->getEntityClasses() as $class) {\n $cmds[] = preg_replace('#' . preg_quote($this->getNamespace() . '\\\\Model\\\\Entity\\\\') . '#', '', $class);\n }\n $cmds['Settings'] = array('Help');\n return $cmds;\n }" ]
[ "0.62533784", "0.6027009", "0.59844047", "0.5892601", "0.57314914", "0.5718232", "0.5645954", "0.5589237", "0.5589203", "0.556155", "0.5531736", "0.5500596", "0.5488947", "0.5403118", "0.5403118", "0.5403118", "0.5403118", "0.5381507", "0.53746694", "0.5359129", "0.53414047", "0.5335905", "0.533215", "0.5306292", "0.53059673", "0.530388", "0.52940255", "0.5290315", "0.52741915", "0.52712363" ]
0.63479316
0
Instantiate command and check if class is correct; A critical error will be generated if it's an invalid class(doesn't extend `\mpf\cli\Command`)!
private function loadCommand($class): cli\Command { $controller = new $class(); if (!is_a($controller, cli\Command::class)) { $this->critical('Command `' . $class . '` must extend ' . cli\Command::class . '!', array( 'requestedController' => $this->request()->getController(), 'requestedModule' => $this->request()->getModule() )); return null; } return $controller; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function verifyCommand($command)\n {\n if (!class_exists($command)) {\n throw FileNotFound::commandNotFound($command);\n }\n\n $class = new $command();\n\n if (!is_a($class, Command::class)) {\n throw InvalidCommand::doesntExtendCommand();\n }\n }", "public function testInstantiation()\n {\n $command = new InstallCommand('contao:install');\n\n $this->assertInstanceOf('Contao\\\\CoreBundle\\\\Command\\\\InstallCommand', $command);\n }", "private function isCommandCompatibleClass($commandClass)\n {\n try {\n new $commandClass;\n } catch (\\Error $ex) {\n throw new \\Exception(\"Error loading class '$commandClass'. Trace: \" . static::class );\n }\n\n return is_subclass_of($commandClass, Command::class) && $commandClass !== Command::class;\n }", "public static function factory($command,$path = null) {\n $commandclass = 'Command_'.$command;\n class_exists($commandclass) || self::_load_command($command, $path);\n return new $commandclass;\n }", "public function testConstructor()\n {\n $this->command = new Command();\n }", "public function __construct()\n {\n // you *must* call the parent constructor\n Command::__construct();\n }", "public static function isValidCommandClass($className)\n {\n if (!class_exists($className)) {\n /** If the class does not exist, it is obviously not valid */\n Cli::writeVerbose('ERROR: command class does not exist : ' . $className);\n return false;\n }\n\n $interfaces = class_implements($className);\n if (!in_array('Caelaris\\CommandInterface', $interfaces)) {\n /** If the class does not extend Caelaris\\CommandInterface it is not a valid command */\n Cli::writeVerbose('ERROR: ' . $className . ' is not a valid command class');\n return false;\n }\n\n return true;\n }", "public function __invoke(Command $command): Command;", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public function testCommand()\n {\n $container = Mockery::mock(ContainerInterface::class);\n $command = new ReplCommand($container);\n $this->assertNotEmpty($command);\n }", "public function testCommandNotFound()\n {\n $this->expectException(\\Exception::class);\n $app = new Conso(new Input('test'), $this->output);\n $app->run();\n }", "public function testParseNonExistentCommand()\n\t{\n\t\t$args = [\n\t\t\t'muse',\n\t\t\t'blah'\n\t\t];\n\n\t\t$arguments = new Arguments($args);\n\t\t$arguments->parse();\n\t}", "public static function validateCommand($command)\n {\n try {\n list($class, $method, $args) = self::parseCommand($command);\n } catch (TaskManagerException $e) {\n return false;\n }\n $args = array_map(function ($elem) {\n return trim($elem);\n }, $args);\n\n return $class . '::' . $method . '(' . trim(implode(',', $args), ',') . ')';\n }", "public function command(Command $command);", "function pestle_cli($argv)\n{ \n $class = createClassTemplateWithUse($argv['class_child'], '\\\\' . $argv['class_parent']);\n \n $class = str_replace('<$use$>', '', $class);\n $class = str_replace(\n '<$body$>', \n \"\\n\" . getConstructorFromParentClass($argv['class_parent']) . \"\\n\", \n $class);\n\n $path = getPathFromClass($argv['class_child']);\n if(!file_exists($path))\n {\n writeStringToFile($path, $class);\n return;\n }\n output(\"Class File Already Exists, but here's the constructor\"); \n output($class);\n}", "public static function IsThisClass(command $cmd)\r\n {\r\n return true;\r\n }", "private function isValid( $command )\n\t{\n\t\tif ( ! $command instanceof \\SplObserver )\n\t\t\tthrow new \\InvalidArgumentException( sprintf(\n\t\t\t\t'%s: %s must extend \\\\SplObserver',\n\t\t\t\tget_class( $this ),\n\t\t\t\tget_class( $command )\n\t\t\t) );\n\t}", "public function testCommandManagement()\n {\n $commander = new Commander(['TL', 'C']);\n\n $this->assertEquals($commander->getCommand(), 'TL');\n $this->assertEquals($commander->hasCommands(), true);\n $this->assertEquals($commander->getCommand(), 'C');\n $this->assertEquals($commander->hasCommands(), false);\n }", "public function defineCommand($commandID, $class)\n {\n $reflection = new ReflectionClass($class);\n\n if (!$reflection->isSubclassOf('Predis\\Command\\CommandInterface')) {\n throw new InvalidArgumentException(\"The class '$class' is not a valid command class.\");\n }\n\n $this->commands[strtoupper($commandID)] = $class;\n }", "public function testGetInvalidCommandByName( )\n {\n $args = [ 'program', 'fake' ];\n \n $command = $this->console->getCommand( $args );\n \n $this->assertNull( $command );\n }", "public static function loadCommandLine($class) {\n\t\t\t\n\t\tif (self::_hasAdapter(get_called_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_called_class(), __FUNCTION__, $class);\n\n\t\t$filename = $class . '.php';\n\n\t\t$file = SITE_PATH . 'cli' . DS . $filename;\n\n\t\tif (!file_exists($file)) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\trequire_once $file;\n\n\t\treturn true;\n\n\t}", "public function testRunCommandMissingMethod() {\n\t\t$Mock = $this->getMock ( 'Shell', array (\n\t\t\t\t'startup',\n\t\t\t\t'getOptionParser',\n\t\t\t\t'out' \n\t\t), array (), '', false );\n\t\t$Parser = $this->getMock ( 'ConsoleOptionParser', array (), array (), '', false );\n\t\t\n\t\t$Parser->expects ( $this->once () )->method ( 'help' );\n\t\t$Mock->expects ( $this->never () )->method ( 'idontexist' );\n\t\t$Mock->expects ( $this->once () )->method ( 'getOptionParser' )->will ( $this->returnValue ( $Parser ) );\n\t\t$Mock->expects ( $this->once () )->method ( 'out' );\n\t\t\n\t\t$result = $Mock->runCommand ( 'idontexist', array () );\n\t\t$this->assertFalse ( $result );\n\t}", "public function buildCommand();", "private function createCommand(string $command) {\n if (!isset($this->executers[$command])) {\n switch ($command) {\n case \"PLACE\" :\n $this->executers[$command] = new PlaceCommand();\n break;\n case \"MOVE\" :\n $this->executers[$command] = new MoveCommand();\n break;\n case \"REPORT\" :\n $this->executers[$command] = new ReportCommand();\n break;\n case \"LEFT\" :\n $this->executers[$command] = new LeftCommand();\n break;\n case \"RIGHT\" :\n $this->executers[$command] = new RightCommand();\n break;\n }\n }\n }", "public function getCommandClass() {\n return $this->commandClass;\n }", "function Command($cmd = ''){\n\t\t$this->cmd = $cmd;\n\t}", "public function testRunCommandBaseclassMethod() {\n\t\t$Mock = $this->getMock ( 'Shell', array (\n\t\t\t\t'startup',\n\t\t\t\t'getOptionParser',\n\t\t\t\t'out' \n\t\t), array (), '', false );\n\t\t$Parser = $this->getMock ( 'ConsoleOptionParser', array (), array (), '', false );\n\t\t\n\t\t$Parser->expects ( $this->once () )->method ( 'help' );\n\t\t$Mock->expects ( $this->once () )->method ( 'getOptionParser' )->will ( $this->returnValue ( $Parser ) );\n\t\t$Mock->expects ( $this->never () )->method ( 'hr' );\n\t\t$Mock->expects ( $this->once () )->method ( 'out' );\n\t\t\n\t\t$Mock->runCommand ( 'hr', array () );\n\t}", "abstract public function newCommand($command, $dockerOptions = [], ...$options);", "private function checkCmdParam(){\n\n $_func = strtolower(__CLASS__);\n $_type = strtolower($this->Filetype);\n $_paths = $this->Paths;\n if( in_array($_type, $_paths[\"Cmd\"][\"WP\"][$_func]) ){\n $this->checkTargetDir();\n }else{\n echo \"O parametro setado para o comando \".__CLASS__.\" nao existe.\\n\";\n echo \"Para criar esse comando, va em '/Framework/Generator/commands.json' e crie assim: \\n\";\n echo \"\\\"WP\\\": {\\n\";\n echo \"\\t \\\"meuComando\\\": [\\\"param1\\\",\\\"param2\\\", {...}],\\n\";\n echo \"\\t \\\"meusOutrosComandos\\\": [\\\"param1\\\",\\\"param2\\\", {...}]\\n\";\n echo \" }\\n\";\n die;\n }\n }", "public function __construct($command=null)\n\t{\n\t\tif ($command) $this->open($command);\n\t}" ]
[ "0.7035968", "0.6893786", "0.6874903", "0.67812544", "0.65882534", "0.62237096", "0.6219034", "0.6195401", "0.6140848", "0.60733247", "0.6071071", "0.606762", "0.60313857", "0.6008594", "0.5979914", "0.5948682", "0.58786994", "0.5858019", "0.58230317", "0.574796", "0.573122", "0.5719265", "0.5709856", "0.57057", "0.56828207", "0.56547254", "0.5644422", "0.56165946", "0.56085217", "0.56049645" ]
0.7258674
0
Get the value of instruments
public function getInstrument(): Collection { return $this->instrument; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCustomInstruments(): array\n {\n return $this->customInstruments;\n }", "public function getValue()\n\t{\n\t\treturn $this->values;\n\t}", "public function getConsumption() {\n\n\t}", "public function getInstrumentID() {\n if (isset($_SESSION[self::$instrumentID])) {\n $ret = $_SESSION[self::$instrumentID];\n } else {\n $ret = \"\";\n }\n\n return $ret;\n }", "public function getValue()\n {\n return $this->getItems(TRUE);\n }", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getUnitValue() : ?array;", "public function listMeasurements(): array;", "public function &getValue();" ]
[ "0.58903986", "0.55951214", "0.55821157", "0.55813116", "0.555934", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.5527653", "0.54704964", "0.54551333", "0.53795874" ]
0.61152315
0
Get the value of experience
public function getExperience() { return $this->experience; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function experience(): Experience;", "public function getExperience() {\n try {\n $_reevoo = Mage::helper('reevoo/api');\n return $_reevoo->getReevooApi();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }", "public function getIdexperience_pro(){\n\n return $this->idexperience_pro;\n\n }", "public function getResearchExperienceAttribute();", "public function experience()\n\t{\n\t\treturn $this->hasOne(Experience::class);\n\t}", "public function show(Experience $experience)\n {\n return $experience;\n }", "public function getImpact(): int\n {\n return $this->impact;\n }", "public function getExperienceRequirements()\n {\n return $this->experienceRequirements;\n }", "public function getLossExperience()\n {\n if( !isset($this->data['loss_experience']) )\n {\n throw new E_OTS_NotLoaded();\n }\n\n return $this->data['loss_experience'];\n }", "public function addExp($experience) {\n\t\tif($this->hasBoost(3)) {\n\t\t\t$experience = $boosted_experience = $experience + ($experience / 2);\n\n\t\t\t$this->experience += $experience;\n\t\t} else {\n\t\t\t$this->experience += $experience;\n\t\t}\n\n\t\treturn $experience;\n\t}", "public function getLoyalityPointValue();", "public function getCurrentLevelExpSubCurrentExp() {\n\t\treturn $this->experience - $this->getCurrentLevelExp();\n\t}", "public function set_experience(){\t\n\t\t\n\t\t$year['0.3'] = '3 Months';\n\t\t$year['0.6'] = '6 Months';\n\t\t$year['0.9'] = '9 Months';\n\t\t$year['1'] = '1 Year';\n\t\tfor($i = 2; $i <= 25; $i++){\n\t\t\t$year[$i] =$i.' Years';\n\t\t\t\n\t\t}\t\t\n\t\t$this->set('yearExp', $year);\n\t}", "public function getIncome()\n {\n return $this->Income;\n }", "public function getLife()\n {\n return $this->life;\n }", "public function getValue(): int\n {\n return $this->getRollOnQuality()->getValue() - $this->getDifficulty();\n }", "public function retirer_experience($experience, $joueur_id = null)\n\t{\n\t\t$experience = abs($experience);\n\n\t\t// Joueur en session\n\t\tif ( ! isset($joueur_id))\n\t\t{\n\t\t\t$joueur_id = $this->CI->session->userdata('id');\n\t\t\t$experience = max(0, $this->CI->session->userdata('experience') - $experience);\n\t\t\t$this->CI->session->set_userdata('experience', $experience);\n\t\t}\n\n\t\t// Joueur externe\n\t\telse\n\t\t{\n\t\t\t$query = $this->CI->db->select('experience')\n\t\t\t\t\t\t\t\t ->from('joueurs')\n\t\t\t\t\t\t\t\t ->where('id', $joueur_id)\n\t\t\t\t\t\t\t\t ->get();\n\t\t\t$joueur = $query->row();\n\t\t\t$experience = max(0, $joueur->experience - $experience);\n\t\t}\n\n\t\t$this->CI->db->set('experience', $experience)\n\t\t\t\t\t ->where('id', $joueur_id)\n\t\t\t\t\t ->update('joueurs');\n\t}", "public function getLevel(): int\n {\n if ($this->experiencePoints < 1) {\n return 1;\n }\n\n return (int) ceil($this->experiencePoints / 100);\n }", "public function getExp()\n {\n return $this->exp;\n }", "public function experienceAction()\n {\n // action body \n $this->view->myExps = Extended\\experience::getAllExperiences( Auth_UserAdapter::getIdentity()->getId() );\n }", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();" ]
[ "0.75352156", "0.7056148", "0.68457407", "0.6839348", "0.67895484", "0.656143", "0.6533814", "0.6321399", "0.63168955", "0.6313286", "0.62927675", "0.6270163", "0.61566716", "0.61076164", "0.60250413", "0.60243374", "0.6023049", "0.59627944", "0.59454894", "0.5938061", "0.59366703", "0.59366703", "0.59366703", "0.59366703", "0.59366703", "0.59366703", "0.59366703", "0.59366703", "0.59366703", "0.59366703" ]
0.79955655
0
Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a space]( If you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication]( (spaces.create)
public function create(Space $postBody, $optParams = []) { $params = ['postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('create', [$params], Space::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create($org_id, $name, $post_on_new_app = TRUE, $post_on_new_member = TRUE) {\n $data = array(\n 'org_id' => $org_id,\n 'name' => $name,\n 'post_on_new_app' => $post_on_new_app,\n 'post_on_new_member' => $post_on_new_member,\n );\n \n if ($response = $this->podio->request('/space/', $data, HTTP_Request2::METHOD_POST)) {\n return json_decode($response->getBody(), TRUE);\n }\n }", "public function createSpace($cloud_pk, $ifc_pk, $project_pk, $data)\n {\n list($response) = $this->createSpaceWithHttpInfo($cloud_pk, $ifc_pk, $project_pk, $data);\n return $response;\n }", "public function create($name);", "public function testSpaceCreate()\n {\n }", "public function setSpaceName($var)\n {\n GPBUtil::checkString($var, True);\n $this->SpaceName = $var;\n\n return $this;\n }", "public function createSpaceRequest($cloud_pk, $ifc_pk, $project_pk, $data)\n {\n // verify the required parameter 'cloud_pk' is set\n if ($cloud_pk === null || (is_array($cloud_pk) && count($cloud_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_pk when calling createSpace'\n );\n }\n // verify the required parameter 'ifc_pk' is set\n if ($ifc_pk === null || (is_array($ifc_pk) && count($ifc_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ifc_pk when calling createSpace'\n );\n }\n // verify the required parameter 'project_pk' is set\n if ($project_pk === null || (is_array($project_pk) && count($project_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $project_pk when calling createSpace'\n );\n }\n // verify the required parameter 'data' is set\n if ($data === null || (is_array($data) && count($data) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $data when calling createSpace'\n );\n }\n\n $resourcePath = '/cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/space';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_pk' . '}',\n ObjectSerializer::toPathValue($cloud_pk),\n $resourcePath\n );\n }\n // path params\n if ($ifc_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'ifc_pk' . '}',\n ObjectSerializer::toPathValue($ifc_pk),\n $resourcePath\n );\n }\n // path params\n if ($project_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'project_pk' . '}',\n ObjectSerializer::toPathValue($project_pk),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($data)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($data));\n } else {\n $httpBody = $data;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "abstract public function createGroup($group_name);", "protected function create_group() {\n global $wpdb;\n\n // REQUIRED FIELDS\n if (empty($_POST['create_group_name'])) {\n $this->admin_messages[] = array(\n 'is_error' => true,\n 'content' => '<p>Please provide a name for the group you are trying to create.</p>'\n );\n return;\n }\n\n if (empty($_POST['create_group_description'])) {\n $this->admin_messages[] = array(\n 'is_error' => true,\n 'content' => '<p>Please provide a description for the group you are trying to create.</p>'\n );\n return;\n }\n\n // do not mysql escape\n $create_group = $wpdb->insert(\n $this->groups_table_name,\n array(\n 'name' => $_POST['create_group_name'],\n 'description' => $_POST['create_group_description'],\n 'create_date' => current_time('mysql')\n ),\n array(\n '%s',\n '%s',\n '%s'\n )\n );\n\n if ($create_group === false) {\n $this->admin_messages[] = array(\n 'is_error' => true,\n 'content' => '<p>There was an error creating the group.</p>'\n );\n return;\n }\n\n $group_name = htmlspecialchars($_POST['create_group_name']);\n $this->admin_messages[] = array(\n 'is_error' => false,\n 'content' => '<p>Successfully created the group <em>' . $group_name . '</em>.</p>'\n );\n return;\n }", "public function createSpaceWithHttpInfo($cloud_pk, $ifc_pk, $project_pk, $data)\n {\n $request = $this->createSpaceRequest($cloud_pk, $ifc_pk, $project_pk, $data);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\Space[]' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Space[]', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Space[]';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\Space[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function createZoneSpaceRequest($cloud_pk, $ifc_pk, $project_pk, $zone_pk, $data)\n {\n // verify the required parameter 'cloud_pk' is set\n if ($cloud_pk === null || (is_array($cloud_pk) && count($cloud_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_pk when calling createZoneSpace'\n );\n }\n // verify the required parameter 'ifc_pk' is set\n if ($ifc_pk === null || (is_array($ifc_pk) && count($ifc_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $ifc_pk when calling createZoneSpace'\n );\n }\n // verify the required parameter 'project_pk' is set\n if ($project_pk === null || (is_array($project_pk) && count($project_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $project_pk when calling createZoneSpace'\n );\n }\n // verify the required parameter 'zone_pk' is set\n if ($zone_pk === null || (is_array($zone_pk) && count($zone_pk) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $zone_pk when calling createZoneSpace'\n );\n }\n // verify the required parameter 'data' is set\n if ($data === null || (is_array($data) && count($data) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $data when calling createZoneSpace'\n );\n }\n\n $resourcePath = '/cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone/{zone_pk}/space';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_pk' . '}',\n ObjectSerializer::toPathValue($cloud_pk),\n $resourcePath\n );\n }\n // path params\n if ($ifc_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'ifc_pk' . '}',\n ObjectSerializer::toPathValue($ifc_pk),\n $resourcePath\n );\n }\n // path params\n if ($project_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'project_pk' . '}',\n ObjectSerializer::toPathValue($project_pk),\n $resourcePath\n );\n }\n // path params\n if ($zone_pk !== null) {\n $resourcePath = str_replace(\n '{' . 'zone_pk' . '}',\n ObjectSerializer::toPathValue($zone_pk),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($data)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($data));\n } else {\n $httpBody = $data;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createWorkspace($name, $description, $language, array $intents = [], array $entities = [], array $dialog_nodes = [], array $counterexamples = [], $metadata = NULL, $learning_opt_out = FALSE, $version = self::VERSION) {\n\n }", "public function actionCreate($name) {\n ;\n }", "public function createGroup()\n {\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BA9 begin\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BA9 end\n }", "function create_screen() {\n\t\tif ( !bp_is_group_creation_step( $this->slug ) )\n\t\t\treturn false;\n\n\t\t$this->admin_markup();\n\n\t\twp_nonce_field( 'groups_create_save_' . $this->slug );\n\t}", "function school_create() {\n $data = $this->_get_data_from_post();\n\n $data['headline'] = \"Create New School\";\n\n $data['btn_text'] = 'CREATE SCHOOL';\n\n $data['form_location'] = BASE_URL.'schools/submit/';\n $data['view_file'] = 'create_school';\n $this->template('public_milligram', $data);\n }", "public function setNameSpace($nameSpace) \n {\n $this->nameSpace = $nameSpace;\n }", "public function testSpacesProjectsCreate()\n {\n }", "public function createSecurityGroup($request);", "private function createCustomerGroup($groupName, $taxClassId)\n {\n $customerGroup = $this->groupFactory->create();\n $groupCount = $customerGroup->getCollection()->addFieldToFilter('customer_group_code', $groupName)->getSize();\n\n if ($groupCount > 0) {\n $this->log->logInfo(\n sprintf('Customer Group \"%s\" already exists, creation skipped', $groupName)\n );\n\n return;\n }\n\n $customerGroup\n ->setCustomerGroupCode($groupName)\n ->setTaxClassId($taxClassId)\n ->save();\n\n $this->log->logInfo(\n sprintf('Customer Group \"%s\" created', $groupName)\n );\n }", "public function createSpaceAsync($cloud_pk, $ifc_pk, $project_pk, $data)\n {\n return $this->createSpaceAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "function groups_screen_group_create (){}", "function create_group()\n\t{\n\t\t$this->data['title'] = $this->lang->line('create_group_title');\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('auth', 'refresh');\n\t\t}\n\t\t//validate form input\n\t\t$this->form_validation->set_rules('group_name', $this->lang->line('create_group_validation_name_label'), 'required|alpha_dash');\n\n\t\tif ($this->form_validation->run() == TRUE)\n\t\t{\n\t\t\t$new_group_id = $this->ion_auth->create_group($this->input->post('group_name'), $this->input->post('description'));\n\t\t\tif($new_group_id)\n\t\t\t{\n\t\t\t\t// check to see if we are creating the group\n\t\t\t\t// redirect them back to the admin page\n\t\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\t\tredirect(\"auth\", 'refresh');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//display the create group form\n\t\t\t//set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['group_name'] = array(\n\t\t\t\t'name' => 'group_name',\n\t\t\t\t'id' => 'group_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('group_name'),\n\t\t\t);\n\t\t\t$this->data['description'] = array(\n\t\t\t\t'name' => 'description',\n\t\t\t\t'id' => 'description',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('description'),\n\t\t\t);\n\n\t\t\t$this->_render_page('auth/create_group', $this->data);\n\t\t}\n\t}", "public function create_topic($name, $opt = null)\n\t{\n\t\tif (!$opt) $opt = array();\n\t\t$opt['Name'] = $name;\n\n\t\treturn $this->authenticate('CreateTopic', $opt, $this->hostname);\n\t}", "public function store(Request $request)\n {\n DB::beginTransaction();\n\n $validInput = array_key_exists('logo', $_FILES)\n ? $this->inputValidator->validateSpaceStore($request, $_FILES['logo'])\n : $this->inputValidator->validateSpaceStore($request);\n\n if (!$validInput['isValid']) {\n return Response::json(['error' => $validInput['message']]);\n }\n // form input\n $slug = (strtolower($request['name']));\n $slug = str_replace(' ', '-', $slug);\n $slug = preg_replace('/[^A-Za-z0-9\\-]/', '', $slug);\n $slug = preg_replace('/-+/', '-', $slug);\n\n $slugCheck = Workspace::where('slug', $slug)->first();\n if (!empty($slugCheck)) {\n $string = str_random(3);\n $slug = $slug . '-' . $string;\n }\n $logo = $request->file('logo');\n\n $coordinates = $this->getGeoLocation($request['address'], $request['city'], $request['state']);\n $lon = $coordinates->results[0]->geometry->location->lng;\n $lat = $coordinates->results[0]->geometry->location->lat;\n\n // create new App\\Workspace;\n $workspace = new Workspace($request->except([\n 'slug',\n 'logo',\n 'username',\n 'password',\n 'avatar'\n ]));\n $workspace->slug = $slug;\n $workspace->lon = $lon;\n $workspace->lat = $lat;\n $workspace->pub_key = 0;\n\n if (!empty($logo)) {\n $logoName = $logo->getClientOriginalName();\n $logo->move('storage/logo/', $logoName);\n $workspace->logo = $request->root() . '/storage/logo/' . $logoName;\n }\n\n $success = $workspace->save();\n if (!$success) {\n DB::rollBack();\n return Response::json(['error' => 'Space not created.']);\n }\n\n $spaceID = $workspace->id;\n $roleID = 2;\n\n $signUpAttempt = $this->authController->signUp($request, $roleID, $spaceID);\n if ($signUpAttempt['hasErrors']) {\n DB::rollBack();\n return Response::json(['error' => $signUpAttempt['message']]);\n } else {\n DB::commit();\n }\n\n return Response::json($workspace->id);\n }", "public function create()\n {\n $this->auth->restrict($this->permissionCreate);\n\n\n Template::set('toolbar_title', lang('mahathuen_action_create'));\n\n Template::render();\n }", "function Add($strName, $strDescription, $org_info)\r\n\t{\r\n\t\tglobal $g_oUserSession;\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\t\tMake sure the organization exists and is valid\r\n\t\t\tWe're using it first to test against the right.\r\n\t\t*/\r\n\t\t\r\n\t\t$orgId = GetOrgID($org_info);\r\n\t\t\r\n\t\tif($orgId < 0)\r\n\t\t{\r\n\t\t\treturn $this->results->Set('false', \"Invalid organization selected for owner\");\r\n\t\t}\r\n\t\t\t\t\r\n\t\tif(!$g_oUserSession->HasRight($this->rights_Add, $orgId))\r\n\t\t{\r\n\t\t\treturn $this->results->Set('false', $g_oUserSession->results->GetMessage());\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t\tMake sure the names are valid\r\n\t\t*/\r\n\t\tif(!$this->ValidateName($strName))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\tif(!$this->ValidateDescription($strDescription))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\t/*\r\n\t\t\tSee if the group name is already in use\r\n\t\t*/\r\n\t\tif($this->GetID($strName) > 0)\r\n\t\t{\r\n\t\t\t//\r\n\t\t\t//\tOrganization is already in the database\r\n\t\t\t//\r\n\t\t\treturn $this->results->Set('false', \"'$strName' is already in use.\");\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t\tbuild the record\r\n\t\t*/\r\n\t\t$arInsert = array();\r\n\t\t$arInsert[$this->field_Name] = $strName;\r\n\t\t$arInsert[$this->field_Description] = $strDescription;\r\n\t\t$arInsert[$this->field_Owner] = $orgId;\r\n\t\r\n\t\tif(!$db->insert($this->table_Name, $arInsert))\r\n\t\t{\r\n\t\t\t\treturn $this->results->Set('false', \"Unable to add '$strName' due to database error.\");\r\n\t\t}\r\n\r\n\t\treturn $this->results->Set('true', \"'$strName' added.\");\r\n\t}", "public function create(array $arguments = [])\n {\n return $this->_objectManager->create('OrviSoft\\AttributeGroups\\Model\\Groups', $arguments, false);\n }", "public function createBucket($name)\n {\n $this->client()->createBucket([\n 'Bucket' => $name,\n ]);\n }", "function create_keyring($projectId, $ring, $location = 'global')\n{\n // Instantiate the client, authenticate, and add scopes.\n $client = new Google_Client();\n $client->useApplicationDefaultCredentials();\n $client->addScope('https://www.googleapis.com/auth/cloud-platform');\n\n // Create the Cloud KMS client.\n $kms = new Google_Service_CloudKMS($client);\n\n // The resource name of the location associated with the KeyRing.\n $parent = sprintf('projects/%s/locations/%s',\n $projectId,\n $location\n );\n\n // Create the KeyRing for your project.\n $keyRing = new Google_Service_CloudKMS_KeyRing();\n $kms->projects_locations_keyRings->create(\n $parent,\n $keyRing,\n ['keyRingId' => $ring]\n );\n\n printf('Created keyring %s' . PHP_EOL, $ring);\n}", "function makeFolder($name, $parentID, $token, $type, $domainID) {\r\n\t$ch = curl_init();\r\n\r\n\tcurl_setopt($ch, CURLOPT_URL, 'https://api.broadsign.com:10889/rest/container/v9/add');\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_POST, 1);\r\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, \r\n\t\"{ \r\n\t\t\\\"container_id\\\": \".$parentID.\", \r\n\t\t\\\"domain_id\\\": \".$domainID .\", \r\n\t\t\\\"group_id\\\": $type, \r\n\t\t\\\"name\\\": \\\"\".$name.\"\\\",\r\n\t\t\\\"parent_id\\\": 0,\r\n\t\t\\\"parent_resource_type\\\": \\\"container\\\"\r\n\t}\");\r\n\r\n\t$headers = array();\r\n\t$headers[] = 'Accept: application/json';\r\n\t$headers[] = 'Authorization: Bearer '.$token;\r\n\t$headers[] = 'Content-Type: application/json';\r\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\r\n\t$result = curl_exec($ch);\r\n\tif (curl_errno($ch)) {\r\n\t\techo 'Error:' . curl_error($ch);\r\n\t}\r\n\tcurl_close($ch);\r\n\treturn $result;\r\n\t\t\r\n}" ]
[ "0.5946093", "0.56691456", "0.5416426", "0.5320446", "0.52837485", "0.5273879", "0.51473445", "0.5052347", "0.50101334", "0.4937882", "0.48883185", "0.48741025", "0.48383072", "0.48229286", "0.4783886", "0.47719818", "0.47610918", "0.4752709", "0.4745504", "0.4740777", "0.47387508", "0.47306925", "0.47185454", "0.4716402", "0.47148073", "0.46982166", "0.468873", "0.46771815", "0.4669679", "0.4668232" ]
0.7129746
0
Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces]( Requires [authentication]( Fully supports [service account authentication]( accounts) and [user authentication]( Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent. (spaces.listSpaces)
public function listSpaces($optParams = []) { $params = []; $params = array_merge($params, $optParams); return $this->call('list', [$params], ListSpacesResponse::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ListSpaces(ListSpacesInput $input, array $context = [])\n {\n $path = \"/spaces\";\n\n $context['name'] = \"eolymp.universe.Universe/ListSpaces\";\n $context['path'] = $path;\n\n return call_user_func($this->invoker, \"GET\", $this->url.$path, $input, ListSpacesOutput::class, $context);\n }", "public function getSpaces();", "public function getSpaces()\n {\n return $this->hasMany(Space::className(), ['id' => 'space_id'])->viaTable('customer_has_space', ['customer_id' => 'id']);\n }", "public function getMembers($space_id) {\n if ($response = $this->podio->request('/space/'.$space_id.'/member/')) {\n return json_decode($response->getBody(), TRUE);\n }\n }", "public function testSpacesList()\n {\n }", "public function getSpace()\n {\n list($response) = $this->getSpaceWithHttpInfo();\n return $response;\n }", "public function index()\n {\n $haus = Workspace::where('id', 5)->first();\n $spaces = Workspace::where('id', '!=', 5)\n ->where('id', '!=', 9)\n ->get()\n ->toArray();\n\n if (!empty($haus)) {\n array_unshift($spaces, $haus);\n }\n return Response::json(['spaces' => $spaces]);\n }", "public function listGroups()\n {\n return $this->service->call(array(\n 'method' => 'glpi.listGroups',\n 'session' => $this->getSessionHash()\n ));\n }", "public function listGroupsCommand()\n {\n $validAttributes = $this->settings['additionalAttributes']['group'];\n $headerRow = ['Name', 'Description'];\n\n foreach ($validAttributes as $attribute) {\n $headerRow[] = $this->translator->translateById('attribute.' . $attribute, [], null, null, 'CrowdApi',\n 'Neos.NeosIo');\n }\n\n $groups = $this->crowdApiConnector->fetchGroups(false);\n $tableRows = array_map(function ($item) use ($validAttributes) {\n $attributes = [\n $item['name'],\n $item['description'],\n ];\n\n foreach ($validAttributes as $attribute) {\n $attributes[] = array_key_exists($attribute, $item) ? $item[$attribute] : '';\n }\n return $attributes;\n }, $groups);\n\n $this->output->outputTable($tableRows, $headerRow);\n }", "public function listQueues();", "public function list()\n {\n try {\n if ($this->shouldCache()) {\n if ($this->checkCache($this->getCacheKey())) {\n $groups = $this->getCache($this->getCacheKey());\n } else {\n $groups = $this->client->listGroups(['domain' => config('gsuite.domain')])->groups;\n\n $this->putCache($this->getCacheKey(), $groups);\n }\n } else {\n $groups = $this->client->listGroups(['domain' => config('gsuite.domain')])->groups;\n }\n } catch (\\Exception $e) {\n throw $e;\n }\n\n return $groups;\n }", "function get_spaces( $force_refresh=false ){\n\t\tif($this->booking_spaces == 0 || $force_refresh == true ){\n\t\t\t$this->booking_spaces = $this->get_tickets_bookings()->get_spaces($force_refresh);\n\t\t}\n\t\treturn apply_filters('em_booking_get_spaces',$this->booking_spaces,$this);\n\t}", "public function getSpaces(array $space_ids, array $params = []): object\n {\n $path = $this->endpoint_base;\n $params['ids'] = join(',', $space_ids);\n\n return $this->get($this->credentials, $path, $params);\n }", "public function spaces()\n {\n return $this->hasMany('App\\Space', 'floor_id', 'floor_id');\n }", "function getSpacesEntry($object) {\n $entries = [];\n foreach(ShareEntry::findFor($object)->all() as $entry) {\n if(!$entry->content->canRead())\n continue;\n $entries[$entry->content->space->id] = $entry;\n }\n return $entries;\n }", "public function getMembersTop($space_id) {\n if ($response = $this->podio->request('/space/'.$space_id.'/member/top')) {\n return json_decode($response->getBody(), TRUE);\n }\n }", "function getSpace() {\n\t$getSpaceApi = array( //TODO replace with API call\n\t\t'totalSpace' => 40,\n\t\t'spaceUsed' => 10\n\t);\n\tif (is_int($getSpaceApi['spaceUsed']) && is_int($getSpaceApi['totalSpace'])) {\n\t\t$percentUsed = ($getSpaceApi['spaceUsed'] / $getSpaceApi['totalSpace']) * 100;\n\t\t$spaceLeft = $getSpaceApi['totalSpace'] - $getSpaceApi['spaceUsed'];\n\t}\n\telse {\n\t\t$percentUsed = 'Error: Space could not be calculated. Please contact an administrator.';\n\t\t$spaceLeft = '~~~';\n\t}\n\n\treturn array('percentUsed' => $percentUsed, 'spaceLeft' => $spaceLeft);\n}", "public function listPermissionGroups();", "public function spaces();", "public function getCustomerHasSpaces()\n {\n return $this->hasMany(CustomerHasSpace::className(), ['customer_id' => 'id']);\n }", "public function getOccupiedSpaces()\n {\n return $this->occupiedSpaces;\n }", "function getGroups();", "public function detachAllSpaces();", "public function loadSpaces(Request $request, int $teamid) {\n $clickup_controller = new clickup();\n $space_object = $clickup_controller->getSpaces($teamid);\n // Filter only usefull information\n $answer = array();\n if (isset($space_object['spaces'])) {\n foreach ($space_object['spaces'] as $space) {\n $answer[] = [\n \"id\" => $space['id'],\n \"name\" => $space['name']\n ];\n }\n }\n return response()->json($answer);\n }", "function getUserGroups(){\n\n\t//establish connection\n\t$conn=connect();\n\tif (!$conn) {\n\t\t$e = oci_error();\n\t\ttrigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);\n\t}\n\t\n\t//Get the groups where the owner is part of a group\n\t$sql = '\n\tSELECT group_lists.group_id, group_name FROM group_lists, groups \n\tWHERE friend_id = user_name\n\tAND friend_id = \\'' . $_SESSION[\"user\"] . '\\'';\n\n\t//Prepare sql using conn and returns the statement identifier\n\t$stid = oci_parse($conn, $sql);\n\t//Execute a statement returned from oci_parse()\n\t$res=oci_execute($stid);\n\n\tif (!$res) {\n\t\t//Error Message\n\t\t$message = \"Server busy\";\n\t\techo \"<script type='text/javascript'>\";\n\t\techo \"alert('$message');\";\n\t\techo \"</script>\";\n\t}else{\n\t\techo \"<select name=\\\"groupList\\\">\";\n\t\t\n\t\twhile($row = oci_fetch_row($stid)){\n\t\t\t//Loop until no more rows\n\t\t\techo \"<option value=\" . $row[0] . \">\" . $row[1] . \"</option>\";\n\t\t}\n\t\techo \"</select>\";\n\t}\n\n\t\n\t// Free the statement identifier when closing the connection\n\toci_free_statement($stid);\n\toci_close($conn);\n\t\n\treturn;\n}", "function displayGroups() {\n $groups = $this->getUserGroups();\n $str = \"\";\n if ($groups->count() == 0) {\n return $str;\n }\n $str .= '<ul class=\"list\">';\n foreach($groups as $thegroup) {\n $str .= \"<li>\".$thegroup->getGroup()->getName().\"</li>\"; \n }\n $str .= \"</ul>\";\n return $str; \n }", "public function actionGroups()\n {\n $directoryModule = Yii::$app->getModule('directory');\n\n if (!$directoryModule->isGroupListingEnabled()) {\n return $this->redirect(['/directory/directory/members']);\n }\n\n $groups = Group::getDirectoryGroups();\n\n Event::on(Sidebar::class, Sidebar::EVENT_INIT, function ($event) {\n $event->sender->addWidget(GroupStatistics::class, [], ['sortOrder' => 10]);\n });\n\n return $this->render('groups', [\n 'groups' => $groups,\n ]);\n }", "public function spacePermissions();", "public function getAllOwnedGroups(){\n return $this->securityDAO->getAllOwnedGroupsDAO();\n }", "public function getAllGroups(){\n return $this->securityDAO->getAllGroupsDAO();\n }" ]
[ "0.6665319", "0.6523809", "0.63263166", "0.57503897", "0.56206244", "0.5601455", "0.54635656", "0.5451948", "0.5446149", "0.5418385", "0.5372999", "0.53536224", "0.53216565", "0.52932525", "0.5264771", "0.5262102", "0.5213151", "0.52057236", "0.52048373", "0.51991695", "0.5187629", "0.51807", "0.5167402", "0.5161731", "0.51583725", "0.5142752", "0.5089731", "0.50895756", "0.5079353", "0.50199467" ]
0.7523509
0
setup PayPal api context
public function __construct() { $paypal_conf = config('paypal'); $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret'])); $this->_api_context->setConfig($paypal_conf['settings']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\n $paypal_conf = Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n $paypal_conf = Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n $paypal_conf = Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n $paypal_conf = Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct() {\n $this->apiContext = PaypalManager::getApiContext(ENV('PAYPAL_CLIENT_ID'), ENV('PAYPAL_SECRET'));\n }", "public function __construct()\n\t{\n\t\t$paypal_conf = \\Config::get('paypal');\n\t\t$this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n\t\t$this->_api_context->setConfig($paypal_conf['settings']);\n\t}", "public function __construct()\n {\n\n /** PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential(\n $paypal_conf['client_id'],\n $paypal_conf['secret'])\n );\n $this->_api_context->setConfig($paypal_conf['settings']);\n\n }", "public function __construct()\n {\n\n /** PayPal api context **/\n $paypal_conf = Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential(\n $paypal_conf['client_id'],\n $paypal_conf['secret'])\n );\n $this->_api_context->setConfig($paypal_conf['settings']);\n\n }", "public function __construct(){\n $this->apiContext = new \\PayPal\\Rest\\ApiContext(\n new \\PayPal\\Auth\\OAuthTokenCredential(\n env('PAYPAL_CLIENTID'), //clientId\n env('PAYPAL_CLIENTSECRET') //clientSecret\n )\n );\n\n // This block sets the app to use paypal production url's\n // setting 'production' in the js for the front end doesn't work\n // $this->apiContext->setConfig(\n // array(\n // 'mode' => 'live'\n // )\n // );\n }", "public function __construct()\n {\n $paypal_conf = Config::get('paypal');\n\n // creates and sets a new ApiContext based on client_id and secret provided in config/paypal.php\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n $this->_apiContext = Paypal::ApiContext(\n 'ASqSIbQls1KkjpEwzQAyjQryvlNsO_rxL2P_58kaw28GcKHTXXtuoaNGxBi3xXdn73VU_JCha65sxcOv',\n 'EAPE21MPEIf7SJntSXh-JifzkSmQX1tbOSwEM4PYhDIqyXsYQmgyl2FXIBzqlXHAbss1kFfGvq2HSv2A'\n );\n\n $this->_apiContext->setConfig([\n 'mode' => 'sandbox',\n 'service.EndPoint' => 'https://api.sandbox.paypal.com',\n 'http.ConnectionTimeOut' => 30,\n 'log.LogEnabled' => true,\n 'log.FileName' => storage_path('logs/paypal.log'),\n 'log.LogLevel' => 'FINE',\n ]\n );\n }", "public function __construct()\n {\n //$this->middleware('auth');\n $this->api_context = new \\PayPal\\Rest\\ApiContext(\n new \\PayPal\\Auth\\OAuthTokenCredential(\n 'AVShglxmKX5v9pPB2g6Y_vBzgyZGfNoM_XMEDsh4pAoFpCYDAHQ5rkE7mVekJaXa7HY9vWYdEmytovAG', // ClientID\n 'EFKtig3xmWfVh2gO_MM_Bx87yeVUXKRykhFh1hV3NYsoqyLZdTjbJu_lUsMuzN69X6i9gUlvQ2ptDjiD' // ClientSecret\n )\n );\n\n $this->api_context->setConfig(\n array(\n 'mode' => env('PAYPAL_MODE', 'sandbox'),\n 'http.ConnectionTimeOut' => 1000,\n 'log.LogEnabled' => true,\n 'log.FileName' => storage_path() . '/logs/paypal.log',\n 'log.LogLevel' => 'ERROR'\n )\n );\n }", "public function __construct()\n {\n $this->middleware('auth');\n\n $this->_apiContext = \\Paypal::ApiContext(\n config('paypal.client_id'),\n config('paypal.secret'));\n\n\t\t$this->_apiContext->setConfig(config('paypal.settings'));\n }", "public static function generateApiContext(){\r\n\t\t$cred = new OAuthTokenCredential(WP_Manager()->getPaypalClientId(), WP_Manager()->getPaypalSecret());\r\n\t\t$apiContext = new ApiContext($cred);\r\n\t\t$apiContext->setConfig(array(\r\n\t\t\t\t'mode'=>WP_Manager()->getPaypalEnvironment(),\r\n\t\t\t\t'cache.enabled' => true,\r\n\t\t));\r\n\t\treturn $apiContext;\r\n\t}", "function paypal_init() {\n $ec_uses_gateway = (defined('MODULE_PAYMENT_PAYPALWPP_PRO20_EC_METHOD') && MODULE_PAYMENT_PAYPALWPP_PRO20_EC_METHOD == 'Payflow') ? true : false;\n $nvp = (!($ec_uses_gateway) && MODULE_PAYMENT_PAYPALWPP_APIPASSWORD != '' && MODULE_PAYMENT_PAYPALWPP_APISIGNATURE != '') ? true : false;\n $ec = ($nvp && ($this->in_special_checkout() || $_GET['type'] == 'ec')) ? true : false;\n if (substr(MODULE_PAYMENT_PAYPALWPP_MODULE_MODE,0,7) == 'Payflow'/* && !$ec*/) {\n $doPayPal = new paypal_curl(array('mode' => 'payflow',\n 'user' => trim(MODULE_PAYMENT_PAYPALWPP_PFUSER),\n 'vendor' => trim(MODULE_PAYMENT_PAYPALWPP_PFVENDOR),\n 'partner'=> trim(MODULE_PAYMENT_PAYPALWPP_PFPARTNER),\n 'pwd' => trim(MODULE_PAYMENT_PAYPALWPP_PFPASSWORD),\n 'server' => MODULE_PAYMENT_PAYPALWPP_SERVER));\n $doPayPal->_endpoints = array('live' => 'https://payflowpro.verisign.com/transaction',\n 'sandbox' => 'https://pilot-payflowpro.verisign.com/transaction');\n } else {\n $doPayPal = new paypal_curl(array('mode' => 'nvp',\n 'user' => trim(MODULE_PAYMENT_PAYPALWPP_APIUSERNAME),\n 'pwd' => trim(MODULE_PAYMENT_PAYPALWPP_APIPASSWORD),\n 'signature' => trim(MODULE_PAYMENT_PAYPALWPP_APISIGNATURE),\n 'version' => '3.2',\n 'server' => MODULE_PAYMENT_PAYPALWPP_SERVER));\n $doPayPal->_endpoints = array('live' => 'https://api-3t.paypal.com/nvp',\n 'sandbox' => 'https://api-3t.sandbox.paypal.com/nvp');\n }\n\n // set logging options\n $doPayPal->_logDir = $this->_logDir;\n// $doPayPal->_logLevel = $this->_logLevel;\n\n // set proxy options if configured\n if (CURL_PROXY_REQUIRED == 'True' && CURL_PROXY_SERVER_DETAILS != '') {\n $proxy_tunnel_flag = (defined('CURL_PROXY_TUNNEL_FLAG') && strtoupper(CURL_PROXY_TUNNEL_FLAG) == 'FALSE') ? false : true;\n $doPayPal->setCurlOption(CURLOPT_HTTPPROXYTUNNEL, $proxy_tunnel_flag);\n $doPayPal->setCurlOption(CURLOPT_PROXYTYPE, CURLPROXY_HTTP);\n $doPayPal->setCurlOption(CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS);\n }\n\n // transaction processing mode\n $doPayPal->_trxtype = (in_array(MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE, array('Auth Only', 'Order'))) ? 'A' : 'S';\n// $this->zcLog('comm details', 'Comm Details: ' . \"\\n\" . print_r($doPayPal, true) . \"\\n\\n\" . 'MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE = ' . MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE . \"\\ndoPayPal->_trxtype = \" . $doPayPal->_trxtype . \"\\n\");\n\n return $doPayPal;\n }", "public function __construct()\n {\n parent::__construct();\n\n\n // Detect if we are running in live mode or sandbox\n if ( config('services.paypal.settings.mode') === 'live' ) {\n $this->paypalClientId = config('services.paypal.live_client_id');\n $this->paypalSecret = config('services.paypal.live_secret');\n } else {\n $this->paypalClientId = config('services.paypal.sandbox_client_id');\n $this->paypalSecret = config('services.paypal.sandbox_secret');\n }\n \n // Set the Paypal API Context/Credentials\n $this->paypalApiContext = new \\PayPal\\Rest\\ApiContext(new \\PayPal\\Auth\\OAuthTokenCredential($this->paypalClientId, $this->paypalSecret));\n $this->paypalApiContext->setConfig(config('services.paypal.settings'));\n }", "public function __construct() {\n parent::__construct();\n $this->middleware('guest');\n\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential('AVSbZbw7g-cdc_q-RzY63n4nLIQQJ1MsU8UHrDU3bbBUWItz7hAbt1jBHxlh3UD2VZHB56TCUvbjPxCL'\n , 'EC-rB97O5g2SHkOY-YpECsRUXXHHm9jIrj3XB9TivA5X-fL2HrHtQT1oKyEwI6P1iRyqIBE69v0Z4t-m'));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n\n // ### Api Context\n // Pass in a `ApiContext` object to authenticate\n // the call. You can also send a unique request id\n // (that ensures idempotency). The SDK generates\n // a request id if you do not pass one explicitly.\n\n $this->_apiContext = Paypalpayment::apiContext(config('paypal_payment.Account.ClientId'),\n\n config('paypal_payment.Account.ClientSecret'));\n\n }", "public function set_api_context() {\n\t\t$this->apiContext = new \\PayPal\\Rest\\ApiContext( new \\PayPal\\Auth\\OAuthTokenCredential( $this->clientID, $this->clientSecret ) );\n\t\t$this->apiContext->setConfig( array( 'mode' => $this->environment ) );\n\n\t\treturn true;\n\t}", "protected function _apiContext()\n {\n if ($this->_apiContext !== null) {\n return $this->_apiContext;\n }\n\n $config = \\App::get('configs')->get('settings.paypal');\n\n $this->_apiContext = new \\PayPal\\Rest\\ApiContext(\n new \\PayPal\\Auth\\OAuthTokenCredential(\n $config['client_id'],\n $config['secret_code']\n )\n );\n\n $options = array();\n\n if ($config['testmode']) {\n $options['mode'] = 'sandbox';\n } else {\n $options['mode'] = 'live';\n }\n\n // @link https://developer.paypal.com/webapps/developer/docs/api/#inputfields-object\n $this->_apiContext->setConfig(\n $options\n );\n\n return $this->_apiContext;\n }", "public function __construct() {\n $this->paypaldata = Config::get('paypal');\n }", "function __construct()\n {\n $this->_paymentRestrictions = Mage::getSingleton('aw_sarp2/engine_paypal_restrictions');\n $this->_service = Mage::getSingleton('aw_sarp2/engine_paypal_service');\n }", "public function __construct()\n {\n $this->_configModel = Mage::getSingleton('radial_paypal/config');\n }", "public function createPayment(){\n $payer = new Payer();\n $payer->setPaymentMethod(\"paypal\");\n\n // Set redirect urls\n $redirectUrls = new RedirectUrls();\n $redirectUrls->setReturnUrl('http://localhost:3000/process.php')\n ->setCancelUrl('http://localhost:3000/cancel.php');\n\n // Set payment amount\n $item1 = new Item();\n $item1->setName('Ground Coffee 40 oz')\n ->setCurrency('USD')\n ->setQuantity(1)\n ->setSku(\"123123\") // Similar to `item_number` in Classic API\n ->setPrice(8);\n $item2 = new Item();\n $item2->setName('Granola bars')\n ->setCurrency('USD')\n ->setQuantity(1)\n ->setSku(\"321321\") // Similar to `item_number` in Classic API\n ->setPrice(2);\n $itemList = new ItemList();\n $itemList->setItems(array($item1, $item2));\n\n $amount = new Amount();\n $amount->setCurrency(\"USD\")\n ->setTotal(10);\n // ->setDetails($details);\n\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($itemList)\n ->setDescription(\"Payment description\")\n ->setInvoiceNumber(100);\n\n // Create the full payment object\n $payment = new Payment();\n $payment->setIntent('sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirectUrls)\n ->setTransactions(array($transaction));\n\n try {\n $payment->create($this->apiContext);\n } catch (Exception $ex) {\n // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY\n ResultPrinter::printError(\"Created Payment Using PayPal. Please visit the URL to Approve.\", \"Payment\", null, $request, $ex);\n exit(1);\n }\n // ### Get redirect url\n // The API response provides the url that you must redirect\n // the buyer to. Retrieve the url from the $payment->getApprovalLink()\n // method\n $approvalUrl = $payment->getApprovalLink();\n // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY\n return $payment;\n $temp = json_decode($payment);\n $returnVal = json_encode( array(\"paymentID\" => $temp->id));\n // return $payment;\n return $returnVal;\n }", "function __construct() {\r\n\t\tparent::__construct();\r\n\t\t$paypal_details = array(\r\n\t\t\t// you can get this from your Paypal account, or from your\r\n\t\t\t// test accounts in Sandbox\r\n\t\t\t'API_username' => 'esajayyogal-facilitator_api1.gmail.com', // 'paypal_api1.somedomain.com', \r\n\t\t\t'API_signature' => 'Aw96tTs-bXJR73B7RYZX6RIxnL3HAtTK1bvcaktTcWfunTX39b-PT0Mu',// 'ABCDEFGHIJKLMNOPQRSTUVWXYZabc.0123456789abcdefgihjklmn-e', \r\n\t\t\t'API_password' => '1369132902',// 'ABCDEFGHIJ123456',\r\n\t\t\t// Paypal_ec defaults sandbox status to true\r\n\t\t\t// Change to false if you want to go live and\r\n\t\t\t// update the API credentials above\r\n\t\t\t// 'sandbox_status' => false,\r\n\t\t);\r\n\t\t$this->load->library('paypal_ec', $paypal_details);\r\n\t}", "public\r\n\r\n\tfunction __construct() {\r\n\r\n\t\t$this->CI = & get_instance();\r\n\t\t$this->CI->load->helper( 'url' );\r\n\t\t$this->CI->load->helper( 'form' );\r\n\t\t$this->CI->load->config( 'hooks' );\r\n\t\t$this->CI->load->config( 'hooks' );\r\n\t\t$this->CI->load->model( 'Settings_Model' );\r\n\r\n\t\t// Get payment keys\r\n\t\t$payment = $this->CI->Settings_Model->get_payment_gateway_data();\r\n\r\n\t\t// AUTHORIZE.NET AIM SETTINGS\r\n\r\n\t\t$this->merchanAuthentication = new net\\ authorize\\ api\\ contract\\ v1\\ MerchantAuthenticationType();\r\n\t\t$this->merchanAuthentication->setName( $payment['authorize_aim_api_login_id'] );\r\n\t\t$this->merchanAuthentication->setTransactionKey( $payment['authorize_aim_api_transaction_key'] );\r\n\t\t$this->refId = 'ref' . time();\r\n\r\n\t\t// PAYPAL PRO SETTINGS\r\n\t\t\r\n\t\t$this->gateway = Omnipay::create( 'PayPal_Pro' );\r\n\t\t$this->gateway->setUsername( 'batikkode-facilitator_api1.gmail.com' );\r\n\t\t$this->gateway->setPassword( 'SKJXNTSPZUUFR4L5' );\r\n\t\t$this->gateway->setSignature( 'AFcWxV21C7fd0v3bYYYRCpSSRl31AHsyCp6cnyiiUJtWS.5bR.YdidWW' );\r\n\t\t$this->gateway->setTestMode( 'true' );\r\n\r\n\t\t// PAYPAL STANDART SETTINGS\r\n\r\n\t\t$sanbox = $payment['paypal_test_mode_enabled'];\r\n\t\t$this->paypal_url = ( $sanbox == TRUE ) ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';\r\n\t\t$this->last_error = '';\r\n\t\t$this->ipn_response = '';\r\n\t\t$this->ipn_log_file = $this->CI->config->item( 'paypal_lib_ipn_log_file' );\r\n\t\t$this->ipn_log = $this->CI->config->item( 'paypal_lib_ipn_log' );\r\n\t\t$this->button_path = $this->CI->config->item( 'paypal_lib_button_path' );\r\n\t\t$businessEmail = $this->CI->config->item( 'business' );\r\n\t\t$this->add_field( 'business', $businessEmail );\r\n\t\t$this->add_field( 'rm', '2' ); // Return method = POST\r\n\t\t$this->add_field( 'cmd', '_xclick' );\r\n\t\t$this->add_field( 'currency_code', $this->CI->config->item( 'paypal_lib_currency_code' ) );\r\n\t\t$this->add_field( 'quantity', '1' );\r\n\t\t$this->button( 'Pay Now!' );\r\n\r\n\t\t\r\n\t}", "public function __construct()\r\n\t{\r\n parent::__construct('paypal');\r\n\r\n if($this->_debug===1){\r\n \t//测试地址\r\n \t$this->gatewayUrl = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\r\n }\r\n\t\t// Populate $fields array with a few default\r\n\t\t$this->set_field('rm', '2'); // Return method = POST\r\n\t\t$this->set_field('cmd', '_xclick');\r\n\t}", "function __construct()\n\t{\n\t\tparent::__construct();\n \n\t\t$this->paypal = new Payment();\n\t}", "function paypal_class() {\n \n // initialization constructor. Called when class is created.\n \n $this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';\n \n $this->last_error = '';\n \n $this->ipn_log_file = 'paypal_ipn.log';\n $this->ipn_log = true; \n $this->ipn_response = '';\n \n // populate $fields array with a few default values. See the paypal\n // documentation for a list of fields and their data types. These defaul\n // values can be overwritten by the calling script.\n\n $this->add_field('rm','2'); // Return method = POST\n $this->add_field('cmd','_xclick'); \n \n }", "private function generateApiContext($clientId, $clientSecret) {\n\t\t\t// #### SDK configuration\n\t\t\t// Register the sdk_config.ini file in current directory\n\t\t\t// as the configuration source.\n\t\t\t/*\n\t\t\tif(!defined(\"PP_CONFIG_PATH\")) {\n\t\t\t\tdefine(\"PP_CONFIG_PATH\", __DIR__);\n\t\t\t}\n\t\t\t*/\n\t\t\t// ### Api context\n\t\t\t// Use an ApiContext object to authenticate\n\t\t\t// API calls. The clientId and clientSecret for the\n\t\t\t// OAuthTokenCredential class can be retrieved from\n\t\t\t// developer.paypal.com\n\t\t\t$apiContext = new ApiContext(\n\t\t\t\tnew OAuthTokenCredential(\n\t\t\t\t\t$clientId,\n\t\t\t\t\t$clientSecret\n\t\t\t\t)\n\t\t\t);\n\t\t\t// Comment this line out and uncomment the PP_CONFIG_PATH\n\t\t\t// 'define' block if you want to use static file\n\t\t\t// based configuration\n\t\t\t$apiContext->setConfig(\n\t\t\t\tarray(\n\t\t\t\t\t'mode' => $this->mode,\n\t\t\t\t\t'log.LogEnabled' => true,\n\t\t\t\t\t'log.FileName' => MANIFEST . '/logs/PayPal.log',\n\t\t\t\t\t'cache.FileName' => MANIFEST . '/cache/PayPal',\n\t\t\t\t\t'log.LogLevel' => 'DEBUG', // PLEASE USE `FINE` LEVEL FOR LOGGING IN LIVE ENVIRONMENTS\n\t\t\t\t\t'validation.level' => 'log',\n\t\t\t\t\t'cache.enabled' => true,\n\t\t\t\t\t// 'http.CURLOPT_CONNECTTIMEOUT' => 30\n\t\t\t\t\t// 'http.headers.PayPal-Partner-Attribution-Id' => '123123123'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// Partner Attribution Id\n\t\t\t// Use this header if you are a PayPal partner. Specify a unique BN Code to receive revenue attribution.\n\t\t\t// To learn more or to request a BN Code, contact your Partner Manager or visit the PayPal Partner Portal\n\t\t\t// $apiContext->addRequestHeader('PayPal-Partner-Attribution-Id', '123123123');\n\t\t\treturn $apiContext;\n\t\t}" ]
[ "0.7897924", "0.78145975", "0.78145975", "0.78145975", "0.77611697", "0.7732793", "0.77179885", "0.76861376", "0.76540965", "0.760636", "0.7592829", "0.744411", "0.7267881", "0.7083003", "0.70794237", "0.7070553", "0.70586514", "0.6945765", "0.6830956", "0.6794331", "0.67225385", "0.6503189", "0.63504225", "0.6274739", "0.6268544", "0.62491304", "0.61275196", "0.6072222", "0.59930414", "0.5983852" ]
0.787418
1
show paypal form view
public function showForm(Request $request) { return view('payments.paypal'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paypalForm($ref_id) {\n\n\t\t$paypalInfo = $this->getPaypalInfo();\n\n\t\t$form = '<html><body onLoad=\"document.paypal.submit()\">';\n\t\t$form.= '<form action=\"'.$paypalInfo['paypal_url'].'\" method=\"post\" name=\"paypal\" id=\"paypal\">';\n\t\t$form.= '<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">';\n\t\t$form.= '<input type=\"hidden\" name=\"business\" value=\"'.$_REQUEST['business'].'\">';\n\t\t$form.= '<input type=\"hidden\" name=\"item_name\" value=\"'.$_REQUEST['item_name'].'\">';\n\t\t$form.= '<input type=\"hidden\" name=\"shipping\" value=\"'.($_REQUEST['quantity']*$_REQUEST['postage']).'\">';\n\t\t$form.= '<input type=\"hidden\" name=\"quantity\" value=\"'.$_REQUEST['quantity'].'\">';\n\t\t$form.= '<input type=\"hidden\" name=\"amount\" value=\"'.$_REQUEST['price'].'\">';\n\t\t$form.= '<input type=\"hidden\" name=\"currency_code\" value=\"'.CURRENCYCODE.'\">';\n\t\t$form.= '<input type=\"hidden\" name=\"item_number\" value=\"'.$_REQUEST['item_number'].'\">';\n\t\t$form.= '<input type=\"hidden\" name=\"StoreID\" value=\"'.$_REQUEST['StoreID'].'\"> ';\n\t\t$form.= '<input type=\"hidden\" name=\"custom\" value=\"'.$_REQUEST['StoreID'].','.$ref_id.','.$_SESSION['ShopID'].','.time().'\"> ';\n\t\t$form.= '<input type=\"hidden\" name=\"return\" value=\"'.$paypalInfo['paypal_siteurl'].'/product_activate.php\">';\n\t\t$form.= '<input type=\"hidden\" name=\"cancel_return\" value=\"'.$paypalInfo['paypal_siteurl'].'/product_activate.php\">';\n\t\t$form.= '<input type=\"hidden\" name=\"notify_url\" value=\"'.$paypalInfo['paypal_siteurl'].'/product_activate.php\">';\n\t\t$form.= '</form></body></html>';\n\t\treturn $form;\n\t}", "public function payments() {\n $this->data = array_merge($this->data, Langurator::getLocalizedWords(\"paypal\"));\n\n\t\t$insecure_checkout_url = Request::root().'/paypal/checkout'; \n\n\t\t$this->data['secure_checkout_url'] = str_replace(\"http\", \"https\", $insecure_checkout_url);\n\n\t\t//$this->firephp->log($this->data['secure_checkout_url'], \"this->data['secure_checkout_url']\");\n\n\t\t$this->data['new_users_email'] = Session::get('email');\n\n\t\treturn View::make('payments', $this->data);\n\t}", "protected function paypal()\n\t{\n\n\t\t\tif ( $this->settings->paypal_sandbox == 'true') {\n\t\t\t\t// SandBox\n\t\t\t\t$action = \"https://www.sandbox.paypal.com/cgi-bin/webscr\";\n\t\t\t\t} else {\n\t\t\t\t// Real environment\n\t\t\t\t$action = \"https://www.paypal.com/cgi-bin/webscr\";\n\t\t\t\t}\n\n\t\t\t$urlSuccess = url('user/dashboard/deposits');\n\t\t\t$urlCancel = url('user/dashboard/add/funds');\n\t\t\t$urlPaypalIPN = url('paypal/ipn');\n\n\t\t\t$feePayPal = config('commissions.paypal_fee');\n\t\t\t$centsPayPal = config('commissions.paypal_cents');\n\n\t\t\t$amountFixed = number_format($this->request->amount + ($this->request->amount * $feePayPal / 100) + $centsPayPal, 2, '.', ',');\n\n\t\t\treturn response()->json([\n\t\t\t\t\t 'success' => true,\n\t\t\t\t\t 'formPP' => '<form id=\"form_pp\" name=\"_xclick\" action=\"'.$action.'\" method=\"post\" style=\"display:none\" target=\"_blank\">\n\t\t\t\t\t <input type=\"hidden\" name=\"cmd\" value=\"_xclick\">\n\t\t\t\t\t <input type=\"hidden\" name=\"return\" value=\"'.$urlSuccess.'\">\n\t\t\t\t\t <input type=\"hidden\" name=\"cancel_return\" value=\"'.$urlCancel.'\">\n\t\t\t\t\t <input type=\"hidden\" name=\"notify_url\" value=\"'.$urlPaypalIPN.'\">\n\t\t\t\t\t <input type=\"hidden\" name=\"currency_code\" value=\"'.$this->settings->currency_code.'\">\n\t\t\t\t\t <input type=\"hidden\" name=\"amount\" id=\"amount\" value=\"'.$amountFixed.'\">\n\t\t\t\t\t <input type=\"hidden\" name=\"custom\" value=\"id='.Auth::user()->id.'&amount='.$this->request->amount.'\">\n\t\t\t\t\t <input type=\"hidden\" name=\"item_name\" value=\"'.trans('misc.add_funds_desc').'\">\n\t\t\t\t\t <input type=\"hidden\" name=\"business\" value=\"'.$this->settings->paypal_account.'\">\n\t\t\t\t\t <input type=\"submit\">\n\t\t\t\t\t </form>',\n\t\t\t\t\t ]);\n\n\t}", "function showPaymentForm($params, $pmconfigs){\n }", "public function view() {\n\n // Set the page's title\n set_the_title($this->CI->lang->line('paypal'));\n\n // Set Boostrap's styles\n set_css_urls(array('stylesheet', '//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css', 'text/css', 'all'));\n\n // Set PayPal's styles\n set_css_urls(array('stylesheet', base_url('assets/base/payments/collection/paypal/styles/css/styles.css?ver=' . MIDRUB_BASE_PAYMENTS_PAYPAL_VERSION), 'text/css', 'all'));\n\n // Simple Line Icons\n set_css_urls(array('stylesheet', '//cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.css', 'text/css', 'all'));\n\n // Set jQuery JS\n set_js_urls(array(base_url('assets/js/jquery.min.js')));\n \n // Set Popper JS\n set_js_urls(array('//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js'));\n \n // Set Bootstrap JS\n set_js_urls(array('//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js')); \n\n // Set Main Midrub JS\n set_js_urls(array(base_url('assets/js/main.js'))); \n\n // Set PayPal's JS LIBS\n set_js_urls(array('//www.paypalobjects.com/api/checkout.js'));\n set_js_urls(array('//js.braintreegateway.com/web/3.33.0/js/client.min.js'));\n set_js_urls(array('//js.braintreegateway.com/web/3.33.0/js/paypal-checkout.min.js')); \n \n // Set PayPal JS\n set_js_urls(array(base_url('assets/base/payments/collection/paypal/js/main.js?ver=' . MIDRUB_BASE_PAYMENTS_PAYPAL_VERSION)));\n\n // Get the incomplete transaction\n $incomplete_transaction = the_incomplete_transaction();\n\n // Verify if incomplete transaction exists\n if ( $incomplete_transaction ) {\n\n // Params array\n $params = array(\n 'transaction_id' => $incomplete_transaction['transaction_id'],\n 'amount' => $incomplete_transaction['pay']['amount'],\n 'currency' => $incomplete_transaction['pay']['currency']\n );\n\n // Verify if isset currency sign\n if ( isset($incomplete_transaction['pay']['sign']) ) {\n\n // Set currency sign\n $params['sign'] = $incomplete_transaction['pay']['sign'];\n\n }\n\n // Verify if isset recurring_payments\n if ( isset($incomplete_transaction['options']['recurring_payments']) ) {\n\n if ( $incomplete_transaction['options']['recurring_payments'] === 'on' ) {\n\n // Verify the plan's ID exists\n if ( isset($incomplete_transaction['options']['plan_id']) ) {\n\n // First get the token\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => 'https://api.paypal.com/v1/oauth2/token',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'POST',\n CURLOPT_USERPWD => get_option('paypal_client_id') . ':' . get_option('paypal_client_secret'),\n CURLOPT_POSTFIELDS => 'grant_type=client_credentials',\n CURLOPT_HTTPHEADER => array(\n 'Accept: application/json',\n 'Accept-Language: en_US'\n )\n ));\n\n $token_response = json_decode(curl_exec($curl), true);\n curl_close($curl);\n\n // Verify if access token exists\n if ( isset($token_response['access_token']) ) {\n\n // Product params for request\n $product_params = array(\n 'name' => 'Plan ' . $incomplete_transaction['options']['plan_id'],\n 'type' => 'SERVICE'\n );\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, 'https://api.paypal.com/v1/catalogs/products');\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($product_params));\n curl_setopt(\n $curl,\n CURLOPT_HTTPHEADER,\n array(\n 'Content-Type: application/json',\n 'Authorization: Bearer ' . $token_response['access_token'],\n 'PayPal-Request-Id: plan_' . $incomplete_transaction['options']['plan_id']\n )\n );\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $product_response = json_decode( curl_exec ($curl), true);\n curl_close ($curl);\n \n // Verify if the product was created\n if ( isset($product_response['id']) ) {\n\n // Plan params for request\n $plan_params = array(\n 'name' => 'Plan ' . $incomplete_transaction['options']['plan_id'],\n 'product_id' => $product_response['id'],\n 'billing_cycles' => array( \n array(\n 'pricing_scheme' => array(\n 'fixed_price' => array(\n 'currency_code' => $incomplete_transaction['pay']['currency'],\n 'value' => $incomplete_transaction['pay']['amount']\n )\n ),\n 'frequency' => array(\n 'interval_unit' => 'MONTH',\n 'interval_count' => 1\n ),\n 'sequence' => 1,\n 'total_cycles' => 1,\n 'tenure_type' => 'TRIAL'\n ), \n array(\n 'pricing_scheme' => array(\n 'fixed_price' => array(\n 'currency_code' => $incomplete_transaction['pay']['currency'],\n 'value' => $incomplete_transaction['pay']['amount']\n )\n ),\n 'frequency' => array(\n 'interval_unit' => 'MONTH',\n 'interval_count' => 1\n ),\n 'sequence' => 2,\n 'total_cycles' => 999,\n 'tenure_type' => 'REGULAR'\n )\n ),\n 'payment_preferences' => array(\n \"service_type\" => \"PREPAID\",\n 'auto_bill_outstanding' => true,\n 'setup_fee_failure_action' => 'CONTINUE',\n 'payment_failure_threshold' => 3\n ),\n 'quantity_supported' => true\n\n );\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://api.paypal.com/v1/billing/plans');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($plan_params));\n curl_setopt(\n $ch,\n CURLOPT_HTTPHEADER,\n array(\n 'Content-Type: application/json',\n 'Authorization: Bearer ' . $token_response['access_token'],\n 'Prefer: return=representation'\n )\n );\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $plan_response = json_decode( curl_exec ($ch), true);\n curl_close ($ch); \n\n // Verify if the plan was created\n if ( isset($plan_response['id']) ) {\n\n // Set Plan Id\n $params['plan_id'] = $plan_response['id'];\n\n // Set recurring_payments\n $params['recurring_payments'] = true;\n\n }\n\n }\n\n }\n\n }\n\n }\n\n }\n\n try {\n\n // Set views params\n set_payment_view(\n $this->CI->load->ext_view(\n MIDRUB_BASE_PAYMENTS_PAYPAL . 'views',\n 'main',\n $params,\n true\n )\n\n );\n\n } catch (Exception $ex) {\n\n // Set views params\n set_payment_view(\n $this->CI->load->ext_view(\n MIDRUB_BASE_PAYMENTS_PAYPAL . 'views',\n 'error',\n array(\n 'error' => $ex->getMessage()\n ),\n true\n )\n\n );\n\n }\n\n } else {\n\n // Set views params\n set_payment_view(\n $this->CI->load->ext_view(\n MIDRUB_BASE_PAYMENTS_PAYPAL . 'views',\n 'expired',\n array(),\n true\n )\n\n );\n\n }\n \n }", "public function paymenForm($affemail, $email, $item_name, $item_number, $item_cost, $item_download_url, $item_cancel_url, $sys_currency, $sys_locale, $sys_charset, $item_ipn_url, $ref,$aff, $ip, $salesletter) {\n\t# header() seems to cause session issues with PayPal\n\techo \"<html>\n\t<head>\n\t\t<title>\".$_ENV['lang['goto_paypal_title']'].\"</title>\n\t</head>\n\t<body>\n\t\t<p align=center>\n\t\t<table width=100% height=100%>\n\t\t\t<tr>\n\t\t\t\t<td align=center valign=center>\n\t\t\t\t\t<table width=420px cellpadding=5 style='border: 1px solid black; font-size: 12px;'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><font face=verdana><p>\".$_ENV['lang['goto_paypal_explain']'].\"</p>\n\t\t\t\t\t\t\t<p>\".$_ENV['lang['goto_paypal_explain2']'].\"</p></font></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td align=center valign=top height=50px><p align=center><font style='font-size: 12px;'>[\".$_ENV['lang['goto_paypal_affiliate']'].\" = $affemail]</font></p></td>\n\t\t\t</tr>\n\t\t</table></p>\n\t\t<form action=\\\"https://www.paypal.com/cgi-bin/webscr\\\" method=\\\"post\\\" id=paymentform>\n\t\t<input type=\\\"hidden\\\" name=\\\"cmd\\\" value=\\\"_xclick\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"business\\\" value=\\\"$email\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"item_name\\\" value=\\\"$item_name\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"item_number\\\" value=\\\"$item_number\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"amount\\\" value=\\\"$item_cost\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"no_shipping\\\" value=\\\"1\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"return\\\" value=\\\"$item_download_url\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"cancel_return\\\" value=\\\"$item_cancel_url\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"no_note\\\" value=\\\"1\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"shipping\\\" value=\\\"0.00\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"currency_code\\\" value=\\\"$sys_currency\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"lc\\\" value=\\\"$sys_locale\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"charset\\\" value=\\\"$sys_charset\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"bn\\\" value=\\\"PP-BuyNowBF\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"rm\\\" value=\\\"2\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"notify_url\\\" value=\\\"$item_ipn_url\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"cbt\\\" value=\\\"\".$_ENV['lang['return_button']'].\"\\\">\n\t\t<input type=\\\"hidden\\\" name=\\\"custom\\\" value=\\\"$ref|$aff|$ip||||$salesletter\\\">\n\t\t</form>\n\t\t\t\t<script language=javascript><!--\n\t\tsetTimeout('redir()', 5000);\n\n\t\tfunction redir() {\n\t\t\tdocument.getElementById('paymentform').submit();\n\t\t\t}\n\t\t\t\t--></script>\n\t\t\t</body>\n\t\t</html>\";\n }", "public function getHtml(){\n\t\t# Check for PayPal ID or an email address associated with PayPal account\n\t\tif(!$this->get('business')){\n\t\t\techo 'Need to set PayPal ID to the variable \"business\".<br>';\n\t\t}\n\t\t# Prepare for form opening\n\t\tif($this->sandbox == true) $url = PAYPAL_SANDBOX_SUBMIT_URL;\n\t\telse $url = PAYPAL_SUBMIT_URL;\n\t\t\n\t\t$this->html .= \"<form name=\\\"{$this->name}\\\" action=\\\"{$url}\\\" method=\\\"post\\\"\";\n\t\tif($this->openInNewWindow) $this->html .= \" target=\\\"_blank\\\"\";\n\t\t$this->html .= \">\\n\";\n\t\t\t\t\n\t\tforeach( $this->variables as $key => $value ){\n\t\t\tif( $value !== \"\" ){\n\t\t\t\t$id = 'pp-'.str_replace('_', '-', $key);\n\t\t\t\t$this->html .= \"<input type=\\\"hidden\\\" id=\\\"$id\\\" name=\\\"{$key}\\\" value=\\\"{$value}\\\" />\\n\";\n\t\t\t}\n\t\t}\n\t\t$this->html .= $this->getCartItemsHtml();\n\t\treturn $this->html;\n\t}", "function Paypal() \n {\n $this->last_error = ''; \n $this->ipn_log_file = '.ipn_results.log';\n $this->ipn_log = true; \n $this->ipn_response = '';\n $this->add_field('rm','2'); // Return method = POST\n $this->add_field('cmd','_xclick'); \n }", "function showPaypal(){\n if(isset($_SESSION['total_quantity']) && $_SESSION['total_quantity'] >= 1){\n\n $paypal = <<<DELIMETER\n \n <input type=\"image\" name=\"upload\"\n src=\"https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif\"\n alt=\"PayPal - The safer, easier way to pay online\">\n \n DELIMETER;\n\n return $paypal;\n\n }\n }", "public function new(){\n\t\treturn view(\"payment\");\n\t}", "function display(){\n global $DOPBSP;\n \n $DOPBSP->views->backend_settings_payment_gateways->template(array('id' => $_POST['id']));\n \n die();\n }", "public function show()\n {\n if($_SERVER['REQUEST_METHOD'] == 'GET') {\n\n $token = $_GET['paymentId'];\n\n $payment = Paypalpayment::getById($token, $this->_apiContext);\n\n dd($payment);\n\n }\n\n }", "public function actionPaypalSuccess()\n\t{\n\t\t$this->layout='//layouts/main2'; // kim\n\t\t$model=new Product('search');\n\t\t$this->render('paypalSuccess', array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function index()\n {\n $total = Cart::total();\n $discount = null;\n $code = null;\n // $action = auth()->user()->isAdmin() ? '/create-invoice' : '';\n\n return view('layouts.payment_form', compact('total', 'discount', 'code'));\n }", "function paypal_auto_form(){\r\r\n\t\t// a form with hidden elements which is submitted to paypal via the \r\r\n\t\t// BODY element's onLoad attribute.\r\r\n\t\t$this->button('Click here if you\\'re not automatically redirected...');\r\r\n\r\r\n\t\techo '<html>' . \"\\n\";\r\r\n\t\techo '<head><title>Processing Payment...</title></head>' . \"\\n\";\r\r\n\t\techo '<body style=\"text-align:center;\" onLoad=\"document.forms[\\'paypal_auto_form\\'].submit();\">' . \"\\n\";\r\r\n\t\techo '<p style=\"text-align:center;\">Please wait, your order is being processed and you will be redirected to the PayPal website.</p>' . \"\\n\";\r\r\n\t\techo $this->paypal_form('paypal_auto_form');\r\r\n\t\techo '</body></html>';\r\r\n\t}", "function prepareBasketPaymentForm($acflag) {\n $Store = new Store();\n $Store->getStore($this->StoreID);\n $Store->setStoreVar('SetLocationID', $this->LocationID);\n $Store->setStoreVar('Locations', $Store->getLocations());\n\n //start modal\n $str = '';\n $str = '<div class=\"modal-header\">';\n $str .= '<button class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">Cancel &times;</button>';\n $str .= '<h4>Choose Payment Type</h4>';\n $str .= '</div>';\n $str .= '<div class=\"modal-body\">';\n if ($acflag === true)\n {\n $str .= '<div class=\"alert alert-block alert-success\">';\n $str .= '<strong>Success!</strong> Your new account has been created.';\n $str .= '</div>';\n }\n $str .= '<form name=\"deliveryinfo\" id=\"deliveryinfo\" class=\"form-horizontal\">';\n $str .= '<div class=\"row-fluid\">';\n if (isset($Store->Locations[$Store->SetLocationID]['ppadd']))\n {\n $str .= '<div class=\"control-group span3 offset1\">';\n $str .= '<label class=\"radio\">';\n $str .= '<input type=\"radio\" name=\"pchoiceopt\" id=\"pchoicepp\" value=\"pp\" checked>';\n $str .= 'Pay Via Paypal';\n $str .= '</label>';\n $str .= '</div>';\n }\n\n $str .= '<div class=\"control-group span3 offset1\">';\n $str .= '<label class=\"radio\">';\n $str .= '<input type=\"radio\" name=\"pchoiceopt\" id=\"pchoicec\" value=\"c\" checked>';\n $str .= 'Pay With Cash';\n $str .= '</label>';\n $str .= '</div>';\n\n if ($Store->Locations[$Store->SetLocationID]['pdq'] == 1)\n {\n $bsk = $this->getBasketInfo();\n //we have a pdq ability\n //what kinds of payments and what cards\n\n if ($Store->Locations[$Store->SetLocationID]['pdqphone'] == 1)\n {\n //phone payments\n $str .= '<div class=\"control-group span3 offset1\">';\n $str .= '<label class=\"radio\">';\n $str .= '<input type=\"radio\" name=\"pchoiceopt\" id=\"pchoicepbp\" value=\"pbp\">';\n $str .= 'Pay via Phone';\n $str .= '</label>';\n \t\t$str .= '</div>';\n //instore with card\n if ($bsk['deltype'] === 'C')\n {\n $str .= '<div class=\"control-group span3 offset1\">';\n $str .= '<label class=\"radio\">';\n $str .= '<input type=\"radio\" name=\"pchoiceopt\" id=\"pchoicepbp\" value=\"coc\">';\n $str .= 'Pay via Card on collection';\n $str .= '</label>';\n $str .= '</div>';\n }\n }\n if (($Store->Locations[$Store->SetLocationID]['pdqmobile'] == 1) && ($bsk['deltype'] === 'D'))\n {\n //mobile doorstep //only on delivery\n $str .= '<div class=\"control-group span3 offset1\">';\n $str .= '<label class=\"radio\">';\n $str .= '<input type=\"radio\" name=\"pchoiceopt\" id=\"pchoicecod\" value=\"cod\">';\n $str .= 'Pay via Card on delivery';\n $str .= '</label>';\n $str .= '</div>';\n }\n }\n\n $str .= '</div>';\n if ($Store->Locations[$Store->SetLocationID]['pdq'] == 1)\n {\n\n $cardstr = '<ul>';\n if ($Store->Locations[$Store->SetLocationID]['mastercard'] == 1)\n {\n $cardstr .= '<li>Mastercard</li>';\n }\n if ($Store->Locations[$Store->SetLocationID]['maestro'] == 1)\n {\n $cardstr .= '<li>Maestro</li>';\n }\n if ($Store->Locations[$Store->SetLocationID]['visael'] == 1)\n {\n $cardstr .= '<li>Visa Electron</li>';\n }\n if ($Store->Locations[$Store->SetLocationID]['visa'] == 1)\n {\n $cardstr .= '<li>Visa</li>';\n }\n if ($Store->Locations[$Store->SetLocationID]['solo'] == 1)\n {\n $cardstr .= '<li>Solo</li>';\n }\n if ($Store->Locations[$Store->SetLocationID]['switch'] == 1)\n {\n $cardstr .= '<li>Switch</li>';\n }\n $cardstr .= '</ul>';\n $str .= '<div class=\"alert alert-info\">We currently accept the following cards ' . $cardstr . '</div>';\n }\n $str .= '</div>';\n $str .= '<div class=\"modal-footer\">';\n $str .= '<button class=\"btn\" data-dismiss=\"modal\" aria-hidden=\"true\" data-loading-text=\"...\">Cancel &times;</button>';\n $str .= '<button type=\"submit\" id=\"pchoiceprog\" data-loading-text=\"...\" class=\"btn btn-success\" title=\"Continue\">Continue</button>';\n $str .= '</div>';\n $str .= '</form>';\n\n return $str;\n }", "function modal_form() {\n\n $this->validate_submitted_data(array(\n \"id\" => \"numeric\"\n ));\n\n $view_data['model_info'] = $this->Payment_methods_model->get_one_with_settings($this->request->getPost('id'));\n\n //get seetings associtated with this payment type\n $view_data['settings'] = $this->Payment_methods_model->get_settings($view_data['model_info']->type);\n\n return $this->template->view('payment_methods/modal_form', $view_data);\n }", "public function makeSimpleForm($data){\n $orderPayment = [\n 'order_id' => $data['order_id'],\n 'payment_id' => \"2\",\n 'operation_code' => date('ymdHis')\n ];\n\n $orderPayments = $this->ordersPayments;\n $orderPayments->create($orderPayment);\n\n $html = \"<form name='paypal_form' action='\".$this->getPaypalUrl().\"' method='POST' id='paypal_form'>\n <input type='hidden' name='cmd' value='_xclick'>\n <input type='hidden' name='bn' value='\".env('PAYPAL_BUSINESS_NAME').\"' />\n <input type='hidden' name='business' value='\".env('PAYPAL_USER').\"'>\n <input type='hidden' name='image_url' value='\".env('PAYPAL_LOGO').\"'/>\n <input type='hidden' name='item_name' value='Pedido \".$data['ref'].\"'>\n <input type='hidden' name='custom' value='\".$orderPayment['operation_code'].\"'>\n <input type='hidden' name='currency_code' value='EUR'>\n <input type='hidden' name='amount' value='\".$data['total'].\"'>\n <input type='hidden' name='return' value='\".route('payments.paypal.ok').\"' />\n <input type='hidden' name='cancel_return' value='\".route('payments.paypal.ko').\"' />\n <input type='hidden' name='notify_url' value='\".route('payments.paypal.response').\"'>\n </form>\n <script>document.paypal_form.submit()</script>\";\n return $html;\n }", "protected function generateForm() {\n $this->context->smarty->assign( [\n 'action' => $this->context->link->getModuleLink( $this->name, 'validation', [], true ),\n ] );\n\n return $this->context->smarty->fetch( 'module:twocheckout/views/templates/hook/payment_options.tpl' );\n }", "public function show()\n {\n return view('public.payment');\n }", "public function payment()\n {\n return view(\"public.payment\");\n }", "public function bulk_pay_form() {\n\n\t\tif( ! affiliate_wp_paypal()->has_api_credentials() ) {\n\t\t\treturn;\n\t\t}\n?>\n\t\t<script>\n\t\tjQuery(document).ready(function($) {\n\t\t\t// Show referral export form\n\t\t\t$('.affwp-referrals-paypal-payout-toggle').click(function() {\n\t\t\t\t$('.affwp-referrals-paypal-payout-toggle').toggle();\n\t\t\t\t$('#affwp-referrals-paypal-payout-form').slideToggle();\n\t\t\t});\n\t\t\t$('#affwp-referrals-paypal-payout-form').submit(function() {\n\t\t\t\tif( ! confirm( \"<?php _e( 'Are you sure you want to payout referrals for the specified time frame via Paypal?', 'affwp-paypal-payouts' ); ?>\" ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\t</script>\n\t\t<button class=\"button-primary affwp-referrals-paypal-payout-toggle\"><?php _e( 'Bulk Pay via Paypal', 'affwp-paypal-payouts' ); ?></button>\n\t\t<button class=\"button-primary affwp-referrals-paypal-payout-toggle\" style=\"display:none\"><?php _e( 'Close', 'affwp-paypal-payouts' ); ?></button>\n\t\t<form id=\"affwp-referrals-paypal-payout-form\" class=\"affwp-gray-form\" style=\"display:none;\" action=\"<?php echo admin_url( 'admin.php?page=affiliate-wp-referrals' ); ?>\" method=\"post\">\n\t\t\t<p>\n\t\t\t\t<input type=\"text\" class=\"affwp-datepicker\" autocomplete=\"off\" name=\"from\" placeholder=\"<?php _e( 'From - mm/dd/yyyy', 'affwp-paypal-payouts' ); ?>\"/>\n\t\t\t\t<input type=\"text\" class=\"affwp-datepicker\" autocomplete=\"off\" name=\"to\" placeholder=\"<?php _e( 'To - mm/dd/yyyy', 'affwp-paypal-payouts' ); ?>\"/>\n\t\t\t\t<input type=\"text\" class=\"affwp-text\" name=\"minimum\" placeholder=\"<?php esc_attr_e( 'Minimum amount', 'affwp-paypal-payouts' ); ?>\"/>\n\t\t\t\t<input type=\"hidden\" name=\"affwp_action\" value=\"process_bulk_paypal_payout\"/>\n\t\t\t\t<input type=\"submit\" value=\"<?php _e( 'Process Payout via Paypal', 'affwp-paypal-payouts' ); ?>\" class=\"button-secondary\"/>\n\t\t\t\t<p><?php printf( __( 'This will send payments via Paypal for all unpaid referrals in the specified timeframe.', 'affwp-paypal-payouts' ), admin_url( 'admin.php?page=affiliate-wp-tools&tab=export_import' ) ); ?></p>\n\t\t\t</p>\n\t\t</form>\n<?php\n\t}", "public function paypal_express_return_page()\n {\n\n if (!empty($_GET['subscriptio_ppec_action']) && ($_GET['subscriptio_ppec_action'] === 'do_payment')) {\n $gateway = new Subscriptio_PayPal_EC_Gateway();\n $gateway->do_express_checkout_payment();\n }\n }", "public function showVerifyForm(){\n return view('business.verify_user');\n }", "public function formNewProcesarPlanilla(){\r\n Obj::run()->View->render();\r\n }", "private function composeMerchantRregistrationForm()\n {\n View::composer(\n\n 'auth.register',\n\n function($view)\n {\n $view->with('plans', ListHelper::plans());\n }\n );\n }", "protected function generateForm()\n {\n $this->context->smarty->assign([\n 'action' => $this->context->link->getModuleLink($this->name, 'validation', [], true),\n ]);\n\n return $this->context->smarty->fetch('module:twocheckout/views/templates/hook/payment_options.tpl');\n }", "public function rsepro_showForm($vars) {\n\t\t$app =& JFactory::getApplication();\t\t\n\t\tif($app->getName() != 'site') return;\n\t\t\n\t\t//check to see if we can show something\n\t\tif (!$this->canRun()) return;\n\t\t\n\t\tif (isset($vars['method']) && $vars['method'] == $this->rsprooption) {\n\t\t\tJFactory::getLanguage()->load('com_rseventspro',JPATH_SITE);\n\t\t\n\t\t\tjimport('joomla.mail.helper');\n\t\t\t$db\t\t= JFactory::getDbo();\n\t\t\t$query\t= $db->getQuery(true);\n\t\t\t\n\t\t\t//is the plugin enabled ?\n\t\t\t$enable = JPluginHelper::isEnabled('system', 'rsepropaypal');\n\t\t\tif (!$enable) return;\n\t\t\t\n\t\t\t$details = $vars['details'];\n\t\t\t$tickets = $vars['tickets'];\n\t\t\t\n\t\t\t//check to see if its a payment request\n\t\t\tif (empty($details->verification) && empty($details->ide) && empty($details->email) && empty($tickets)) \n\t\t\t\treturn;\n\t\t\t\n\t\t\t//get the currency\n\t\t\t$currency = $vars['currency'];\n\t\t\t\n\t\t\t//get paypal details\n\t\t\t$paypal_email\t\t= $this->params->get('paypal_email','');\n\t\t\t$paypal_return\t\t= $this->params->get('return_url','');\n\t\t\t$paypal_lang\t\t= $this->params->get('paypal_lang','US');\n\t\t\t\n\t\t\t$query->clear()\n\t\t\t\t->select($db->qn('name'))\n\t\t\t\t->from($db->qn('#__rseventspro_events'))\n\t\t\t\t->where($db->qn('id').' = '.(int) $details->ide);\n\t\t\t\n\t\t\t$db->setQuery($query);\n\t\t\t$event = $db->loadObject();\n\t\t\t\n\t\t\t//do we allow users to sell their own tickets?\n\t\t\tif (rseventsproHelper::getConfig('payment_paypal','int')) {\n\t\t\t\t$query->clear()\n\t\t\t\t\t->select($db->qn('paypal_email'))\n\t\t\t\t\t->from($db->qn('#__rseventspro_events'))\n\t\t\t\t\t->where($db->qn('id').' = '.(int) $details->ide);\n\t\t\t\t\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$user_paypal = $db->loadResult();\n\t\t\t\t\n\t\t\t\tif (!empty($user_paypal)) \n\t\t\t\t\t$paypal_email = $user_paypal;\n\t\t\t}\n\t\t\t\n\t\t\t//check if the e-mail address is valid\n\t\t\tif (!JMailHelper::isEmailAddress($paypal_email)) {\n\t\t\t\techo JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_NO_VALID_EMAIL');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t//check to see if the return_url is valid\n\t\t\tif (substr($paypal_return,0,4) != 'http') \n\t\t\t\t$paypal_return = '';\n\t\t\t\n\t\t\t//get the url for paypal\n\t\t\t$paypal_url = $this->params->get('paypal_mode') ? 'https://www.paypal.com/cgi-bin/webscr' : 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n\t\t\t\n\t\t\tif (count($tickets) == 1) {\n\t\t\t\t$ticket\t\t\t= $tickets[0];\n\t\t\t\t$paypal_item\t= htmlentities($event->name.' - '.$ticket->name,ENT_QUOTES,'UTF-8');\n\t\t\t\t$paypal_total\t= isset($ticket->price) ? $ticket->price : 0;\n\t\t\t\t$paypal_number\t= isset($ticket->quantity) ? $ticket->quantity : 1;\n\t\t\t} else {\n\t\t\t\t$paypal_item\t= htmlentities($event->name.' - '.JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_MULTIPLE'),ENT_QUOTES,'UTF-8');\n\t\t\t\t$paypal_total\t= 0;\n\t\t\t\t$paypal_number\t= 1;\n\t\t\t\t\n\t\t\t\tforeach ($tickets as $ticket) {\n\t\t\t\t\tif ($ticket->price > 0)\n\t\t\t\t\t\t$paypal_total += ($ticket->price * $ticket->quantity);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($paypal_total == 0) return;\n\t\t\t\n\t\t\t$thetax = 0;\n\t\t\t$thediscount = 0;\n\t\t\t\n\t\t\tif ($details->early_fee)\n\t\t\t\t$thediscount += $details->early_fee;\n\t\t\t\n\t\t\tif ($details->late_fee)\n\t\t\t\t$thetax += $details->late_fee;\n\t\t\t\n\t\t\t$html = '';\t\t\n\t\t\t$html .= '<fieldset>'.\"\\n\";\n\t\t\t$html .= '<legend>'.JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_TICKETS_INFO').'</legend>'.\"\\n\";\n\t\t\t$html .= '<table cellspacing=\"10\" cellpadding=\"0\" class=\"table table-bordered rs_table\">'.\"\\n\";\n\t\t\t$html .= '<tr>'.\"\\n\";\n\t\t\t$html .= '<td>'.JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_TICKETS').'</td>'.\"\\n\";\n\t\t\t$html .= '<td>'.\"\\n\";\n\t\t\t\n\t\t\t$discount = $details->discount;\n\t\t\t$total = 0;\n\t\t\tif (!empty($tickets)) { \n\t\t\t\tforeach ($tickets as $ticket) {\n\t\t\t\t\tif (empty($ticket->price))\n\t\t\t\t\t\t$html .= $ticket->quantity. ' x '.$ticket->name.' ('.JText::_('COM_RSEVENTSPRO_GLOBAL_FREE'). ')<br />';\n\t\t\t\t\telse\n\t\t\t\t\t\t$html .= $ticket->quantity. ' x '.$ticket->name.' ('.rseventsproHelper::currency($ticket->price). ')<br />';\n\t\t\t\t\t\n\t\t\t\t\tif ($ticket->price > 0)\n\t\t\t\t\t\t$total += ($ticket->quantity * $ticket->price);\n\t\t\t\t}\n\t\t\t} \n\t\t\tif (!empty($discount)) $total = $total - $discount;\n\t\t\t\n\t\t\t$html .= '</td>'.\"\\n\";\n\t\t\t$html .= '</tr>'.\"\\n\";\n\t\t\t\n\t\t\tif (!empty($discount)) {\n\t\t\t\t$html .= '<tr>'.\"\\n\";\n\t\t\t\t$html .= '<td>'.JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_TICKETS_DISCOUNT').'</td>'.\"\\n\";\n\t\t\t\t$html .= '<td>'.rseventsproHelper::currency($discount).'</td>'.\"\\n\";\n\t\t\t\t$html .= '</tr>'.\"\\n\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($details->early_fee) {\n\t\t\t\t$total = $total - $details->early_fee;\n\t\t\t\t$html .= '<tr>'.\"\\n\";\n\t\t\t\t$html .= '<td>'.JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_EARLY_FEE').'</td>'.\"\\n\";\n\t\t\t\t$html .= '<td>'.\"\\n\";\n\t\t\t\t$html .= rseventsproHelper::currency($details->early_fee);\n\t\t\t\t$html .= '</td>'.\"\\n\";\n\t\t\t\t$html .= '</tr>'.\"\\n\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($details->late_fee) {\n\t\t\t\t$total = $total + $details->late_fee;\n\t\t\t\t$html .= '<tr>'.\"\\n\";\n\t\t\t\t$html .= '<td>'.JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_LATE_FEE').'</td>'.\"\\n\";\n\t\t\t\t$html .= '<td>'.\"\\n\";\n\t\t\t\t$html .= rseventsproHelper::currency($details->late_fee);\n\t\t\t\t$html .= '</td>'.\"\\n\";\n\t\t\t\t$html .= '</tr>'.\"\\n\";\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($details->tax)) {\n\t\t\t\t$total = $total + $details->tax;\n\t\t\t\t$html .= '<tr>'.\"\\n\";\n\t\t\t\t$html .= '<td>'.JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_TICKETS_TAX').'</td>'.\"\\n\";\n\t\t\t\t$html .= '<td>'.rseventsproHelper::currency($details->tax).'</td>'.\"\\n\";\n\t\t\t\t$html .= '</tr>'.\"\\n\";\n\t\t\t}\n\t\t\t\n\t\t\t$html .= '<tr>'.\"\\n\";\n\t\t\t$html .= '<td>'.JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_TICKETS_TOTAL').'</td>'.\"\\n\";\n\t\t\t$html .= '<td>'.rseventsproHelper::currency($total).'</td>'.\"\\n\";\n\t\t\t$html .= '</tr>'.\"\\n\";\n\t\t\t\n\t\t\t$html .= '</table>'.\"\\n\";\n\t\t\t$html .= '</fieldset>'.\"\\n\";\n\t\t\t\n\t\t\t$html .= '<p style=\"margin: 10px;font-weight: bold;\">'.JText::_('COM_RSEVENTSPRO_PLG_PLUGIN_PAYPAL_REDIRECTING').'</p>'.\"\\n\";\n\t\t\t\n\t\t\t$html .= '<form method=\"post\" action=\"'.$paypal_url.'\" id=\"paypalForm\">'.\"\\n\";\n\t\t\t$html .= '<input type=\"hidden\" name=\"business\" value=\"'.$this->escape($paypal_email).'\" />'.\"\\n\";\n\t\t\t$html .= '<input type=\"hidden\" name=\"item_name\" value=\"'.$paypal_item.'\" />'.\"\\n\";\n\t\t\t$html .= '<input type=\"hidden\" name=\"currency_code\" value=\"'.$this->escape($currency).'\" />'.\"\\n\";\n\t\t\t\n\t\t\t$html .= '<input type=\"hidden\" name=\"cmd\" value=\"_xclick\" />'.\"\\n\";\n\t\t\t$html .= '<input type=\"hidden\" name=\"charset\" value=\"utf-8\" />'.\"\\n\";\n\t\t\t$html .= '<input type=\"hidden\" name=\"amount\" value=\"'.$this->convertprice($paypal_total).'\" />'.\"\\n\";\n\t\t\t$html .= '<input type=\"hidden\" name=\"notify_url\" value=\"'.JRoute::_(JURI::root().'index.php?paypalrsepro=1').'\" />'.\"\\n\";\n\t\t\t\n\t\t\t$html .= '<input type=\"hidden\" name=\"custom\" value=\"'.$this->escape($details->verification).'\" />'.\"\\n\";\n\t\t\tif (!empty($paypal_return))\n\t\t\t\t$html .= '<input type=\"hidden\" name=\"return\" value=\"'.$this->escape($paypal_return).'\" />'.\"\\n\";\n\t\t\t\n\t\t\t\n\t\t\tif (!empty($details->tax))\n\t\t\t\t$thetax += $details->tax;\n\t\t\t\n\t\t\tif (!empty($thetax))\n\t\t\t\t$html .= '<input type=\"hidden\" name=\"tax\" value=\"'.$this->convertprice($thetax).'\" />'.\"\\n\";\n\t\t\t\n\t\t\tif (!empty($details->discount))\n\t\t\t\t$thediscount += $details->discount;\n\t\t\t\n\t\t\tif (!empty($thediscount))\n\t\t\t\t$html .= '<input type=\"hidden\" name=\"discount_amount\" value=\"'.$this->convertprice($thediscount).'\" />'.\"\\n\";\n\t\t\t$html .= '<input type=\"hidden\" name=\"quantity\" value=\"'.intval($paypal_number).'\" />'.\"\\n\";\n\t\t\t$html .= '<input type=\"hidden\" name=\"lc\" value=\"'.$this->escape($paypal_lang).'\" />'.\"\\n\";\n\t\t\t$html .= '</form>'.\"\\n\";\n\t\t\t\n\t\t\t\n\t\t\t$html .= '<script type=\"text/javascript\">'.\"\\n\";\n\t\t\t$html .= 'function paypalFormSubmit() { document.getElementById(\\'paypalForm\\').submit() }'.\"\\n\";\n\t\t\t$html .= 'try { window.addEventListener ? window.addEventListener(\"load\",paypalFormSubmit,false) : window.attachEvent(\"onload\",paypalFormSubmit); }'.\"\\n\";\n\t\t\t$html .= 'catch (err) { paypalFormSubmit(); }'.\"\\n\";\n\t\t\t$html .= '</script>'.\"\\n\";\n\t\t\t\n\t\t\techo $html;\t\t\t\n\t\t}\n\t\t\n\t}", "public function paypageAction()\n {\n $this->loadLayout();\n $this->renderLayout();\n }", "public function index() {\n\t\t/*\n\t\t* Using my sandbox account for testing\n\t\t* PP Sandbox Account : [email protected]\n\t\t* Client id : AWqDW98qfqzsEW81pfcAEh_dZY0o6j8V9zMvgDkRDyiLC4vIFJ7c-5V-T9s7yQxtaqw-W1xk3CQ8WGac\n\t\t* Password : EEvQ1GRey_hyqxo2mTrX-O0zVOqUtAwdC0uoflNhlTgV20LCmSPAve3im7iHCKxFMxJzRuRVtRRoR4PD\n\t\t*/\t\n\n\t\t/* $paypal_batch_data = $_POST['paypal_payout_textarea'];// you can use this variable too in run time , commenting this for your use case.*/\n\t\t\n\t\t//Step 1: Create Paypal access token to initiate the payment \n\t\t$paypal_access_token = $this->createAccessToken();\n\t\t\n\t\t//Step 2 :Execute the Payout \n\t\t$result_create_payout = $this->createPayout($paypal_access_token);\n\t\t\n\t\t//setting the result values to views\n\t\t$this->set('payout_batch_id', $result_create_payout->batch_header->payout_batch_id);\n\t\t$this->set('sender_batch_id', $result_create_payout->batch_header->sender_batch_header->sender_batch_id);\n\t\t$this->set('batch_status', $result_create_payout->batch_header->batch_status);\n\t\t$this->set('email_subject', $result_create_payout->batch_header->sender_batch_header->email_subject);\n\t\t$this->set('email_message', $result_create_payout->batch_header->sender_batch_header->email_message);\n\t\t$this->render(\"paypal\");\n\t\t\n\t\t}" ]
[ "0.70882684", "0.6717941", "0.66942966", "0.6686399", "0.6616549", "0.6598096", "0.6570308", "0.65518326", "0.65260005", "0.6473319", "0.6466569", "0.6432644", "0.6426535", "0.64187866", "0.6417543", "0.63581866", "0.63561815", "0.6355933", "0.63419276", "0.63261235", "0.62947005", "0.6281216", "0.6277554", "0.62631166", "0.62580454", "0.624121", "0.6222394", "0.6220454", "0.6203953", "0.61276424" ]
0.7793435
0
////////////////// PHOTO //////////////////// API CREATE
public function createPhoto(){ $arrayPost = ['album_id_album' => $_POST['album_id_album'], 'id_photo' => $_POST['id_photo'], 'photo' => $_FILES['photo']["name"], 'titre' => $_POST['titre'], 'description' => $_POST['description'], 'statut' => $_POST['statut'], 'localite' => $_POST['localite']]; $photoModel = new PhotoModel(); $this->showJson($photoModel->ajouterPhoto($arrayPost, $_FILES)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generatePhoto() {\n\t}", "public function create_person_with_photo()\n {\n $person = create_person_with_photo();\n $photo = $person->photos()->first();\n\n $this->assertEquals('local',$photo->storage);\n\n $person = create_person_with_photo('node_modules/admin-lte/dist/img/avatar.png');\n\n $photo = $person->photos()->first();\n\n $this->assertEquals('avatar.png',$photo->origin);\n $this->assertEquals('local',$photo->storage);\n $suffix = $person->id . '-' . snake_case($person->name) . '.png';\n $this->assertStringEndsWith($suffix,$photo->path);\n\n }", "public function create()\n {\n //Image\n }", "public function createImage($request);", "public function create()\n {\n echo 'create trong Controllerphoto';\n //\n }", "public function makeThumbnail($photo){\n\n\n\n}", "function addPhoto($file) {\n $photo = [\n '_id' => new ObjectID(),\n 'name' => basename($file['name']),\n 'type' => pathinfo($file['name'], PATHINFO_EXTENSION),\n 'path_orig' => NULL,\n 'path_thumbnail' => NULL,\n 'path_watermark' => NULL,\n 'watermark' => filter_var($_REQUEST['watermark'], FILTER_SANITIZE_STRING),\n 'title' => \"Bez tytułu\",\n 'author' => \"Anonim\",\n 'date' => date('YmdHis'),\n ];\n $photo['path_orig'] = 'images/original/' . $photo['_id'] . '.' . $photo['type'];\n $photo['path_thumbnail'] = 'images/thumbnail/' . $photo['_id'] . '.' . $photo['type'];\n $photo['path_watermark'] = 'images/watermark/' . $photo['_id'] . '.' . $photo['type'];\n if(!empty($_REQUEST['title'])) {\n $photo['title'] = filter_var($_REQUEST['title'], FILTER_SANITIZE_STRING);\n }\n if(!empty($_REQUEST['author'])) {\n $photo['author'] = filter_var($_REQUEST['author'], FILTER_SANITIZE_STRING);\n }\n move_uploaded_file($file['tmp_name'], $photo['path_orig']);\n createThumbnail($photo['path_orig'], $photo['path_thumbnail'], $photo['type']);\n createImageWithWatermark($photo['path_orig'], $photo['path_watermark'], $photo['type'], $photo['watermark']);\n \n // add information about photo to database and check if id is not repeated\n $db = getDB();\n if (!empty($_REQUEST['privacy']) && $_REQUEST['privacy'] == \"private\") {\n $user = ($db->users->find(['login' => $_SESSION['username']])->toArray())[0];\n if (empty($user['photos']))\n $photos = [];\n else\n $photos = iterator_to_array($user['photos']);\n while (in_array($photo['_id'], $photos))\n $photo['_id'] = new ObjectID();\n array_push($photos, $photo);\n $user['photos'] = $photos;\n $db->users->replaceOne(['login' => $_SESSION['username']], $user);\n \n }\n else {\n while (!empty($db->photos->findOne(['_id' => new ObjectID($photo['_id'])])))\n $photo['_id'] = new ObjectID();\n $db->photos->insertOne($photo);\n }\n }", "public function create()\n\t{\n\t\treturn view('admin.resources.photos.create');\n\t}", "public function create()\n {\n return view(\"admin.gallery.add_photo\");\n }", "public function actionCreate()\n {\n $model = new Photos();\n $post = Yii::$app->request->post();\n if ($post) {\n if ($model->load($post) && $model->save()) {\n return $this->showFlash('添加成功','success');\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function add_photo_to_person()\n {\n $path = 'node_modules/admin-lte/dist/img/avatar.png';\n $person = create(Person::class);\n\n add_photo_to_person($path, $person);\n $photo = $person->photos()->first();\n\n $this->assertEquals('avatar.png',$photo->origin);\n $this->assertEquals('local',$photo->storage);\n $suffix = $person->id . '-' . snake_case($person->name) . '.png';\n $this->assertStringEndsWith($suffix,$photo->path);\n\n $this->assertTrue(Storage::disk('local')->exists($photo->path));\n\n }", "public function actionCreate()\n {\n $model = new UserPhoto();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n if(!empty($_FILES['file']['name'])){\n if (!file_exists('media/users/' . Yii::$app->user->id)) {\n mkdir('media/users/' . Yii::$app->user->id . '/');\n }\n if (!file_exists('media/users/' . Yii::$app->user->id . '/' . date('Y-m-d'))) {\n mkdir('media/users/' . Yii::$app->user->id . '/' . date('Y-m-d'));\n }\n $dir = 'media/users/' . Yii::$app->user->id . '/' . date('Y-m-d') . '/';\n\n\n\n $i = 0;\n\n if (!empty($_FILES['file']['name'][0])) {\n $request = Yii::$app->request->post('UserPhoto');\n //Debug::prn($request->get(['id']));\n foreach ($_FILES['file']['name'] as $file) {\n Image::thumbnail($_FILES['file']['tmp_name'][$i], 1000, 1000, $mode = \\Imagine\\Image\\ManipulatorInterface::THUMBNAIL_OUTBOUND)\n ->save($dir . $file, ['quality' => 100]);\n $img = new UserPhoto();\n $img->album_id = $request['album_id'];\n $img->img = $dir . $file;\n $img->user_id = $request['user_id'];\n $img->save();\n $i++;\n }\n }\n }\n\n\n return $this->redirect(['/user/settings/user_profile']);\n } else {\n $album = AlbumPhotoUser::find()->where(['user_id' => Yii::$app->user->id])->all();\n return $this->render('create', [\n 'model' => $model,\n 'album' => $album,\n ]);\n }\n }", "public function create()\n {\n $response = $this->checkValidUser();\n if ($response === null) {\n $data = $this->getData();\n $name = $data['name'];\n $caption = $data['caption'];\n $dataUrl = $data['dataUrl'];\n $id = $this->imageModel->create_from_dataurl($name, $caption, $dataUrl);\n $response = $this->respond(['id'=>$id]);\n }\n return $response;\n }", "public function store(PhotoRequest $request)\n {\n $validated = $request->validated();\n\n $image = $request->get('image');\n $name = time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n \\Image::make($request->get('image'))->fit(300, 400)->save(public_path('images/upload/').$name);\n\n Photo::create([\n 'title' => $validated['title'],\n 'image' => $name,\n 'product_id' => $validated['product_id'],\n ]);\n\n return response()->json([\n 'message' => 'Фотография успешно добавлена',\n ]);\n }", "public function create(CreateTalkPhotoRequest $request)\n {\n $talkdetail = TalkDetail::with('room')->get();\n return new CreateResponse($talkdetail);\n }", "public function create()\n {\n return view('REST.photos.create');\n }", "public function store(Request $request)\n {\n\n $validation = $request->validate([\n 'title' => 'required|string',\n 'description' => 'string',\n 'image' => 'image'\n ]);\n\n $imgName = \\photon_image_process($request,'image');\n\n Photo::create([\n 'title' => $request->title,\n 'slug' => str_slug($request->title),\n 'description' => $request->description,\n 'image' => $imgName,\n 'user_id' => auth()->user()->id,\n 'album_id' => $request->album_id\n ]);\n\n return redirect()->route('photo.index')->with('status','Album successfully created');\n\n\n }", "public function add_photo_to_user()\n {\n $path = 'node_modules/admin-lte/dist/img/avatar.png';\n $user = create(User::class);\n\n add_photo_to_user($user, $path);\n $photo = $user->person->photos()->first();\n\n $this->assertEquals('avatar.png',$photo->origin);\n $this->assertEquals('local',$photo->storage);\n $suffix = $user->person->id . '-' . snake_case($user->person->name) . '.png';\n $this->assertStringEndsWith($suffix,$photo->path);\n\n $this->assertTrue(Storage::disk('local')->exists($photo->path));\n }", "public function create()\n\t{\n\t\treturn View::make('admin.photo.create');\n\t}", "public function create()\n {\n //\n return view('photo');\n }", "public function store(Requests\\UploadPhotoRequest $request)\n {\n if(!$this->auth) {\n return response()->json(['status'=>false,'message'=>'You must be logged in to upload photo']);\n }\n $profile_id =$this->_userId;\n $upload =new UploadPicture();\n $upload->process($request);\n $photo = new Photo();\n $photo->full_path =$upload->full_path;\n $photo->thumb_path =$upload->thumb_path;\n $photo->profile_id =$profile_id;\n $photo->save();\n\n //go ahead and set as feature photo\n $profile = $this->profile;\n // echo $photo->id;\n $profile->photo_id=$photo->id;\n $profile->save();\n\n return response()->json(['status'=>true,\n 'message'=>\"Your photo was uploaded successfully\",\n 'photo'=>[\n 'id'=>$photo->id,\n 'thumb_path'=>$photo->thumb_path,\n 'full_path'=>$photo->full_path]]);\n\n\n }", "public function create()\n {\n return view('photo.create');\n }", "function addPhoto($photos, $album, $photoInfo)\n{\n $fd = $photos->newMediaFileSource($photoInfo[\"tmp_name\"]);\n $fd->setContentType($photoInfo[\"type\"]);\n\n $entry = new Zend_Gdata_Photos_PhotoEntry();\n $entry->setMediaSource($fd);\n $entry->setTitle($photos->newTitle($photoInfo[\"name\"]));\n\n $result = $photos->insertPhotoEntry($entry, $album);\n return $result;\n}", "public function create( Request $request ) {\n $path = $request->file( 'photo' )->store( 'testing' );\n\n return response()->json( [ 'path' => $path ], 200 );\n }", "public function actionCreate()\n\t{\n\t\t$model = new IndexSpecPhoto;\n\t\t$imgData = array();\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\t$model->status = IndexSpecPhoto::STATUS_INACTIVE;\n\n\t\tif (isset($_POST['IndexSpecPhoto'])) {\n\t\t\t$model->attributes = $_POST['IndexSpecPhoto'];\n\n\t\t\t$imgData = Yii::app()->request->getParam('img', array());\n\t\t\tif ($model->validate() && $file = $this->cropImage($imgData, $model)) {\n\t\t\t\t$model->image_id = $file->id;\n\t\t\t\t$model->save(false);\n\n\t\t\t\t$this->redirect(array('index'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create', array(\n\t\t\t'model' => $model,\n\t\t\t'imgData' => $imgData,\n\t\t));\n\t}", "public function create()\n {\n //\n return view('createPicture');\n }", "public function create()\n {\n return view('backEnd.photos.create');\n }", "public function storeImage(PostPhotoRequest $request)\n {\n $eventId = $request->input('id_event');\n $event = Events::find($eventId);\n\n $imageFile = $request->file('photo');\n $extension = $imageFile->getClientOriginalExtension();\n $picture_name = $imageFile->hashName();\n\n dump($picture_name);\n\n FileUploadGestion::uploadFile($imageFile, $picture_name, '/img/eventsUser');\n\n $path = '/img/eventsUser/' . $picture_name . '.' .$extension;\n\n $image = new Image;\n $image -> path = $path;\n $image -> save();\n\n $image_event = new EventImage;\n $image_event -> id_event = $event->id;\n $image_event -> id_image = $image->id;\n $image_event -> save();\n\n return redirect('publicevents/' . $event->id);\n }", "public function actionCreate()\n {\n $model = new Images();\n\n if ($model->load(Yii::$app->request->post())) { \n $model->file_ru = UploadedFile::getInstance($model, 'file_ru');\n $model->file_uz = UploadedFile::getInstance($model, 'file_uz');\n $model->file_en = UploadedFile::getInstance($model, 'file_en');\n $model->upload();\n $model->save();\n $add= new Activity;\n $add->addAct(\"create\", \"Images\", $model->id); //activity\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //\n return view('photos.create');\n }" ]
[ "0.70976895", "0.7087774", "0.7056971", "0.6799154", "0.67352194", "0.6712439", "0.657897", "0.6536958", "0.64620084", "0.64221126", "0.6419349", "0.63928545", "0.63851666", "0.63545364", "0.6349796", "0.63315374", "0.63306266", "0.6323327", "0.6318174", "0.6303851", "0.62995964", "0.6288597", "0.62671965", "0.6241468", "0.6234003", "0.6231885", "0.6176378", "0.6167869", "0.61509174", "0.61469376" ]
0.722751
0
Creates a form to delete a Measure entity by id.
private function createDeleteForm(Measure $measure): FormInterface { return $this->createFormBuilder() ->setAction($this->generateUrl('admin_measure_delete', ['id' => $measure->getId()])) ->setMethod('DELETE') ->getForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_estatservei_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Maid $maid)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('back-office_maid_delete', array('id' => $maid->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('meal_delete', array('id' => $id)))\n ->setMethod('DELETE')\n// ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('equipe_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Excluir'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('nomenclaturequestionnairerecensement_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('absences_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('t360evaluations_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder(null, array ( 'attr' => array ( 'id' => 'delete_record' ) ) )\n ->setAction($this->generateUrl('cms_produtos_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Excluir', 'attr' => array('class' => 'btn btn-danger delete')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n // return $this->createFormBuilder()\n // ->setAction($this->generateUrl('func_pedido_delete', array('id' => $id)))\n // ->setMethod('DELETE')\n // ->add('submit', 'submit', array('label' => 'Delete'))\n // ->getForm()\n // ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('equipment_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('visitapromocion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sale_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer', 'attr' => array('class' => 'btn btn-danger')))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('slider_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array(\n 'label' => 'SUPPRIMER ',\n 'attr' => array('class' => 'btn btn-danger'),\n ))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('statElev_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('supprimer_structure', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('avenant_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer','attr'=>array( 'class'=> 'pc_sidebar_element')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('alumnosalon_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mm_cmf_admin_contentnode_delete', array('id' => $id)))\n ->setMethod('DELETE')\n //->add('submit', SubmitType::class, array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ge_estudiante_delete', array('id' => $id)))\n ->setMethod('POST')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm();\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('shcpinsctlenfermedad_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('licenciaequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('sales_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('secteur_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer', 'attr' => array('class'=>'btn btn-danger btn-block margin-bottom')))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('patient_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private\n function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('equipes_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete', 'attr' => array(\n 'class' => 'btn btn-block btn-danger',\n 'style' => 'margin-top:5px;'\n )))\n ->getForm();\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('store_admin_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('megaloman_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Usuń'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('articles_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('gc_informations_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('structure_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }" ]
[ "0.6790627", "0.6753362", "0.67349815", "0.6679821", "0.66744286", "0.66680145", "0.66468495", "0.664606", "0.6638695", "0.6637051", "0.6626737", "0.6626376", "0.66218525", "0.65783817", "0.6576019", "0.6571163", "0.65665793", "0.6565308", "0.65544695", "0.6549409", "0.6547122", "0.6545195", "0.6538416", "0.65382075", "0.6533074", "0.6528752", "0.6520626", "0.65010697", "0.65004444", "0.6496392" ]
0.76219964
0
/ Used to supply term for the Where clause directly in texql, e.g.: TermTerm("SummaryData contains 'coin' OR AdmWebMetaData contains 'coin');
public function TexqlTerm($texql) { array_push($this->WhereTexqls, $texql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addConditionForText() {\n if (substr(trim($this->input['text']), 0, 1) == '#') {\n \t // looking for an article uid?\n \t\t$uid = intval(substr(trim($this->input['text']), 1));\n \t\tif (trim($this->input['text']) == '#' . $uid) {\n \t\t\t// text contains a query like #[int], so search for this uid ONLY\n \t\t\t$this->table_references = array('tx_newspaper_article');\n \t\t\t$this->where = array('uid=' . $uid);\n return self::TEXT_SEARCH_FOR_UID;\n \t\t}\n \t}\n\n // Search for all terms divided by a space character\n // So \"demo example\" finds all articles with both the \"demo\" AND \"example\" somewhere in the article\n $wherePart = array();\n foreach(t3lib_div::trimExplode(' ', $this->input['text']) as $term) {\n $wherePart[] = '(' .\n 'title LIKE \"%' . addslashes($term) . '%\" OR ' .\n 'kicker LIKE \"%' . addslashes($term) . '%\" OR ' .\n 'teaser LIKE \"%' . addslashes($term) . '%\" OR ' .\n 'bodytext LIKE \"%' . addslashes($term) . '%\"' .\n ')';\n }\n\n $this->addWhere(implode(' AND ', $wherePart));\n return self::TEXT_SEARCH_FOR_TEXT;\n }", "private function getCatalogWhereTerms () {\n\t\tif (is_null($this->catalogId) || $this->catalogId->isEqual($this->getCombinedCatalogId()))\n\t\t\treturn 'TRUE';\n\t\telse\n\t\t\treturn 'catalog_id = :catalog_id';\n\t}", "public function getQueryPhraseTerm($phrase);", "function wpse_178511_get_terms_fields( $clauses, $taxonomies, $args ) {\r\r\n if ( ! empty( $args['search_name'] ) ) {\r\r\n global $wpdb;\r\r\n $search_like = $wpdb->esc_like( $args['search_name'] );\r\r\n if ( ! isset( $clauses['where'] ) )\r\r\n $clauses['where'] = '1=1';\r\r\n\r\r\n $clauses['where'] .= $wpdb->prepare( \" AND t.name LIKE %s\", \"$search_like%\" );\r\r\n }\r\r\n return $clauses;\r\r\n}", "private function getCatalogWhereTerms () {\n\t\tif (is_null($this->catalogId) || $this->catalogId->isEqual($this->getCombinedCatalogId()))\n\t\t\treturn 'TRUE';\n\t\telse\n\t\t\treturn '\n\tcatalog_id = :catalog_id \n\tAND SCBCRSE_COLL_CODE IN (\n\t\tSELECT\n\t\t\tcoll_code\n\t\tFROM\n\t\t\tcourse_catalog_college\n\t\tWHERE\n\t\t\tcatalog_id = :catalog_id2\n\t)\t';\n\t}", "function ctrl_search_where($where){\n global $wpdb;\n if (is_search())\n $where .= \"OR (t.name LIKE '%\".get_search_query().\"%' AND {$wpdb->posts}.post_status = 'publish')\";\n return $where;\n }", "function BuildBasicSearchSql(&$Where, &$Fld, $Keyword) {\n\t\t$sFldExpression = ($Fld->FldVirtualExpression <> \"\") ? $Fld->FldVirtualExpression : $Fld->FldExpression;\n\t\t$lFldDataType = ($Fld->FldIsVirtual) ? EW_DATATYPE_STRING : $Fld->FldDataType;\n\t\tif ($lFldDataType == EW_DATATYPE_NUMBER) {\n\t\t\t$sWrk = $sFldExpression . \" = \" . ew_QuotedValue($Keyword, $lFldDataType);\n\t\t} else {\n\t\t\t$sWrk = $sFldExpression . \" LIKE \" . ew_QuotedValue(\"%\" . $Keyword . \"%\", $lFldDataType);\n\t\t}\n\t\tif ($Where <> \"\") $Where .= \" OR \";\n\t\t$Where .= $sWrk;\n\t}", "function BuildBasicSearchSql(&$Where, &$Fld, $Keyword) {\r\n\t\t$sFldExpression = ($Fld->FldVirtualExpression <> \"\") ? $Fld->FldVirtualExpression : $Fld->FldExpression;\r\n\t\t$lFldDataType = ($Fld->FldIsVirtual) ? EW_DATATYPE_STRING : $Fld->FldDataType;\r\n\t\tif ($lFldDataType == EW_DATATYPE_NUMBER) {\r\n\t\t\t$sWrk = $sFldExpression . \" = \" . ew_QuotedValue($Keyword, $lFldDataType);\r\n\t\t} else {\r\n\t\t\t$sWrk = $sFldExpression . \" LIKE \" . ew_QuotedValue(\"%\" . $Keyword . \"%\", $lFldDataType);\r\n\t\t}\r\n\t\tif ($Where <> \"\") $Where .= \" OR \";\r\n\t\t$Where .= $sWrk;\r\n\t}", "function searchCFields($Term){\n\t\n}", "function custom_posts_where( $where, $query ) {\r\n \r\n global $wpdb;\r\n if ( is_main_query() && is_search() ) {\r\n \r\n //* get additional where clause for the user\r\n $user_where = get_user_posts_where();\r\n \r\n $where .= \" OR (\r\n {$wpdb->term_taxonomy}.taxonomy IN( 'category', 'post_tag' ) \r\n AND\r\n {$wpdb->terms}.name LIKE '%\" . esc_sql( get_query_var( 's' ) ) . \"%'\r\n {$user_where}\r\n )\";\r\n \r\n }\r\n return $where;\r\n \r\n}", "function BuildBasicSearchSql(&$Where, &$Fld, $Keyword) {\n\t\tif ($Keyword == EW_NULL_VALUE) {\n\t\t\t$sWrk = $Fld->FldExpression . \" IS NULL\";\n\t\t} elseif ($Keyword == EW_NOT_NULL_VALUE) {\n\t\t\t$sWrk = $Fld->FldExpression . \" IS NOT NULL\";\n\t\t} else {\n\t\t\t$sFldExpression = ($Fld->FldVirtualExpression <> $Fld->FldExpression) ? $Fld->FldVirtualExpression : $Fld->FldBasicSearchExpression;\n\t\t\t$sWrk = $sFldExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING));\n\t\t}\n\t\tif ($Where <> \"\") $Where .= \" OR \";\n\t\t$Where .= $sWrk;\n\t}", "function search_get_where_sql($table, $fields, $params, $use_fulltext = TRUE) {\n\tglobal $CONFIG;\n\t$query = $params['query'];\n\n\t// add the table prefix to the fields\n\tforeach ($fields as $i => $field) {\n\t\tif ($table) {\n\t\t\t$fields[$i] = \"$table.$field\";\n\t\t}\n\t}\n\t\n\t$where = '';\n\n\t// if query is shorter than the min for fts words\n\t// it's likely a single acronym or similar\n\t// switch to literal mode\n\tif (elgg_strlen($query) < $CONFIG->search_info['min_chars']) {\n\t\t$likes = array();\n\t\t$query = sanitise_string($query);\n\t\tforeach ($fields as $field) {\n\t\t\t$likes[] = \"$field LIKE '%$query%'\";\n\t\t}\n\t\t$likes_str = implode(' OR ', $likes);\n\t\t$where = \"($likes_str)\";\n\t} else {\n\t\t// if we're not using full text, rewrite the query for bool mode.\n\t\t// exploiting a feature(ish) of bool mode where +-word is the same as -word\n\t\tif (!$use_fulltext) {\n\t\t\t$query = '+' . str_replace(' ', ' +', $query);\n\t\t}\n\t\t\n\t\t// if using advanced, boolean operators, or paired \"s, switch into boolean mode\n\t\t$booleans_used = preg_match(\"/([\\-\\+~])([\\w]+)/i\", $query);\n\t\t$advanced_search = (isset($params['advanced_search']) && $params['advanced_search']);\n\t\t$quotes_used = (elgg_substr_count($query, '\"') >= 2); \n\t\t\n\t\tif (!$use_fulltext || $booleans_used || $advanced_search || $quotes_used) {\n\t\t\t$options = 'IN BOOLEAN MODE';\n\t\t} else {\n\t\t\t// natural language mode is default and this keyword isn't supported in < 5.1\n\t\t\t//$options = 'IN NATURAL LANGUAGE MODE';\n\t\t\t$options = '';\n\t\t}\n\t\t\n\t\t// if short query, use query expansion.\n\t\t// @todo doesn't seem to be working well.\n//\t\tif (elgg_strlen($query) < 5) {\n//\t\t\t$options .= ' WITH QUERY EXPANSION';\n//\t\t}\n\t\t$query = sanitise_string($query);\n\n\t\t$fields_str = implode(',', $fields);\n\t\t$where = \"(MATCH ($fields_str) AGAINST ('$query' $options))\";\n\t}\n\n\treturn $where;\n}", "public function getWhereSQL()\n {\n $operation = trim($this->field_row->operation);\n \n if (strlen($operation) == 0) {\n return \"\";\n }\n \n $crit = $this->field_row->criteria;\n if ($crit == \"[ME]\")\n {\n $crit = Auth::user()->id;\n }\n\n if ($this->field_row->sys_name == \"bool\") {\n $crit = ($this->field_row->criteria == \"'\" . trans('fields.yes') . \"'\") ? 1 : 0;\n } \n \n return \" AND \" . $this->field_where_name . \" \" . $operation . \" \" . $crit;\n \n }", "public function whereOpenBracket()\r\n\t{\r\n\t\treturn $this->add('where',$this->_parts['where'].' ( ', true);\r\n\t}", "public function where_clause() {\n\t\t$parts = sprintf( $this->where_pattern, $this->id );\n\n\t\tif ( property_exists( $this, 'ask_type' ) && $this->ask_type ) {\n\t\t\t$parts .= sprintf( ' AND t.ask_type = \"%s\"', $this->ask_type );\n\n\t\t}\n\n\t\treturn $parts;\n\n\t}", "function advanced_custom_search( $where, $wp_query ) {\n\t\tglobal $wpdb;\n\n\t\tif ( empty( $where ))\n\t\t\treturn $where;\n\n\t\t// get search expression\n\t\t$terms = $wp_query->query_vars[ 's' ];\n\n\t\t// explode search expression to get search terms\n\t\t$exploded = explode( ' ', $terms );\n\t\tif( $exploded === FALSE || count( $exploded ) == 0 )\n\t\t\t$exploded = array( 0 => $terms );\n\n\t\t// reset search in order to rebuilt it as we whish\n\t\t$where = '';\n\n\t\t// get searcheable_acf, a list of advanced custom fields you want to search content in\n\t\t$list_searcheable_acf = list_searcheable_acf();\n\t\t// foreach( $exploded as $tag ) :\n\t\t\t$where .= \"\n\t\t\tAND (\n\t\t\t\t(f_cms_posts.post_title LIKE '%$terms%')\n\t\t\t\tOR (f_cms_posts.post_content LIKE '%$terms%')\n\t\t\t\tOR EXISTS (\n\t\t\t\tSELECT * FROM f_cms_postmeta\n\t\t\t\t\tWHERE post_id = f_cms_posts.ID\n\t\t\t\t\t\tAND (\";\n\t\t\tforeach ($list_searcheable_acf as $searcheable_acf) :\n\t\t\tif ($searcheable_acf == $list_searcheable_acf[0]):\n\t\t\t\t$where .= \" (meta_key LIKE '%\" . $searcheable_acf . \"%' AND meta_value LIKE '%$terms%') \";\n\t\t\telse :\n\t\t\t\t$where .= \" OR (meta_key LIKE '%\" . $searcheable_acf . \"%' AND meta_value LIKE '%$terms%') \";\n\t\t\tendif;\n\t\t\tendforeach;\n\t\t\t\t$where .= \")\n\t\t\t\t)\n\t\t\t\tOR EXISTS (\n\t\t\t\tSELECT * FROM f_cms_comments\n\t\t\t\tWHERE comment_post_ID = f_cms_posts.ID\n\t\t\t\t\tAND comment_content LIKE '%$terms%'\n\t\t\t\t)\n\t\t\t\tOR EXISTS (\n\t\t\t\tSELECT * FROM f_cms_terms\n\t\t\t\tINNER JOIN f_cms_term_taxonomy\n\t\t\t\t\tON f_cms_term_taxonomy.term_id = f_cms_terms.term_id\n\t\t\t\tINNER JOIN f_cms_term_relationships\n\t\t\t\t\tON f_cms_term_relationships.term_taxonomy_id = f_cms_term_taxonomy.term_taxonomy_id\n\t\t\t\tWHERE (\n\t\t\t\t\ttaxonomy = 'post_tag'\n\t\t\t\t\t\tOR taxonomy = 'category'\n\t\t\t\t\t)\n\t\t\t\t\tAND object_id = f_cms_posts.ID\n\t\t\t\t\tAND f_cms_terms.name LIKE '%$terms%'\n\t\t\t\t)\n\t\t\t)\";\n\t\t// endforeach;\n\t\treturn $where;\n\t}", "function BasicSearchWhere() {\n\t\tglobal $Security, $CustomView1;\n\t\t$sSearchStr = \"\";\n\t\t$sSearchKeyword = ew_StripSlashes(@$_GET[EW_TABLE_BASIC_SEARCH]);\n\t\t$sSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$sSearch = trim($sSearchKeyword);\n\t\t\tif ($sSearchType <> \"\") {\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\n\t\t\t}\n\t\t}\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$CustomView1->setBasicSearchKeyword($sSearchKeyword);\n\t\t\t$CustomView1->setBasicSearchType($sSearchType);\n\t\t}\n\t\treturn $sSearchStr;\n\t}", "function BasicSearchWhere() {\n\t\tglobal $Security, $student_subjects;\n\t\t$sSearchStr = \"\";\n\t\t$sSearchKeyword = $student_subjects->BasicSearchKeyword;\n\t\t$sSearchType = $student_subjects->BasicSearchType;\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$sSearch = trim($sSearchKeyword);\n\t\t\tif ($sSearchType <> \"\") {\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\n\t\t\t}\n\t\t}\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$student_subjects->setSessionBasicSearchKeyword($sSearchKeyword);\n\t\t\t$student_subjects->setSessionBasicSearchType($sSearchType);\n\t\t}\n\t\treturn $sSearchStr;\n\t}", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "function BasicSearchWhere() {\n\t\tglobal $Security;\n\t\t$sSearchStr = \"\";\n\t\tif (!$Security->CanSearch()) return \"\";\n\t\t$sSearchKeyword = $this->BasicSearch->Keyword;\n\t\t$sSearchType = $this->BasicSearch->Type;\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$sSearch = trim($sSearchKeyword);\n\t\t\tif ($sSearchType <> \"=\") {\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\n\t\t\t}\n\t\t\t$this->Command = \"search\";\n\t\t}\n\t\tif ($this->Command == \"search\") {\n\t\t\t$this->BasicSearch->setKeyword($sSearchKeyword);\n\t\t\t$this->BasicSearch->setType($sSearchType);\n\t\t}\n\t\treturn $sSearchStr;\n\t}", "function cf_search_where( $where ) {\n global $pagenow, $wpdb;\n if ( is_search() ) {\n $where = preg_replace(\n \"/\\(\\s*\".$wpdb->posts.\".post_title\\s+LIKE\\s*(\\'[^\\']+\\')\\s*\\)/\",\n \"(\".$wpdb->posts.\".post_title LIKE $1) OR (\".$wpdb->postmeta.\".meta_value LIKE $1)\", $where );\n }\n return $where;\n }", "function FormWhereSection($where, $varName, $value, $startOfWhere, $stringVal) {\n if (strlen($value) != 0) {\n if(!$startOfWhere && strlen($where) != 0)\n $where = $where . \"AND \";\n if($stringVal)\n $where = $where . $varName . \" = \\\"\" . $value . \"\\\" \";\n else\n $where = $where . $varName . \" = \" . $value;\n }\n return $where;\n}", "function condition_query($where = 'where') {\n $clauses = array();\n foreach ($this->$where as $group => $info) {\n if (empty($info['clauses'])) {\n continue;\n }\n $clause = implode(\") \" . $info['type'] . \" (\", $info['clauses']);\n if (count($info['clauses']) > 1) {\n $clause = '(' . $clause . ')';\n }\n $clauses[] = $clause;\n }\n\n if ($clauses) {\n $keyword = drupal_strtoupper($where);\n if (count($clauses) > 1) {\n return \"$keyword (\" . implode(\")\\n \" . $this->group_operator . ' (', array_filter($clauses)) . \")\\n\";\n }\n else {\n return \"$keyword \" . array_shift($clauses) . \"\\n\";\n }\n }\n return \"\";\n }", "protected function fullTextWildcards($term)\n\t{\n\t\t$reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n\t\t$term = str_replace($reservedSymbols, '', $term);\n\n\t\t$words = explode(' ', $term);\n\n\t\tforeach ($words as $key => $word) {\n\t\t\t/*\n\t\t\t * applying + operator (required word) only big words\n\t\t\t * because smaller ones are not indexed by mysql\n\t\t\t */\n\t\t\tif (strlen($word) >= 1) {\n\t\t\t\t$words[$key] = $word.'*';\n\t\t\t}\n\t\t}\n\n\t\t$searchTerm = implode(',', $words);\n\n\t\treturn $searchTerm;\n\t}", "function buildQuery($attributes, $terms, &$query) {\n\t \t$i = 0;\n\t \tforeach($terms as $term) {\n\t \t\t$i++;\n\n\t \t\tif ($i == 1) {\n\t \t\t\t$j = 0;\n\t \t\t\tforeach($attributes as $attribute) {\n\t \t\t\t\t$j++;\n\t \t\t\t\tif ($j == 1) {\n\t \t\t\t\t\t$query .= $attribute . \" LIKE '%$term%' \";\n\t \t\t\t\t}\n\t \t\t\t\telse {\n\t \t\t\t\t\t$query .= \"OR \" . $attribute . \" LIKE '%$term%' \";\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n\t \t\telse {\n\t \t\t\t$j = 0;\n\t \t\t\tforeach($attributes as $attribute) {\n\t \t\t\t\t$j++;\n\t \t\t\t\tif ($j == 1) { \n\t \t\t\t\t\t$query .= \"OR \" . $attribute . \" LIKE '%$term%' \";\n\t \t\t\t\t}\n\t \t\t\t\telse {\n\t \t\t\t\t\t$query .= \"OR \" . $attribute . \" LIKE '%$term%'\";\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t \t$query .= \")\";\n\t }", "public function andWhere($column, $operator = '', $value = '');", "public function advanced_custom_search($where, $wp_query)\n\t{\n\t\tif (empty($where)) {\n\t\t\treturn $where;\n\t\t}\n\n\t\t// Get search expression\n\t\tif (is_admin()) {\n\t\t\t$terms = $wp_query->query_vars['s'];\n\t\t} else {\n\t\t\t$terms = $keyword = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_STRING);\n\t\t}\n\n\t\t// Explode search expression to get search terms\n\t\t$exploded = explode(' ', $terms);\n\t\tif ($exploded === FALSE || count($exploded) == 0)\n\t\t\t$exploded = array(0 => $terms);\n\n\t\t// Reset search in order to rebuilt it as we which\n\t\t$where = '';\n\n\t\t// Get searcheable_acf, a list of advanced custom fields to search content in\n\t\t$list_searcheable_acf = $this->list_searcheable_acf();\n\n\t\tforeach ($exploded as $tag) {\n\t\t\t$where .= \"\n AND (\n (post_title LIKE '%$tag%')\n OR (post_content LIKE '%$tag%')\";\n\n\t\t\tif (!empty($list_searcheable_acf)) {\n\t\t\t\t$where .= \" OR EXISTS (\n SELECT * FROM postmeta\n\t WHERE post_id = posts.ID\n\t AND (\";\n\n\t\t\t\tforeach ($list_searcheable_acf as $searcheable_acf) {\n\n\t\t\t\t\tif ($searcheable_acf == $list_searcheable_acf[0]) {\n\t\t\t\t\t\t$where .= \" (meta_key LIKE '%\" . $searcheable_acf . \"%' AND meta_value LIKE '%$tag%') \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$where .= \" OR (meta_key LIKE '%\" . $searcheable_acf . \"%' AND meta_value LIKE '%$tag%') \";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t$where .= \")\n )\";\n\t\t\t}\n\n\t\t\t$where .= \" )\";\n\t\t}\n\n\t\treturn $where;\n\t}", "protected function fullTextWildcards($term)\n {\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, '', $term);\n \n $words = explode(' ', $term);\n \n foreach ($words as $key => $word) {\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if (strlen($word) >= 1) {\n $words[$key] = '+' . $word . '*';\n }\n }\n \n $searchTerm = implode(' ', $words);\n \n return $searchTerm;\n }", "public function getSearchQueryText()\n {\n $catalogSearchData = $this->getCatalogSearchData();\n if ($this->_didYouMean) {\n $catalogSearchData->setDidYouMeanQueryText($this->_didYouMean);\n return __(\"Search results for: '%1' instead\", $catalogSearchData->getEscapedQueryText());\n }\n return __(\"Search results for: '%1'\", $catalogSearchData->getEscapedQueryText());\n }", "function textquery($k, $v, $objectlist, $speclist, $photolist) {\n\n // Add the appropriate prefix for each table\n // object is t1, spectra is t2, photometry is t3\n if (in_array ($k, $objectlist)) {\n $k = \"t1.\" . $k;}\n elseif (in_array($k, $speclist)) {\n $k = \"t2.\" . $k;}\n elseif (in_array($k, $photolist)) {\n $k = \"t3.\" . $k;}\n\n \n // Check to see if the value was empty\n if (trim($v) == '') {\n $segment = $k . \" IS NULL AND \";\n } else {\n \n // Break up by commas unless it's a reference field\n if ($k == \"t1.LCReference\" || $k == \"t2.Reference\") {\n // For everything else,\n $segment = \"(\" . $k . \" LIKE '\" . $v . \"') AND \";\n } else {\n\n $segment = \"(\";\n $pieces = explode(',',$v);\n // For each item\n for($i=0;$i<count($pieces);$i++) {\n\t\n\t// Strip off any whitespace between items\n\t$v = trim($pieces[$i]);\n\n\t// If the person has a host name of \"Anon\" instead of \"Anon.\"\n\tif ($k == \"t1.HostName\" && $v == 'Anon' OR $v== 'anon') {\n\t $v = 'Anon.';\n\t}\n\n\t$segment = $segment . \"(\" . $k . \" LIKE '\" . $v . \"') OR \";\n }\n \n // Strip off last 'OR'\n $segment = substr($segment, 0, -4) . \") AND \"; \n }\n }\n\n return($segment);\n}" ]
[ "0.62658954", "0.61476576", "0.6086237", "0.60493046", "0.60360134", "0.5760568", "0.5759297", "0.5758717", "0.5709718", "0.5708752", "0.5662686", "0.5615534", "0.55895054", "0.5568582", "0.55548584", "0.5529445", "0.5528127", "0.55217886", "0.5518407", "0.55062324", "0.54851204", "0.54644215", "0.5413863", "0.53883183", "0.53780574", "0.53732157", "0.5372861", "0.5371205", "0.53592235", "0.53557444" ]
0.63079387
0